Showing archive results for 2013

Oct 28, 2013
Post comments count0
Post likes count1

The financial acumen of sea turtles

Raymond Chen

I dreamed that I was attending some sort of "how to be awesome" seminar where the presenter said, among other things, that a sea turtle, when left to thrive undisturbed, amasses $1 million in personal wealth within one year.

Non-ComputerDream
Oct 28, 2013
Post comments count0
Post likes count1

Using GetLogicalProcessorInformationEx to see the relationship between logical and physical processors

Raymond Chen

Today's Little Program uses the function to print the mapping of logical processors to physical processors, as well as the mapping of logical processors to packages. (A dual-core processor is a single package with two cores. If those cores are themselves dual-hyperthreaded, then you have four logical processors total.) The helper function tak...

Code
Oct 25, 2013
Post comments count0
Post likes count1

My, those threads start up really fast nowadays

Raymond Chen

Here's a little puzzle inspired by an actual bug: Can the assertion at the start of ever fire? Naturally, the answer is Yes, otherwise it wouldn't be a very interesting article. The assertion can fire if the worker thread starts running before the call the returns. In that case, the caller hasn't yet received the handle or ID of the newly...

Code
Oct 24, 2013
Post comments count0
Post likes count1

When should I use the FIND_FIRST_EX_LARGE_FETCH flag to FindFirstFileEx?

Raymond Chen

Windows 7 introduces a new flag to the function called . The documentation says that it "uses a larger buffer for directory queries, which can increase performance of the find operation." This is classic MSDN-style normative documentation: It provides "just the facts". Far be it for MSDN to tell you how to write your application; the job of f...

Code
Oct 22, 2013
Post comments count0
Post likes count1

The hierarchy of user education, as interpreted by a vice president

Raymond Chen

One of my colleagues told me a story from his days on the Windows team. He had to give a presentation to his vice president on his feature, and he prepared his presentation and demo obsessively to make sure it went smoothly. At the meeting, there were three presentations on the schedule, all of them with features targeting IT professionals. The fi...

Other
Oct 21, 2013
Post comments count0
Post likes count1

Using a toy cash register as a keyboard doesn't add up

Raymond Chen

I dreamed that I was composing a blog entry about one of my dreams, but I had to do it on a toy cash register which had been paired to my computer. It turns out that this is difficult for a number of reasons. For one thing, the cash register has only ten letters of the alphabet on it. You have to switch to the alternate keyboard for the rest. Als...

Non-ComputerDream
Oct 21, 2013
Post comments count0
Post likes count1

Opening and manipulating Internet Explorer windows programmatically

Raymond Chen

Today's Little Program takes the JavaScript application from a few years ago and converts it to C#. This was inspired by a customer who started with the question, "How can I close all Internet Explorer windows programmatically?" This was a strange request. After all, the user may be rather upset that their Amazon shopping spree was suddenly ter...

Code
Oct 18, 2013
Post comments count0
Post likes count1

The case of the redirected standard handles that won't close even though the child process has exited (and a smidge of Microspeak: reduction)

Raymond Chen

A customer had a supervisor process whose job is to launch two threads. Each thread in turn launches a child process, let's call them A and B, each with redirected standard handles. They spins up separate threads to read from the child processes' stdout in order to avoid deadlocks. What they've found is that even though child process&nbs...

CodeMicrospeak