October, 2005

  • The Old New Thing

    Night of the Knitting Dead


    Okay, wrong zombie movie, but I couldn't resist the pun. Knit zombies reenact Dawn of the Dead. Now playing on Flickr.

  • The Old New Thing

    The Hallowe'en-themed lobby


    During the Windows 95 project, the window manager team stayed late one night and redecorated the lobby. They suspended a variety of Hallowe'en-themed objects from fishing lines: spiders, ghosts, witches, jack-o'-lanterns, that sort of thing. The fishing line went up and over pulleys, rigged so that the objects spookily rose and fell seemingly of their own volition. It was quite an impressive display.

    The fishing lines were anchored to various doors in the building. Since the doors they chose were highly-trafficked, this assured a random pattern of motion for the objects suspended from the fishing line. Of course, no spooky Hallowe'en display would be complete without a spider rigged to the front door, rapidly descending upon the poor victim coming in for a meeting.

  • The Old New Thing

    Even in the enlightened year of 2005, we have programs that don't handle long file names


    When I saw Tim Sneath's description of the root cause for all the Windows Vista product key problems, I was amazed that the reason was something my readers tend to go completely ballistic over: Long file names.

    It so happens that one of the ISO mounting tools that people were using for installing Windows Vista doesn't support long file names! (At least not by default.)

  • The Old New Thing

    How to recognize different types of sentinel timestamps from quite a long way away


    Some time ago, I discussed several timestamp formats you might run into. Today we'll take a logical step from that information and develop a list of special values you might encounter. Note that if you apply time zone adjustments, the actual timestamp may shift by up to a day.

    Date Interpretation
    January 1, 0001 The value 0 as a CLR System.DateTime.
    January 1, 1601 The value 0 as a Win32 FILETIME.
    December 29/30, 1899 The value -1 or 0 as an OLE automation date.
    December 13, 1901 The value 0x80000000 as a time_t.
    December 31, 1969
    January 1, 1970
    The value -1 or 0 as a time_t.
    January 1, 1980 The beginning of the DOS date/time era. (Unlikely to be encountered since 0 is not a valid DOS date/time value.)
    January 19, 2038 The value 0x7FFFFFFF as a time_t.
    February 7, 2106 The value 0xFFFFFFFF as a time_t.
    September 14, 30828 The value 0x7FFFFFFF`FFFFFFFF as a FILETIME.

    All of these special values have one thing in common: If you see them, it's probably a bug. Typically they will arise when somebody fails to do proper error checking and ends up treating an error code as if it were a valid return value. (The special values 0, -1, and 0xFFFFFFFF are often used as error codes.)

  • The Old New Thing

    Without a doubt, the world's worst online Swedish lessons


    Lesson 3: Schomething schtranger (mp3) is part three of a series of four (so far) horrifically bad Swedish lessons. (Warning: Off-color content and copious swearing, but nevertheless very funny.) Boz has been living in Sweden since June, and two of his so-called friends have been putting together Swedish language tapes for him. Listen along as he goes through the tapes, trying to repeat each of the phrases.

    Each of the lessons does illustrate a genuine detail of the Swedish language, even though Slaygon and Makke choose to illustrate the points using sentences you're unlikely to encounter in your average Swedish textbook...

    • Lesson 1: Homographs, words spelled the same but with different meaning, sometimes with different pronunciation.
    • Lesson 2: Inflections and compound words, where two words change meaning when combined into a single word.
    • Lesson 3: The sj and tj sounds, two difficult sounds. The "sj" sounds like rushing wind, which I tend to mispronounce as German frontal "ch" because I forget to lower my tongue and open my mouth cavity in order to get that echo-ey whistling effect. The "tj" sound is close to English "sh" (differing in some subtle way I have yet to learn).
    • Lesson 4: The letters K, G and Y. The pronunciations of "K" and "G" vary depending on context. The "Y" is a tricky rounded vowel.

    One fine point of pronunciation that doesn't get much attention in textbooks is the Swedish long "i" sound. Most sources just tell you to pronounce it like English "ee", but you're also supposed to push it towards the back of the mouth, so that you sound like Kermit the Frog. I tend to pronounce it like English "ee" and forget to do the Kermit thing. Just like with my problems with "sj", it's not that I don't know how to do it; I just forget.

  • The Old New Thing

    Why is the OEM code page often called ANSI?

    It has been pointed out that the documentation for the cmd.exe program says

    /A Causes the output of internal commands to a pipe or file to be ANSI

    even though the output is actually in the OEM code page. Why do errors such as this persist?

    Because ANSI sometimes means OEM.

    The "A" versions of the console functions accept characters in the OEM code page despite the "A" suffix that would suggest ANSI. What's more, if you call the SetFileAPIsToOEM function, then "A" functions that accept file names will also interpret the filenames in the OEM code page rather than the ANSI code page.

    "There are two types of people in the world: Those who believe that the world can be divided into two types of people, and those who do not."

    There are those who mentally divide the world of characters into two groups: Unicode and 8-bit. And as you can see, many of them were involved in the original design of Win32. There are "W" functions (Unicode) and "A" functions (ANSI). There are no "O" functions (OEM). Instead, the OEM folks got lumped in with the ANSI folks.

    There are also those who realize the distinction, but out of laziness or convenience often use "ANSI" as an abbreviation for "an appropriate 8-bit character set, determined from context". In the context of console programming, the appropriate 8-bit character set is the OEM character set.

    The person who wrote the online help for cmd.exe clearly meant ANSI to mean "That thing that isn't Unicode."

    /A Causes the output of internal commands to a pipe or file to be ANSI
    /U Causes the output of internal commands to a pipe or file to be Unicode

    I'll leave you to decide whether this author belongs to the "Everything is either Unicode or ANSI" camp or the "just being casual" camp.

    Related: Keep your eye on the code page.

  • The Old New Thing

    PC Magazine interviews "the team behind Windows" on its twentieth birthday


    PC Magazine interviewed "the team behind Windows" in commemoration of Windows' twentieth birthday. The article's author talked with Bill Gates, Charles Simonyi, Jeff Raikes, Ray Ozzie (huh? He didn't even work at Microsoft until April 2005! How could he have been part of "the team behind Windows"?), Jim Allchin, Brad Silverberg, David Cole, Yusuf Mehdi, Joe Belfiore, and Chris Jones. Ten managers. Apparently "the team behind Windows" doesn't include programmers or testers.

    For some reason, the media often identify Hillel Cooperman (a Product Unit Manager) as a programmer, and whenever this happens, we always make a point to assign him a nasty bug to fix.

  • The Old New Thing

    When programs assume that the system will never change, episode 1


    An example, all too frequent, of ways programs assume that the user interface will never change is reaching into system binaries and sucking out undocumented resources. In the shell, we have fallen into the reluctant position of carrying "dead" icons around for the benefit of programs that assumed that they would always be available. However, we often make these "orphaned" icons blank so that these programs don't crash, but they don't necessarily look all that wonderful either.

    Recently, I learned of a new type of resource stealing: Stealing animations. For Windows Vista, there have been many changes to the way the system internally organizes its resources in order to support the Multilingual User Interface feature. One of the things we found was a handful of programs that reach directly into Shell32.dll in order to obtain the file copy animation. Too bad (1) the animation isn't kept there any more, and even if we moved the animation back to its original location, (2) the animation uses a new compression scheme that older programs can't handle.

    Remember, resources in system DLLs should be treated as implementation details, unless explicitly documented otherwise.

    I'm not sure what we're going to do about the animation resource problem. Suggestions anyone? Should we declare these programs broken and make the people who bought them go back to their vendors for upgrades? (What if there is no vendor?) Should we develop a shim and hope that those four are the only programs that need it? Should we carry the original animation in shell32.dll as junk? If I told you that one of the programs that did this won "Game of the Year" recently, would that change your answer? What if another turned out to be a top-rated anti-spyware program?

  • The Old New Thing

    It's like being at the PDC, but without the lines or the tote bag


    Michael Swanson announced last night that the arduous process of assembling the PDC 2005 DVD content is now complete and the results are now online. For free. For six months. You can choose a session and watch it via streaming video, or you can download the video itself for offline enjoyment (!). Michael also has links to the order form if you want to have shiny silver DVDs in your grubby mitts. I'm told that the masters have been released to manufacturing; this means that shiny silver DVDs (including Channel9 bonus tracks) will probably be in the grubby mitts of attendees by (U.S.) Thanksgiving. But don't quote me.

    So go ahead, set up your own "virtual PDC". Tote bag not included.

  • The Old New Thing

    Seattle Twenty-Five for $25 November 2005 restaurant list is available


    A regular restaurant promotion in the Seattle area is called Twenty-Five for $25 (The "$" is silent). Other cities have their own versions of this. New York's is called Restaurant Week, for example, and Toronto's is called (I am not making this up) Winterlicious.

    The common theme is that participating restaurants offer a prix fixe menu for a reduced price. Twenty-Five for $25 offers dinner for $25 or lunch for $12.50. Restaurant Week offers lunch for $20.05 (the price goes up by a penny each year); some restaurants also offer dinner for $30.05. Winterlicious's menus are C$10/$20 for lunch and C$20/$30 for dinner.

    If your city offers these promotions, I strongly encourage you to give them a try. It's a great way to eat at a fine restaurant without destroying your wallet. Plus, the portions are much more reasonably-sized.

    One thing that I do miss in Seattle is "pre-theater dinners". In London, the restaurants in the theater district have special menus designed to offer you a leisurely dinner while still getting you out in time to catch your show. In Seattle, you're on your own to make sure you get out in time, which can be a challenge when the restaurant doesn't seem to be playing on your team.

Page 1 of 5 (41 items) 12345