Thursday 23 April 2009

Wednesday 22nd April 2009 – The Best Laid Plans of Mice and Men

One of the drawbacks of a life in computer programming is a well-developed and very precise sense of unreality.  Computer programs live in what is now commonly called a virtual world.  Computer programmers, on the other hand, don't.  But they can get confused about this.  Having carefully planned something, they may then feel no need to actually do it.  Indeed, they may feel that, having planned it so carefully, they have actually done it.

I am now finding a million things about my trip where virtual and real worlds don't coincide.  Take, as an example, my nice new watch.  For years I had a watch which, if you'll pardon the pun, clocked in with the National Physical Laboratory every night to set itself right.  Then I discovered that there was a new model which not only did that, it figured out where it was in the world and checked in with the equivalent institution in Germany, Japan and the USA.  I hope you can see how attractive and, indeed necessary, such a gadget would be to a computer programmer going on a trip to the United States.  The American Institution is based in the University of Colorado, at Fort Collins.  Fort Collins is pretty near the geographical centre of the United States.  The watch itself knows which of the four US time zones it's in.  So that was knowing-the-right-time sorted out.  You might think that is an excessive attention to detail, but then you're not a computer programmer (or if you are you don't, if you see what I mean).

Crossing the Atlantic from east to west by liner gives one the luxury of a week of twenty-five hour days.  But that's only in the real world.  In the virtual world inside my flashy new watch, however, there was nothing in the Atlantic to synchronise it with reality.  It had to be done manually.

Naturally, I turned to the Standard Operating Procedures manual for the trip.  And under 'Flashy new watch, Adjusting to reality, Manual', what do you think I found?  Nothing; not a dicky bird; there wasn't even a blank page.  Not even computer programmers carry the instruction manual for their watch around with them.  When I was packing my equipment, and wondering which manuals I was going to need, I didn't even consider the only one I've actually needed so far.

But not to worry: I'll pretend I'm a teenage boy and figure it out heuristically, by trial and error.  The watch possesses only two buttons for communicating with the program inside it.  Now consider: how many different ways do you think you can press two buttons?  Most of you will be aware that the ultimate sanction against a catatonic computer sulk is to press and hold the power button for ten seconds.  So you will be able to deduce that pressing a button is likely to be two separate events to a computer, namely 'press' and 'release'.  And the length of time between these two events is likely to be significant, particularly to a watch.  So, to cut an already too-long story a bit shorter, the answer to the question about how many ways is actually an infinite number.  But which of these infinite combinations are going to be significant to the watch?  There is then the added difficulty of figuring out the watch's responses on its two-character screen, which it normally uses to tell me the date and the day-of-the-week.

So, for idle moments on the crossing, I had myself a mind-exercise at least as stimulating  as sudoku, and much more practical.  And it turned out to be fascinating, because the programmers of the watch have clearly left any number of test and check routines inside the watch.  I now know, for instance, how to make the second-hand tick completely round the dial once without moving the minute hand.  I can move all the hands to precisely twelve o'clock.  I can make the hands move to another time which varies according to a set of rules I have not yet deduced.

Of course, time was relatively short (sorry about that), because I was assuming that when the watch reached New York, it would wake up to Fort Collins and set itself right. But it didn't.  New York came and went, and the watch continued in its sulk.  The I noticed that a set of button pressings got me to the point where one button took me through a sequence of numbers that went from +11 to –11, but instead of –9, -8, -7, -6, -5, -4, it went –9, P, M, C, E, -4, which gave the game away.  That's just got to be 'Pacific', Mountain', 'Central' and 'Eastern' hasn't it?  Maybe that was how to tell it it was in New York.  Except by this time it was in Chicago.  So I set it to 'C' (because Chicago's on Central Time) and then put it back into telling-the-time mode.

And this morning, when I looked, it shyly told me that, at six minutes past two, it had had a little chat by radio with a computer at Fort Collins Colorado, which is its way of telling me it knew the time in Chicago: and now, therefore, at long last, so did I.

Of course, as is common with these heuristic processes, I can't remember how I did it.  So when I move on to Mountain Time, I'll have the same problem all over again