Pages

Tuesday 31 December 2013

Ammo can

The medium-sized ammo can arrived today. I removed the lid, lined it with one-inch-thick foam (that came with some hard drives), and squeezed in 12 batteries, giving me a total of 30 amp-hours at 30 volts, 900 watt-hours. And then it fit nicely into the pannier. I reckon that's enough for about 60 kilometers. The whole thing, including ammo can and on-the-road tools, is 10 kilos, which isn't much when rolling along (I'm 100 kilos and the bike another 25, so it adds about 8%) and it's easy to detach from the bike when it needs to be lifted over an obstacle.

Perfect.

All I need now, is some decent weather.

Monday 30 December 2013

Fun with computers

I'd decided to replace a 750gb drive with a 2000 gb in Dovda. So I powered the computer down, opened it up and replaced the drive. When I powered up again, one of the drives (a different one, of course) was showing zero gb.

Well, I know how to fix this now. So I got out my fixing kit (which is an RS232 to TTL converter, plus a set of instructions on how to use it, se a previous post), and started to connect it to the miscreant drive. But then the power socket fell out of the fixing kit. Ugh.

So, on with the soldering iron, and it turned out to be quite easy to repair the fixing kit. And then using that, I fixed the zero-byte drive. And that seems to be OK now! And I've ordered another RS232-TTL converter, because it would be annoying to be without one, and they're only $4.

And then my leased-line link to the internet started "flapping". That's the name they use for an intermittent connection. I was losing about 10% of pings, which means a usable line, but not good.  I rebooted the router, but that didn't help, so I phoned Daisy. I got to tech support quite quickly, and they're going to look into it. As of this moment, I'm getting 100% ping, so maybe they've fixed it already.

I've ordered a medium-sized ammo can. I calculate that I can get all 12 batteries into it, plus a foam inner to reduce shocks. What I'm trying to do here, is avoid damage to the batteries when I fall off the bike, which (despite my best efforts otherwise) happens about once per year. The ammo can will hold it's shape under impact, and the foam inner will keep the batteries safe. I'm hoping that the whole thing will fit inside on pannier. If it doesn't, I'll start looking for a bigger pannier, or else bolt hooks on to the ammo can so that I can hang it directly on the back rack.

One of my Christmas presents was "How to build your own electric bike". It's a good book, and I could have made considerable use of it a few months ago, but I've already discovered most of what it says. For example, it talks about "overclocking" the motor, by which it means giving it a few more volts than nominal. Well, I already did that, and I already know it works. Still, it's nice to know that I'm not alone.

Update.

And then ...

My secure server stopped working. And three other computers that I was using to format drives. And ... so I went down to the Data Centre, and found that all the computers connected to my switching PDU (that allows me to power off and power on remotely) were out. And that meant that the PDU was powerless. I soon tracked it down - some idiot (me) had put a 5 amp fuse on the power-in to the PDU, and I'd just been adding computers until it overloaded. A computer pulls about half an amp, and I'd put on about ten, for no real reason. So I took most of the computers off the PDU, and put in a new fuse (13 amps, which is what it should have been in the first place) and then brought all the downed machines back up.

Sunday 29 December 2013

Shamley Green outing

Ladysolly and I went caching to Shamley Green today. Cold, but very sunny, and hardly any mud. The traffic on the way there was bad, it seems that everyone was going round the M25 today.

We did 30 caches altogether, all easy finds.

Saturday 28 December 2013

The trap in the User Interface

Daughter.2 got me a boxfull of books for Christmas - she had my Amazon wish list. When I went through the books, I found two copies of one of them, and three copies of another. And it wasn't a mistake by Amazon, that's what the delivery note said too.

So what happened?

I think it's a user interface issue.

Imagine this. You're using a web site, such as Amazon, you're on the page that shows what you want to buy, and you click on the button that says "buy one". Then you carry on to the next item on your shopping list.

But then you go back and have another look at the page where you just made a purchase.

In going back to that page, there's two possibilities. 1) you're looking at the page just before you click the "buy" button and 2) you're looking at the page just after you click the "buy" button. If it's 2), then there's two possibilities, A) you're just looking abd B) in going to that URL, you, in effect, just click the "buy" button again.

The problem comes, of course, with possibility 2B.

I would imagine that some web sites would say, hey, the customer just repeated the transaction, maybe he doesn't really want two of them, I'll just check back with him and make sure that he does. And other web sites wouldn't.

In the case of Amazon, they do check back, sort of. When you finally go to "checkout", you get a list of what you bought before you commit to it, so you can be sure that the list is correct. And if there's two of anything, then you see that there's two (or three, or more).

Of course, when you're buying three dozen books, you might not check that carefully. And I think that's what happened here.

The same thing nearly happened to Ladysolly; she noticed it at checkout. She thought that Amazon must have changed the way their web site works. But I think it's because she's changed from using her desktop computer, running Windows and Firefox for ordering. Now she uses her iPad, using IOS and Safari, and the user interface is sufficiently different so that what you might think was the same action in both, isn't. With Windows/Firefox, you're repeatedly clicking on the back button, or right-clicking on it and choosing the page. With IOS/Safari, you're swiping backwards and forwards. And it's easy for an action to have a different outcome to the one you expect.

This isn't a bug, it's a feature. However you design a user interface, some people will misunderstand what is actually going on. And this is a lot worse, of course, when you change from one UI to another.

So the lesson to take away, is that you should always check at checkout time, that what you're about to commit to buy, is exactly what you wanted.



Thursday 26 December 2013

Rudolf and the New Operating System from a Very Big Company

The fifth in the increasingly inaccurately misnamed trilogy. You can read my other stories here.



Rudolf and the New Operating System from a Very Big Company

It's been nice and quiet recently. You might remember that a few years ago, 
I spent an unconscionable amount of time sorting out problems in Sir 
Sangrathta Claus's operation, many of them caused by Rudolf the Red (the 
reindeer's shop steward) and his consultant. And, since consultants help 
whoever asks, I have at other times helped Rudolf with some problems (mostly 
caused by Sir Claus and his consultant). Eventually, I suggested a merger 
between them, which led to a couple of years peace, and I thought all that 
was behind me, until I received a message, in the usual way. 

I expect you've sent lots of messages to Santa, but not many people receive 
them, so you might not be aware that he doesn't use email, or fax, or the 
phone, or even snail mail. No. He doesn't send many messages, but when he 
does, he delivers them personally. Out of a big sack. After sliding down the 
chimney. I offered him a glass of sherry, and invited Rudolf to come in from 
the cold for a mince pie, and we sat and talked about the problem. 

Like most problems, it wasn't just one thing, it was a combination. Now that 
most of the kids have computers and internet access, Santa had decided to 
set up a Web site. He would be able to show the kids what was on offer, and 
they could click on the presents they wanted. This would be fed 
automatically into Santa's ordering system (I'd rather not talk about that, 
if you don't mind, it wasn't one of my best designs, especially the idea of 
getting squirrels to write it). That would streamline the whole operation, 
leading to savings in personnel, stocks and manufacturing costs, and a 
noticeable improvement in profitability. At least, that was the theory. 

The Internet consultant they got in - well, you know the sort of person, 
don't you? Rather a lot of Internet experts have appeared lately; it's 
almost as if someone has been sowing dragon's teeth. His name was Jonny Come 
Lately, he'd spent nearly a month using the Web, and could write HTML if he 
avoided Forms and Server Push and anything else that was past chapter two of 
the How-to book. He recommended using HTTPD (an excellent shareware Windows 
Web server, but not really up to getting about ten million hits per day, 
because there's an awful lot of children in the world). His solution for 
making it run faster, was to use a Pentium P133. That wasn't fast enough, of 
course. So his next idea was to upgrade the operating system to the 32 bit 
one that they're making all the fuss about. You know? Comes from a Very Big 
Company? They say their New Operating System will run all your old Dos 
programs, and all your old Windows programs? And, since this was such a Good 
Thing, Jonny got a good deal on a site licence, and upgraded all their 
systems. Pilot studies are for Wimps who don't have confidence in themselves 
and in the Very Big Company that makes the OS. Trials never prove anything 
because they always work. And then Jonny moved on to his next consulting job 
(tuning up the control system in a nuclear reactor), leaving Santa and 
Rudolf to cope with the fallout. 

I winced. Wince, wince, wince. I knew what was next in this story; not in 
detail, but in general, and I was right. There were all sorts of unusual 
bits of hardware and software in this system, and that's without the bits 
that worked by magic. We'd bought a job lot of assorted ethernet cards from 
Sidney Mincing's Computer Emporium, so there were seventeen different 
drivers. Some of the sound cards were, well, unusual and interesting. The CD 
ROMs used IDE controllers instead of SCSI, because that was cheaper. The 
printers, well, Blue Dragon used to make a wonderful laser printer, fast and 
cheap. They've gone out of business now, of course, but we had the Win 3.1 
drivers for them. But not anything else. 

You get the picture. Most of the contents of most of the computers would 
still work, but there was only one computer that still worked as well as it 
did before Jonny came along, and that was because it was broken. Naturally, 
I asked if they could go back to their old system. Naturally they couldn't. 
They had backups of their data files, but that doesn't help much, and 
Jonny's boundless confidence in the claims made by the Very Big Company had 
made their upgrade a one way street. 

I looked at my wristwatch, and it said half past October. Ten weeks before 
Christmas, or to put it another way, judging from my local shops, Christmas 
already. I thought about the mess they were in, and then I thought about the 
consequences of a Christmas in which the little customers don't get their 
toys. It was an unthinkable scenario, so I agreed to do my best, although I 
couldn't for the life of me see how we could make their systems work in 
time. 

First things first - a site visit. I wrapped up warm (it gets chilly up 
there), and Santa and I mounted Rudolf, and I don't think I'll ever get used 
to the way that reindeer can canter uphill even when there isn't a hill. 
Soon, we were galloping along at 30,000 feet. Rudolf had timed it well, and 
over Iceland we met BA07 on its way to Tokyo via the polar route. "Always 
economise on effort", said Rudolf as he landed on the left wing. Some of the 
passengers saw us, but they didn't say anything to anyone, naturally. Well, 
would you? And how would you word it? As we passed over 90 degrees of 
latitude, Rudolf leapt off and glided down for a perfect four-point landing, 
and pretty soon, I was staring glumly at a few dozen computers running that 
New Operating System. The computers were almost, but not quite, operational. 
They booted up fine, but some wouldn't recognise the network, some would 
only work with screens in 640 by 480 by 16 mode, some had no sound, some 
couldn't print, some could print but only some fonts - I'm sure you 
recognise the predicament. 

I sat down with a piece of paper and made a list of the possibilities, and 
the drawbacks of each. No, I don't use a computer, not when it's something 
like this. Because that kind of deep thought needs an interruption-free 
environment, and the small room that provides this doesn't usually have 240 
volts available. 

1. Reinstall Windows 3.1. I couldn't just run SETUP for this, I'd have to 
back the computers up, reformat them, Fdisk and reinstall. Problems: all the 
configuration data would be wrong, and I'd have to reinstall all the device 
drivers, which were different for each one. 

2. Work out what drivers for the New Operating System were missing on each 
computer, and get them from the manufacturer. Problems: Some of the 
manufacturers were out of business, and even if they weren't, many of the 
drivers wouldn't be available. 

3. Get on to the Very Big Company and persuade them to make their New 
Operating System fully Windows 3.1 compatible. Problems: It would need the 
persuasive power of Torquemada. In case you've forgotten, he was the geezer 
in charge of the Spanish Inquisition. 

4. Write the missing drivers myself. Problem: I don't have the technical 
data about the devices, so I'd have to reverse engineer the old drivers. 

5. Find a full backup of all the computers. Problem: Pigs might fly.

6. Go back to a paper system. That had a lot of attractions, especially as 
it meant that Jonny and his ilk couldn't mess it up in future. Problem: I'd 
get struck off the Consultants Register if I ever suggested to a client that 
they stop using computers. One of the prime rules of consultancy is "The 
answer is a computer. Now what's the question?" Some people don't use the 
word computer, they say "system", or even "solution". 

When you don't know how to solve a problem, there's one tried and tested 
thing you can do. Yes - I called a meeting, and invited everyone I could 
think of. Best to spread the blame, no? I used Powerpoint (when you've got 
nothing to say, always make it look good) and laid out the six alternatives, 
explaining why each one wouldn't work. "So what's your proposal?" said 
Santa. Oh no - you don't catch me that easily. I didn't have a proposal, but 
no consultant worth his salt ever admits that. I suggested we discuss the 
matter first - maybe there were alternatives I hadn't thought of (said in 
the tone of voice that implies the total impossibility of the notion). 

The discussion went to and fro, like discussions do. Sometimes they talked 
about the subject at hand, sometimes they digressed onto production 
problems, or the dwarves' demands for new hammers. Rudolf just sat 
despondently with his head in his hooves, and when I asked for his input 
(always ask for "input", it sounds better) he just said "If only we'd never 
hired Jonny Come Lately". 

The buzz of conversation receded into the background as this comment 
triggered a blinding flash in the middle of my brain, the kind of thing you 
get once in a blue moon, the signal that an idea has just been spontaneously 
born. I could see a way out of this mess. "It's a long shot, but it just 
might work", I said to myself, and as everyone knows, if you say that 
mantra, then it's sure to work. I explained the idea to the committee, and 
it sounded even crazier out loud than just thinking it, but no-one could 
think of anything better, so we set to work. 

The first step was to get all the fairies in the organisation into one room. 
That isn't as easy as it sounds - fairies can be quite spiteful and catty 
about each other. Some of them refused to attend unless others were banned, 
some insisted that their special brand of mineral water be available, and 
several of them couldn't find their wands. But that was easy, compared to 
getting them all to hold hands. Have you ever tried to get a roomful of 
fairies to hold hands? Some insist on holding hands with certain others, 
some refuse to be within three fairies of their enemies, and the whole 
thing was an appalling non-linear optimisation problem. Fortunately, I still 
remember how to use the Fletcher-Davidon method (just to remind you, it's 
like Newton-Raphson, but multi-dimensional), and an hour's number crunching 
with my portable got the problem solved. Thank goodness for the floating 
point capabilities of the Pentium chip. 

I explained the task to the fairies - it would probably be the hardest wish 
they'd ever granted, which was why I needed so many of them. I needed them 
to change the past - easy enough for a fairy. But the change I needed, was 
to get a certain consultant, Mr Jonny Come Lately, to refuse a paid 
consulting job on the flimsy grounds that he wouldn't know how to do it. 
That, of course, is mind-bogglingly impossible. Fortunately, fairies are 
used to doing the impossible. 

Everyone closed their eyes, and there was a sort of "Pop", but a "Pop" 
without the vowel. And without the consonants. Something shifted, or maybe 
it didn't. Something changed, or maybe it didn't. We all opened our eyes, 
and the fairies were all flaked out; the magical outpouring had obviously 
left them exhausted, and we'd be lucky to see any magic from any of them 
before next Christmas. Never mind - it had worked. I distinctly remembered 
that Mr Lately had been unable to take on the assignment, due to an even 
more lucrative job elsewhere, and I rushed to the computers, expecting to 
see the old familiar Windows 3.1 on the monitors. 

Imagine my dismay when I started up a PC, and it came up with the Other New 
Operating System, from the Other Very Big Company! Imagine my consternation 
when I found that all the other computers were the same! Imagine my fear, 
uncertainty and doubt when I discovered that all the systems were just as 
smegged up as they had been before, but now in a different way! I thought 
about this, and then I remembered that when Mr Lately had declined, they'd 
found another consultant, whose email address was Newkid@aol.com. Which 
tells you everything, if you know what aol is. Yow! 

I sat in a corner of the room, closed my eyes, and put my arms over my head. 
I realised what I'd done wrong. Imagine relying on the floating point 
capability of a Pentium! How could I have been so stupid? How was I going to 
fix things now - the fairies were all unfairied, and I had exactly the same 
problem as before, and I didn't know what to do. Then it came to me - 
standard consultant's practice when you've totally smegged up your client. 
Tell him everything's fine now, and walk away from the mess. But then I 
thought of all the little customers who wouldn't be getting their presents, 
and I thought of my two, who would spend the whole of the Christmas holiday 
making my life miserable, and I thought of three billion other unhappy 
children, and I couldn't do it, I couldn't abide by the Consultant's Code. I 
had to stay and fix the problem. 

Gradually, the panic died down and I was able to think rationally about the 
problem. And the first thing that occurred to me was that I didn't have 
exactly the same problem. I still needed to make a change to the past, but 
all I needed to do was to get myself to buy a 486dx-100 instead of a 
Pentium, and since that was a smidge cheaper, that shouldn't be too hard. 
All I needed was a fairy that wasn't totally knackered, and I'd be home free. 

One of the problems with fairies, is that there's never one when you want 
one. But I know where you can always find a fairy. I hitched a lift on 
Rudolf, flew down to Florida, and there, in the middle of Disneyland, was 
what I needed (EuroDisney won't do, they don't use real fairies there, just 
French chaps dressed up as fairies). They use real fairies in Disneyland - 
I think they get them from California. A bit of persuasion from Rudolf's 
antlers, and I had my wish. I looked down at the notebook I always carry, 
and sure enough, a Panasonic CF41 with a 486dx-100 met my gaze - no Pentium. 
Rudolf and I traveled back to the place that is as North as you can get, and 
I checked their PCs. The reassuring sight of Windows 3.11 glowed from the 
screens, and everything was working normally again. 

So let this be a lesson for you. Never hire a consultant called Jonny Come 
Lately, and never rely on fairies to fix problems. I'm glad to say that this 
Christmas will be as per usual, and please, please, don't forget to leave 
the mince pie out for the reindeer. But I'm not so sure about the Christmas 
after, because just as I was leaving I heard one of the elves say to another 
one "You know, I've been reading about this New Operating System in the 
magazines, and I think we should start using it ..." 

Christmas!

The first job today was to deal with the flood that ladysolly got in when the shower got blocked. I gave her Words of Advice on how to mop it up.

Then down to London by car to daughter.1 who was making Christmas lunch for all of us. When the time came to distribute Christmas presents, a very special guest appeared.


Unfortunately, I was out of the room at the time, but apparently there was lots of "Ho ho ho" and "Who's been naughty?" before he vanished up the chimney to give a mince pie to the reindeer.

I got two sweaters (one good, one for caching), a hoodie and more books than you might have guessed. Ladysolly got an iPhone 5C (among other goodies), which means I'll be inheriting her old iPhone 4, which is a lot more suitable for caching than the 3 that I'm currently making do with.

We all ate far too much, and plan to do the same tomorrow, but at daughter.2's, but then on to daughter.1 for leftovers.


Wednesday 25 December 2013

Rudolf the Red, Part Four of the Trilogy

The plot thickens - it's always Christmas and never winter ...
 
 
 
Rudolf the Red, Part Four of the Trilogy

All through the summer, I wondered and waited.  Which of the rivals
would seek my help this year - Sir Sangrathta Claus in his North Pole
Industrial Complex, or the renegade Rudolf the Red, based in the
Antarctic?  In the past, I had aided each in turn against the other,
maintaining a delicate balance of power between the two ancient
enemies.  Imagine my surprise when they both turned up at my lodgings!

What could possibly have brought these two arch-rivals together?  What
external threat had induced Santa to climb into bed with a reindeer,
so to speak?  As they spoke, it all became clear.  My Little Pony
Incorporated had merged with the Company of Care Bears, and the
resulting organisation was so large, even the annual Christmas
consumer feeding frenzy wasn't enough for it.  The "Our Littlecare
Ponybear Corp" had devised a dastardly plot, and Rudolf and Sir
Sangrathta sought my help to foil it.

OLPC market research had determined that consumer spending slowed down
in winter except of course at Christmas.  The plot was simple, and
almost the same as one devised by C S Lewis.  OLPC would control the
calendar, so that it was always Christmas and never winter.  If you
think about it, that's far worse than the opposite.

"Ho ho ho", I said, sceptically.  That's is so obviously impossible, I
couldn't see why Rudy and Santa were worried, until they explained.
OLPC had almost succeeded already.  You may have noticed that
Christmas seems to start round about September, and doesn't end until
well into January.  They were simply going to gradually extend it at
both ends until it met sometime in May.  Then it would always be
Christmas.

The other half of the plan was to eliminate Winter, and suddenly I
realised that Global Warming wasn't an accident.  But that left one
problem.  "Surely a world that is always Christmas and never winter
would be ideal for you guys, too?"

Rudy and Santa exchanged glances.  Rudy spoke first.  "No winter, no
snow." he said, succinctly, and I could see what he meant.  No snow,
no sleighs;  no sleighs, who needs reindeer?  Then Santa explained why
a 12-month Christmas was less than ideal.  "The whole point of
Christmas is that it's special.  The little customers spend a month
counting the days with their advent calendars, and on the day itself,
it's like magic.  And anyway, I need the other 12 months to recover.
Christmas all year round means nervous breakdowns all round."

So that was my commission.  To boldly stop Christmas from spreading
throughout the year, and to make sure that winter came.  It was clear
that such a gigantic undertaking could not be accomplished without
help, so once again, I called on my friends, the squirrels.

I had a plan.  It is always best to aim at root causes, and the root
cause of Christmas is television.  You will have noticed that as the
autumn progresses, the programs get more and more Christmassy;
without this pull, Christmas just wouldn't happen.  The other end of
the problem was Global Warming, but I had a plan for that too, and
that's where the squirrels came in.

First, we tackled the television problem.  It used to be really
difficult to hack into a TV studio, on account of they didn't use
computers.  But now, satellite broadcasting has made things a lot
easier.  I'd better explain how this works.

The programs are made on the ground - that's the easy part, because
all you need are old Star Trek reruns, and the membership of a decent
video club.  They haven't got around to showing "I Love Lucy" yet, but
its just a matter of time.  You point a camera at all this, modulate a
radio wave, and point the transmitter towards a satellite that you
hang in the sky.  To hang a satellite in the sky, all you have to do
is use Arthur C Clarke's idea, and orbit your satellite at the
distance where earth orbit takes 24 hours, which as I recall means
23,000 miles high.  The satellite retransmits the signal in a
directional beam, and anyone with a dish can pick it up.

But the companies doing this, aren't simply public benefactors;  they
want to be paid for the service.  So they encrypt the signal, to
prevent people from getting a free ride, and sell the decryptors.

There are several ways to get at this scheme.  The first is to build
your own decryptor, so that you can rip off the programs without
paying for them.  This really isn't worth doing;  the effort of
building a decryptor isn't worth the programs you get.  More
interesting is the idea of hitch hiking on to the beam going up.

The satellite won't accept any old rubbish, of course.  But it doesn't
discriminate on the quality of the programs (as you can see).
Instead, there is an authorisation code that it needs to receive,
before it will accept anything for retransmission.  And that code is
encrypted before it is transmitted, just like Novell does with its
passwords.  And thus, breaking that code is made really, really
difficult, as you can see the chaos that would be caused if any old
bod could broadcast any old rubbish via satellite.

So, I didn't even try to hack the password.  Instead, I simply
recorded the authorisation signals, and without even knowing what they
were, I played them back.  That gave me my way into the satellite, but
next it was necessary to be a bit devious.

I couldn't just override showings of "White Christmas" and the film
whose name I forget, but is unbearably cute and has a Guardian Angel
coming down to earth at Christmas or Wonderful Life, the one where
James Stewart saves his Savings and Loan against the odds at Christmas
(and I doubt if the US government enjoy watching that one, with what's
going on in that industry), and all the other old pot boilers that
they trot out each Christmas.  Someone would have noticed.  What I did
was more subtle, and involved snow.

The old IBM CGA card had a bug in it.  To make video access really
fast, you memory map it, so that writing to $B800:0 is writing to the
top left hand corner of the screen.  That means you have to use dual
ported memory, so that it can be accessed by the CPU and by the 6845
video controller, and so that you can write it from the CPU, even
while the 6845 is reading it.  The bug in the IBM CGA is that if you
do that, you get interference on the screen, which we call snow.  You
don't get that with Mono, EGA or VGA.  But it means that if you want
to do direct screen writes without any snow, you have to wait for the
horizontal or vertical retrace, as the electron gun flies back for the
next sweep, and you have to write your bytes out as it is retracing.

Here's how you do this:

retry: mov dx,3dah
 in al,dx
 test al,8
 jnz doit
 test al,1
 jnz retry
l1: in al,dx
 test al,1
 jz l1:
doit:   ;read or write to video memory

TVs work in a very similar way to PC monitors;  in fact, TVs were
there first, so perhaps I should have put that the other way round.
In fact, you can use an ordinary domestic TV as a PC monitor, provided
it is a US standard (NSTC, short for Never the Same Colour Twice) TV,
and not my dear old Baird.  To do this, you have to use 40 column mode
(try typing MODE CO40).  This is why directory listings are designed
for 40 columns.  I still use MODE CO40 sometimes when I want to
display something to a lot of people;  a handy trick.

So what I did was, whenever some horrendously cute program was
scheduled about penguins in the Arctic, or Polar Bears in the
Antarctic, or anything at all with Bing Crosby in it, or that James
Stewart film, or The Snowman, or anything by Dickens - well, you see
what I mean.  What I did was, I beamed up authorised snow.  As the
films got more sentimental and Christmassy, my snow got more intense,
with the result that everyone thought it was just interference (or
cute), and changed channel to watch something more healthy, like Blue
Peter, or the Texas Chainsaw Massacre.

The non-satellite channels were easier, as there's no encrypting.  The
TV scans at 50 frames per second, so all I had to do was synchronise
to that, and pump out a very brief microsecond blast of white noise
every 20 milliseconds.  Unfortunately, the PC timer ticks at a
frequency of 18.2 times per second (it does an interrupt 8 each time),
which is too slow.  But there's more than one way to skin a cat;  I
set up a counting loop that just cycled as it counted down, and when
it reached zero, it triggered the transmitter, and reset the counter,
and that way, I could get close enough to 50 frames per second to
simulate snow.  And since I was pumping out noise not signal, I didn't
need much power to do it.

So, by gentle but insidious pressure, we delayed the onset of
Christmas until the time when all channels were Christmassing full
blast, at which point there was no way the thing could be delayed any
more, but by that time, it was late November, and therefore officially
Christmas anyway.

Once I'd got this system working, I could leave it on automatic.  The
channels, bless them, published their schedules in advance, and Santa
could spot anything remotely Christmassy at a hundred yards.  So our
PC-controlled transmitter sent up the authorisation recording and the
snow, by consulting the system clock and Santa's schedules.  That
meant I could start to do something about it being Never Winter.

There has been a lot of concern about the greenhouse effect.  This is
often cited, but never explained.  Why should it be warmer inside a
greenhouse than outside?  The reason is the glass.  The incoming heat
comes from the suns rays, which are high frequency;  light and
infra-red, coming from a body whose surface temperature is 6000
degrees Celsius.  These rays go through glass like , well, like
through glass.  So the heat can get into the greenhouse.

This warms up the air and soil inside.  But the temperature is only a
few dozen degrees Celsius, and the radiation emitted by a body at that
temperature is very long wave.  Glass is opaque to radiation at that
low frequency, and the heat can't escape by conduction (glass is a
very poor conductor) or convection (because you keep the windows
closed).

Carbon dioxide has the same effect on radiation, so if there were to
be more of it in the atmosphere, the world would be warmer.  If you
burn coal, oil or gas you convert carbon and oxygen to carbon dioxide.
Some of that is dissolved in the oceans, some of it is grabbed by
plants and photosynthesised into carbohydrates, but some of it remains
in the atmosphere, and it could build up.  Also, there's a bunch of
guys chopping down trees as fast as their sharp little axes can chop,
down in South America.  Chop chop chop, and those trees are no longer
photosynthesising.

My first priority was to stop those choppers, and that's where the
squirrels came in.  If, when you square up to a tree and spit on your
hands (which I am reliably informed is what all lumberjacks do) you
see an unbearably cute little squirrel with bright eyes and a bushy
tail sitting in the tree, there is no way you'll chop it down, because
lumberjacks are gentle, sensitive souls, who drink tea and press wild
flowers (which I also have on good authority).  So while my squirrels
held on in South America, I pursued my grand scheme.

Reducing the level of carbon dioxide in the atmosphere is one way to
cool down the globe.  Another would be to turn down the wick in the
sun, but a third way is to move further from the fire.

Obviously, the scientists had already thought of this and rejected it.
If you attach a rocket to the earth and light the blue touch paper,
that won't move it at all, because although the rocket is pulling the
right way, the rocket's exhaust is pushing the earth back the other.
But if you harness up a team of reindeer, you don't have that problem,
because reindeer don't work on the reaction principle (for an
explanation of how they do work, see Connectivity December 1989).

The first problem was that the earth is spinning, which meant that
wherever we attached the tow bar, it would keep changing the direction
of the tow.  That's easily solved;  you attach the towing point at the
Pole.  The choice of Pole was easy too;  the South Pole is just ice on
ocean, and we needed to attach to land.  The real problem was that in
Summer, if you tow the North Pole, you are moving it towards the sun,
which is the wrong way.  And not even reindeer are stupid enough to to
a major exercise like that in winter.

It looked like stalemate.  Towing the South Pole would just lift a
gigantic ice lolly out of the water, and towing the North sends you
the wrong way.  Fortunately, Angela, who has a reputation for
unorthodox ideas, saw the answer.  "You don't pull, you push".

Brilliant.  We needed a high tower to attach the lines to, so that the
reindeer could tow downwards;  fortunately, I spotted just the thing a
few years ago in Paris, and when we went there, after a few inquiries,
we were lucky enough to discover that they were selling it for scrap.
So I bought the Eiffel Tower, and by attaching quite a lot of reindeer
to it and sawing through the base, we got it aloft and northbound.
Quite a lot of people turned out to see it go, waving their fists and
shouting encouraging words like "arrettay-voo" and "Albion perfide".

We got it back to the Pole, and set it up.  We didn't need to put down
foundations or anything like that, as the reindeer were going to be
pushing it downwards.  We attached lots of reindeer, and started them
going.

I expect you will by now have seen what the flaw in my plan was.  I
should have seen it too, because one of the courses I did at
university was "Dynamics of an Asteroid", concerning just this sort of
thing.  But you don't tend to see the solar system as a rotating frame
of reference.

You'll be familiar with the gyroscope effect.  If you take a rotating
bicycle wheel and try to twist it, it feels like it is squirming
through 90 degrees, and it doesn't wind up going where you pushed it.
A planet rotating round its orbit is exactly the same, and when you
push it one way, it moves at 90 degrees to your push.  So that
although the reindeer were pushing the planet away from the sun, the
only effect was to tilt the orbit relative to the plane of the
ecliptic.

I've seen some pretty heroic cockups in my time.  Everyone makes at
least one mistake - IBM with the PC Junior, Microsoft with Dos 1.0,
Lotus with Spotlight and John Logie Baird with the television.  But
not many people can sheepishly admit that they misplaced a planet.

Well, of course, as soon as we realised what was happening, we shut
down the reindeer, attached a ringbolt to the North Pole, and started
towing in the same direction that the planet moves, with a component
towards the sun to compensate for the earlier error.  And pretty soon,
we'd moved the world to where we wanted it.  Winter had returned to
the world, and Christmas only lasted for one month.

I suppose you're all wondering what happened to the moon.  Well, if
I'd remembered Professor Moriarty's course, I would have remembered
that the moon is actually more closely bound to the sun than to the
earth, and in all that cavorting, we'd left it behind, still in its
old orbit - conservation of momentum, don't you know.  You've probably
always taken the moon for granted, like I did;  I never really thought
that the absence of tides would be so important.  But that turns out
to be nothing, compared to the effect of having no moon on people, to
to be more precise, on about half of them.  OLPC are foiled, Santa and
Rudy have settled their differences are are now working in
partnership.  But I'd better do something about the moon, before life
gets completely unbearable.  Maybe if I built a giant cannon out of
say, oil piping, and aimed carefully ...

Tuesday 24 December 2013

Fun with a spammer

I was spammed by another of the organisations that really shouldn't be spamming anyone, because until the spam arrived from them I thought that they were reputable. Clearly, they'd bought a list from one of the less scrupulous list vendors, sold as "business users". And I was on this list.

They were suggesting that I spend part of my hospitality budget at their venue, a big venue in London, capable of seating many thousands. So, thinking about Christmas (a month in the future) for me and ladysolly, I emailed them back with an enquiry. At this stage, I didn't mention how many people would be involved - I just asked for more details, and an estimate of costs.

Two weeks later, I hadn't heard anything back. That's a bit surprising - why go to the trouble of spamming milli0ons, if you aren't going to respond to sales queries?

So I emailed them again, asking why they hadn't replied to my enquiry.

A week later, they got back to me, asking me if I was a member of some organisation they run. So I emailed back, explaining that I wasn't, but that I was replying to their original email.

A few days later, they replied, explaining that as Christmas was now upon us, they wouldn't be able to respond until January.

So I emailed them back, explaining that as Christmas was now almost upon us, I'd made other arrangements. I said that I felt that they were suffering from having too many customers to be able to even answer a sales enquiry, and that I hoped that they would soon sort out this problem, either by increasing their efficiency or by reducing their number of customers (and I hoped that my going elsewhere had helped them with this).

And would they please remove me from their list of potential customers to send emails to.

The weather here

I have my AirPi operational, and installed just outside my house, so that it can measure temperature, humidity, pressure, light level, UV level and NO2 and CO pollution level.

The weather here

Rudolf's Revenge

Another story from 25 years ago.


 
 
Rudolf's Revenge

At the North pole, all was not well.  Rudolf the Red had been
outmaneuvered twice, and now he and his herd were in serious trouble.
What should he do?  It was all too complicated for a mere reindeer.
Suddenly, he had a flash of genius - he'd call in the only consultant
he knew, which fortunately also happened to be the best one he could
possibly have chosen.

I was sitting at my computer trying to improve my "Marble Madness"
score beyond what my five-year old had achieved when there was a
curious clattering at the door.  I opened it, and a troop of six
reindeer entered.  They sat in a circle with their legs folded neatly
under them, and Dancer, the spokesdeer, explained the problem.

During my first visit to the North Pole, I'd set up an order entry and
processing system capable of handling the requests from two billion
customers all demanding product at the same time of year.  This was a
rush job, held together with fairy magic and blessings, but it hung
together long enough to do the job that year - it came unstuck only
next year when Rudolf the Red called a general strike in protest at
the unfriendliness of the system.  I dealt with that on my second
visit, by setting up macros to make the software work automatically,
and Sir Sangrathta Claus called in penguins to act as blacklegs to run
it.  By the way, all this is written up in the December 1986 and 1987
newsletters;  these and other reports of unusual consulting jobs are
also available on disk .....  in the User Group library.

But Rudolf and his comrades were now unemployed, and if you've ever
tried to get a job at the North Pole in the middle of winter, you'd
understand their plight.  Dancer told me harrowing tales of frozen,
starving reindoes and reinfawns, and I felt a deep sense of shame at
what I'd helped to bring about.  Yes, even consultants have
consciences, and when we borrow your watch in order to tell you the
time, we often deduct a bit from the bill, on account of it being such
a crummy timepiece.

So I packed my bags, put on my warmest woolies, grabbed my portable
computer, and followed Dancer outside.  Dancer and the other reindeer
hitched themselves up to the sleigh, I climbed aboard, and we set off.
Everything was fine as we went up the hill to Amersham, but when we
reached the top, the reindeer just kept going up.

I suppose if I'd thought about it, I'd have realised that you can't
get to the North Pole entirely on land.  Normally, I have no fear of
flying;  I've globe-trotted so much that a 747 is just like a big bus.
But that sleigh-ride was something else.  For a start, I couldn't see
what held it up.

Then I realised - it works the same way that aeroplanes work.
Basically, aeroplanes work because everyone believes that they work.
Before the Wright brothers, people believed that aeroplanes couldn't
work, but the Wright brothers convinced themselves by looking at
Lillienthal's gliders, and then convinced everyone else.  So just
remember, next time you fly, that the only thing that keeps it up is
your belief that it all works - whatever you do, you must maintain
that belief.

Once I'd worked out what kept the sleigh airborne, I felt a lot
happier about things, and I sat back and enjoyed the flight, while
carefully maintaining my belief that it worked.  Eventually, we
reached our destination, and I saw a bright red beacon that guided the
reindeer down to the landing zone.  We touched down with a bump, and
came to a halt beside the bright red beacon, which turned out to have
a reindeer attached to it.  "Hello, Rudolf", I said, for it was
obviously he.

I looked round for signs of habitation;  a stable, or hovel or at
least an igloo.  But all I saw was reindeer snuffling at the snow,
looking for moss.  There wasn't even anywhere to sit;  such was the
grinding poverty that an unemployed reindeer suffered.  I felt awful -
had I really caused this disaster, just to make sure that my two got
their presents each year?  Pangs of remorse shot through my soul as I
asked the question every consultant asks first;  "How are you going to
pay me?".

Rudolf explained that they didn't have any money, but he had some
excellent hides to trade, and some superb sets of antlers.  I was a
bit dubious at first, because I couldn't see how I could sell the
antlers, but then Rudolf explained how you can powder them, and sell
the powder - well, I won't explain what the powder is supposed to be
good for, but basically, it works just like aeroplanes and sleighs,
but you have to maintain the belief.

We sat down and talked turkey.  Rudolf had two problems - how to
survive the bitter winter without losing half the herd, and how to get
back at the Claus Corporation.  He obviously thought I'd dream up some
computer trickery that would make the world all right, install it, and
everything would be tickety-boo.

I meet a lot of people with that idea.  A lot of the questions I get
boil down to "Which key should I press to make my life wonderful
forever?" I told Rudolf I'd have to sleep on it, and I put up my tent,
unrolled my sleeping bag, and was soon fast asleep.

Here's how it works.  When you're asleep, all the distractions are
gone.  There is no input, no output, no interrupts to service.  The
CPU can grind away, working on the problem you've given it, using
about ten times as much power as during the day.  So if you see me
with my eyes closed, you can be sure I'm working hard;  if I'm snoring
as well, you're really getting your money's worth.

Sure enough, when I woke up in the morning, I had the answer.  I
called Rudolf and all the other reindeer together, and explained the
plan.  "We're going to beat Santa at his own game.  He's always
operated a total monopoly;  we're going to compete with him, undercut
him on price and offer a quality service, complete with technical
support.  By the time we've finished, he'll be out of business!"

Well, the reindeer loved it.  Only Rudolf looked dubious.  "How?" he
said.  So I explained the plan in detail.  You see, one of my degrees
is in econometrics, so I understand how economics works from a
quantitative point of view.  I think what really convinced Rudolf was
when I scratched the translog equations in the snow, and showed how
market share would respond to price and marketing until Santa's
mega-empire would have inadequate turnover to support the
superstructure, and it would collapse.

"First, we have to get finance", I said.  Rudolf and I set up a
spreadsheet there and then, showing how our business plan would
develop over the next five years.  Then, we hitched up the sleigh, and
flew back to my house.  Rudolf and I spent the next few days polishing
up the business plan.  I suppose I ought to explain what a business
plan is.

Essentially, a business plan is a work of fiction, dressed up to look
like fact.  I'm quite good at doing that, as I've had a lot of
practise at telling realistic pork pies, and I can tell an exciting
story with the best of them.  But the business plan is a rather
special work of fiction, and there are special rules to abide by,
otherwise it doesn't count, and won't win any prizes.

The most important rule is to have a happy ending.  This could be a
nine-figure profit, or a stock flotation, or whatever.  The next rule
is to have a fairly straight line between the final profit figures and
the start;  no nasty little dips.  The third rule is that the whole
thing has to be dressed up with lots of spurious figures and charts,
typeset and printed on glossy paper;  obviously the work of someone
who can afford the best.  It took me about half an hour to whomp up a
little financial model using 123, another hour to do some impressive
charts using Harvard Graphics, two hours to write the executive
summary (I can write 2000 words per hour when I know that no-one's
going to read it).  Then I ran my financial body copy generator, which
produces as many words of impressive sounding financial jargon as you
need.  A couple of hours with Ventura pulled all these pieces
together, and I took the final diskette down to my local DTP bureau,
where they output it on a Linotron using Garamond, with colour
separation for the charts, and got a thousand copies printed up on
glossy paper.

It looked magnificent.  I spent part of my life as a stockbroker, so I
know how to do these things, and this one was a beauty.  The best part
was the superb picture of our Chairman;  Rudolf standing on the brow
of a hill, surveying the city arrogantly, dominating the picture with
his impressive branching antlers.  Actually, it was just a snap on
Hampstead Heath.

Next, we mailshotted our prospectus to the City of London.  After all
the government privatisations and the immense profits that were made
out of those, the prospect of a twenty billion pound flotation sounded
to them like Christmas - well, it should, shouldn't it.  Soon we were
being invited to give presentations on our proposals, and were
beseiged by stockbrockers wanting to act for us and at the same time
get a finger in the gravy.  Merchant banks practically came to blows
over who would make us the biggest loan, and the Japanese and US
institutions battled over the size of their share allocations.
Rudolf was a great success - they'd never seen anything like him
before. I do think it's important to have an impressive Chairman.

Not many people understand what drives share prices - it's the
aeroplane principle again.  As long as people believe that they're
going up, they want to buy, and so send the prices up.  But as soon as
they lose faith, they want to sell, and that sends prices tumbling
down.  It really is surprising how often the aeroplane principle gets
used.

After the flotation, we could do no wrong.  Rudolf was the City's
darling, their blue-eyed boy (well, red-nosed reindeer, actually).
But after the palaver died down, I had to remind him that we had a job
to do - we actually had to get this enterprise on the road.

First we had to get premises;  this isn't as easy as it sounds.
Landlords are very wary of new enterprises;  they like to feel that
their rent money is safe.  Solicitors are a major pain in the
affidavit, and if you think buying a house is the worst experience in
the world, that's because you haven't tried renting business premises.
We looked absolutely everywhere - we even looked north of Watford and
south of the Thames.  What we needed was about 200 million square feet
of light industrial premises, and a large local workforce.
Eventually, Rudolf found it in the last place I would have thought of
- the South pole.

It seems that over the years, successive Antarctic expeditions have
been putting up Nissen huts and abandoning them, until now you can
scarcely turn round.  No-one seemed to own them, so we simply moved in
and squatted there.

Now we needed an experienced workforce.  Reindeer were no problem;
Rudolf's herd had followed us to the South Pole.  Soon dwarves, elves,
fairies and hobbits started turning up at the factory gates;  word had
spread that there was work to be had down South, and soon the North
was looking like a depressed area.  Our plant was frantically busy,
tooling up for the annual rush.  But how were we going to market
our products?

Well, I'm sure you've guessed.  But there might be a few people left
who don't know who's behind My Little Pony, Care Bears and He-Man.
All those collectables that your kids get filled up with come from us,
and the dealers loved it because the margin they got from us was
greater than the competition offered.

The orders flooded in, and we couldn't cope with the rush.  Rudolph
started panicking, but I reminded him about the Plan, and started on
the accounting and control systems, while he started recruiting
labour.  Penguins were out, of course, on account of them all being
employed by the competition.  But Rudolf was brilliant, and what I
first thought was a plague of squirrels turned out to be our workforce
arriving.

This time, I'd learn from my experiences at the North Pole, and do it
right.  This time, there would not be a flaky network of underpowered
micros held together with magic and blessings.  This time, I'd put in
a system that could cope with anything.  This time, I'd put in a
proper mainframe, programmed by proper programmers.

It wasn't hard to choose which one.  I love the VAX dearly, and
whenever I get near one, I pat it, which gets me some funny looks.
But when you need a substantial transaction processing system, there's
only one place to go, and it's Big and Blue.

Next, I needed workstations.  I know what you're thinking - PCs, or at
least PS/2s.  Well, you're wrong.  Until OS/2 is firmly established
with Extended Edition and Presentation Manager, linking a micro to a
mainframe is still very flaky.  Oh sure, you can do 3270 emulation
quite well (except that the keyboard's all wrong, a major pain).  But
the seamless micro-mainframe link, where the user doesn't actually
know or care which computer he's using, is still in the future.  And
if all you're going to do is terminal emulation, you might as well
eliminate the hassles and incompatibilities, and use real 3270
terminals.

We needed the biggest on-line transaction-oriented order-entry,
progressing, invoicing and bill-of-materials in the world, and no
noddy off-the-shelf copy of Instant Accounts was going to cope with
the two billion customers, and the twelve billion orders that would
soon flood in.  And we needed it soon.  Fortunately, it's a well known
fact that if it takes one programmer one year to write one program, it
will take a thousand programmers two hours to write the same program.

We set up an EDP Department, with a Data Centre, a Systems Centre, and
an Information Centre.  We hired operators by the dozen, analysts by
the hundred, and programmers by the thousand.  We advertised in all
the computer magazines, offering good money, and a very Southerly
climate, and soon we had applicants flocking to us in droves.  Because
we were in such a hurry, we decided to use every competent applicant,
irrespective of previous experience;  we even drafted in some of the
brighter squirrels, who turned out to be rather better than some of
the programmers.

First we established a database of personnel, showing each person's
experience and languages.  We couldn't use any one language for this
job, as there were so many represented, so we decided to write a
modular system so that each module could be in a different language,
if necessary.

At first, progress was rapid.  Code was churned out at a great rate,
and the system grew in size and complexity.  But then we found that
some of the languages wouldn't link, and we had to write assembler to
patch them together.

Then we found that some of the languages we were using couldn't read
the files generated by other modules, and we had to write translating
programs.  Then we found that we needed to run part of the system
under MVS, and part under CMS, and we linked the parts by downloading
the files to a System/36 and back again.  The 36 was such a good idea
that we decided to offload part of the project development onto a
whole clutch of them, but then we found we needed to link them
together, so we put in a network to connect them, only it turned out
to be non-trivial to link that network to the mainframe, and the
squirrels didn't speak very good English and kept misunderstanding the
specs, and ...

Meanwhile, Christmas was coming.  That's an understatement - Christmas
was rushing towards us like an express train, and we weren't ready for
it.  Rudolf was stampeding in all directions, and I have to admit that
I was getting a teeny bit worried about the way the project was going.
I sat down and did a few calculations about our rate of progress and
likely finishing date, and then I did a bit of panicking myself.  The
project was a total mess, and getting worse;  every time we patched up
one problem, four other things fell over.

It was time to do a consultant's disappearing act - rule number one is
don't ever be around when the client implements the mess you designed
for him.  But I'd missed a vital point - I could only leave by sleigh,
and that needed reindeer, and Rudolf would soon sniff that one out.
So it was time for a complete rethink of the whole system.

The mainframe-based system was obviously beyind hope;  the only chance
was to start afresh.  Fortunately, I still had my portable with me, so
I pulled it out, and set to work.

I needed to write a major, multiuser system, that could be operated by
naive elves (*all* elves are naive).  But it had to be robust enough
to stand up to the stupid things that they would do.  I couldn't use
the sort of database with problems like "needing re-indexing" and lost
file headers and all the frailties that PC databases are heir to.
User-friendliness and extreme power;  thousands of users all accessing
the database at once, and doing their best to mess it up.  There
wasn't a database in the world that would cope.

Then, just as I was wondering how on earth you could use a PC for
transaction processing, a squirrel trampled over my keyboard, and a
great blinding light struck me - of course - I should have thought of
it in the first place - SQL (pronounced SEQUEL).

Structured Query Language is without question the best route to a
solid multi-user relational database with distributed data.  All the
protection is done at the database server, and the workstations just
send SQL requests to the database;  there's no way the user can switch
off in the middle of an update and corrupt the lot, or screw up the
header, or anything at all that messes up the system, because you
have COMMIT and ROLLBACK.

SQL is not something you'd want to teach to elves, but you don't have
to.  You get a nice friendly front end that lets them set up their
data entry or data extract, and sends it to the server using the SQL
protocol.  I chose Paradox as the front end, because all the elves
already knew Lotus from the system I'd set up at the North pole, and
Paradox is easy to teach to Lotus users.  I put a Sequent in as the
SQL server - you could call a Sequent a micro, but I'm not sure that
something that runs several dozen 386s in parallel deserves to be
called titchy.  I designed a nice, simple data structure, hooked up
the PCs to the Sequent via an Ethernet, showed the elves how to use
Paradox, and away they went.

By golly it worked!  Obviously a Sequent with 256 PCs networked to it
is pretty small beer, but all I needed to do now was network 256
Sequents together, and I had a 65536-station network.  And the beauty
of SQL is that it still worked - the workstation doesn't care where
the data is actually stored.  The elves took to Paradox like ducks to
water, and I didn't have to write a single line of code!

Our system was much more up-to-date and efficient than our
competitors, and of course our marketing was very much better since we
had Care Bears and My Little Ponies, and (best of all) Rudolf.  The
real killer, though, was my brilliant masterstroke on the teddy bear
product.  We copyrighted the look and feel of the Teddy Bear (funnily
enough, no-one had thought of doing that before, and it didn't seem to
matter that we hadn't actually invented it).  Sir Santa was unable to
supply the single most important product line, and with our lock on
this strategic area, we were soon able to ensure that the bear product
was allocated only to our loyal dealers.  Or to put it another way -
you buy all your stock from us, or you get no bears.  It's a tough
competitive market, and all's fair when the hearts and minds of
customers are at stake.

So once again, it looks like this Chistmas will be a happy one
all round, and your little customers can spend many happy hours
unwrapping their presents and destroying them. Of course, there is
one person whose Christmas will be a little bit tarnished; I gather
that Claus Enterprises is about to go into receivership. On the other
hand, perhaps it won't - in my opinion, all Santa needs is a really
good consultant, and it just so happens that ... well, I'll tell
you about it next year.

Monday 23 December 2013

Rudolf the Red strikes again

This one is a bit more than 25 years old, and features daughter.1 and daughter.2.


RUDOLF THE RED STRIKES AGAIN


Well, I did warn them.  I did say that anything as complicated as an
accounting system to handle Christmas needed more than six weeks to
write.  By the way, if you've forgotten how it worked, read "A
Computer for Christmas" in the December 1986 newsletter.  You may
recall that I did say that relying on a fairy blessing on the disks
was less safe than a proper tape backup system.  And that the problem
with using pixies for data entry was that they had an attention span
of about five minutes.  And anyone who thinks you can train reindeer
to use touch sensitive screens wants his head seeing to.  But the
system held together against all my expectations, and if your little
customers didn't get their present, the chances are they filled their
order form in wrong.  No, the trouble came from an entirely unexpected
direction - Rudolf the Red.

He'd been outmaneuvered (perhaps that should be outreindeereuvered)
last year, and he knew it.  He'd demanded action over the long hours
that he and his brother reindeer had been working;  he'd thought that
industrial pressure of this kind would help the chronic unemployment
that was currently affecting the reindeer community, and he'd been
totally unprepared for Sir Sangrethta Claus calling in an expert
computer consultant to set up a major meta-network of IBM ATs.

Christmas 1986 went off quite well, apparently, and about 30 billion
presents had been delivered, mostly on time and mostly to the right
customers.  But Rudolf had been burning brightly with anger ever
since, and he was determined that 1987 would be different.  Through
winter, spring and early summer he bided his time, quietly subverting
the occasional elf here, the odd dwarf there.  But at Conference that
year he made an impassioned speech about the dehumanisation,
unemployment and health hazards that my computer system had caused,
and his rhetoric galvanised the assembled herd into a standing ovation
(they rattled their antlers together).  He then followed up by
organising the elves into bands, the fairies into rings and the
dwarves into groups of seven.  By the time I'd got the panicky
telegram from Sir Sangrethta, the whole place was unionised and about
to strike unless certain conditions could be met.

It was a disaster.  They wanted the hours in front of VDU screens to
be limited to four per day, lead-lined filters to screen out any
harmful radiation, an ambient temperature of 15 degrees Celsius, an
undertaking that there would be no redundancies, and user-friendly
software.  Any of these demands could probably have been met, but the
thought of writing user-friendly software was as repugnant to me as it
is to any other Right-Thinking programmer.

So I packed my warm woollies, and got on the JAL flight to Tokyo.  Why
Tokyo?  Because it seems that the shortest route to Tokyo is the Great
Circle route over the North Pole, and I bet you can imagine the
stewardess's surprise as I made my exit.  There was the usual
sickening feeling that the parachute wasn't going to open, and then I
was floating down like Alice down the rabbit hole towards the place
where all lines of magnetic force converge.

Sir Sangrathta was wearing his red survival suit, complete with
insulating padding and long white neck-warmer.  I'd forgotten just how
cold it was up there, and I shivered, wishing I'd worn my thermal
underwear.  But the sleigh ride soon warmed me up;  Santa was a
completely fearless driver, and I shut my eyes and hoped that we
wouldn't meet anything coming the other way.  We arrived in one piece,
and Santa took me underground to the "Workshop" as he affectionately
called his mammoth industrial complex.  And then he filled me in.

It seemed that the magic had held - Santa had understood how fragile
the system was, and had recruited unicorns to reinforce the fairy
programming.  Unicorns are well known for their programming prowess;
the most powerful and user-hostile operating system of all was named
after them, in an attempt to make use of nominal magic.  But this was
not making the reindeer situation any better, as reindeer have a deep
prejudice against unicorns;  they're the wrong colour, and have a
single long horn instead of the more conventional branching antlers.
Rudolf the Red, in a typical agitprop ploy, was making hay out of the
unicorns' presence, and a more permanent solution was needed.

"It's all impossible", I said to Santa.  "If we make the system
user-friendly, it'll take years, and anyway by then, Rudolf will have
thought up more unreasonable demands." "We've got to cope somehow",
Santa said vehemently, and he painted a moving picture of Christmas
morning all over the world, with the little customers asking
plaintively why there were no presents.  I gulped, and thought of
Angela and Jennifer, and the peace that pervaded the house for several
blessed hours as they first unwrapped their parcels, and then
destroyed the contents.  Tears came to my eyes as I thought of
spending the entire Christmas trying to entertain them, and I could
see that in that direction lay madness and possible infanticide.

"We have to keep the reindeer happy somehow", Santa said, and I agreed
with him.  So we sat down and thought of everything we could.  We
could have shorter hours, if we doubled the staff.  Santa looked very
dubious about this, as it would eat heavily into his profit margins.
The fears about radiation from VDU screens were totally unfounded, of
course, and anyway you get a LOT of radiation at the North Pole, as
the lines of magnetic force funnel it all down there.  But we could
deal with the VDU issue by substituting the new LCD screens, which are
completely radiation-free.

In fact, we could think of solutions to just about everything that
Rudolf and the other shop stewards were demanding, with the exception
of the user-friendliness of the software.  Santa suggested that we
rewrite it, but I pointed out that there wasn't time, and anyway I'd
be thrown out of the Programmers Guild if I perpetrated such an
unprofessional act as to write software that was actually usable
without a degree in clairvoyance.

"We're knackered then", Santa said succinctly.  "Well, not quite", I
said.  An idea had been sprouting in the corner of my brain, a corner
that I keep clear and well watered (hence all the beer) for just such
a purpose.  I could feel it in there, but it wasn't ready to come out,
so I had to go in and get it.  There's a technique I use called
Lateral Thinking - read Edward de Bono's book if you want to know more
about it.  It isn't actually one technique, but several.  You use them
when you're completely stuck on a problem that looks impossible.  The
first thing you do is turn the problem inside out/upside down,
approaching it from a completely different angle.

For example, I thought of teaching the reindeer to appreciate
user-hostile software.  That's not as daft as it sounds;  it has
worked well for mainframe programmers down the centuries.  But Santa
pointed out that Rudolf had a nose for such ploys, and would smell a
rat immediately.  Another of the big Lateral Thinking techniques is to
keep asking yourself whether you are tackling the Real Problem, or
whether you've got bogged down on just a small part of it.  Often, if
you backtrack to the Real Problem, you find a solution that doesn't
involve you with the impossibility that you thought you had.  In this
case, the Real Problem was to get 30 billion ("35 billion this year",
said Santa, "it keeps growing") presents out to the little customers,
and there was absolutely no way that this could be done without
extensive use of computers.

One of my favourite Lateral Thinking techniques is called "Relax
Unnecessary Assumptions".  Often, you make a problem harder to solve
by adding constraints that aren't actually part of the problem.  You
add them because you haven't thought too clearly, and these
constraints look like they are necessary, and part of the problem.
Typically, a solution arrived at this way gets the client response "Oh
yes, well of course we could have done it *that* way".

"Huskies", I said.  Santa looked at me.  "We've got some chocolate
biscuits", he said.  "No," I said, "I mean the dogs." I explained my
idea, and it was pretty unorthodox.  "Why do we need reindeer at
all?", I asked.  "Sack the lot of them.  Use Huskies to pull the
sleighs, and you can dispense totally with the reindeer".  The
customers won't mind as long as the presents arrive - we could use
Securicor for all they care.  And with all the reindeer dismissed,
Rudolf's power base would be gone, and we could get on with the job.
I explained that President Reagan had used the same technique with the
Air Traffic Controllers, and Eddie Shah had dealt with the print
unions the same way.

He liked it.  The more we talked about it, the more we could see that
with the reindeer out of the way, we could use all our existing
systems, except for delivery.  Santa quite liked the Securicor idea,
but I explained that it would be quite difficult to persuade them to
make the deliveries in the way that our customers expected.  Securicor
deliverymen have a thing about chimneys.  No, Huskies were the thing
to go for.

Santa sent out an internal memorandum, making the reindeer redundant
and putting them on four week's notice.  Unfortunately, reindeer can't
read, so we had to go round explaining it to them, and I hope I never
have to do anything like that again.  Reindeer have reindoes and
reinfawns, and there isn't much alternative employment at the North
Pole.  But we didn't have any choice, really, it was either them or
our little customers.

I suppose I should have guessed what Rudolf the Red's response would
be.  He went round all the elves, dwarves, fairies and other staff,
calling for solidarity with the reindeer, and telling them that it
would be their turn next if they didn't stick together now.  And
before I knew what was happening, we had a general strike on our
hands.

Sir Sangrethta was frantic.  "Now look what you've done", he kept
saying, and "We've got to give in".  But he calmed down after a couple
of pints of pudding brandy, and after I pointed out that giving in to
the reindeer wouldn't actually get the presents out, but just leave us
back where we were before.  "What can we do then?", he asked me.  I,
of course, had a plan.

How do you operate a PC when all the operators are on strike?  There
are several ways.  There's a user group library program called Newkey
(disk 39), which lets you write keyboard macros that can run
automatically.  You can drive quite a lot of programs that way, and
being Shareware, it's quite cheap.

Borland (bless you, Philippe) do something even better called
Superkey.  That's more powerful and flexible;  you can have macros
that are really long, you can prompt for user input in the middle of a
macro, and you can put pauses in the middle of a macro, vital for when
a program flushes the keyboard buffer before continuing to accept
keystrokes.

But best of all, there's a rather clever program called PC Automator
from a British company;  Direct Technology.  That can be made to do
almost anything you can think of;  you can make it take fairly
intelligent decisions based on what is on the screen.  The call it the
Software Robot, and it was PC Automator that would save the day here.
You can put it into learn mode, and it will record your keystrokes.
You can then put conditions round it, such as "Whenever you see
'Completed' on the screen, start a new customer".  All I needed was
the right macros written in ACL (Automator Control Language).

We already had a well-filled database on the Super-Lan of 10,000 IBM
ATs, all set up last year, and there would be no need to do all that
data entry again.  And since we were getting a direct feed from the
Registrar of Hatches, Matches and Dispatches on 1/2 inch 1600 bpi
magnetic tape, we didn't even need to type in data to keep it up to
date.  We did have to process the little customer's orders, but the
new Kurtzweil document readers can read just about anything, using
intelligent pattern recognition techniques to turn the most
incomprehensible scrawl into ASCII data (and all children know that
you're not supposed to use joined-up-writing when communicating with
the North Pole).  So we had the data entry and order processing
problem just about licked, except that there wasn't anyone to set up
the macros, and we needed the presents to be wrapped and physically
transported to the sleighs.

But Santa already had that one under control, and when I asked him
how, he just grinned, flapped his arms and waddled.  It was only when
the penguins started arriving in large numbers that I understood.  Not
even Rudolf's influence had spread as far as the South Pole, and for
the price of a few fish, we had all the willing hands we needed (well,
flippers, actually).

The penguins were an instant success, and didn't mind being called
blacklegs at all, since that's what they had.  They were quick little
learners, and soon got the hang of wrapping paper and Sellotape.  The
Huskies were just great - they already knew about pulling sleighs, and
all we had to do was show them how to jingle the bells and do reindeer
imitations.  But that left me with the problem of writing the macros
to drive the system.  It's quite a big programming job, and there
isn't time to do it properly (is there ever?).  The fairies won't play
ball (or to be more precise, that's the only thing they seem to do
these days) and the unicorns have been subverted by the reindeer.  So
that only leaves me with one possibility.  I'm going to need your
help.

I'm sorry it's such short notice, but you can see how it is.  I've got
the penguins all lined up, and the system's all designed.  I just need
a bit of help with writing the macros, but I need it in a hurry.
Christmas is coming, and unless we get this thing working, an awful
lot of people will have a rather disappointing Christmas.

Get onto JAL413 (or BA426) to Tokyo;  it leaves every day at 14:30
(check in at terminal 3 at 12:30), and when your compass needle starts
spinning in a confused way, close your eyes, shout "Geronimo" and
jump.  Oh, and don't forget to put your parachute on first.
 

The Mystery Shopper scam

It sounds great! They'll send you money, you do a test purchase with part of it (sending the surplus back to them) and you get to keep the lovely thing you purchased. It sounds too good to be true!

And, of course, it is.

The working of this scam depends on two things.

1) It takes a bank several days to process a cheque, and that includes a cashier's cheque.

2) If you send money via Western Union, it's immediate, and there's no way to undo the transaction.

So. You sign up, giving your name, address, and bank details (and there's lots of opportunities for additional scams using this information, which is going to be sold to other scammers), and you get a cheque, drawn on the National Bank of Ruritania, for £1800. Or some other bank, or some other amount. But it's a bank cheque, a cashier's cheque, and they're good as gold, aren't they?

Not always. This one is forged, because actually the "National Bank of Ruritania" doesn't exist. And you pay it into your bank, and you're credited with the £1800, and everything looks rosy, and you draw out the £1200 that you wire via Western Union, and you spend the other £600 on a lovely iSomething, and you're laughing.

Until the cheque bounces. And your bank isn't going to take the loss, no way. They're taking that £1800 out of your account, and if that puts you into unauthorised overdraft, there's a hefty fee for that, plus hefty interest rates, and don't even *think* of taking out a "payday loan" for this at 5000% APR.

And you go back to Western Union, and ask for your £1200 back, but WU explain that all transfers are irreversible. So you take your lovely iSomething back to the shop, and if you're lucky, you'll get your £600 back, so you're only out £1200.

There's lots of variations on this, of course. Anything that involves you receiving money from a complete stranger is probably a scam, and if it also involves you sending money back to them via Western Union (or similar service), it's definitely a scam.

So what should you do?

Easy - delete the email.

Sunday 22 December 2013

Bike.1 ready to roll

After several months in reserve, bike.1 is at last ready for riding. I took it out for a test run today, just before the rain started, and the only fault I found was that the LEDs showing battery state were much too bright, quite dazzling. I don't need them anyway, because I have a voltmeter instead, which gives me a much better idea of battery state. So I covered the display with masking tape, and now it's just a slight glow.  So bike.2 can, at last, be put back into its normal role as backup bike.

I've ordered a few things for bike.1, which should arrive in the new year. Nothing crucial, but I do like having a clock/thermometer on the handlebars, and I've ordered a short pump to replace the full-size one that's currently in the panniers, plus a multitool for adjusting things while in the field. And a puncture repair kit, of course. Although when using kevlar tires, gel inserts and thorn-resistant inner tubes, I've never had a puncture. So far.

I'd like to do a series of 70-odd caches near Barnwell, but I'll wait until the weather forecast isn't "downpour".

Another computer for Christmas

This was also written about 30 years ago.


A computer for Christmas

It was April, and the elves were still sorting out the shambles from
last Christmas.  And a right shambles it was too;  boys toys sent to
girls, girls toys sent to boys, and some customers getting no presents
at all.  The reindeer schedule had been cobbled together at the last
minute, the dwarves were given the wrong production dockets - a complete
shambles.  Everyone was fed up, and highly cheesed off with the boss.
The dwarves were fed up at the amount of overtime they'd put in, the
reindeer were seriously thinking about a strike, and the elves were
working-to-rule.

Rudolf "the Red", the reindeer's shop steward, called a meeting, and
invited delegations from the dwarves and elves to attend as observers.
"We can't go through another year like this.  We've got to force
management to invest some of their bloated profits to move forward into
the future." he said.  Everyone agreed, and so they formed the Ad Hoc
Committee to Study Ways and Means.

By the time the committee had reported back, it was July, and by then
everyone had gone on holiday.  So it was not until September, at the
annual Conference that the report was examined.  The Ad Hoc Committee's
conclusions were simple - all aspects of ordering, production and
distribution had to be computerised, and Conference endorsed the report
and voted that it be made a non-negotiable demand at the next meeting
with management.

Meanwhile, in a penthouse deep under the North Pole, Sir Sangrethta
Claus and the rest of the main board of Christmas PLC were having a
meeting.  "It worked a treat", said Sir Sangrethta.  "They'll be
practically begging us to put in computers." For some time now, Sir
Santa had been trying to introduce modern technology throughout his
plant, but it had to be done carefully, as a strike at the wrong time
would have a disastrous impact on his bottom line.

So in early October, Rudolf and his fellow negotiators sat down at the
table with Sir Sangrethta Claus and his industrial relations director,
expecting a tough fight.  But after a token resistance, the threat of a
December strike worked as usual, and management acceded to the worker's
just demands.  Perhaps it was as well that Rudolf didn't hear Sir
Santa's "Ho ho ho" as he left the meeting.

Naturally, at that point, they called in the best consultant they could
find, so I packed my warmest woollies, and set off for the North Pole.
They had written down their requirement, which made a change, so when I
sat down for my first meeting with Santa, I knew what to expect.

The problem was a little unusual.  It was a standard ordering, stock
control, production, distribution and accounts system they needed, but
with a highly seasonal demand pattern, and with a rather high volume.
About two billion customers must receive their presents exactly on time,
and although some orders are received in good time, for the most part
the customers don't do anything until the last minute.  Santa gave me a
guided tour of the system.  "The orders come in here", he said, "and go
down to the elves.  They enter them in a ledger, with the name and
address of the customer.  Each order is given a number, and a production
docket is filled in." We proceeded to the workshops.  Almost drowned by
the din of hammers, Santa shouted "The dockets are distributed from
here".  A dwarf rushed past, sneezing violently and carrying a big pile
of boats.  "We're already ramping up production for this year.  Each
docket is given to the dwarf that specialises in that particular
product", he said.  "When the toy is finished, the docket is pinned to
it, and it goes back to the elves."

We went back upstairs to see another band of elves.  They were matching
the docket numbers to the ledger entries, and tying a label with the
delivery address to the goods.  "From here it goes to dispatch", Santa
said.

"What about invoicing?", I asked.  He took me into another large room,
where yet more elves were working from huge directories of birth and
marriage certificates.  "We have to work out which parents to invoice;
it isn't always as simple as it sounds.  Some customers have several
parents, some have none.  But they all have to get presents, and it all
has to be paid for."

"I never realised you ran such a complex operation", I said.  Santa
turned and looked at me.  "This is the biggest business in the world.
There are two billion customers, and on the average they get twenty five
pound's worth of toys.  Our turnover is bigger than most governments.
Over the years, we've gradually built it up from a non-commercial and
amateurish thing into a proper big business."

We went on to Distribution.  Here, the reindeer were gift-wrapping the
presents, sorting them according to post codes, and passing them down a
chute to the loading bay, where they were piled up on the sleighs.  "The
trouble is, everything's done by hand, and takes forever.  We have to
service our two billion customers in an incredibly short space of time,
so the work force is enormous, and grossly underutilised most of the
year."

I agreed.  "Yes," I said, "I can see a lot of ways that computers would
help.  For example, looking up the customer's parents should obviously
be done by a database, and the post code sort could be done at the same
time." Santa beamed.  "There's a lot of things that need doing;  it's a
big job," I continued.  "Probably be able to get it done in a couple of
years or so."

Santa's beam turned into a blench.  "Gulp", he gulped.  "We've got to
have it in time for the coming Christmas." Now, I'm used to tight
deadlines, but this was ridiculous.  "Not possible", I said.  "Can't be
done.  You can't just wave a magic wand and expect a major system like
this to appear out of thin air in no time at all.  It needs careful
analysis, specification, design and finally coding;  at least two
years."

"What if we waved a million magic wands?", asked Santa.

"?", I said.

"We can use the fairies.  The wishing level doesn't get very high until
much later in the year, so they haven't got much to do.  They can do the
grunt work of actual coding and data entry, but we need you to design
it.  It must be done for this year, and money is no object".

That last phrase silenced the objections forming in my throat.  Little
cash registers went ding in my head, and my eyes filled with pound
signs.  Maybe the job couldn't be done by ordinary means, but with a
million wishes at my disposal, maybe, just maybe ...

It took me two weeks to complete the fundamental design.  I started by
designing the data structure, in the best Wirth tradition.  The main
problem was the sheer size of it.  Santa had said two bilion customers,
but I knew that you have to allow for growth.  The problem is that the
largest integer that you can store in four bytes is four billion, even
storing it unsigned.  And I had to assume that the North Pole operation
might one day be expanded to cover the customer's parents as well as the
customers themselves, which would require six billion records.  This, I
realised, was a major problem, as it meant that I couldn't use an
off-the-shelf data handling package like dBase II, but would have to
code from scratch.  I had to invent a new type of integer, the six-byte
integer, and all indexing would be done with those.  It was also clear
that one IBM PC would not be able to cope with the problem, so a network
system would be needed, with its added complexity.

There were many other problems that I'd never met before;  one was the
problem of magnetism.  Being sited exactly at the North Pole, compasses
went crazy, and I was worried about how the magnetic media would cope.
So I specified Faraday cages for all equipment, and a second cage to go
around the entire computer area.

I decided to keep records for all potential customers, as well as
current ones.  This was partly with one eye on future expansion, but
also to simplify the problem.  So each record contained the customer's
name, address and post code, codes that indicated past deliveries to
that customer, the customer's birthday (again, with an eye on future
expansion), and pointers to the records on the customer's parents.
There were also fields for the current orders, and fields to record the
progress of the order.

The elves job would therefore be simplified - all they had to do was
read the customer's order (sometimes the handwriting was atrocious),
call up the customer's record and enter the order details.  Invoicing
would be automatically routed to the correct parents, using the pointers
in the database, and the reindeer could deliver the invoices as part of
the main drop, instead of having to make a separate journey.

A separate data base would take care of production and stock control,
but they would use common codes, and there would be links between the
two data bases.  The docket system would be abolished, and dwarves would
simply make product to replenish stocks, whenever a computer-generated
forecast of stocks got too low.  This would free the dwarves from all
paperwork, and let them get on with their real work, which would make
them less grumpy.

They wouldn't have to transport the goods around either.  Part of the
design called for pixies to do the gift-wrapping, and they could also
transport the goods to the warehouse.

The reindeer would have less paperwork also.  The computer would be able
to decide when a full sleigh-load for a particular area could be made
up.  It would them print out a list of goods and the dispatch address.
The reindeer would draw product from inventory already gift-wrapped,
stick the label on, and load it into the sleigh along with the invoices
that needed sending to the same address.  They could then concentrate on
their main job of hauling the goods to market, and on arrival, insertion
of the goods into the appropriate receptacle.

The total size of the database was 2 billion records, with each record
being 1K long, for a total of 2 trillion bytes (2 million megabytes, or
2 terabytes.  Since the largest hard disk available is only about 400
megabytes, we would need 5,000 of them.  I specified 5000 IBM ATs as
file servers, linked together in groups of 64.  Each group of 64 had an
AT as a supervisor, and the supervisors were again grouped in a network
into clusters of 64.  With 4096 file servers per cluster, I needed only
two clusters, but there was the potential to expand to three or more, as
required.

Backup looked as if it would be a bit of a problem.  But I solved that
in the usual way, by not having any.  I did specify, however, that all
the file servers be blessed, just as a precaution, which is more than is
done at most sites.

Printing was a problem.  You can't put a typewritten label on a present,
so I wanted to use laser printers to create the appearance of hand
writing.  But lasers can't handle colours, so eventually, I settled on
flat-bed plotters as the primary output devices.  The problem is that
they are slow, so I had to have quite a lot of them.  A label takes
about three minutes to write;  add another five for removing it and
putting in a blank, and each plotter will turn out 200 labels per day.
We would have about a month to make 2 billion labels.  In the plotter
room, therefore, there would have to be 300,000 plotters, with each
group of four driven by its own plotter-server.

The order data entry would mean keying in a peak of 200 million orders
per day.  Each elf could input 500 orders per day, so 400,000 data entry
machines would be needed, networked using the same clustering system as
the file servers.

Finally, I had to think about the machine that would be used to sort and
process the information.  Clearly, something powerful would be required,
and so the choice was easy - since the most powerful machine around was
the 386, it had to be one of those.

The overall design, therefore, called for half a million IBMs knitted
together into the largest LAN ever built, connected to 2 terabytes of
disk storage, and using 300,000 plotters for output.

I was very pleased with the final design, and had it typed up by one of
the fairies, and took a copy to Sir Sangrethta.  "How much will all this
cost?", he asked.

"About four billion pounds", I said, "which works out at two pounds per
customer." "Cheap at the price", said Santa, handing me a cheque with
more noughts on it than I could comfortably carry.  I went down to the
leprachauns to have it converted into bags of gold, and then got the
goblins in Purchasing to raise an order.  I'm not sure exactly which
box-shifter got the order but I'm sure that celebrations must have gone
on far into the night, probably until dawn.  By the time the sun rose,
and the gold had changed back into straw, we'd got the machines safely
under the Pole.  It's a tough life, being a box-shifter.

Then my problems really began, as we had to set up the hardware, and at
the same time write the software and begin to enter the data.  Have you
ever tried to teach Turbo Pascal to a million fairies?  The trouble is,
they haven't got a very long attention span, and no notion of working
systematically.  All they seemed to want to do was wave their wretched
wands about.  But I got them working together, and soon they were
churning out code at a great rate.  Somehow, we got the elves all
trained in keyboarding, in spite of the problem with their hands being
too small.  The reindeer were the worst.  I don't know how I managed to
overlook the fact that you can't operate a keyboard with hooves, but we
managed to set up a system using a touch sensitive screen, which they
regularly broke (it was the iron horseshoes that was the problem) until
someone (I think it was Rudolf the Red) suggested that they use their
noses.

By the time I finished training the maintenance dwarves, whose idea of
fixing things seemed to be to hit them with a hammer, and handed the
system over to the team of pixies who would be running it and doing the
software maintenance, it was the middle of November, and the system had
to go live without any proper testing.

I collected my fee from Santa (I insisted on five-pound notes, having
seen what happened to fairy gold) and went back to London, expecting to
get a call at any time.  The design is sound, but it is a worryingly
large system, and I'm not sure how the blessings on the disks will stand
up to actual use.  I'm also worried about some of the magic that the
fairies used in the software engineering, and if those dwarves start
bashing around with their hammers ...

Well, you see the problem.  The job was rushed, the documentation is
inadequate, the testing was non-existent.  I'll be very surprised if it
all hangs together for this year's peak, and it really wants re-doing
properly after the rush is over.  If I were you, I wouldn't rely on
getting your usual annual visit this year.  If you want your little
customers to be sure of getting their presents, you should go out and
get them yourself, and pretend that they've come from the usual source.

Saturday 21 December 2013

A Computer for Christmas

I wrote this story nearly 30 years ago, so the techology has moved on since then - but not by much. Although you can buy four terabyte hard drives now.


A Computer for Christmas


Sir Sangrathta and Mrs Claus we having a terrible row again.  "You're
always down at the factory", she said.  "Even the reindeer see more of
you than I do".  "I can't help that", said Sir Sangrathta, "I have a
very important job to do, and you know what happens if it doesn't get
done."

Both of them fell silent at the appalling thought of a failure to
deliver the merchandise on time, to the right customers.  Even worse
than the impact on the customers, would be the impact on the
customers' parents, driven close to insanity by this failure.

"There are so many of them these days", complained Sangrathta, "and
they all want so much, and it's all so complicated." "You ought to get
a computer", said Mrs Claus.  "I've got enough toys already", he
replied.  "No, I mean a proper one, a business machine."

I was sitting at home, trying to write a device driver for a quarter
inch tape drive, when some appalling noises came from the roof.  The
noises got louder, and started coming from the wall, and then
suddenly, in my fireplace, there sat a bearded, rather portly, but
distinguished looking gentleman in a dark blue pin-striped suit.  He
picked himself up, and introduced himself - it was Sir Sangrathta
Claus.

I looked at my watch.  "You're a bit early, aren't you?" I said,
noticing that it was only half past May.  He ignored that, sat down
and said "I have a problem."

That little phrase is one I hear twenty times a day.  Usually, I can
help people over the phone, in five minutes, off the top of my head.
Sometimes I have to spend a few hours unscrambling a disk for them.
But occasionally, "I have a problem" turns into a major consulting
project.

Sir Sangrathta explained the problem, and it certainly sounded like a
doozy.  Each year, he received and had to process over two billion
orders.  Most of those were received in the month of December, most of
them were in an illegible hand-written scrawl, most of them didn't
give a delivery address, and they all had to be delivered on the same
day.

But order processing was only part of it.  He also had to make sure
that the manufacturing process ran smoothly, so that product was
actually available in adequate quantities and to the correct product
description, in several thousand categories.  Raw materials had to be
ordered and paid for, he needed invoicing of the orders (and
statements to remind late payers drawn up) and last, and by no means
least, delivery had to be arranged at the right place and, most
importantly, at the right time.  It was an administrative nightmare.

"How did you get into this mess?" I asked.  "It was fine a few hundred
years ago", he replied.  "I really enjoyed it then.  Seeing the little
faces of the customers light up made it all worth while.  And life was
simpler then, there were only a few product lines, and only a few
million customers.  But it just grew and grew, and I'm working twenty
hour days, and I'm getting an ulcer, and I have rows with Mrs Claus,
and I can't take it any more." He put his head in his hands, and
looked miserable.

"There there", I said, because I couldn't think what else to say.
"Can you help me?", he said.  "Why don't you just give it up?" I said.
He looked at me.  "Can you imagine the consequences of that?"

I thought of my two, and the way they look forward to the Big Day, and
how they write little notes, and leave a mince pie for the reindeer,
and get up at 6am and start unwrapping.  I thought about the
alternative;  I thought about a tree with no little parcels, about the
disappointment and tears.  But most of all I was multiplying two
billion customers by ten presents by about £10 profit per customer,
and I was losing track of the noughts, and I thought about one percent
of that, and tears came to my eyes.  I agreed to take on the job.

I packed my warmest woollies, a portable PC, and we set off.  I was
quite surprised at the conveyance we used;  I'd expected a sleigh, but
it seems that 747s are much faster and more comfortable.  We took the
morning flight to Tokyo - this flies the great circle route over the
North Pole, and if I was surprised to be on a jumbo jet, imagine the
surprise of the stewardess when we left the plane at latitude zero.

As we floated down on our parachutes, I had a chance to look around.
There didn't seem to be any buildings or installations, but I could
see a glowing red beacon, and we headed for that.  As we got closer, I
could see that the beacon was attached to a horse with horns, and when
we landed nearby, I realised that I was looking at a genuine reindeer.
Santa introduced me - "Dr Solomon, this is Rudolf the Red, my
foreman."

We were standing next to a small hut - surely this couldn't be the
mighty Claus empire?  He opened the door, revealing a flight of steps,
and we hurried underground, out of the bitter cold.

First, we went to reception.  All the cryptic handwritten orders come
here, to be decoded by expert graphologists, and typed neatly onto
official order forms by the fairies.  At the same time, the little
customer's name, address and invoice address is added, as they often
leave this out.

Next, we went to the Great Hall.  The place was gigantic.  Bands of
elves ran to and fro clutching papers, teams of trolls carried great
palletised loads, and dwarves carrying axes and hammers ran around in
groups of seven.  It was a kind of organised chaos, but overhead was
something truly remarkable.

Do you remember when shops sent dockets and change around on overhead
wires, and the sales person would put your order and payment in a
little cylinder, pull a handle, and it would go "chung" and the
cylinder carrying your order would fly off to the bowels of the shop.
And then it would come back with your change in a little cylinder.
Well, the air was thick with wires and cables, and the sound of
pull-chung was going all the time.  This was their communications
system, and in 1888, it was the very latest technology.

"When we put this in, we could pension off the pixies that used to
carry messages;  the pull-chung machines are much faster and more
reliable" explained Santa.  This contraption carried the orders from
the fairies to the elves, who sorted them by product line and made out
production dockets for the dwarves.  The dwarves made product to
satisfy these dockets, but they had a small number of goblins keeping
an eye on raw materials, who sent messages back to Purchasing if
anything ran low.  Purchasing was run by a group of wood-nymphs, and
they were constantly receiving requests for raw materials which they
filled by sending orders down to the kobolds in the mines that were
attached to the complex.

Finished product was shrink-wrapped and palletised, carried by the
trolls to the order-assembly points, where the griffins made up the
orders, working from the elves dockets.  These orders were passed to
the reindeer, who sorted them out into geographical drops, ready for
delivery on the big night.

The whole thing was unbelievably complicated, and the same data was
being copied again and again, but sometimes wrongly, and sometimes the
pull-chung machines misrouted or got stuck, invoicing details were
lost, delivery addresses weren't available, or the customer specified
an inappropriate product and no-one noticed, or credit was being
over-extended, or raw materials were ordered too late or in excess,
and some products were being over-produced and lay in great unwanted
heaps - it was a true shambles.

Sir Sangrathta and I retreated into his office, away from the din of
the pull-chung machines.  "This is hopeless", I said.  "I know", he
said, "Do you think a computer would help?" What a question!  Anyone
with half a brain could see that they had a problem that was a
standard business problem, solved with computers millions of times all
over the world.  the only difference was the scale of the problem, but
computers have got pretty powerful these days.

I set to work with a pencil (2B) and paper.  People sometimes ask me
why I use seventeenth century technology to design 1990s systems, but
the answer is simple - if I sit down at a computer, the temptation to
jump in and start coding is irresistable, and coding without design is
a capital error.

Obviously, we needed a LAN.  Equally obviously, no ordinary LAN would
do.  We needed to put order entry on it, customer address look-up,
order processing, invoicing, statements, delivery planning - the lot.
And everyone in the Sangrathta organisation would need access to the
database, which would be immense.  I did a few sums;  two billion
customers, perhaps 1k of information each, means two terabytes (two
million megabytes) of data.  Um.  I don't think you can get a disk
that big.

So how can I store two terabytes?  There are really only two ways -
the first is to use a mainframe (spit) and the second is to use
100,000 20mb hard disks.  But to use 100,000 hard disks, you need
50,000 computers, as you can only put two disks in a computer, because
of the way that hard disks are controlled.

This isn't as silly as it sounds.  I was going to need that many
computers anyway, to act as data entry or display screens, and to
control the output devices, and to do the processing.  It all fitted
together nicely, except that I couldn't see how to network that many
computers.

Networks can work in one of two ways;  the problem is that you can't
really have two computers sending messages down the network at once,
they have to take turns, and the problem is how to organise that.  The
token passing method works like a relay race - whoever has the baton
can do the running, and when you've finished with the baton, you pass
it on to anyone who wants it.  The good thing about this method is
that it is very organised, and performance is very predictable.  The
trouble is, there is only one baton, and if you have 50,000 computers
all competing for it, the ones at the far end will never see it.

The other method is CDMA, otherwise known as free-for-all.  Any computer 
wanting to use the network looks to see if it is free - if it is, it tries 
to grab it.  If it isn't, it waits.  If two computers try to grab the 
network at once, they collide, and they both back off and each waits a 
random time before trying again.  This is much less organised, but at least 
every computer stands some chance of getting control of the network for a 
while.  I decided to use this type of network, which means using Ethernet. 

In order to give each computer a chance to actually get some use of
the network, I had to minimise the time that each one spent hogging
it.  So I had to go for a very fast system, capable of carrying a lot
of traffic, and that meant optical fibres.

Next, I had to think about which database to use.  That wasn't very
difficult, actually.  End-user tools like dBase won't work in an
environment where the data is spread over 50,000 computers.  You have
to use a truly relational database, which faithfully sticks to all Ted
Codd's twelve rules.  With such a database, it doesn't matter where
the data is actually stored;  your program doesn't have to worry about
that.  Unfortunately, there aren't any databases that conform to all
the rules;  and that left me rather stuck.  But I shelved that problem
for a while, and thought about the cabling.

Cabling is always a nightmare.  You have to take up the floors, or
pull through ducts, and the curves are always too sharp, and there's
always a fault at the most unreachable bit.  It was worse here - there
was no floor apart from the bare rock, and I didn't fancy taking that
up.  Nor was there a false ceiling to lay the cables over, I though,
ruefully glancing up;  then I realised that the pull-chung machines
could serve a second purpose.  I'd use them to carry my optical fibre
cables.

The file server was easy - we didn't need one, as the database was
totally distributed.  But the output was difficult, as we needed to
fake hand written greetings cards.  My first thought was to use
flat-bed plotters, but then I worked out that we'd need about a
million of them, as they're quite slow, and we'd need a pixie to
change the paper for each one.  Then I remembered that hand writing is
just a different kind of font, and I decided to use laser printers
with soft fonts.  Because lasers are quite fast, I only needed a
thousand of them, and could attach them to the computers that were
already in the network.  I would also use those lasers for invoices,
delivery notes, statements and reminders.

I went to Sangrathta with my design.  Naturally, he noticed the hole
immediately - "Where are you going to get a relational database?", he
asked.  I admitted that I didn't know of one, and mumbled something
about asking Ted.  He beamed.  "I've got a better idea", he said.
"Would you like your present early this year?".  I must say I didn't
believe he could do it, as writing a truly relational database isn't
something you tackle lightly, but when he summoned the Chief Fairy,
and explained what he wanted, and the Chief Fairy waved his magic
wand, and there was a poof, and a nicely wrapped box appeared out of
nowhere, I swallowed my doubts.  And when I unwrapped it, it was
called "Truly Relational Database", by Ted Codd and blow me, it was.

So the plan was complete - all we had to do was implement it.  Have
you ever tried to buy 50,000 computers?  We tried Amstrad, but they
wouldn't give us any kind of discount, even for that quantity, as we
were end-users.  We tried several of the lesser-known manufacturers,
but they all said that 50,000 was more than they sold in a month of
Sundays, and they couldn't supply.  Just as we were about to give up,
and buy lots and lots of different brands (which would lead to lots
and lots of incompatibility problems), I remembered one more supplier
that we ought to try, who was probably big enough to supply, and who
offered Volume Purchase Agreements to major customers.  I phoned up
IBM.

IBM were surprisingly helpful.  Yes, they could supply that quantity;
Yes, we could have a large volume discount;  Yes they could deliver
(although I heard a strangled noise when I told him where to) and Yes
there was a local dealer to support us - Moomintroll Technologies.
The Moomins were very helpful indeed, which wasn't surprising when I
went to visit their premises;  they weren't terribly big, they'd only
ever sold one other computer before (apparently, the first one went to
Rudolf the Red, and was being used to run the union).

Then I thought about the Ethernet cards - again, the problem was
getting 50,000 of them.  I went to the largest card manufacturer I
could think of;  Western Digital, who make just about every hard disk
controller that is ever sold.  They didn't sell an Ethernet card, but
when I explained what I wanted it for, and that we'd want 50,000, they
did a few sums and designed one just for us (which they now market
generally, and quite successfully).

Putting the network together went well.  The computers were solid IBM,
the Ethernet cards were good quality, and even stringing the cables
was done easily by the nimble elves, running along the pull-chungs and
tying them to the wires with pretty pink bows.  To help write the
software, we drafted in a herd of Unicorns.  This might sound unusual,
but remember that Unicorns are already familiar with Unix (indeed,
that operating system was named after them) and so are at home in a
multi-user environment.  They seemed to get on well with Truly
Relational Database, so I left them to it, and started organising the
training.  Yes, training.

I've seen too many major projects fail because no-one thought to train
the users in how to use it.  Even with the most user-friendly systems,
people are nervous about using it until they've been shown how.  So we
organised mammoth training sessions, and it turned out to be just as
well, as most of the users had never seen a computer before.

Round about December, we were ready.  The hardware worked (and if a
computer failed, a squad of dwarves would rush in and replace it).
The network worked (unlike most networks) because this one had been
properly designed.  The software worked, because Unicorns are fabulous
beasts, and magic to boot.  So nothing could possibly go wrong - and
if you believe that, you'll believe any fairy story.

The problems came from an unexpected direction.  Sir Sangrathta
decided, without telling me, that the system would work first time.
So when I tried to run the system in parallel with the old system, I
found that the old system had been chucked away, and we had to go live
on an untried system.

To my surprise, the system worked - the unicorns had worked their
usual magic.  Everything was running smoothly right up till December
23rd, when the reindeer started to use the system to organise the
deliveries, and then all hell broke loose.  In particular, what
happened was, Rudolf the Red called a strike.

It seems that reindeer hate unicorns - something to do with having the
wrong number of horns.  So when Rudolf's herd started using the
system, they complained about the user-unfriendliness of the system
"Reminds me of Unix", said Rudolf.  Then they complained that the
keyboards were too small (and looking at their hooves, I could
sympathise) and about the radiation hazard that they'd heard VDUs
represented, and about the chairs they were supposed to use (again, I
suppose I hadn't really thought about the fact that reindeer are a
different shape).  The strike spread, until the whole works was out.

I went to see Sir Sangrathta, but he'd left a note for me that said
something about nervous breakdowns and he'd done a bunk with Mrs
Claus.

So here I sit, all alone in this huge, deserted, Great Hall, trying to
wrap up twenty billion presents.  I've done about three hundred so
far.  I haven't even thought about how I'm going to get them
delivered, or invoiced, or anything.  I need help, and soon.  Please
come and give me a hand, or a lot of little customers are going to be
terribly disappointed this year.

Drive down to Heathrow, and park in the Long-term car park - this is
going to take a while.  Get on to flight BA242 to Tokyo, and when you
compass needle spins and tries to stand on end, open the door, shout
"Geronimo", and jump.  Oh, and don't forget to put your parachute on
first.