November, 2008

  • The Old New Thing

    Now it's like people buy sneakers to make money out of them


    Where there are sneaker addicts you will have sneaker speculators. And not all the sneakerheads appreciate it.

    Such trading bothers purists like Raymond Chen, 26.

    "People used to buy sneakers because they love them," Chen said. "Now it's like people buy sneakers to make money out of them."

    Chen, an engineer from Shoreline, owns about 120 pairs of sneakers and spends about $100 a month on his hobby. If there are a number of shoes releasing within the same month, he spends more.

  • The Old New Thing

    You can't fight in here; this is the War Room!


    (Video clip for those who don't get the reference.)

    The term War Room is attributed to Winston Churchill, used to describe the underground meeting room where the war effort was directed. It is the "crucial meeting room where important decisions are made" sense of the term that is used at Microsoft.

    Many software products (or even just components of software products) have a meeting room designated as its War Room. Depending on the stage of the project, War Meetings might be held weekly, daily, or even several times a day. The meeting is run by the War Team, with representatives from all product components in attendance. Progress reports are given, the schedule is managed, critical bugs (or, if things are coming down to the wire, all bugs) are reviewed. For projects that are spread out over multiple locations, fancy teleconferencing equipment may be installed, and there may be clocks on the walls for time zones around the world.

    Since the same people tend to attend these meetings over and over, there's a good chance that you'll find long-standing inside jokes and other rituals. For example, in the Windows War Room, there are pieces of paper on the walls with various catch phrases printed on them. I have no idea what they mean, but they are obviously a source of amusement for the people who spend hour after hour in the War Room.

    If you're a programmer or tester, you don't have much direct interaction with the War Meetings unless you are responsible for a bug that has caught the attention of the War Team, at which point you are suddenly thrust into the frenzy. Before each War Meeting, your manager will want a status report, and if it's a new bug, you may even have to explain the situation in person. For example, suppose the project is in its final days, and a new bug just turned up. You may be called upon to describe the bug to the War Team, assess how risky the fix is and its impact on performance, application compatibility, and all that other information that the release management team will need to know in order to decide whether they are going to approve the fix. (Another phrase you may hear is taking a bug to War, which means bringing the bug before the War Team to request that they approve the fix for the product.)

    And now that you've learned all this vocabulary surrounding the term War Room, you have to forget it all, because the new term is Ship Room, since that is the room where decisions about shipping the product are made. (Though it seems that the security folks still call their meeting room the War Room.)

    Aside: The White House War Room was renamed the Situation Room in 1961.

    I don't know the reason for sure, but I suspect the old term is deprecated because it sounds too belligerent and uncooperative.

    (And happy Veteran's Day.)

    Bonus track: Inside the SQL 2008 Ship room. And no, the music is not part of the meeting.

  • The Old New Thing

    What do these topics have in common?


    Update: The first correct answer is from Tom Smith who correctly identified the articles as having ridiculous In Popular Culture sections which mention The Simpsons. Lazbro was right: There needs to be a bot that deletes all "In Popular Culture" sections from Wikipedia.

  • The Old New Thing

    How slow do you have to slow-double-click for it to be a rename?


    In many parts of the system, you can rename an item by first selecting it, then clicking on its name. The selection step is typically done by clicking on the item, which creates the risk that your second click will be interpreted as a double-click rather than as a rename click. How slow do you have to slow-double-click for it to be a rename?

    Slow enough that it's not a regular double-click.

    The double-click time is set in the mouse control panel; I believe the current default is 500 milliseconds. If your two clicks are within a half second of each other, they will be treated as a double-click. If they occur more than a half second apart, then they are treated as two clicks.

    Okay, I lied.

    If you think about it, the algorithm above misses a case: Suppose you click on an item, wait two seconds, and then double-click it. That second click (the first in the double-click) shouldn't initiate a rename because it's really part of a double-click.

    Therefore, the rule really is that a click on a selected item with no other clicks within the double-click time, either before or after is treated as a rename.

    That's why the answer to commenter boxmonkey's question "Who renames files by slowly double clicking?" is "Nobody." It's like asking, "Who makes a telephone call by picking up the receiver and holding the hook down for three seconds before beginning to dial, then holding the hook for another three seconds when the call is over?" Holding the hook isn't part of dialing process. The purpose of holding the hook is to ensure that when you ultimately go off hook, the operation won't be interpreted as a flash. You don't consider it part of the phone dialing process; it's just a way to separate the next call from the previous one.

  • The Old New Thing

    What I don't get about bank robbers


    My reaction to the news story about the so-called Barbie Bandits wasn't disbelief or shock at the crime, but rather confusion over their over-arching plan. People rob a bank and use the money to buy stuff. Dude, cut out the federal crime; just steal the stuff directly.

    When I expressed this disbelief at the lunch table, one of my colleagues took issue with my assessment. "Oh, no, the food in state prison is awful. Federal is much better."

  • The Old New Thing

    Self-esteem gone overboard: The perils of a global namespace


    There are items with overly generic names. HANDLE, CloseHandle, GetObject, DIFFERENCE, query.exe. But their functionality doesn't live up to their name. HANDLE refers only to kernel handles, CloseHandle can only close kernel handles, GetObject only gets information about GDI objects, DIFFERENCE applies only to the numerical difference between group resources and standalone resources, and query.exe only queries information about Terminal Services Remote Desktop Services.

    Why do functions that operate only inside a specific realm have names that suggest a broader scope?

    Self-esteem gone bad.

    You're on the kernel team. You have a handle manager. What should you call your handles? Well, since they're handles, just call them HANDLE. Because that's what they are, right? And naturally the function that closes HANDLEs should be called CloseHandle. Sure, there are other types of handles out there, but they don't exist in your world. Your world is the kernel, and in the kernel world, you can call them HANDLEs and everybody will know that you're talking about kernel handles because that's why you're in the kernel in the first place! Why would somebody pass a handle to a non-kernel object to a kernel function? That makes no sense!

    Similarly, the GDI folks came up with their own object system, and naturally the way you get information about an object is to call GetObject. There's no confusion here, right? I mean, this is GDI, after all. What other types of objects are there?

    The Terminal Services Remote Desktop Services folks thought the same thing when they created their query.exe program. Hey, this is a computer set up to run Remote Desktop Services; of course you want to query information about Remote Desktop Services.

    Of course, when your symbol exists in a shared namespace, the context of your naming decision becomes lost, and your generic-sounding function name (which worked just great for generic operations in the world in which it was created) ends up carrying more meaning than you originally intended.

    Commenter Sean W. tries to explains that Unix doesn't have this problem. "A Unix-flavored close() system call can close any file descriptor." This explanation ends up being its own counter-argument. When you say that it can close any file descriptor, you're admitting that it can't close anything. You can't use close() to close the objects opened by opendir() or dbm_open() or XtOpenDisplay.

    "Well, yeah, but it can close any file descriptor regardless of where it came from." And CloseHandle works the same way: It can close any kernel handle regardless of where it came from.

    Sean W. later clarified that "the scope of close() is the system kernel, so it's reasonable to expect that it applies to kernel data and no other data, whereas the scope of CloseHandle is all of Win32, including at least KERNEL/USER/GDI/ADVAPI." Um, actually, the scope of CloseHandle is also the kernel.

    And in the category of "suggesting things that are already done" goes this comment from Daniel, who suggests that the documentation explain which HANDLEs can be closed by CloseHandle. Actually, if you look at each function that creates a handle, it also tells you the function to use to close it. Not quite the same thing, but since you have to open something in order to close it, you'll find the information even sooner.

  • The Old New Thing

    What seventh grade students want to be when they grow up, an analysis


    A few years ago, I listed some of the careers seventh grade students chose for themselves. But my friend the seventh grade teacher pointed out to me that the list hides the correlation between the jobs and the students.

    The lower-performing students chose the high-glamour jobs: Professional athlete, model, rock star, actor. Some of these students may be exhibiting boundless optimism; others may simply not have thought through the question very much and just picked the first thing that popped into their head. By comparison, the higher-performing students tended toward low-glamour but highly-skilled jobs: Contract attorney, civil engineer, brain surgeon, traffic planner.

    It's interesting that both groups are setting themselves up for disappointment in different ways. The big dreamers are likely to be disappointed when they find that becoming an actor involves lots of waiting tables and tiny roles trying to get your big break, or that becoming a professional athlete means you're competing against thousands of other hopefuls for only a few dozen openings. On the other hand, the harsh realists may be selling themselves short, missing out on a chance to exercise their creativity.

    Or maybe it's just too soon for twelve-year-olds to be worrying about this sort of thing. Let them have their dreams for a few years longer.

  • The Old New Thing

    Does version 6 of the common controls support ANSI or not?


    I mentioned in passing a few years ago that version 6 of the common controls supports only Unicode. And then other people stepped in to say, "Well, XYZ uses ANSI and that works for me." So does it support ANSI or doesn't it?

    It does and doesn't.

    All of the controls in the common controls library are internally Unicode. But not all controls in the library are created equal.

    The first group is the traditional common controls. List view, tree view, those guys. These controls were never part of the window manager and have been internally Unicode on all Windows NT platforms. The ANSI messages such as LVM_SETITEMA are implemented by thunking to and from Unicode.

    The second group is the controls that were traditionally part of the window manager itself. If you aren't using version 6 of the common controls, you will continue to use the versions built into the window manager, and those versions, for the most part, are also internally Unicode.

    The one weirdo is the edit control. The edit control uses black magic voodoo to tell whether you created it with CreateWindowExA or CreateWindowExW, and its internal edit buffer is ANSI or Unicode accordingly. (Regular window classes don't have access to this magic voodoo. It's one of the historical weirdnesses of the edit control that date back to the old days.)

    The internal character set goes largely unnoticed since the window manager automatically converts between Unicode and ANSI as necessary. For example, if you call SetWindowTextA to a Unicode edit control, the window manager will convert the string from ANSI to Unicode and send the Unicode string to the edit control. The one place the internal character set becomes visible to the outside world is with the EM_GETHANDLE and EM_SETHANDLE messages, because these messages access the internal buffer of the edit control. You therefore have to know whether your edit control is a Unicode or ANSI edit control so you know the correct format of that internal buffer.

    When these window manager controls were ported into the common controls library, the voodoo was lost, since that magic is available only to internal window manager classes, and the common controls aren't internal window manager classes. Since the common controls library uses RegisterClassW to register the window class, the edit control that comes with the common controls is a Unicode edit control. In other words, if you use CreateWindowA to create an edit control from the common controls library, and you send it a EM_GETHANDLE message, the buffer you get back will be a Unicode buffer, not an ANSI one.

    This wacky behavior with EM_GETHANDLE, as well as other even more subtle weirdnesses that come from the edit control in the common controls library being always internally Unicode means that code that calls CreateWindowA and expects the result to be an edit control which is internally ANSI will be in for a bit of a surprise when they are using version 6 of the common controls library.

    These and other subtle ANSI/Unicode discrepancies are why the common controls library, starting with version 6, requires a Unicode application. If you're an ANSI application and you create controls from the common controls library, you may encounter strange behavior. It'll mostly work, but things may be weird at the fringe.

    Now, why not just get rid of all the ANSI support entirely? Why leave it in, even though it doesn't quite work perfectly? For the same reason the Windows XP common controls are not a separate library with separate window class names. As noted, there are programs that like to go hunting around into windows that don't belong to them. Some of those programs might stumble upon one of Explorer's list views and use various nefarious techniques to do things like stealing strings from another program's list view control. If support for the ANSI messages such as LVM_GETITEMA were removed entirely, then those sneaky programs would stop working.

    You might say, "Well, tough for them." You'll say that until you discover that one of those sneaky programs happens to be one that you use every day, possibly even one that you wrote yourself. Oops. Now you're going to tell all your friends, "Don't upgrade to the next version of Windows. Its compatibility sucks."

    Okay, so the common controls still have to be backward compatible with the ANSI messages that existed in version 5. But at least the new messages such as LVM_SETINFOTIP can be Unicode-only.

    And it means that all you folks who are using version 6 of the common controls but haven't converted to Unicode are relying on a compatibility loophole. The ANSI support is there for the old programs that thought they were talking to a version 5 common control; it isn't there for you.

  • The Old New Thing

    Microspeak: Represent


    The more conventional definition of represent is along the lines of "to act as a proxy for". An attorney represents his or her client in court. Your legislator represents you in the assembly. A token on a board represents your position in the game.

    At Microsoft, the word represent takes on a stranger meaning. Here are some usages inspired by actual sentences:

    • We need someone to represent this bug at the morning meeting.
    • Can somebody represent which OS versions are affected by this issue?

    In the first case, I'm guessing that the word represent means "to act as an advocate for" or possibly just "to serve as a source of information on".

    In the second case, it appears that the word represent just means "tell us in an official capacity".

    These new senses may be influenced by rap lyrics and what is genteelly referred to as urban culture.

    If somebody actually knows what the word "represent" means at Microsoft, please add a comment. I asked the person who made the second statement for a definition, but what came back was merely the "act as a proxy for" definition, which clearly doesn't make sense. (How can a person act as a proxy for a list of operating systems?)

  • The Old New Thing

    Quite possibly my last in-person ballot for a long time


    Most parts of the state of Washington have switched to all-mail voting. No more standing in line at the polling place and casting your vote in person. This is certainly a convenience, but to me, it dilutes the voting experience.

    Part of the experience is the sense that you're part of a process, and standing in a room full of voters certainly drives that point home. You may come from all walks of life, but you all have one thing in common: You all want to vote.

    Also concerning to me is the loss of the guaranteed secret ballot in a mail-in election. With a mail-in ballot, you have the problem that an overbearing family member can dictate how the rest of the family shall vote, and can even oversee the process as the rest of the family members dutifully fill in the dots, then seal and sign the envelope. A family member who wants to cast a vote differently really has no chance. But with an in-person election, the voter goes into a voting booth, and nobody is permitted to go in with that person (with a few exceptions). You know that the vote cast is the voter's true intentions. The overbearing family member has no way of confirming that the vote was cast according to his or her orders.

    (Actually, in my voting district, that's not really true with in-person voting even today. We don't use pull-the-lever voting booths; we use fill-in-the-dots forms, and after filling in the dots, you take your ballot from the voting booth to the scanner. During that walk, the overbearing family member can inspect your ballot to make sure you filled it out "correctly".)

    My voting district is scheduled to switch to all-mail voting next year, and this morning, I stood in line for what is quite possibly the last time. The poll worker for my precinct is a nice Chinese woman. She used to try to speak Mandarin with me whenever I came in, and I would respond with a few set phrases before explaining, "不會說." (Getting the sentence wrong helps drive the point home.) Now she recognizes me and knows better.

    I noted, "Lots of people here today."

    She replied, "Yeah, really busy. More people here now than we used to get all day." She may have been exaggerating, but it was definitely more crowded than it usually is.

    I forgot to say good-bye to her as I left. We may never see each other again.

    (Raymond predicts that the comments will be taken over people discussing electronic voting.)

Page 3 of 4 (33 items) 1234