Went to Target at lunch yesterday and saw they had, not one, but three of the Xbox 360 premium boxes in stock. Decided to wait until the next Tomb Raider came out before I picked it up.

Promptly returned after work and purchased it. Also got a second controller and Project Gotham Racing 3.

Hooked that bad boy up to the ol’ LCD TV when I got home and fired it up.

It’s awesome.

Jenn and I raced for quite some time and determined that it’s hella fun, but neither of us are really any good at that game. It doesn’t make it less fun, we’re just used to games like Burnout where the driving is vastly more arcade-oriented. It’ll just take a bit of practice, is all. The cool thing is that the two player [on the same screen] is so clear - it’s not like the other times we’re playing where you struggle to see where you’re going. The benefits of higher resolution, eh?

I didn’t join Xbox Live yet because I need to get the wireless network adapter (no network drop in that room), but once that happens, I’ll be in business.

I’m also looking forward to checking out some of the media capabilities. I’ve heard a lot about it; time to try it out firsthand.

Now I need to convince Stu and my dad to get one and we can all play together.

gists, csharp, net comments edit

A minor follow-up to my JavaScript and Unicode Character Validation entry (and sort of a reminder to myself):

Sometimes when working with characters in regular expressions it’s nice to be able to dump one or more characters as a line of Unicode hex escape sequences. For example, abc becomes \u0061\u0062\u0063.

Here’s a quick snippet for a console app that will let you input a series of characters and will dump out the list of characters entered as Unicode hex:

using System;
public class DumpHexChars{
  public static void Main(){
    Console.Write("Enter chars to convert to Unicode hex: ");
    string chars = Console.ReadLine();
    string output = "";
    for(int i = 0; i < chars.Length; i++){
      output += String.Format("\\u{0:x4}", Convert.ToInt16(chars[i]));
    }
    Console.WriteLine(output);
    Console.ReadLine();
  }
}

Got the cable phone hooked up on Saturday. Decided that we were tired of shelling out to Verizon for what has thus been sub-par service and that we’d go with the ol’ Comcast phone because we’ve always had good luck with their service and it’s actually cheaper for what we end up getting, all told.

While the guy was there he put in three new cable outlets (because not all of the rooms in the house had them… still not all of them have one, but I think there’s only one room that doesn’t that really might need one). That was cool. Plus, due to the new outlets, I can now put the cable modem right down next to the computer and connect directly to the network. Previously I was having to connect through wireless because, well, no cable drop was in the office. I’m movin’ up in the world, people!

Sunday I spent the day playing Paper Mario with Stu, which was hella fun since it’d been a couple of weeks since last we played. Made some good progress there and also tried the Papa John’s “Kong-Sized Pizza,” which was pretty ridiculously giant and filled us up nicely.

I would probably be remiss in not saying that there are a couple of friends of mine that are going through some hard times right now, so time was spent with them during the weekend as well. I won’t say more than that, since it’s not my place, but I hope they’re doing well and will continue to support them as needed.

Less serious: just found the Red Dwarf 8 DVD is coming out soon, and there’s a limited edition with a motorized scutter toy on it. Preordered!

gists, xml comments edit

Hanselman pointed out to me yesterday that Dan Suceava posted a VS add-in that finds duplicate RESX items by ID and prints out the duplicate names in a report.

Now, I’m all over VS add-ins and adding cool functionality to the development environment, but this feels a lot like overkill to me. I admit I didn’t go download the thing because, as neat as it sounds, it occurs to me that you could just jam a 10 minute XSLT together and find out the answer that way. (And who knows - the add-in may be doing just that.)

So, for those interested, here’s a quick-and-dirty XSLT that will go through a RESX file and print out a list of duplicate resources by ID along with a count of how many were found:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/root">
    <xsl:for-each select="data">
      <xsl:variable name="dataName" select="@name" />
      <xsl:variable name="currPosition" select="position()" />
      <xsl:variable name="numDups" select="count(/root/data[@name = $dataName])" />
      <xsl:variable name="numBefore" select="count(/root/data[@name = $dataName and position() &lt; $currPosition]/@name)" />
      <xsl:if test="$numDups &gt; 1 and $numBefore = 0"><xsl:value-of select="$dataName" /> (<xsl:value-of select="$numDups" />)&#0013;</xsl:if>
    </xsl:for-each>
  </xsl:template>
</xsl:stylesheet>

A sample report might look like this:

    ResourceID1 (3)
    ResourceID4 (2)
    ResourceID7 (4)

Used in conjunction with a command-line tool like nxslt, you’re set - specify your RESX file as the input XML, and the above as the style sheet. Done!

Another thing we learned in my peer mentoring class was that there are such things as stupid questions.

That sounds bad, but let’s look at that: what constitutes a stupid question? Well, if you flip it around, what constitutes a good question? A good question is one in which the person asking the question has really thought the question through, they’ve tried to answer it themselves, and they have a good grasp on what they’re asking - they’ve put some effort into the formulation of the question. So, then, a stupid question is when the person asking doesn’t think at all about the question, they just blast it out there.

What shows me that you’ve thought about a question? That’s different for different people, but when you ask me a question, especially if it involves me having to stop what I’m doing to answer, here’s what I want to know:

  • Priority: Is this super-urgent, or are you just asking out of curiosity? If it’s not crisis level and I’m busy, maybe you should save it for later.
  • Time To Answer: How long do you think it’s going to take me to answer? More than two or three minutes (from the time you start asking the question to the time I finish answering) and you might want to block off some time in Outlook.
  • Concise Description of Problem: Can you ask the question in one or two sentences (including enough context to make the problem understandable)? If not, stop and think through what you’re asking.
  • What You Expect: What are you looking for from me? Advice? A technical direction? Just someone to vent to?
  • Who Else You Asked: If you asked other people the question first, are they still working on it? Did they give you any additional information?
  • What You’ve Done: What have you done already to try to answer the question yourself?
  • When You Need It: Do I have to answer right now or can I get back to you?

Much of this goes hand in hand with the use of correct communication protocol. If you bug a person too much and/or in the wrong fashion, you’re not going to get a great response.

I’ll also throw out two more tips, specifically for people asking me questions:

  • Do not start your question with “I have a quick question.” I’ll determine if it’s quick or not based on the amount of time you think you need. Instead, try “I have a one-minute question” or “I have a two-minute question.” Make sure your time estimate is accurate - don’t say you have a two-minute question if it’s a fifteen-minute question. Don’t tell me you need one minute when you really need five.
  • Do not show up and drop your laptop on my desk. I know you may want me to review some code or look at something. The fact that you had to bring your laptop over already tells me you’re over the one-or-two-minute limit on drop-in questions and you need to schedule some time in Outlook. Nothing is more frustrating than “*bam* Hey, can you look at this?” Seriously.

I think I’m going to try this out on a larger scale. If folks at work have questions, I’m happy to answer them, as long as they’re good questions.