Holy cow, I wrote a book!
Of all the things I did for Windows XP,
if I had to choose the one feature that I'm most proud of,
it's fixing Pinball so it doesn't consume 100% CPU.
The program was originally written for Windows 95
and had a render loop that simply painted frames as fast
In the checked build, you could tell the program to display the
number of frames per second.
They reserved room for two digits of FPS.
When I got to looking at Pinball's CPU usage, I built the
checked version and took a peek at the frame rate.
Imagine my surprise when I saw that Pinball's frame rate on
contemporary hardware was over one million frames per second.
I added a limiter that capped the frame rate to 120 frames per second.
This was enough to drop the CPU usage from 100% to 1%.
Now you can play Pinball while waiting for your document to print
without noticeably impacting printing speed.
Windows Vista will not have support for really old DVD drives.
(The information below was kindly provided to me by the optical
storage driver team.)
When PC DVD drives first came out in 1998,
the drives themselves did not have support for region codes
but instead relied on (and in fact the DVD specification required)
the operating system to enforce region coding,
with the further understanding that
starting on January 1, 2000
all newly-manufactured drives
would support region coding in hardware
rather than relying on software enforcement.
For the purpose of this discussion, I will call the two types of drives
"old" (manufactured before 2000) and "new" (manufactured on or after
January 1, 2000).
It is that software enforcement that is going away.
Turns out that the enforcement of region coding in software
had its own problems:
These were among the considerations which
contributed to the decision to stop supporting these old drives.
What does this mean for you?
Almost certainly, the answer is "absolutely nothing".
First, there is no change to the way data is read from DVD drives,
so data discs will still work the same way as they do today.
Second, all new DVD drives will continue to run as they did before;
the only change is that the risk of mis-identification as an old
drive has been removed.
Only if you have an old drive will you notice anything different,
namely that encrypted/regionalized DVD movies will no longer play.
And since the average drive lifetime is only three years,
the number of such old drives that are still working is vanishingly small.
Not even the optical drive test team can manage to keep their
old drives alive that long.
Why did the Windows 95 CD have extra fun stuff,
Good Times and Buddy Holly music videos,
the Rob Roy trailer,
and the cartoons by
Because it was fun!
Why does one have to justify having fun?
In addition to the multimedia fun,
there was also video game fun,
with the addition of Pinball
and the mercifully-forgotten hovercraft game Hover!
(Some of us thought it was so awful,
we secretly called it
[While Raymond was on vacation,
the autopilot stopped working
a power outage.
This entry has been backdated.]
Magician and mentalist
Derren Brown teaches us how we can all exercise our psychic powers,
or at least use psychology to make people think we're psychic.
Video Clips page
collects all the examples into one place for your viewing pleasure.
Why does Windows setup lay down a new boot sector?
Because the alternative is worse.
You would expect that after installing an operating system,
the operating system should boot.
If your boot sector is damaged,
say because this is a brand new hard drive with no boot sector,
or because it was infected with a boot sector virus,
you expect the operating system's setup program
to replace the boot sector with a good one.
If it didn't, you'd have an operating system that didn't boot.
Not the greatest introduction to a new operating system.
I know some people are going to suggest, "Why doesn't the
setup program ask before overwriting the boot sector?"
But think about it.
It's Christmas Day,
you're installing Windows XP on your computer,
you go through the setup process, and it
asks you a question you can't answer.
"Gosh, the computer says that I have a custom boot sector.
It says that this could be for legitimate reasons, or it could
be due to a virus. How the heck am I supposed to know the difference?"
That's assuming they even read the dialog.
A much more realistic scenario is,
"Eek! The computer is asking me a scary question!
How do I cancel out of this?
I hate computers.
They're so hard to use."
Yes, this means that if you are an ultradweeb with a custom
boot sector, you will lose it when you install Windows.
But Windows isn't picking on you.
It even destroys itself.
If you take a Windows XP machine and install
Windows 2000 onto it,
the Windows 2000 setup program will lay down a new boot
sector that knows how to boot Windows 2000 but doesn't know
about Windows XP.
You'll have to restore the Windows XP boot files to restore
Even if Windows Setup did give you the option of "don't overwrite
the boot sector" you still wouldn't like it.
Windows Setup would get to the point where it lays down a new boot
sector, and it says, "Ooh, an unrecognized boot sector, and the
user said they want to leave it alone.
Okay, I won't touch it.
Now, how do I tell the foreign boot sector where I installed
this operating system?"
Since the authors of Windows Setup are not clairvoyant,
they don't know what kind of boot sector you're going to have,
so they won't know how to tell that foreign boot sector,
"Please add 'Windows' to the list of known operating systems,
and here is how you start it."
The result: You just installed an operating system and have
no way to run it.]
Things are a little better starting with
Windows XP Service Pack 2
and Windows Server 2003 Service Pack 1, though.
Those and future versions of Windows setup
check the version of the NTLDR file and will leave a newer
version of the boot loader intact rather than overwriting it with
an older version.
Let's just hope that you're not installing
because you need a fresh boot sector...
an essay contest on the topic
What is Humanity's worst Invention?,
it reminded me of a related essay exercise assigned to
seventh-graders by a friend of mine.
The students (typically thirteen years of age) were given the topic
What is humanity's greatest invention or discovery?
Here are some of the greatest inventions and discoveries of all time,
according to these students:
Some sentences written in support of these claims:
That last one is my favorite.
There's something poetic about it.
Update 1pm: It should have gone without saying that these
are hardly representative samples of the students' work
but rather the most amusing ones.
A common problem when answering technical questions is
that people sometimes ask a question that can't or shouldn't
be answered because it is based upon a misunderstanding.
What's particularly frustrating is when they insist
that you answer their question as posed,
even when you try to explain to them that their question is itself
It's as if somebody asked you the question,
"Do I have to use the remote control to lock my kangaroo?"
You could answer the question literally ("No"),
but the person asking the question would walk away with the wrong
conclusion ("Wow, kangaroos are self-locking!").
a similar analogy I made with balsa wood and nails.
Here's an example of a question that betrays misunderstanding.
I just enabled hyperthreading on my dual-Xenon machine,
and Task Manager now shows four processors instead of two.
Which of them are the physical processors and which
are the virtual ones?
When you turn on hyperthreading,
each individual physical processor acts as if it were two virtual processors.
From Task Manager's point of view, the computer has four virtual
The two virtual processors associated with each physical processor
are completely equivalent.
It's not like one is physical and one is virtual.
They are both virtual and compete equally for a share of the one
When you set processor affinities,
you set them to virtual processors.
To find out which virtual processors are associated with the same
you can call
the GetLogicalProcessorInformation function.
You probably wouldn't want to run Windows or applications
directly off your USB memory drive,
even if you could.
The reason is that the solid-state memory used by these drives
support only a limited number of write cycles per block.
(Originally measured in the thousands, though I'm led to believe
that it's gone up since then.)
Most software assume that a disk's lifetime is essentially
infinite and have no qualms about writing to a file multiple times.
For example, your program might decide to group its data in chunks.
To modify a byte of the file, you would load a chunk, modify the byte,
then write the chunk out.
You've "spent" a write cycle for an entire chunk
of data even though you really
might have been able to get away with updating a single sector.
What's more, if that one byte gets modified three times in a row,
you just paid for three writes when you could have gotten away with just one
if you had just done a little more caching.
Operating systems often update a file's metadata with high frequency.
The last-modified time on a directory entry gets rewritten each time
the file is updated.
The free block bitmap is updated each time disk space is allocated
The page file gets updated constantly.
A database application will update its database index very frequently.
Even a simple application will probably update its history and
settings files often.
These "hot spots" are most likely to wear out first
on a drive.
Unfortunately, these hot spots also tend to coincide with nonrelocatable
critical file system metadata;
as a result,
once the sector responsible for, say, the free cluster table goes bad,
the drive is useless (in the absence of hardware sector remapping).
I know some people who wrote a so-called
"Flash File System" specifically designed for this class of devices.
It spread the writes out across the disk so that it wore uniformly,
avoiding the "hot spot" problem.
The file system came out in the early 1990's and promptly died because
the hardware hadn't yet caught up to the software.
It was a solution ahead of its time.
Note that my information about the number of write cycles of
flash memory is pretty old.
Can modern USB drives handle millions of writes before wearing out?
the Image File Execution Options key
Its power can be used for evil as well as for good.
Its intended use is to force a program to run under a debugger
regardless of how it is launched (and secondarily to alter how
the system treats the program).
It's handy if you need to debug a program "in the wild"
rather than under the controlled environment of your favorite IDE.
For example, you can use it if you want to debug how a program
runs when it is launched by some other program you can't debug.
Two things people often forget:
Evil can be done with
the Image File Execution Options key.
Malware can install themselves as the "debugger" for a
frequently-run program (such as Explorer)
and thereby inject themselves into the execution sequence.
Note that the ability to use the Image File Execution Options key
for evil purposes is not a security hole.
To modify the key in the first place requires administrator permissions.
Consequently, anybody who can exploit this feature
already owns your machine.
Sometimes psychic debugging consists merely of seeing the bigger picture.
On one of our internal bug-reporting mailing lists, someone asked,
"How come when I do XYZ, my CPU usage goes to 50%?"
My psychic answer: "Because you have two processors."
The response was genuine surprise and amazement.
How did I know they had two processors?
If they had only one processor, the CPU usage would be 100%.
This seems unhelpful on its face, but it actually does help
diagnose the problem,
because now they can
search the bug database for bugs in the XYZ
feature tagged "100% CPU" to see if any of those apply
to their situation.
(And in this case, it turns out that one did.)