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="">
  <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>

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.

Stu kills me. It’s always all-or-nothing with everything he does.

Like, every three months or so, he decides he’s not drinking soda anymore, he’s just going to drink water. So he’ll do this cold turkey thing for a week or so, then slide into just having some juice or lemonade or something every once in a while. That lasts a couple of days until he moves to diet soda of some nature… which also only lasts a couple of days until he skips directly to the Mountain Dew. If they had Jolt at work, he’d probably have hit that long ago.

That cracks me up - he can’t just stick on the diet soda or maybe something a little lighter, he goes right from water to the Mountain Dew. If the guy was a poker player, he’d have a pair of twos and go all in.

The latest Stu craze is coffee. Up until about a week ago, Stu had never had a single cup of coffee. When you offered him one or urged him to try it, he’d politely decline. Not sure why, whether it was that he didn’t think it’d taste good, or that it didn’t sound good, or something else. He just wasn’t interested.

Somehow last week Sara broke him down and got him into a Starbucks. Hoo boy. Here’s kind of how it went last week:

Tuesday: Went to Starbucks, had first coffee. Pretty good! Going to have to try this again. Thursday: Went back to Starbucks after work, this time with Trav and Jenn. Had a mocha. Fantastic! Friday: Went to Starbucks at lunch. Decided I need to try one of everything on the menu. Started at the top with the standard “cup of coffee.” Will work through all specialty items. Saturday: Stopped in at Bed Bath and Beyond as well as Fred Meyer to look at coffee machines. Did you know you can brew this in your own home? Brilliance! I must have one. Found one that appealed to me, but decided to do a little research before committing. Sunday: Went back to Bed Bath and Beyond and picked up a nice coffee machine. Trekked past Starbucks for an “official” travel mug because the ones at Bed Bath and Beyond, well, they don’t quite profess my newfound love of coffee the way it needs to be broadcast. Also stopped by Fred Meyer and ground me up a couple different types of coffee (roughly two pounds worth - I anticipate tearing through this like it’s going out of style). Can’t wait to get this stuff home and set up my shrine to the coffee god. I have a tatami mat that will sit perfectly in front of it, and I can face the whole thing to the east so I can see the rising sun as my fragrant new coffee brews to perfection. Next stop, self-actualization!

I won’t lie - I can’t say I didn’t egg him on just a little bit. It’s kind of fun to get swept up in Stu’s waves. I mean, it did lead to bongos before, so I’m curious to see where this one will go. Sara, you’ve created a monster.

Continuing our foray into new board games (and following some recommendations from readers/friends), we went to the game store on Saturday and picked up a copy of Alhambra.

The four of us (Stu, Tif, Jenn and I) had a pretty good time with it. The object is to buy tiles that you place in a city. Each tile is of a different type (“tower” or “garden” or whatever) and scoring is based on who has the most of any given tile type (“I have the most towers, so I get X points; you have the most gardens, so you get Y points”). The mechanics were pretty easy to learn and after the first couple of turns folks seemed to get it pretty well. I liked the way turns were broken down and the way you lay the tiles to build your city, but I wasn’t too thrilled with the expense of rearranging the tiles in your city. For example, I can either remove a tile from my city, add a tile to my city, or swap a tile in my city for one in my reserve board (sort of a “holding area” for tiles). But I can’t take a tile from one place in my city and move it to another place

  • I’d actually have to remove the tile and place it in my reserve on one turn, then spend the next turn placing it elsewhere. I think there should be a “move tile” option.

Other than that, like I said, it went over pretty well and I look forward to playing it again. We only got one round in that night.

Tiff also picked up a couple of games, both by Cheapass. The first was Kill Doctor Lucky, which we didn’t have a chance to play, and the other was Give Me the Brain!, which we did play.

Give Me the Brain! is a card game that takes about 15 minutes to play through. The idea is that you’re all zombies working in a fast food joint and there’s only one brain (represented by a six-sided die) amongst you. The object is to get rid of all the cards in your hand, but certain cards require that you have the brain in order to play, so there’s a round of bidding to see who gets the brain followed by a round of card play where each person tries to complete “jobs” by playing cards. Each “job” causes some sort of consequence to occur (like someone else will have to draw a card). What makes things interesting is that there are a lot of “perpetual cards” (with things on them like “give this card to the person on your right” that will never actually go out of play).

It took a while to figure this one out because the rules are written in a sort of confusing fashion (plus it was getting late), but once we played a game through we figured it out and were able to play a second pretty easily.

It’s an okay game, and I’d like to give it another shot because I don’t think it got a fair shake that late at night, but it is fairly quick and not too deep, so if you’re looking for something to while away a rainy afternoon, this probably isn’t it… but if you’ve got a group of friends who maybe aren’t entirely sober, this could be pretty fun.

Saturday was cake tasting (and decision making) day, so Jenn, Stu, Tif, and I all went down to JaCiva’s to decide what kind of wedding cake we’re going to have.

Pretty much anything JaCiva’s makes is awesome (which is why we went with them), and after some tough decision making, we’re getting a four-tier cake that serves 125 and breaks down like this:

  • First tier (bottom) - 14” - Chocolate Fudge cake with Bavarian Custard filling
  • Second tier - 10” - Pink Champagne cake with Strawberry Preserves filling
  • Third tier - 8” - Poppy Seed Pudding cake with Raspberry Preserves filling
  • Fourth tier (top) - 6” - Pina Colada cake with Pina Colada (pineapple, coconut, and rum) filling

The style is called “Chocolate Flow.” Each tier is iced in white and then dark chocolate is poured on top and allowed to run slightly down the sides, creating a nice flowing effect. It has red icing roses with silver leaf petals on each tier that accent nicely against the dark brown and white cake. Beautiful (and, in fact, reasonably affordable).

Sunday Jenn and Tiff met up with Jenn’s mom and sister and they picked out bridesmaid dresses. I haven’t seen the dresses, but Jenn assures me that they look great. I have seen the shoulder wrap portion of the dresses, and the red that Jenn chose is gorgeous. It’s going to be great.

That said… Jenn went back with Tiff to see how things would match up with her dress, and looking at the dress it turns out there are some holes in it that Jenn didn’t see when she first purchased it. She got it from a charity event for a steal, so it’s not like there’s a whole load of money out the door, but she really loves the dress and now she sees that someone must have torn some of it when they tried it on or something, which sucks. Now she’s going to talk to a bridal shop and see if it can be fixed. If not… well, looks like she’ll be dress shopping again. That would suck because, like I said, she loves the dress, but she’s like me: just “repairing it” may not be enough - you know it wasn’t perfect at one point, so it’s going to bug you.

I told her we should call her dress “Distort-o-Dress” after the TV incident that ended up causing me to get a new big-screen TV (“you only see it if you’re looking for it, but since you know it’s there, you always see it…”). That got a smile, which I’m glad for. It’ll all work out. At least we caught it early, right?