Monday, March 31, 2008

Watching the Watchers, Your Money at Work

It's no surprise that politics is all about money. But it sure can be surprising what the government uses our money for. Here's a sampling from the past couple of weeks.

Computers continue to have more and more processors available, and as the trend increases, moving data around to keep all that processing power fed becomes more and more of a bottleneck. Electrical signals propagate relatively slowly, and moving them around generates heat. Light beams, however are very, very fast, and super efficient. Sun has announced a government contract worth $44 million to research connecting chips using lasers. One Sun researcher describes the project as "high risk." High risk in this case means an even chance of failure.

The solar powered Mars rovers, Spirit and Opportunity, have remained useful well past their designed mission, but it costs about $20 million annually to keep the programs running. Since there's only so much money to go around, and the program has been asked to cut $4 million out of their budget, one or both of the rovers must be put into hibernation for periods of time they would have been gathering data on the Martian winter.

A story in the Seattle Times begins with this quote, "The unsettling thing about living in a surveillance society isn't just that you're being watched. It's that you have no idea." The reporter proceeds to tell a second hand story government nuclear surveillance picking up the radiation from a cat that had just had a cancer treatment. As it went by on the interstate at seventy miles per hour.

And finally, the presidential primary candidates are pulling in fund raising money at a pace of around $100 thousand a month. Extending that trend for a year reveals a frightening comparison: there are seven African countries or islands that have a gross domestic product of less than one billion dollars. The candidates are literally spending more than some small nations.

At least this stuff makes my budgeting decisions seem rather simple...

Monday, March 24, 2008

Leap Years and The Calculation

One of the first of many obscure details I learned as a working computer programmer was how leap years truly work. Most adults can probably tell you that leap years come every four years. Many can no doubt even tell you which years they will be, though they may have to refer to their correspondence with Presidential Elections in the U.S. or the Summer Olympic Games. I suspect very few people will tell you the exceptions to the four year pattern in general conversation.

Little details like this are exactly the kinds of things one must deal with when programming, and it's often critically important to get the full details correct. Leap years actually occur on years evenly divisible by four, excepting those years that are also divisible by one hundred, unless they are divisible by four hundred. Getting things like this wrong can cause really obscure issues. The year 2000 was one of those divisible-by-four-hundred leap years. Interconnected systems are particularly vulnerable to people getting things like this wrong. It's easy to imagine a reporting program that expects input on the first of every month. (Accounting, inventory, and physical observation data are some examples that can all be batched up by remote stations and "mailed in" using this pattern.) If one side of the communications channel gets the date wrong, suddenly things don't work the way they were expected to. It's annoying if you are collecting data on the movement of a glacier using a remote laser range finder. It's lawsuit bait if you are batching accounting transactions for an automated billing system.

Leap years are a simple example. The fun really starts when you get into things like correcting for daylight savings time, or figuring out when Easter will be this year. In the Middle Ages, Easter was a much bigger milestone than it is today, and figuring out the date it fell was so important that the process had its own name: Computus. Translated from the Latin, this simply means The Calculation. Having the observance tied to the solar and lunar cycles and the need for it to fall on a Sunday combine to make a fairly nasty little computational problem. The basic algorithm goes like this: Easter Sunday falls on the first Sunday after the first full moon after the vernal equinox. If you have this year's calendar in front of you, it's easy enough (though you will usually have to agree to assume the equinox falls on the 21st of March). If you don't have a calendar, or need to be making out next year's, or the following, it gets harder quickly. One math doctoral student calculates that the progression of Easter dates takes nearly six million years to repeat. The Wikipedia link above has some examples of the tables that were used to help with The Calculation. Those tables are a medieval version of what we would call a "feature requirements specification" these days.

Of course, groups of churches settled on different, incompatible methods for The Calculation. Differences in the interpretation what "full moon" and "vernal equinox" mean have lead down the years to divergent Easter date behavior. Folks, this kind of stuff is why we want you want to have precise, documented definitions of all the terms used in your specifications...

Sunday, March 16, 2008

Late Sunday Points of Interest

If you steal music using the Internet, would you be willing to pay five dollars a month to go legal? If you don't steal music, would you be willing to pay five dollars a month to allow you to access the downloads? How about if you don't access music at all over the internet? This situation could appear on your Internet Service Provider's bill sooner than you think, as the music industry struggles to adjust to the digital, connected world.

Speaking of the Internet, China is coming under scrutiny for more than just poor manufacturing quality control. Internet crime is rife in the country, and there are signs of a pattern of cyber-attacks from China against U.S. military computing infrastructure. As if the various virii weren't enough trouble.

Speaking of trouble, did you know there's only one company in the world that can cast the containment vessels for nuclear reactor cores in one piece? The bottleneck could slow any attempts at large scale nuclear reactor deployment. Given the economic news in the U.S. this could be a big deal in the coming decades.

Speaking of the economy, the U.S. no longer has the world's largest gross domestic product. Thanks to currency fluctuations, the "Euro zone," the group of fifteen countries that use the Euro, now has a larger collective GDP than America.

Wednesday, March 12, 2008

Headline Hunting: Desert Morale Addition

Today's Headline Hunting is brought to you by the beginning of spring allergy season... Without further preamble, I present: "Chuck Norris the only WMD in Iraq."

Tuesday, March 4, 2008

Not Enough Chopsticks to Go Around

Five philosophers are sitting around a dinner table with a large bowl of noodles in the center. Being philosophers, they mostly sit and think, but being at a dinner table, they sometimes decide to eat. When they are thinking they aren't eating, when they are eating they aren't thinking, and they never talk to each other. When one decides to eat, he reaches for each of a pair of chopsticks, one on the left and one on the right. Unfortunately, they are in an extremely cheap restaurant which only put out five chopsticks, one between each of the philosophers. This unlikely situation is a classic computer science analogy about synchronization.

Synchronization: the process of maintaining one thing in step with another thing. Syncing issues abound, not just in computer engineering and programming, but in life too. Parents of more than one child know all about synchronization, and the consequences of things getting out of lockstep. Manufacturing processes depend on the supply chain keeping enough parts available for production to continue. If your doctor overbooks her morning schedule or has an unexpected emergency to handle, she's not going to get to your appointment on time in the afternoon. Planes must be serviced, fueled, and crewed in an orderly fashion to ensure air travel happens as planned. One broken traffic light can snarl city traffic for blocks. In both comedy and love, timing, we are told, is everything.

So, the next time you are forced to kill an unresponsive program, give your computer the old three-finger-salute, or are just twiddling your thumbs waiting for a web page to load, picture a hungry philosopher holding a chopstick. The next time you feel you aren't making any progress in your work or life, pause and look for what's blocking you. It's worth noting that the dining philosophers problem is easy to solve if the philosophers start talking to each other. And occasionally, when you find yourself trying to eat noodles with a single chopstick, it can be worth leaving the table to find a good burger joint.