October, 2008

  • The Old New Thing

    Stick to the normal candy and nobody gets hurt

    • 26 Comments

    Hallowe'en is a family affair at Microsoft. It typically starts at around 3 or 4 o'clock, with costumed kids roaming the hallways collecting treats from offices. One year, one of my colleagues decided that the kids deserved more than the usual candy bars and chocolates. Even though he is Caucasian, he went to the local Asian foods market and stocked up on all sorts of Asian candies. Lychee-flavored gelatin, rice crackers, spiced watermelon seeds, you name it. It's a holiday and a cultural learning experience. He dumped all the candies into a big bowl and set them out for the kids.

    The kids didn't quite know what to make of it. They'd knock on the door, say Trick or Treat, reach for the bowl and... freeze, or possibly even recoil.

    "It's okay, Johnny. Just take one," Johnny's parents cajoled.

    Little Johnny remained unconvinced.

    Many kids would hesitantly pick out a candy. Some would back away slowly and move to the next office.

    One reaction came from some teenage girls who said (probably in reaction to the rice crackers), "You cheapskate! You just went to the cafeteria and took some crackers!" He was unable to convince them that, no, these aren't soup crackers; they're Asian candy.

    The day wound down, and my friend still had a lot of candy left over. I wandered over to check on him and brought another Caucasian colleague (let's call him Bob) so we could marvel at what those wacky Asians consider candy. We sifted through the bowl, and Bob shouted out, "Hey, I remember these!"

    My friend and I were kind of surprised that Bob recognized an obscure Asian candy. Bob explained, "Yeah, I had a Chinese roommate in college, and he would sometimes eat these." Bob cracked open the package and popped one into his mouth. "Yup, it's the same stuff. I wonder what it is."

    We looked at the package. It identified itself as haw flakes. What are haw flakes? We didn't know. Maybe the ingredients panel will give us a clue.

    "Ingredients: Haw, sugar."

    Okay, that didn't help much.

    From then on, my friend bought the normal candy to give out on Hallowe'en.

  • The Old New Thing

    Working with ambiguous and invalid points in time in managed code

    • 16 Comments

    Public Service Announcement: Daylight Saving Time ends in most parts of the United States this weekend.

    I pointed out some time ago that Win32 and .NET deal with daylight saving time differently. Specifically, Win32 always deals with the time zone you are currently in (even if it's not the time zone that corresponds to the timestamp you are manipulating), whereas .NET deals with the time zone that was in effect at the time the timestamp was generated.

    For more details on the latter, I refer you to Josh Free from the BCL Team Blog, who some time ago explained how to work with ambiguous and invalid points in time in managed code.

  • The Old New Thing

    Dude, the admission bracelet goes around your wrist

    • 17 Comments

    Short stories from the 2008 PDC:

    • On the bus heading to the attendee party at Universal Studios, I overhear one person advising another on how to put on the band that grants admission to the park: "Be careful not to catch any hair on the glue. Otherwise it's a real pain in the butt." Dude, I don't know where you put it, but the admission bracelet goes around your wrist.
    • The Windows 7 networking folks are showing off two new features: DirectAccess and BranchCache. I've seen them and even though they're not flashy (I mean, how flashy can you make networking?), they're wicked cool features for corporations.
    • It's great talking with people and discovering all the great things they've been doing, how they've put together the various pieces with clever bits of glue to do something amazing. I can only imagine that the inventor of LEGO feels this way.

    Bonus chatter added 9am:

    • On same evening as the Ask the Experts session was a Lakers-Clippers basketball game in the Staples Center arena next door to the convention center. I overheard some of the event staff organizers discussing where they can legally set up their security perimeter to prevent rowdy basketball fans from entering the convention center and drinking the free alcohol. Apparently, parts of the convention center are classified as public space.
    • On the last day of the conference, one of the parking garages is converted into a giant suitcase storage room. Peering into it recalls the final scene of Raiders of the Lost Ark.
    • Girish Raja is in charge of wireless connectivity at the 2008 PDC. The keynote room was the biggest puzzle. Back in 2005, you only had to worry about people getting wireless connectivity once they stepped out of the keynote room, but now, you have hordes of people who need internet connectivity during the keynote. I'm looking forward to seeing further entries discussing the logistics of providing that much wireless bandwidth for a conference like the PDC.
    • Sriram Krishnan had a tough sell: He had to convince people to come to his talk even though it took place at the same time as mine and Anders's. (Though from looking at the attendee feedback, it looks like he did just fine. In fact, he did better than me.) I was chatting with him afterwards, and he noted that the keynote demos for cloud computing were a nail-biter because, well, it's the cloud. Anything can happen—it's the cloud.
    • Last week, I mentioned in mixed company (which to technology nerds means not men and women but rather geeks and non-geeks) that I couldn't join them for an event they were planning because I was going to be at the PDC. One of the non-geeks asked, "What is PDC?" My reply: "Pretty Dorky Conference."
  • The Old New Thing

    If you're going to reformat source code, please don't do anything else at the same time

    • 36 Comments

    I spend a good amount of my time doing source code archaeology, and one thing that really muddles the historical record is people who start with a small source code change which turns into large-scale source code reformatting.

    I don't care how you format your source code. It's your source code. And your team might decide to change styles at some point. For example, your original style guide may have been designed for the classic version of the C language, and you want to switch to a style guide designed for C++ and its new // single-line comments. Your new style guide may choose to use spaces instead of tabs for indentation, or it may dictate that opening braces go on the next line rather than hanging out at the end of the previous line, or you may have a new convention for names of member variables. Maybe your XML style guidelines changed from using

    <element attribute1="value1" attribute2="value2" />
    
    to
    <element
             attribute1="value1"
             attribute2="value2"
    />
    

    Whatever your changes are, go nuts. All I ask is that you restrict them to "layout-only" check-ins. In other words, if you want to do some source code reformatting and change some code, please split it up into two check-ins, one that does the reformatting and the other that changes the code.

    Otherwise, I end up staring at a diff of 1500 changed lines of source code, 1498 of which are just reformatting, and 2 of which actually changed something. Finding those two lines is not fun.

    And the next time somebody is asked to do some code archaeology, say to determine exactly when a particular change in behavior occurred, or to give an assessment of how risky it would be to port a change, the person who is invited to undertake the investigation may not be me. It may very well be you.

  • The Old New Thing

    PDC 2008 notes: How to get to room 406A, and other notes

    • 19 Comments

    Today is the day of my talk. I'm always a bit nervous before these things, because I'm never sure if what I'm going to present matches up with what people are expecting. Most people who come to my PDC talk don't know who I am, so they aren't expecting me to toss out a few catch phrases, use my psychic powers, and tell stories about how a bug in a 16-bit scanner driver written in 1993 is the reason why TCP/IP is so complicated. (That last part was a parody.)

    Today's notes:

    • They certainly don't make navigating around the Los Angeles Convention Center easy. My talk is in room 406A. Since the room number is in the 400's, it is naturally on the third floor. And to get to the third floor, you get into the elevator and push 2.
    • Someday, they will remember to put a clock in the room where the speaker can see it. That way, you have a clue how you're doing on time. You might think that when I glance at my laptop, I'm consulting some speaker notes. Nope, I'm just checking the time.
    • A relatively quiet place to work is in the valley outside meeting room 151. The operative word here is relatively. It's still noisy, but the carpeting muffles the noise better than the big open spaces which are more echoey.
    • The meals at the PDC are free. The snacks are free. The milk, juice, soda, water, and coffee are free. There is only one thing that isn't free, and that's the coffee at the Starbuck's stand near the main room. And there's always a line. Leave it to the geeks to find the one thing that they have to pay for and line up for it.
  • The Old New Thing

    Why does my Run dialog say that tasks will created with administrative privileges?

    • 30 Comments

    "I don't know what happened, but now when I open the Run dialog on my Windows Vista machine by typing Windows+R, there is a shield under the edit box that says This task will be created with administrative privileges. What's going on?"

    One my colleagues used psychic powers to solve this problem: "I imagine that you manually killed Explorer, and then you used an elevated command prompt or an elevated Task Manager to launch a new one. An elevated Explorer shows this message. To fix it, exit your elevated Explorer, and exit your running elevated copy of Task Manager (if any). Then type Ctrl+Alt+Esc to launch a normal (non-elevated) Task Manager and use File, New Task to run a new un-elevated Explorer."

    My colleague's psychic powers were right on target.

    "Your psychic powers are better than my memory. I now recall that I did kill and restart Explorer when debugging my shell extension, and I did so from a command line, which—given the evidence—must have been an elevated command prompt."

  • The Old New Thing

    Typo patrol at the 2008 PDC

    • 17 Comments

    Typo patrol got off to a very quick start. One of the flyers in the attendee goodie bag is from a company which offers two free months of service to PDC attendees. The first step in obtaining the service is "Just signup and mention the PDC by January 31, 2008."

    Okay, just hang on while I fire up my time machine.

    Bonus grammar typo: signup is a noun; sign up is a verb.

    The second typo is kind of important. In all the PDC documents (including the voucher to pick up your attendee goodie bag), it says to go to Kentia Hall. This is incorrect. If you try, you'll find a locked door. The goodie bags (and all other Kentia-related services) are actually in Parking B, which is next to the south entrance to Kentia Hall.

    Other PDC 2008 notes:

    • The badge colors are the same as they were in 2005.
    • My talk is scheduled for Wednesday at 3:00pm in room 406A. I will be available in the Windows 7 lounge after the talk, where I will remain untl Ask the Experts begins, at which point I will move to the Windows 7 Ask the Experts table. I will also be in the lounge on Thursday morning until noon. And if you see me wandering around the PDC or just sitting at a table pretendng to do work, feel free to come up and introduce yourself. You're not interrupting anything. (If I didn't want to be interrupted, I wouldn't be out on the floor!)
    • I stopped by the Geeks with Blogs booth since I subscribe to their master feed just to see what everybody is chattering about.
    • In the Speaker Prep room, there's a monitor showing real-time speaker feedback statistics as the results are counted, complete with trend lines (ooh, everybody loves Anders) and attendee comments (uh-oh, technical problems with Bob's talk really hurt him). It's oddly fascinating for about 30 seconds.
    • It may be due to language problems, it may be due to poor training, or it could just be laziness, but Microsoft's attempt to reduce the environmental impact of the conference has not been a rousing success when it comes to waste diversion: The compost bins are littered with glass and plastic waste. Glass bottles, plastic bottles, and milk cartons go into the container recycling bin; plastic waste goes into the trash. We've been doing this in Redmond for quite some time, so it's frustrating seeing people get it wrong and spoiling the entire batch.
    • I learned of a new species of animal: The Overflow Room Vulture. These are people who don't decide ahead of time what talks they will attend, but rather hang around near the overflow rooms and attend whatever talk shows up there. The theory is that if a talk overflows, it must be pretty good! (Of course, this assumption is not always correct. Talks which the organizers know are going to be popular are assigned larger rooms. An overflow indicates that demand was higher than expected; it's a relative measure, not an absolute one.)
  • The Old New Thing

    To climb the corporate ladder you'll need some rope, but rope has many purposes

    • 17 Comments

    When KC told me about a trick she learned to get an area expert to respond to her email, I cautioned her that the trick might backfire:

    A friend of mine (let's call him Bob) happens also to work in the technology industry, and the manager for the part of the project he worked on was, to put it nicely, "in the wrong line of work." No matter how many times Bob would explain how the system worked on the whiteboard, his manager never really understood it. And the misunderstandings weren't just of the "oh I missed a little detail" variety; rather, they tended to elicit a "What planet are you from?" sort of reaction. Bob spent many impromptu meetings patiently trying to clear up various degrees of confusion or explaining why some clever new idea won't work because it violates the laws of physics as we currently understand them.

    Add to the tenuous grasp on technical concepts the uncanny ability to take all the credit when making presentations to senior management. You know the type of people I'm talking about: They're the sort who manage to skate through school by using their good looks, charming personality, and/or social status to get other people to do their homework for them.

    One day, the manager sent out a plan to a large group of people, including some senior managers, and included in the email one of those "Huh?" questions, something akin to "... and it'll connect to the server wirelessly through the parallel port, and—hey Bob, inkjet printers can run off the parallel port, right?"

    Bob decided that he'd had enough. He replied to the mail thread with a simple, "Yes, inkjet printers can run off the parallel port."

    Somebody else in the group gave Bob a phone call. "Um, Bob, what do inkjet printers have to do with anything?"

    Bob answered, "Just making sure there's enough rope."

    Bob's colleague replied, "Gotcha."

    The manager's tenure ended a few months later.

  • The Old New Thing

    Ah, local Los Angeles television news, how I miss thee

    • 8 Comments

    Sitting in my hotel room the night before the 2008 PDC, I'm watching the Los Angeles local news, and the field reporter just said, "The police say this is an isolated incident, but it could happen anywhere."

  • The Old New Thing

    If you don't want to try to repair the data, then don't, but you should at least know that you have corrupted data

    • 2 Comments

    When I wrote about understanding the consequences of WAIT_ABANDONED, I mentioned that one of the possible responses was to try to repair the damage, but some people are suspicious of this approach.

    Mind you, I'm suspicious of it, too. Repairing corruption is hard. You have to anticipate the possibility, create enough of a trail to be able to reconstruct the original data once the corruption is recognized, and then be able to restore the data to some semblance of consistency. I didn't say that this was mandatory; I didn't even say that it was recommended. I just listed it as one of the options, an option for the over-achievers out there.

    For most cases, attempting repair is overkill. But you still have to know that something went wrong; otherwise, one crashed program will lead to more crashed programs as they try to operate on inconsistent data. The purpose of the article was to raise awareness of the issue, based on my observation that most people blindly ignore the possibility that the mutex was abandoned.

Page 1 of 4 (33 items) 1234