October, 2009

  • The Old New Thing

    Once you announce a date, you're already late


    Steve Sinofsky (who used to blog on careers at Microsoft for college grads and more recently oversaw the Engineering Windows 7 blog) said something that stuck with me: Once you announce a date, you're already late.

    Such is the nature of media coverage of the software industry. You can talk all you want about what the product does, but once you begin to speculate about a ship date, all your discussion may as well never have happened. All anybody cares about any more is how far behind schedule you are. (And as far as the media are concerned, you are already behind schedule.) The ship date countdown clock goes up, and all anybody writes about is how your product has been delayed a week, a month, whatever. Even if your original schedule was a purely speculative guess that you pulled out of your butt and the updated schedule is based on some preliminary analysis, the headline won't be "Microsoft refines schedule for Project X." It'll be "Project X slips three months." The article will probably begin "Project X, announced by Microsoft scarcely two weeks ago, is already in deep trouble, suffering a three-month schedule slip even before it gets out of the gate."

    I was reminded of this adage (and use it as my standard answer to questions I'm not authorized to answer) when a Microsoft executive attending RSA Conference 2007, a computer security conference, was asked to speculate on when the next version of Windows would be ready. If you read what he actually said, you can tell that he was just making a guess on the spot, but the next thing you know, the "ship date" makes not only the article headline, but also becomes the top headline on InfoWorld's conference coverage and sparks a discussion on Slashdot. Up goes the countdown clock. Even long after the conference is over, it still is listed as the number two headline for the entire conference, even though it has nothing to do with the conference!

    We don't know what it is, but whatever it is, it's already late.

    Bonus example:

    What started out as a plan turned into a confirmed ship date and then a promise.

  • The Old New Thing

    Please, sir take a seat, sit anywhere you like, but oh, no, not there, rats


    Here's a joke:

    Question: Where does Bill Gates sit?

    Answer: Anywhere he wants.

    (Naturally, substitute the chairman of your company for Bill Gates.)

    I was told this story by a manager who was preparing a demo for Bill Gates. Bill was going to pay a visit to the offices of one particular project which was still under development and be taken on a tour, stopping by offices to see how things are going and get demos of different parts of the project. This manager was in charge of one of the features and naturally was called upon to prepare a little demo.

    Chance favors the prepared, and our manager took great care to make sure the demo would go off without a hitch.

    Before Bill came, I spent some time figuring out the agenda and wrote a list of bullet points on a notepad. I 'cleaned' my desk and left the notepad on the desk to my right so I easily take a quick peek if needed. Ran the demos a couple of times to make sure they were still working. Everything was ready.

    A few hours later, it was demo time. Bill came to my office, and after some introductions, he decided to sit down.

    At my desk.

    On my right.

    Right on top of my notepad.

    I screamed inside my head. This is the sort of thing that happens only in the movies.

    Fortunately, the demo went well and there was no need to consult the notepad.

    But still.

  • The Old New Thing

    How to write like Raymond: Start a sentence with a question mark


    Another installment in the extremely sporadic series on how to write like Raymond.

    I use the question mark as an emoticon to indicate befuddlement or confusion. (This is not to be confused with the use of an inverted question mark in Spanish.) Here's an imaginary example:

    To: Cakes and Cookies Discussion

    Hi, I'm trying to bake a carrot cake, but I'm having trouble finding the right staple gun. Does anybody have any recommendations?

    My reply might go something like this:

    ? What the heck are you planning to do with that staple gun?
  • The Old New Thing

    Leaving Reflections | Projections 2009, travel marathon part two


    Thanks, everybody, for coming out to the Job Fair and attending my talk at Reflections | Projections 2009. Though I should have predicted that scheduling a talk on Saturday morning means that attendance will be somewhat sparse. Thanks to the conference staff with special shout-outs to Kim Vlcek, Bhargav Nookala, Jim Wordelman, and Matt Dordal for taking care of me during the conference.

    Returning to Seattle was also a minor adventure. On my way out out of town, I stopped by Papa Del's, generally considered the benchmark for Chicago-style pizza, but they don't sell single slices for take-out, and I didn't feel like eating an entire pizza. I guess I'll have something to look forward to at my next visit.

    For the drive back to O'Hare, I once again stopped in Bourbonnais, this time at Mancino's Grinders and Pizza, which appears to be another Midwestern restaurant chain, though I didn't know it at the time. My rule of thumb when traveling is "If I've heard of it, then don't eat there." Translation: Avoid the national restaurant chains; eat something local. It may be great, it may not, but it'll be different.

    I took too long of a dinner break, and when I arrived at the airport, the ticket agent told me my flight was taking off in five minutes. I went through security (no line!) and raced through the terminal. Of course, when you're running to your gate, your gate is inevitably one at the far end of the airport. As I ran past a pair of twentysomething white guys, one of them shouted, "Run, Chinky, run!"

    Wow, I haven't heard that epithet since elementary school.

    Up until that point, my interactions with the fine people of Illinois were uniformly positive, and I had found them all to be unfailingly polite and helpful. I'm going to give the state the benefit of the doubt and say that the guy and his buddy were visiting from another state. (Like maybe New Jerkland or something.)

    I arrived at the gate in time. I'm not sure, but if I wasn't the last person on the plane, I was definitely one of the last. We landed in Seattle at around midnight, but since the last train to downtown Seattle departs at 12:06am, I asked my wife to pick me up.

    Although I caught Alexis Ohanian's talk (and enjoyed it), I had to leave early to catch my flight and missed Ryan North's talk, which the post-conference chatter suggests was a monster hit. I'll have to wait to catch it when the video is posted.

    ... until I met a man who had no feet: My travel day was nothing compared to the gentleman in the seat next to me, who was in hour 25 of a 30-hour itinerary: Minsk to Kiev to Warsaw to Chicago to Seattle to Kennewick to home (the last leg by car).

    More travel day chatter: The scientists on the Polaris Project have to suffer through a four-day trek from Bellingham, WA to Cherskiy, Russia even though the two cities are only 3000 miles apart. Reason: Federal regulations.

  • The Old New Thing

    Thinking inside the box


    Commenter Nick asks whether any though has been given to running applications in a sandbox where they are given access only to their installation directory, My Documents, and a handful of other directories and registry keys. "I feel that this would seriously prevent viruses/spyware from being as effective, and apps would not be able to dump files all over the users' HD."

    Yes, a lot of thought has been given to sandboxing (most of which I am not at liberty to discuss) but the compatibility consequences have been a constant source of trepidation.

    For example, if you restrict the application just to My Documents and other selected folders, then double-clicking a file from some other location (not on the list of "allowed" locations) would result in a strange "File not found" (or maybe "Access denied") error message when the application tried to open a file that it didn't have access to. Redirecting file system operations has its own problems, such as applications saying that they successfully saved the file, but when you go to look in Explorer, it's not there!

    To add to the complexity, the Common Criteria (the modern version of what was formerly known as C2 security) have their own rules about what behavior is permissible. For example, it is my understanding that the Common Criteria require that when access is denied to a location, the error that is returned must be "access denied"; you are not allowed to lie to an application and say "Um... yeah... I got your location right here..."

    Tracking an application's shortcuts and registry entries is complicated by the fact that the application is hardly the only entity that accesses those shortcuts and registry entries. If some other application moves the shortcut to a new location or copies it, does that get added to the tracking list? If so, which tracking list? (The one for the application that created the original shortcut or the application that copied it?) Many settings are system-wide. If an application changes a system setting, and then you uninstall the application, do you restore the system setting to the value it had before the application was installed? If you say yes, then what if you had five applications all of which were changing the same system setting, and you uninstall the third one, what do you "restore" the setting to?

    Windows Vista introduces a limited sort of "sandboxing" as part of a compatibility shim for applications which write to administrative locations in the file system or registry for no good reason. Those writes are redirected to a "pretend" directory or registry key, and the application (hopefully) doesn't know any better. That's about the extent of my knowledge of this Windows Vista feature; if you want to read more about it, you can probably hunt around MSDN. Try the phrase file system redirection. (This will probably also turn up features related to 32-bit emulation, so you'll have to do some more filtering.)

  • The Old New Thing

    Arrived in Urbana-Champaign for Reflections|Projections 2009


    Today was a long travel day.

    I left my office at 9:30am to catch the bus from Redmond to downtown Seattle, then took the train to the Tukwila station, then took the shuttle bus to Seattle-Tacoma International Airport (because Airport Station doesn't open until later this year), then flew to Chicago O'Hare airport, and then drove to Urbana-Champaign, with a stop at the Bourbonnais Steak and Shake on the recommendation of a friend as a good stopping point—about halfway—and an introduction to classic Midwest road food, arriving (after several wrong turns) at my hotel at midnight.

    If only there were a way I could have worked a ferry into that itinerary.

    This is only my second visit to the Midwest, and my first venture outside of the Chicago area. Things I had trouble with:

    • Being in the correct lane for the exit I want to take.
    • Getting into the cash lane for the toll booths.

    It was a bit eerie driving along the highway and seeing names of cities that up until now were merely locations of legend (or product code names). Places like Chicago, St. Louis, Memphis, Des Moines, Indiana, Iowa.

    But now I'm in Urbana working the Job Fair and wondering whether I'm prepared for my talk tomorrow.

    Bonus weird sign: From the train, I saw a shop called Best Cake Teriyaki. I didn't know you could make cake teriyaki, and I'm not sure I ever want to see one.

    Online mapping showdown:

    • Google Maps says to take I-80 towards "Lowa" (should be "Iowa") and then take exit I-57S towards "Memohis" (should be "Memphis"). It also has that street view thing so you can familiarize yourself with the intersections ahead of time.
    • Bing Maps spells the geographic names correctly and also tells you whether the ramp is on the left or right. It also gives the streets between which the destination can be found, which is good when you're not familiar with the area. No street view, though.
    • Mapquest also gets the spelling right and calls out the left ramps. (Otherwise, a right ramp is implied.) Also no street view.

    As it happens, I used the Google directions as my primary reference and got lost multiple times because I more than once found myself in the wrong lane with no time to get into the correct lane before the exit was past, and then had to get off the highway, turn around, and try to recover. I didn't show it above, but Google also sent me down some back roads to get to my hotel instead of sticking to the main roads. I missed the tiny side street and didn't realize my mistake until I was two and a half miles past where I should've turned.

    Next time, I'm going to use Bing as my primary reference and supplement with Google street view. (I'm sorry, Bing folks, for doubting you!)

  • The Old New Thing

    Important window message numbers to memorize


    You probably know them already, but if you're new to Win32, here are some key window messages. I would normally suggest that you commit them to memory, but if you do enough debugging, you'll end up memorizing them anyway because you see them all the time.

    0x000F WM_PAINT
    0x004E WM_NOTIFY
    0x010n WM_KEYxxx
    0x0111 WM_COMMAND
    0x0112 WM_SYSCOMMAND
    0x0113 WM_TIMER
    0x0200 WM_MOUSEMOVE
    0x020n WM_MOUSExxx
    0x0400 WM_USER
    0x8000 WM_APP
    0xCxxx RegisterWindowMessage

    I include 0x001A in the list even though it is a low-traffic message because you do see it a lot when you are investigating hangs. The WM_SETTINGCHANGE (which also goes by the name WM_WININICHANGE) is a common culprit when investigating why your program has wedged: You're broadcasting a notification and there's a window in the system that isn't responding.

    I know that Visual Studio has a shortcut for decoding error codes. I wonder if it has one for decoding message numbers.

  • The Old New Thing

    Don't use global state to manage a local problem, practical exam


    There was much speculation as to how the "Ignore other applications that use Dynamic Data Exchange" setting got set. Well, one possibility is that somebody used global state to manage a local problem.

    "Why on earth does this setting exist?" I don't know, but there appear to be scripts which rely on it.

    The setting is exposed to scripts, and perhaps at some point you ran a script which didn't want Excel to be interrupted while it was running. The documentation for the Excel Application Object does say that it contains application-wide (global) settings.

    I'm not saying that's why you are encountering the problem, but it's just one possibility I ran across while doing some Web searching to learn more about the setting.

    One of those Web searches took me to Susan Bradley (the SBS Diva) who gave one reason why somebody would enable this checkbox: It shuts up a different warning.

  • The Old New Thing

    Viral video: Pianotrappan


    Yes, it's an advertisement for Volkswagen, but still, it's a fun video, and it features Scarlatti's keyboard sonata in C (K159) as a bonus.

    Even the old guy who shuffles along slowly at 1:23 tries the stairs.

    Double bonus: You can watch the original Swedish version.

  • The Old New Thing

    When you want to pass a parameter on the command line, don't forget to pass the parameter on the command line


    This happens to me, too. I once got so distracted by the process of purchasing some tickets in person, choosing the performance date and the seats, fumbling for my credit card, signing the receipt, and when I was done, I left the ticket booth without my tickets!

    Here is a question that came in from a customer. The details have been changed but the underlying point is the same.

    According to the documentation, the taglog command prints a history log of all the tags in the system. I can pass the -d option to limit the date range, and that works too. It also says that that I can pass a specific tag name to limit the listing to just that one tag, but I can't get that part to work. Here's what I'm doing:

    for /f %i in (taglist.txt) do taglog -d 2008/05/01,2008/05/31 >> output

    But this just dumps the history of all tags during the month of May, not the tags I asked for.

    This customer got so excited about passing the date range filter that he forgot to pass the tag name.

    for /f %i in (taglist.txt) do taglog -d 2008/05/01,2008/05/31 %i >> output
Page 2 of 4 (35 items) 1234