October, 2006

  • The Old New Thing

    Invalidating the null window redux

    • 51 Comments

    The people who work on the next generation of the window manager, known as the Desktop Window Manager (DWM), told me that their original plan was to get rid of the compatibility hack that says that invalidating the null window invalidates the entire desktop, but by an amazing coincidence, two days after I posted that article, they received a report that the beta version of an upcoming product from a major vendor still relies on that behavior (albeit accidentally). They contacted the vendor who agreed to fix the bug, but the fact that a modern program still relies on this ancient behavior gave them pause. If a program written just this year relies on the null window hack, imagine how many programs written in years past also rely on that behavior. After some deliberation, they decided to put the compatibility hack back in, just to be safe.

    Some compatibility hacks never die, no matter how hard you try to kill them.

  • The Old New Thing

    More tales of dead computers: My home desktop

    • 75 Comments

    Yes, I said that my next dead computer story would be the AlphaServer, but late-breaking news has forced me to shuffle the order a bit.

    My home computer has been circling the drain for several months. (The Northbridge fan would buzz and sometimes spin really slowly.) When the motherboard finally stopped powering on, I knew its time was up.

    Being the clueless geek I am, I figured, "No big deal. Swap out the motherboard and I'm back in business." Easier said than done. For you see, my computer is so old, nobody makes motherboards compatible with the one I had. According to Wikipedia, not only has Socket A been discontinued, its replacements, Socket 754 and 939, have themselves been superseded (by AM2). I was two generations obsolete.

    Therefore, with the motherboard upgrade came a CPU upgrade and of course a RAM upgrade since my old PC-2100 RAM doesn't work in the new motherboard (which wants PC-3200 but can slum it with PC-2700).

    After I got the new parts home, I realized that the new motherboard wants a PCI Express video card rather than my old AGP card, and it also needs a new power connector that my old ATX power supply doesn't have, so I'll need a new case and power supply, too.

    My simple "swap out the motherboard" has turned into a massive upgrade. I'm thinking I would have been better off just buying a Dell.

    I'm not out of the woods yet. I get everything all plugged in and hooked up, and the hard drives won't spin up. Well, they do spin up, as long as I don't plug in the IDE cable. But if I plug in the IDE cable, they refuse to spin. (Yes, I tried a different cable.) I don't think it's excessive power draw, because I get this even when I hook up just one hard drive, and when the IDE cable isn't plugged into the motherboard, the drives spin up just fine. I'm baffled on this one.

    Update: No, it's not bad cabling, since I used the cables intact from the old computer. The exact same cables in the exact same configuration worked on the other computer. And the cables are keyed so I'm not installing them backwards. And it's not lack of power. I fed power to the drive from the old computer's power supply, and the same thing: Spins up if IDE cable disconnected. (What's more: If the IDE cable is connected and the motherboard is powered off, the drive does not spin up.)

  • The Old New Thing

    Quick and dirty Hallowe'en costume for physics geeks

    • 10 Comments

    When I was considering with some friends what I could be for Hallowe'en this year, one of the ideas that emerged in a fit of brainstorming was "Schrödinger's cat".

    To dress up as Schrödinger's cat, or more accurately, the Schrödinger cat thought experiment, you just need a cardboard box and a heavy marker. Use the marker to write "Contents: Schrödinger's cat. Warning: Do not observe." If you really want to get fancy, you can stick a cat doll inside the box to satisfy the people who ignore the warning. (Then you can scold them for collapsing the wave function.) Leave it ambiguous as to whether the cat is alive or dead.

    As part of the brainstorming, I also blurted out the costume "Schrödinger's catbox". I have no idea what that would be, though. It just sounded surreal.

    Ultimately, I decided that a cardboard box was simply too cheesy, so I dusted off my Nobel Peace Prize costume, which I wore this past weekend to a pumpkin-carving party.

  • The Old New Thing

    Psychic debugging: Why doesn't my program show up when I call ShellExecute?

    • 22 Comments

    This question came in from a customer (paraphrased):

    If I run my program from the command prompt, it works great, but if I run it from my launcher via ShellExecuteEx, it never appears.

    See how good your psychic powers are at solving this problem before I give you the second question that gives away the answer.

    Any luck?

    Here's a second question from a different source (but which coincidentally came in the same day).

    I'm trying to use ShellExecute to open a document. The function succeeds (returns a value greater than 32), but I don't get anything on the screen.

    if (ShellExecute(Handle, NULL, FileName, NULL,
        NULL, NULL) <= (HINSTANCE)32) ...
    

    The problem the second person is having lies in the last parameter to the ShellExecute function. It's nShowCmd, which is supposed to be an SW_* value, but which this person is passing as NULL. It so happens, that the value zero corresponds to SW_HIDE, which explains why the program doesn't appear: You told it to run hidden!

    Now go back to the first problem. Do you see what the person most likely did wrong? The code probably went like this:

    SHELLEXECUTEINFO sei = { sizeof(sei) };
    sei.hwnd = hwnd;
    sei.lpVerb = TEXT("open");
    sei.lpFile = pszFile;
    ShellExecuteEx(&sei);
    

    Since the sei.nShow member was not explicitly set, the value was implicitly set to zero by the incomplete initializer. And as we noted above, zero means SW_HIDE.

    It turns out my psychic debugging was correct. That was indeed the source of the first person's problem. Now you can use your psychic powers, too.

  • The Old New Thing

    Wired Magazine's report on that bizarro Ferarri crash

    • 11 Comments

    Say what you want about blogs, there's still room in the world for engaging journalism, such as Randall Sullivan's report on that bizarro Ferarri crash that started out as a spectacular event but turned out merely to be the entry into a much more complex and intriguing world. (via BoingBoing.)

    (Recent development: Eriksson turns down a plea deal. Interesting that he spoke through an interpreter.)

  • The Old New Thing

    How do I shut down a workstation via Remote Desktop?

    • 35 Comments

    When you are connected to a workstation via Remote Desktop, the "Turn Off Computer" option changes to "Disconnect". But what if you really want to turn off the computer, hibernate it, or put it on stand-by?

    Note: These tips work on Windows XP, but there is no guarantee that they will work in future versions of Windows.

    One way to do this is to run Task Manager and select your shutdown option from the "Shut Down" menu.

    Another trick is to click on the desktop and type Alt+F4. This will call up the shutdown dialog, where you get the usual shutdown options like "Shut down", "Shut down without installing updates", "Restart", "Stand by", and "Hibernate".

    These next two tricks are documented and will continue to work in future versions of Windows:

    If you're a command line person, you can run shutdown.exe, but that program supports only shutdown and restart; it doesn't do stand-by or hibernate. But the shutdown.exe program has a serious flaw: It requires you to have administrator privileges. If you are a limited user with shutdown privileges, the shutdown.exe program will complain. (Which means that I don't use it.)

    Finally, if your computer isn't using Fast User Switching, you can type the Ctrl+Alt+End hotkey, which is the Remote Desktop version of Ctrl+Alt+Del and consequently takes you to a dialog where you can do various system-type things, among them logging off and shutting down.

  • The Old New Thing

    No good deed goes unpunished, part 2

    • 33 Comments

    Sometimes you're better off keeping your fool mouth shut.

    When I reply to a question on an internal discussion list, often with a clarifying question rather than an answer, it will occasionally happen that the person I replied to will send a response directly to me rather than including the discussion list. This is bad for a few reasons.

    • I was just trying to help you ask a better question. I didn't sign up to be responsible for the answer. I have an actual job whose description does not include "Solving your personal problems."
    • Sending the response directly to me means that others on the discussion list miss out on the answer. (Assuming I even know the answer.) It also prevents the answer from going into the discussion list archives.
    • Sending the response directly to me means that if I happen to go on vacation or am otherwise unavailable, you won't get an answer to your question. Other people on the discussion list can't chip in with their advice since you didn't include them on the reply.
    • Sending the response directly to me creates an implied obligation on me to reply. I didn't sign up for that.

    When somebody does this, I typically forward the message back to the discussion list with a message like "I wish they'd fix that Exchange Server bug where the discussion list keeps getting deleted from the 'To' line." This is a little joke that I use to avoid directly accusing the person of removing the discussion list from the 'To' line intentionally.

    I used to write some variation of "It's that annoying Outlook bug again..." but Jensen Harris asked me to stop because they were actually getting bug reports filed into the Outlook defect tracking database that went, "Outlook is deleting discussion lists from the To line when people reply. Raymond says so, so it must be true." The poor Outlook folks had to keep explaining to the people who submitted these bug reports, "No, Raymond was making a joke (at your expense)." To take the heat off the Outlook team, I switched to blaming Exchange Server. I have no idea if the Exchange Server team has their own collection of analogous bugs. They haven't asked me to change my joke, so maybe it's not a problem for them.

  • The Old New Thing

    Dead Sea Scrolls lectures available online (or in person if you can get there)

    • 3 Comments

    As I noted last year, the Dead Sea Scrolls are in Seattle, and in conjunction with the exhibition is a series of eleven lectures at Town Hall. Tonight's lecture is The Dead Sea Scrolls, Jesus & The Da Vinci Code. These lectures are rebroadcast on The Seattle Channel, and it appears that the city also makes the video available via streaming media. It takes a few weeks for them to make it to the archive page, though. The first lecture in the series, Dead Sea Scrolls: Early Judaism and the Births of Christianity just went up. Fascinating stuff.

  • The Old New Thing

    Don't require your users to have a degree in philosophy

    • 61 Comments

    Help text is not the place to put logic puzzles.

    In Windows Vista, when you go to the System control panel, you are shown a number that describes your computer's rating. But are higher numbers better or worse? If I had a choice, would it be better to have a 1 rating or a 5 rating?

    In earlier betas of Windows Vista, you had to have a degree in philosophy to figure this out. If you clicked the "Help" button on the System control panel page, you were sent to a page of help text that tried to explain the performance rating. When it got around to explaining what the number means, the text said, paraphrased, "When looking for software to run on this computer, you should choose programs whose rating is less than or equal to the rating of this computer."

    So does this mean that bigger ratings are better?

    "Well, if a program's rating is small, then the computer's rating needs to be bigger than that, so a program wants its rating to be as small as possible so more computers can run it. If my computer's rating is small, programs will be fighting to get a rating low enough that I can run it. That's a good thing for me, right? No wait, but what if the program I want has a high rating? Then my computer will need a higher rating. If my computer had a low rating, then that wouldn't be less than or equal to the program's rating. No wait, I got it backwards, it's the program that needs to be less than or equal to the computer, not the other way around. If the program's rating needs to be less than or equal to the computer's rating, then that means that the computer's rating needs to be greater than or equal to the program's rating. If my computer rating were higher, than it could run more programs."

    "I think."

    "Why can't they just say, 'Bigger numbers are better'?"

  • The Old New Thing

    Answering phones at KUOW for their Fall 2006 pledge drive

    • 10 Comments

    I spent Saturday evening as a volunteer answering the phone for one of our local public radio stations, KUOW. This was the first time I had worked a pledge drive, and it was a fun experience.

    I was there sort of as an honorary member of a group of friends who get together every week for drinks; they decided to volunteer for the pledge drive as a fun change of pace. Here's sort of how the evening goes: You'll be sitting there at the table chatting with your friends, and then a phone rings and the conversation instantly stops while somebody took a call. By the time the call is over, everybody had forgotten what they had been talking about and a new conversation starts up. There were a lot of conversations that just ended abruptly and were never resumed. Great for people with short attention spans.

    When the volunteer coordinator announces, "Pledge break in two minutes," it means things are going to get exciting soon. The calls arrive in waves. The moment the pledge telephone number is announced, the phones start ringing. A few minutes after the pledge break ends, the phones quiet down. (That's the best time to go for a bathroom break.)

    At one point, the person next to me started taking a pledge and then went into a coughing fit. She handed me the receiver, and I finished the call for her. But while I was on the phone with her pledge, my phone rang, and another volunteer had to answer my phone. The second volunteer had the presence of mind to take her phone out of the rotation before answering mine, so the chain wouldn't continue! (During one of those short conversations, the volunteer that went into the coughing fit explained that she started volunteering because her then-boyfriend did it. "I wanted to make sure he wasn't coming just to meet cute girls.")

    The second volunteer (the one who answered my phone) later took a pledge from the host of one of KUOW's news programs! She answered the phone and recognized the caller's name but played it safe because, hey, it might just be a coincidence. When she asked for the caller's e-mail address, he said, "They've got it already. I work there." Now sure of her caller's identity, she decided to have a little fun and tried to upsell him to the next pledge level.

    I'm told that in the old days, the phone system didn't randomize the assignment of incoming calls to telephones. Instead, it operated as a hunt group: There was a "hot seat" that always got the first call, then the second seat always got the call if the hot seat was busy, and so on. Eventually, they realized that this wasn't fair to the person in the hot seat and they installed a system that spread the calls out more evenly.

    When you're in the car or at home listening to the pledge drive, it sounds like the hosts are right there in the pledge room, but that's just an illusion produced through the magic of radio. (Special effects in radio are a lot cheaper than they are on television.) The hosts are upstairs in the main control studio, and the pledge drive volunteers are downstairs in the performance studio. There is a microphone in the pledge room so the hosts can hear if, say, a cheer goes up.

    The entire operation is low-tech. We take pledges with the tried-and-true "pen and paper" technique. Some of the people who call in think we're all in front of computers with the entire membership database available at the touch of a button. No such luck. It's great that you've been a member for ten years and have your membership number handy, but I can't call up your address; you'll have to give it to me again.

    On the other hand, the low-tech way of recording pledges means that when somebody makes a pledge, say, ten minutes after their favorite show ends, you can backdate their pledge form so their pledge counts towards the show they wanted to support.

    The current tally is recorded on a whiteboard that is updated by hand. The highest-tech part of the whole operation is a webcam that sends a picture of the whiteboard upstairs so the hosts can see how things are going.

    If everybody is quiet in the pledge room, you can hear the on-air audio feed, which is piped in at low volume. When the calls are coming in, the room gets quite noisy, and some people use an earplug to block the non-telephone ear. It basically means that down in the pledge room, we have no idea what's happening on-air. I'm told that during an earlier pledge drive, the host said something like "At some point during the evening, I'm going to repeat a song. When this happens, call the pledge line and tell us the name of the song." Of course, nobody told the volunteers about this. Somebody would call up and say the title of a song and the volunteers would have no idea why.

    When the volunteer coordinator asked us for the name of our group so we could be acknowledged on the air, we had to do a bit of brainstorming. The group doesn't have a name (it's just a bunch of friends who get together for drinks), so we made up a funny name on the spot. I'm told that one year, the group gave its name as The Bill Radke Fan Club. (This was back in the heyday of Radke's show Rewind.) Bill Radke was upstairs in the booth and freaked out. He was afraid it was a bunch of stalkers who rummage through his trash looking for discarded socks or something. Once convinced that they weren't a bunch of crazy people, he came down and even answered the phones for a while. But he didn't do a very good job: It was as if he'd never seen a pledge form before. He'd be baffled by the instructions and fill it out wrong. Ultimately, his technique settled into "answer the phone, chat with the caller for five minutes, then hand the phone to a volunteer to collect the pledge information."

    This year, the show that happened to be on the air at the time was The Swing Years and Beyond, so we chose the name The Swing Beers. When the name was announced, the on-air banter went like this:

    Amanda: "And in our pledge room answering phones we have a group called The Swing Beers. I don't know what that means."

    Ken: "I do."

    Ken Vincent obviously drinks beer.

Page 2 of 4 (36 items) 1234