The Old New Thing

Mother's Day is for all mothers, not just your own mother

This upcoming Sunday is Mother's Day in the United States, and I'm reminded of a little story from several years ago. One day, we asked a colleague how he and his new child were planning to celebrate Mother's Day. "Yup, I'm all over that. I mailed a gift to my mother earlier this week, and I'll call her on Sunday." — Um, aren't you ...

Data breakpoints are based on the linear address, not the physical address

When you ask the debugger to set a read or write breakpoint, the breakpoint fires only if the address is read from or written to by the address you specify. If the memory is mapped to another address and modified at that other address, then your breakpoint won't see it. For example, if you have multiple views on the same data, then ...

The economics of soccer penalty kicks

I'm fascinated by economics, specifically the application of economic theories to things you wouldn't normally consider as economics. Back during the World Cup, Slate's undercover economist column took a look at the economics of penalty kicks. Steven D. Levitt, co-author of another paper on the subject, writes in more detail on the ...

Gentle reminder: On a dialog box, do not give OK and Cancel accelerators

I know most of you know this, but I'm going to say it for the record. When you have a dialog box with an OK and/or Cancel button, do not give the keys accelerators. In other words, simply write The dialog manager already has those buttons covered. The hotkey for the OK button is Enter (since it is the default pushbutton), and the hotkey ...

The new dietary restriction landscape

Non appetit, the modern quandary of preparing a dinner for people who all have different types of dietary restrictions. Depending on whom I invite to dinner, I may have to put together a meal that conforms to one or more of the following restrictions: low-fat, pescetarian, vegetarian, nondairy, non-pork, non-beef. (Yes, many of these ...

Apparently I've been promoted by mistake all these years

A few years ago, this posting on the secret to getting promoted caught my eye. After several years at Microsoft, I had an epiphany today. I came to the realization that the best way, rather the only way -- to get promoted is to demonstrate the ability to hire and retain top talent. Other factors do go a long way but without the ability to ...

Psychic debugging: Why does ExitProcess(1) produce an exit code of zero?

Here's a question that came from a customer. By now, you should already have the necessary psychic powers to answer it. Our program calls to indicate that it exited unsuccessfully. The process that launched our program waits for the program to exit and then calls to retrieve the exit code. The function succeeds, but the exit code is zero! ...

If you pass invalid parameters, then all bets are off

Alun Williams pointed out that if you pass invalid parameters to , it does not destroy the . Well, yeah, because if you pass invalid parameters, then all bets are off. Different functions perform different degrees of parameter validation; the degree to which this is done is typically guided by security concerns. Information that crosses ...