The Old New Thing

Why do text files end in Ctrl+Z?

Actually, text files don't need to end in Ctrl+Z, but the convention persists in certain circles. (Though, fortunately, those circles are awfully small nowadays.) This story requires us to go back to CP/M, the operating system that MS-DOS envisioned itself as a successor to. (Since the 8086 envisioned itself as the successor to the 8080...

Senators are really good at stock-picking

A Georgia State University study shows that U.S. senators have an uncanny knack for picking stocks that outpace the overall market. Professor Alan Ziobrowski's analysis of senators' financial disclosure data found that over a period of six years, the lawmakers outperformed the market by 12 percent. Professor Ziobrowski seems ...

What is the default security descriptor?

All these functions have an optional LPSECURITY_ATTRIBUTES parameter, for which everybody just passes NULL, thereby obtaining the default security descriptor. But what is the default security descriptor? Of course, the place to start is MSDN, in the section titled Security Descriptors for New Objects. It says that the default DACL comes ...

What happens to those "To Any Soldier" care packages

Commentator and novelist Christian Bauman recalls the excitement of receiving mail from anonymous well-wishers back home during his deployment with the U.S. Army in Somalia in the early 1990s. This was a fascinating listen. The coup, of course, was getting a letter with a snapshot or two inside. I don't know why, but the further...

Tony Harding laces up again

The skater you love to hate is back. Tonya Harding will lace up for a single game tomorrow with the Indianapolis Ice, which coincidentally happens to be "Guaranteed Fight Night". (If there's no fight, you get a free ticket to another game.) Ah, minor-league hockey... Personally, I don't think it's right when somebody benefits ...

Why are dialog boxes initially created hidden?

You may not have noticed it until you looked closely, but dialog boxes are actually created hidden initially, even if you specify WS_VISIBLE in the template. The reason for this is historical. Rewind back to the old days (we're talking Windows 1.0), graphics cards are slow and CPUs are slow and memory is slow. You can pick a menu ...

The Department of Homeland Security, the television series?

I am not making this up. There's a new television show based on The Department of Homeland Security, titled D.H.S.. I guess they realized that The O.C. was a hip edgy name so they'd try it too. The audio clips I heard on the radio seemed to make the DHS sound like a non-stop adrenaline-rush guns-drawn kind of department, when my personal ...

Why do operations on "byte" result in "int"?

(The following discussion applies equally to C/C++/C#, so I'll use C#, since I talk about it so rarely.) People complain that the following code elicits a warning: "The result of an operation on 'byte' should be another 'byte', not an 'int'," they claim. Be careful what you ask for. You might not like it. Suppose we lived in a fantasy ...