Coding Horror

programming and human factors

Computer Hardware Pornography

I've never understood programmers who loved the craft of programming, but were disinterested in the underlying hardware -- the very tool that allows them to practice their craft. I have an unabashed love for computer hardware that borders on inappropriate. I'm not ashamed to admit it.

Warning: this post appeals to prurient interests-- in computer hardware.

If, like me, you love the hardware as much as the software, you're in for a rare treat. I have three books you'll definitely want to have delivered in an unmarked brown wrapper.

In collaboration with the Computer History Museum in Mountain View, California, the book Core Memory: A Visual Survey of Vintage Computers was recently released. I picked up a signed copy at the Maker Faire a week ago.

Core Memory: A Visual Survey of Vintage Computers, book cover

Core Memory is a virtual tour of the amazing visual storage area of the Computer History Museum. If you live in the area, and have any interest whatsoever in computers, visit this museum. It's awe inspiring-- any computer you can think of is probably represented there. Some of them have been painstakingly refurbished to functioning status, and they do demonstrations periodically. That's how I had the privilege of playing Spacewar on the original vector display of the only known functioning PDP-1 in the world. If you can't make it to the museum, this book is the next best thing to being there.

Robert Scoble recorded a short video of the photographer, Mark Richards, touring the visual storage area and talking about the two year gestation of the book. You can get a preview of the magnificent photography in the book at Mark Richards' website. Boing Boing called them magnificent portraits of the machines' pretty faces and equally beautiful guts, a stunning series of "glamour shots" for nerds. Unfortunately, I can't link directly to the photo section; you'll have to manually navigate to the main menu and select Book: "Core Memory".

Along the same lines, Mark Frauenfelder's book The Computer: An Illustrated History explores the complete history of computing in pictorial style, beginning with the abacus and going all the way to the Aibo and iPod.

The Computer: An Illustrated History, book cover

It's a broader overview of the computer as a fixture of human culture, filled with similarly amazing photographs. It's a fine companion that fills the gaps in Core Memory nicely. This book review at ArsGeek provides a chapter summary and some additional commentary.

Both of these books focus on computers, although there's a brief chapter on game consoles in The Computer. If you're more interested in the entertainment side of computer hardware, you'll definitely want the German import The Encyclopedia of Game Machines.

The Encyclopedia of Game Machines, book cover

It's an absurdly exhaustive reference of every game console-- and every computer that was used for gaming-- ever released. Although the book has a slightly European bent, it truly justifies the title "encyclopedia". If you played games on it, know anyone who played games on it, or just read about other people playing games on it, it's featured in this excellent book along with relevant statistics, a summary, and of course a rich set of high resolution photographs. You can view sample pages in the retroblast review.

As for me, I own all three books, and I recommend them highly. It's the only way to satisfy my insatiable hardware lust, short of the world's largest bank account. Now if you'll excuse me, I need some "alone time" to go read through them.. again. I'm sure you understand.

Discussion

Why Is The System Idle Process Hogging All The Resources?

From the "you can't make this stuff up department", this 2003 gem from blogging O.G. John Dvorak:

IDLE-TIME PROCESS. Once in a while the system will go into an idle mode, requiring from five minutes to half an hour to unwind. It's weird, and I almost always have to reboot. When I hit Ctrl-Alt-Delete, I see that the System Idle Process is hogging all the resources and chewing up 95 percent of the processor's cycles. Doing what? Doing nothing? Once in a while, after you've clicked all over the screen trying to get the system to do something other than idle, all your clicks suddenly ignite and the screen goes crazy with activity. This is not right.

I remember reading Dvorak's PC Magazine column at the time and doing a double-take. Dvoraksayswhat?

Task Manager, showing system idle process

In John's defense, it sounds like he was having some kind of strange, unrelated problem which he wrongly attributed to the idle task. But his profound misunderstanding of how this fundamental bit of computer science works is a wee bit disturbing for a computer journalist of his tenure and stature.

In case there's anyone reading this who doesn't understand how the System Idle Process works (Hi Mr. Dvorak!), the Wikipedia entry for Idle task is unusually succinct, so I'll just quote it in its entirety:

In computing, an idle task is a special task loaded by the OS scheduler only when there is nothing for the computer to do. The idle task can be hard-coded into the scheduler, or it can be implemented as a separate task with the lowest possible priority. An advantage of the latter approach is that programs monitoring the system status can see the idle task along with all other tasks; an example is Windows NT's System idle process.

On modern processors, where a HLT (halt) instruction saves significant amounts of power and heat, the idle task almost always consists of a loop which repeatedly executes HLT instructions. However, on older computers, where temperature dissipation was almost constant with CPU load, the program would often do useless things, like blink the front panel lights in an amusing or recognizable pattern.

Often, this had the effect on timeshared systems that if one was lucky enough to have access to the computer room, one could glance at the front panel lights to see how busy the machine was. If the idle pattern very rarely showed up, the machine was heavily loaded, and one might go for lunch before waiting for a job to finish; on the other hand, if it was clearly blinking the idle pattern, one might run the job immediately.

In Unix-like operating systems such as Linux, the idle task has process ID zero, and never exits. Another specially distinguished task on Unix-like operating systems is the init process, which does little more than wait around for its child processes to die.

In other words, if the idle task is "chewing up 95 percent of the processor's cycles", that's normal: it simply means your CPU isn't working very hard on anything at the moment.

Discussion

How to Get Rich Programming

I originally discovered the fiendishly addictive Tower Defense as a multiplayer game modification for Warcraft III. It's a cooperative game mode where you, and a few other players, are presented with a simple maze. A group of monsters appear at the entrance and trudge methodically toward the exit. Your goal is to destroy the monsters before they reach the exit by constructing attack towers along the borders of the maze. As you kill monsters, you gain cash, which you use to purchase more powerful attack towers and upgrades for your existing towers. The monsters keep increasing in power each wave, but if you're clever, you might be able to survive all the waves and reach the end.

I can't explain exactly what makes Tower Defense so addictive, but man, is it ever. Perhaps it's the collaborative gameplay, along with the "just one more time" element of different tower arrangements and greater income to build ever more powerful towers. Remember, this is a game mode not created by Blizzard, but invented by multiplayer game modders using the tools provided with Warcraft III. It was completely unique-- I had never played anything like it. After about six months, I completely stopped playing traditional multiplayer games of Warcraft III in favor of user modifications like Tower Defense. As a hat tip to the community, Blizzard included their take on tower defense as a hidden mission in the Frozen Throne expansion.

I suppose it was inevitable that this new, addictive Tower Defense game mode would jump from the select audience of gamers with gaming-class PCs to simpler Flash implementations everyone can enjoy. The low-intensity, puzzle-like gameplay of Tower Defense translates well to the broad audience of casual gamers. And the most popular version, by far, is Desktop Tower Defense.

Desktop Tower Defense

Warning: before clicking on that link, allow me to reiterate: tower defense is addictive! Don't blame me if you lose an hour or more of productivity. But if you, like me, just have to make it through all 50 levels (or 100 levels in challenge mode), I refer you to this collection of Desktop Tower Defense strategies. And a word of advice: upgrade a few towers to the maximum; don't spread your upgrades across a fleet of towers.

You'd be surprised how much money you can make by creating a flash game and giving it away for free on the internet. The Tower Defense game mode is a business opportunity for an enterprising programmer. According to a recent interview, Paul Preese, the author of Desktop Tower Defense, is making around $8,000 per month.

So here's a couple ways to a create successful game online:

  1. Find an investor who's crazy enough to give you millions of dollars
  2. Put it on a distribution network and hope you get enough customers willing to buy it as a download
  3. Make a Flash mini-game, let people play it for free, and watch the ad revenue pour in when the site gets 20 million pageviews a month.

That's the option Paul Preece took with his phenomenally popular Desktop Tower Defense, and though he has no professional experience with game development, the Visual Basic programmer is now making, by his estimate, high four figures monthly for his ferociously viral little game.

DTD's main revenue source is AdSense, but with its avalanche of popularity, advertisers have approached Preece directly, leading to "Affiliate deals, sponsorship, custom versions for other companies etc. The last two are in the pipeline but I thought I'd add them in at a low level."

Preece's main expense is running the server. "Hosting fees are negligible," he says, "at $130 per month. But I am getting very close to the 1200GB bandwidth allocation!" That plus "the continuous supply of late night Red Bull" comprise the bulk of Desktop's budget.

So minus the time he spent programming, and his nominal hosting fees, Paul Preese is clearing almost $100,000 "salary" per year with Desktop Tower Defense. And he did it all on his own: he wrote the game, placed it on a public web server, hooked up AdSense, and then submitted it to a few social bookmark sites. No selling his soul to a publisher, no middlemen, just pure income, controlled directly by him.

What's truly exciting about this is how the internet has created economic opportunity for a single programmer working alone. You might not get rich, exactly, but $100k/year is an impressive salary in most areas of the United States. Roller Coaster Tycoon was the last traditionally published game created by a single programmer working alone. The author, Chris Sawyer, cleared $30 million for all the various version of the game released since 1999, according to financial documents released by the publisher. And just to put things in perspective, the publisher cleared $180 million. That's the "selling your soul" part.

Granted, $4 million per year is a heck of a lot more than $100,000 per year. But the odds of you and I getting a publishing deal-- or writing a game in assembly language-- are pretty slim. Paul's success, on the other hand, is something that any programmer, with sufficient motivation and a little bit of luck, could potentially duplicate.

Discussion

Upgrading to a High Efficiency Power Supply

In When Hardware is Free, Power is Expensive, I referenced a Google whitepaper (pdf) that explained why typical PC power supplies are not particularly efficient:

Most likely, the computer you're using wastes 30-40% of the electrical power it
consumes because it is using an inefficient power supply.
It's difficult to believe that something as basic as a power supply could be responsible for that amount of waste, but it's true. The problem with power supplies is that they generate heat, which saps away energy meant to power the computer. That happens when the power supply converts AC current into the DC current needed by computers

Google's solution for their datacenter computers is a radical makeover – switching wholesale to single-voltage 12 volt power supplies.

The net result of [the switch to a single-voltage 12v power supply] is a dramatic improvement in efficiency (including the power supply and the regulators) to about 85%, at virtually no cost. In other words, you won't have to pay more for a higher-efficiency PC, because the power supply is actually getting simpler, not more complicated. By spending another $20 or so extra, it is possible to use higher-quality components and achieve efficiencies well over 90%.

You won't be able to buy such computers for a while, and Google isn't planning on selling you any. But we're working with industry partners such as Intel to make this technology an open standard that everyone can use, and that all vendors hopefully will adopt. It's the right solution technically, and the right thing to do for the environment.

Who knows when these hypothetical single-voltage systems will arrive on the market in the form of desktop PCs and laptops we can actually buy. In the meantime, it is possible to upgrade your computer with a high efficiency multiple-voltage power supply. Unfortunately, existing high efficiency power supplies aren't available "at virtually no cost"; they tend to be quite a bit more expensive than their less efficient cousins. I just upgraded my home PC to a high efficiency power supply:

  • Core 2 Duo 3.2 GHz CPU (overclocked, overvolted)
  • Radeon X1900 XTX primary video card
  • Radeon X1550 secondary video card
  • Western Digital Raptor 150 GB primary hard drive
  • Seagate 750 GB secondary hard drive
  • Creative X-Fi sound card

Note that this is a fairly power hungry system by current desktop standards. The gaming-class video card and overclocked/overvolted CPU are the primary culprits. I used my trusty kill-a-watt to measure the power usage before and after the power supply upgrade. The power supply was the only component that changed.

Typical PSU Efficient PSU
Off 5 w 5 w
Boot (peak) 237 w 215 w -22 w 9.3%
Desktop 205 w 185 w -20 w 9.8%
1 × Prime95 236 w 217 w -19 w 8.1%
2 × Prime95 257 w 237 w -20 w 7.8%
DiRT demo peak 270 w 247 w -23 w 8.5%

Most typical desktop PC power supplies are only 60 to 75 percent efficient; high efficiency models offer 80+ percent, all the way up to 85 percent depending on the load. And that's exactly what we're seeing in these results. With the new high-efficiency power supply installed, I gained about 10 percent efficiency at each load level. To get an idea of where this system stands in terms of overall power usage, you can compare with a few different systems shown on page 4 of the Silent PC Review Power Supply Fundamentals.

I was surprised to find that my PC uses 5 watts of power even when it's powered off. This is what's known as "standby" electricity loss, and at least one study showed it accounts for 6 to 16 percent of all energy use in homes, and another (pdf) estimates that standby power use is now responsible for 1% of total carbon emissions on earth. The only way to reduce your computer's power use to zero watts is to unplug it from the wall, or flip the power switch on the back of the power supply.

If you're interested in upgrading to a high-efficiency power supply, look for models tagged with the 80 PLUS designation, which are guaranteed 80% efficient at 20%, 50% and 100% of their rated load. Many vendors cut corners by stating their power supplies offer "up to" 80 percent efficiency, but what they don't tell you is that you'll only reach that level of efficiency under extreme power loads that are unrealistic for most desktops. Seasonic is a popular choice, as they have aggressively enforced the 80 PLUS certification on almost their entire product line. But fair warning: you will pay a premium.

You can use the handy calculator provided by the 80 PLUS website to determine how much money you could potentially save on your power bill by switching to a more efficient power supply. It's usually not much, unless you happen to run a server farm. But every little bit helps, and until Google and Intel offer up their single-voltage 12 volt system designs – which supposedly offer greater than 90 percent efficiency – it's the best we can do.

Discussion

The End of the "Microsoft Tax"

Today, bowing to customer demand, Dell launched a new series of desktops featuring the free, open-source Ubuntu operating system.

To my knowledge, this is the first time Dell has ever offered any non-Microsoft operating system on their desktops. Until today, it was quite literally impossible to decline the Windows license when you bought a desktop from Dell. If you bought a desktop PC from Dell, you got -- and paid for -- a copy of Windows, whether you wanted it or not. This is commonly referred to as "The Microsoft Tax". Offering a free desktop operating system is effectively the same thing as selling hardware without any operating system.

Whether you're a fan of the latest open source operating systems, or just a fan of plain old-fashioned consumer choice, the end of the Microsoft tax is a win for customers. I was a little worried that Dell would charge extra for the privilege, but it looks like they played fair and square:

Dell Dimension E520 Dell Dimension E520N
CPU Core 2 Duo E4300 1.86 GHz Core 2 Duo E4300 1.86 GHz
RAM 1 GB DDR2 1 GB DDR2
Hard Drive 250 GB 250 GB
Media CD-RW/DVD CD-RW/DVD
Video Integrated Intel GMA X3000 Integrated Intel GMA 950
OS Windows Vista Home Premium Ubuntu Desktop Edition 7.04
$679 $599

The hardware is essentially identical. We can infer that Dell's price for a Windows Vista Home Premium license is $80. An OEM copy of Home Premium runs about $129, so it's cheaper to buy the license from Dell than it is to buy one yourself. But if you have no intention of running Windows, you just saved eighty bucks.

Kudos to Dell for doing the right thing and ending the Microsoft Tax. It's also quite possible today will be looked back on as an important turning point in the history of desktop computing.

Discussion