Wednesday, 7 June 2017

Railroads to the Gold

For someone raised in Europe, the sheer scale of the American West is hard to grasp. It takes a long day of driving to get from San Francisco to Las Vegas. But when you finally arrive, after 10 hours or more on the road, you are still only about a third of the way to the Rockies. To cross Nevada on US Route 50 will take all day, if you stop from time to time, and you will pass through almost nowhere, just endless desert and mountain ranges. Not for nothing is it called "the loneliest highway".

But it was the railroads that made the West, not roads. The first transcontinental railroad connected California to the then edge of civilisation at the Mississippi, nearly 2000 miles away. It was built in the astonishingly short time of 6 years, crossing the vast deserts of Utah and Nevada, the Rocky Mountains and even more challenging Sierra Nevada. Apart from the vast hostile terrain, its builders also had to deal with the understandably hostile natives, who would see their homelands torn away from them as a consequence.

The first main lines in Britain were the London and Birmingham and the Great Western, from London to Bristol. These were both a bit less than 100 miles long, nothing at all compared to what was needed in the US. Once the trunk lines were built, in both countries, there was the opportunity to build branches to serve other towns. A typical British branch line was 10 or 20 miles long. It would carry a daily goods train, stopping at every station to set down and pick up wagons, and a handful of daily passenger trains, also stopping at every station.

There were branch lines in the West too, but they ran to hundreds of miles. In 1905, gold was discovered in a truly middle of nowhere place, soon named as Bullfrog, about half way between Las Vegas (which itself barely existed at that time) and Reno. Very quickly the towns of Rhyolite and Beatty were established.

Immediately there was a need for railway connection to this new bonanza. And so not just one, but three separate lines set out across hundreds of miles of desert to reap these new-found riches. One, the Tonopah and Goldfield, came from the north. From the south two completely separate lines were started, built by rival organizations: the Tonopah and Tidewater, heading due south across arid desert for two hundred miles, and the Las Vegas and Tonopah, starting from a junction with the Union Pacific at Las Vegas. They were originally supposed to be a single line, but their founders had a serious disagreement and each decided to build their own line.

Building these lines across the desert was a massive undertaking. They ran on the eastern fringes of Death Valley, the hottest place in the world where summer temperatures routinely exceed 50°C. The men worked in gangs, one digging while all the others threw cold water - a precious and expensive resource itself - over him and each other. No reasonable person would try and work in the summer heat of the desert - but there was money to be made, every day the railway wasn't built was revenue lost.

But gold mines are fickle things. The Bullfrog deposits gave generously but were quickly exhausted. By the time the railroads had been built across the desert, a total of 500 miles (25% further than from London to Edinburgh) the mines were played out. Already the population of Rhyolite had fallen drastically, from 5,000 to around 1,500. When people moved out they took their houses with them - they were simple wood structures, easily reduced to planks and nails, and wood was expensive.

The railway station, though was a much more permanent edifice. In fact even now, after a century of neglect and abandonment, it is still standing, the only intact building in the much-visited ghost town of Rhyolite.

On lines this long, train services were much less frequent than on Europe's shorter branches. There would be at most one daily passenger train, taking all day (or all night) to cover the 200 miles of track. As services ran down, reflecting the reality that there was really no traffic left, the services was reduced to every two or three days.

In summary, by the time the railway got to Rhyolite, there was nothing for them to do - "all steamed up and nowhere to go".

Rhyolite Depot, still standing in 2017
As you'd expect, the two southerly lines were quickly rationalised. The Las Vegas and Tonopah stopped running trains in 1919, after just 11 years. It had never made sense for there to be two lines, even if Rhyolite had prospered for much longer.

In Britain it wasn't unknown for railways to be duplicated for purely competitive reasons, just not on this scale. The tiny town of Ramsey, Cambridgeshire (population 5000) had two lines that met head on, one built to stop the other invading its territory. But each line was only about 10 miles long, not 200.

The Tonopah and Tidewater scraped a living shipping borax from the quarries around Death Valley. It also tried to become a tourist line, feeding the 1920s Furnace Creek Inn in the valle via the narrow-gauge Death Valley Railroad. It never fulfilled the promise of its name - Tonopah was 100 miles north of the Rhyolite terminus, while the closest it got to tidewater was at Ludlow, in the middle of the Mojave desert 200 miles from the sea. Somehow the line struggled on through the 1930s, despite major flood damage in 1933 and 1938. It finally closed in 1942, and now it's very hard to find any trace of it.

The Tonopah and Goldfield hung on for a bit longer, not closing until 1947. It scraped a living serving the ranchers and the small remaining mining activity in the desolate area between Beatty and Tonopah. Many of the ties (sleepers) were sold to Scotty's Castle for use as firewood, where they remain in a huge pile.

Today it's the first line to close, the Las Vegas & Tonopah, that is the easiest to find, since most of highway 395 from Las Vegas to Beatty follows its path.

It seems incredible that 500 miles of railway would be built, in the amazingly short time of just three years across uninhabited, desolate country, to serve a single collection of mines. And sad that despite that, the mines were already running down by the time they got there, leaving them to eke out an existence serving a population that barely existed.

Sunday, 30 April 2017

What Does "The" Mean?

It's a word we use a thousand times a day, but trying to pin down its meaning turns out to be really quite hard. What does "the" mean? What is the difference between "the house", "a house" and just "house"?

To a native speaker of English, or another language that has the equivalent word (like French or German), it's so intuitive that it will seem like a silly question. But for speakers of languages that don't have it, like Russian, it's a mystery. It's very characteristic of native Russian speakers to speak and write without articles, like "Where is station?"

(There's an old joke about a Russian who arrives in England at Victoria station (I said it was old) and realises his watch has stopped. He approaches someone, who just happens to be a professor of philosophy, and asks, "Excuse me please, what is time?" To which the answer is, "That, my friend, is a very difficult question.")

A little thought shows that "the" somehow ties the noun in question to some mutually shared context. More than that depends entirely on the context in question. One of the harder questions in computational linguistics (and there are plenty of them) is to figure out the referent (what is being talked about) when "the" is used.

If I say to my partner "where is the car?" it is implicit that I means our shared car, or the car we happen to be using at the moment. But if I say "I saw a bad accident yesterday, with a car and a bus. The car rolled over",  it means a car we've never talked about before, one I introduced in the previous sentence. I can even introduce a previously-unknown referent with "the". It's a common turn of phrase to say something like, "The car that parked in my space yesterday was back again today." It's really a shorthand for "There was a car that parked in my space yesterday, and it was back again today."

If I walk up to a stranger in the street and say "Where is the car?" they will just be puzzled, because they have no context to identify any specific car. But if I ask "Where is the station?", they will apply common sense to assume I mean the station in the town we happen to be in, or the nearest station.

"A", by contrast, implies something that is brand new to our discourse. "I bought a hat yesterday" means some hat that we've never spoken of before, at least when uttered all by itself. (It could be followed by, "Remember, the green one we saw last week", which changes the meaning completely).

Many, probably most, languages get along just fine without being able to make this distinction. Japanese has an interesting variation, the so-called "topic marker" (は, pronounced "wa"). This is generally considered to be very difficult for foreigners to get the hang of, yet if you think of it as "the" you will get along just fine. It is in opposition to the "subject marker" (が, pronounced "ga") which is somewhat equivalent to "a". If I say "car-wa has broken down", it means (in the absence of some other context) "my car" or "our car". But if I say "car-ga has broken down" it means "some other car, that we didn't know about before", maybe to explain a traffic jam - which particular car is unimportant. (Like everything in language it's more complicated than this, but it's a good enough explanation to get by with).

The thing that suddenly made me think about all this was something I wrote recently. There is another meaning of "the" where the referent is the notion of the thing, rather than the thing itself. If I say "The car has changed the way people live", it's obvious I'm not referring to any particular car, but rather the idea of the car, car-ness in general. We use this meaning without even realising it, yet it is completely different.

I wrote a blog article called "The Five Pound Note". It started out as a general discourse on British currency in general, and the banknote worth £5 in particular. But then I told the story of one £5 note in particular, that dropped from my mother's purse while we were boarding a bus when I was a child. In other words, I had switched the meaning of "the" in mid-article. This use of "the X" to mean (roughly) "some X which you'll find out about if you read this" is very common in literary titles: The Very Hungry Caterpillar, The Mouse That Roared, The Sting.

All of which is one small part of why computers have a long way to go yet before they can really figure out natural languages that humans use all the time without even thinking about what they are trying to say.

Monday, 10 April 2017

The Five Pound Note

I'm just preparing for a trip back to the UK. As usual I'm assembling a little bag of UK banknotes and change,  but this time I'm being a bit more careful since the current one-pound coin and five-pound note are about to be withdrawn and replaced.

The one pound coin was introduced in 1983 - until then we had the pound note, which (unlike any modern British notes) was green. And before decimalisation in 1972, there was even a note for half of one pound, the 'ten bob note' (ten shillings, 50p in modern money). It was a little smaller than the pound note, and a reddish-brown colour.

The ten-bob note still lives on, in the colloquial expression, "bent as a nine-bob note" - meaning dishonest or corrupt. "I wouldn't buy nuffin' from that lot, they're all bent as a nine-bob note". Because a nine-shilling note would necessarily be a forgery. And also it alliterates nicely.

Five pounds used to be serious money, at least for a working class family like mine, as I once saw very vivdly. I must have been about seven or eight. We were on our annual week's holiday with my grandmother in Dovercourt, close to the ancient (and still very important) port of Harwich. She'd retired to a tiny cottage there around the time I was born. It was just big enough for her, my parents and myself, my parents sleeping on what must have been a horribly uncomfortable convertible sofa (a "put-u-up") that had to be unfolded after dinner every night and restored to its daytime function every morning. To a small child it was a paradise. The beach, with its choc-ices and endless civil engineering possibilities, was short bus-ride away on the exotic green Eastern National bus. There was a ferry across the estuary to Felixstowe, with its fairground, and walks along the promenade to see the long-disused lighthouses.

We had just got off one of those green buses, on our way to the beach, when my mother gave a gasp of horror. One of those five pound notes was missing from her purse. She was sure she'd had it when we left, so it must have come out somehow during the journey. That single banknote represented most of our holiday budget. My father earned about £30 per week, as a shop assistant selling the odds and ends that went into the then-thriving East End clothing industry along with the fabric itself.

My mother wasn't given to tearful outbursts, and I don't remember her crying, but it was certainly a very stressful moment. I remember her doing the mental arithmetic to see what kind of holiday we could still have on the remaining money in her purse. She tried to reassure me that everything would be alright, but I don't think it would have been.

In desperation, she made a phone call to the bus depot which occupied a very central position on Dovercourt's main shopping street. And, miracle of miracles, someone had seen the note fall and given it to the driver, who had handed it in to the depot as he drive past. I think maybe my mother did cry then. I won't say "that would never happen today", because I think these random acts of kindness are still common enough, and people were no more honest then than they are now. But certainly it was a huge stroke of good luck.

And there was better to come. My mother jumped on the next bus into town and rushed into the garage. The rule was that the bus company took 10% of the value of any lost property, as a way to cover their costs in handling it. Getting 90% of our holiday budget back was a lot better than losing it all, but it was still a significant dent.

The man in the bus garage office said to her, "Well, rightly we ought to take ten shillings off you. But you called almost before it was handed in, so it don't seem right really." And gave her back her whole five pound note, without taking the 10% they were entitled to. Really I'm sure he just felt sorry for my  mother.

So our holiday proceeded with its intended budget after all. The fact that I still remember all these details - I can even remember where we were and what kind of bus it was (a Bristol MW or LS single decker, since you didn't ask) - speaks volumes about the impact this little incident had on a small boy at the time.

Saturday, 4 February 2017

The Unstoppable Mr Bouncy - an LGB Track Cleaner That Works

When I started to put together my LGB garden railway, I quickly realized I would need some way to keep the track clean. The brass rails oxidize quickly outdoors, not to mention getting covered in bits of leaf and general garden dirt. Clean track with a bright, conductive surface is essential for smooth operation.

It’s possible to clean track by hand, of course. I have about 100 feet of track - small by garden standards - and it is a thoroughly unpleasant and back-breaking job, shuffling around the garden on your bottom, scratching away at a couple of feet of track at a time. There has to be a better way.

LGB have thought of this, and they give you two possibilities. One is a goods wagon with a couple of tiny abrasive pads on the bottom. Experience with even a small, indoor layout shows that these quickly wear out and get clogged. The Rolls-Royce alternative is the Track Cleaning Loco, styled after the yellow track maintenance vehicles you see all over the world. At least, originally they were yellow. When they introduced a DCC version, it became red.

I found a used yellow one, pre-DCC, on Ebay. With the installation of my usual NCE decoder, it was good to go. It would trundle around the layout, its cleaning wheels grinding away and leaving fresh, shiny track behind it. Perfect. At least, for a couple of feet. Then it would stop - because the track was dirty. It has a very short wheelbase, so it only takes slightly uneven track plus a bit of dirt for it to be deprived of power. This is a problem for all locomotives, but for one whose job is to take care of dirty track it completely defeats the objective.

As shipped, there is no control to turn on and off the cleaning motor. If you drive the loco forwards, it cleans as it goes, making a terrible noise that sends our cat scrambling for the fence. In reverse, it runs quietly and without cleaning the track. Neat, but not always convenient.

Early in its life, it had a disaster. While I was tinkering with it, body removed, a loose wire touched the track, shorting the track power to the motor. This fried not only the decoder, but also the LGB board that runs the lights and so on, and even some of the external electrics of the layout itself. I took advantage of that to do a full DCC installation, using a cheap Chinese voltage step-down board to supply an adjustable voltage to the cleaning motor. This could now be controlled using DCC with a relay to switch the power to it. It pulls about 2 amps, way beyond the auxiliary output of the decoder.

It was operable again, but still needed clean track to work. It bounces along the track quite violently as the cleaning wheels oscillate against its movement, so much so that we christened it Mr Bouncy.

The first year that I reopened the layout in spring, I had no choice but to clean the whole layout by hand. It really is a miserable job, and it persuaded me to try and make Mr Bouncy actually work.

My first attempt was to fit NCE's own booster module. This uses six one-farad supercaps in series. Supercaps are amazing things. Until about 10 years ago, the largest capacitor you could get was about 100,000µF. And it was huge. Supercaps use a different technology making tens end even hundreds of farads perfectly practical. The only problem is that they run at very low voltages - normally 2.7V. The NCE booster turned out to be useless - it can only run at 15V, so I had to turn down my 18V track voltage. That upset several of the locomotives, and made smooth running much harder. And it just didn't have enough capacity for a loco as large as this. - in fact it had no effect at all.

Nevertheless, supercaps are a very attractive solution to the problem. I thought about various ways to use them. I bought a bag of 10 30F units, and just for the sheer ridiculousness of it, a 350F supercap, which is about the size of a D-cell battery. Unlike a battery, though, it will cheerfully supply tens or even hundreds of amps for as long as it is charged.

The problem is that supercaps have to be carefully managed. You can connect them in series, but even so you have to to do something to ensure that none of them go over the individual voltage limit. You also have to control the charging current - a discharged supercap will cheerfully pull hundreds of amps. That looks like a short circuit to the rest of the layout, and will just shut down the power supply. There's a very nice chip (the LTC3350) made to deal with exactly these problems, but it's not suitable for the kind of amateur construction I'm doing. For one thing it's only available in a PQFN package, which requires industrial machinery to solder.

So I tried a different approach. I bought an LGB crane wagon on Ebay, and fitted it with metal wheels and a connector to feed the loco. I figured that the extra wheels and longer wheelbase would allow it to find a way through dirty track. It helped a little, but not much. The cleaner would still not go round the layout, even when the track was in reasonable shape, without constant attention and the occasional prod.

So it was back to the supercap solution. There are two problems: how to reduce the track voltage to something acceptable to the supercap, at the same time controlling the charging current; and how to bring that voltage back up to the 18V or so that the decoder is expecting.

Electronics, Ebay, and cheap Chinese modules to the rescue this time. There are switch-mode power supply chips that do these jobs, and better yet, you can buy them assembled into modules for under $5. My solution used two of them: one, a buck converter, to reduce the track voltage to 5.2V to feed two 30F supercaps in series, with a constant current mode allowing the charging current to be controlled to 2A. They're in series because the boost converter, that turns 5.2V back into 17V supposedly requires 5V to operate. In reality it works fine down to 3V, but not 2.7V. The two of them fit side by side on a board along with the two supercaps and a few other components, and the whole assembly just fits into the available space in the front part of the loco, above the cleaning wheels and motor. A clever design would allow the two converters to be combined, using a single inductor - that's precisely what the LTC3350 does. But it would have taken a lot more of my time than just soldering a couple of modules to a board.

The extra parts are quickly explained. The two big diodes on the left are 1N5422 5A Schottky diodes. They feed the higher of the input voltage and the output of the converter, to the output. The converter is set to slightly less than the track voltage, so its output is only used when the track voltage is absent. The smaller 1N4001 beside them ensures there is no reverse current through the step-down converter. The LED and zener at the top right show when the supercaps are charged close to 5.2V. There is a second supercap under the board, fitting into the gap between the wheels.

One modification is required to the decoder, which isn't designed to work with a booster like this. The power input circuit, consisting of a bridge rectifier and a smoothing cap, needs to be separated from the rest. Luckily, in the case of my usual NCE decoder, this can be done by cutting just one track, and soldering wires either side of the cut to connect to the booster. First the heatsink must be removed from the base, by cutting the shrink-wrap that holds it in place. The picture also shows one of the extra wires soldered on. Once the modification has been made and tested, the heatsink is replaced and held in place with a new piece of one-inch shrink wrap.

Finally it was time to test Mr Bouncy on the track. And this time, he worked perfectly. The track was filthy, unused for several months and black with oxide. I cleaned a short stretch, put Mr Bouncy on it and left him to charge - it takes about 30 seconds for the supercaps to charge fully. Then I set him slowly in motion. It was a pleasure to watch. The cleaner motor runs only on track power, so you can easily hear when power is interrupted. But the traction motor uses the booster. He will continue to trundle along slowly for up to about ten seconds, invariably enough to reach good power again and recharge. At first the cleaner runs only very intermittently, but on the second pass the track is a little cleaner and by the fifth pass it was running almost continuously, leaving beautiful shiny rails behind himself. A handful of times he did stop altogether, but the small current available through the dirty rails was enough to slowly recharge the supercaps, until he nudged along a few inches and then reached good power again. He can just be left to make a dozen or so circuits of the whole track, without any supervision at all.

We're very close to perfection now. One remaining problem with Mr Bouncy is that the rails aren't cleaned evenly. For some reason a little oxide remains over the sleepers, but not in between them. Clearly the height of the railtop is not exactly constant. I think the solution to that is to attach a conventional "scraper" type rail cleaner behind him, to finish the job off, and I've just ordered one of those. It is a real pleasure to watch him going round and round, occasionally idling along under his own power but never coming to a stop. And much easier than doing the job by hand. Though our cat, Missy, doesn't really agree.

Wednesday, 9 November 2016

School Computing, 1960s Style

As a teenager I was fascinated by computers. This was the mid-1960s, when a typical computer had a whole building to itself, replete with whirring magnetic tapes. The personal computer was still two decades away. My local library had a huge selection of books on the subject, as it did on even the most arcane topic. Why, remains a mystery. So I had read all the then-famous books by Daniel D McCracken on each of the programming languages of the time - Fortran, Cobol, IBM 360 Assembler, and Algol 60.

But my learning was strictly theoretical. Only huge companies and a few well-endowed universities owned them, and access for a working class lad was out of the question. Like the Poles, who at that time did magnificent work on the theory of computing simply because the real thing wasn't available to them, all my computing was done in my head.

My dreams were given unexpected reality thanks to a certain Bill Broderick, at the Royal Liberty School a few miles away in Gidea Park. He was the first person in the country to see that schools needed computers. Somehow he raised the money to buy one of the first minicomputers, an Elliott 903, which was installed there and available to all the schools in the area. The term "minicomputer" is strictly relative. This one was the size of a large chest freezer and with its anciliary equipment still took up a good sized room - but not a whole building.

I was about 14 when one of my teachers asked me if I was interested in using it. Normally that was a privilege reserved for sixth-formers (16 upwards). Of course I said yes.

Timesharing had yet to be invented, so each school had a scheduled session of a couple of hours with hands-on access to the machine. Ours was at 4pm on Fridays. Half a dozen of us would go down there, usually in our maths teachers' cars, to run and debug our little programs.

The only input/output for the machine was paper tape. No printer, no terminals, not even flashing lights. Programs were laboriously written out longhand on special sheets, one box per character, then prepared offline by unseen typists. In theory we would take along our programs, run them, get the result on paper tape, print it, and there we were, successful programmers. In practice it never worked like this. When mistakes were found, there was no editor. Programs were corrected using the venerable ASR33 teletype, copying the tape and stopping it where needed to make changes. The ability to sight-read paper tape was essential.

All student programming was done in Algol 60, or at least the 903's subset of it. It was a miracle to have a compiler that would run on such a tiny machine. Several tricky language features were omitted, such as call-by-name and recursion. Even so running a program involved two passes. In the first, the compiler was loaded from a spool of paper tape about four inches across. Now the program tape could be loaded. If all went well, an object tape was produced. If not, the output tape contained error messages. Or rather, error numbers - there wasn't room in the machine for verbose text. Meanwhile, there was time to hand-rewind several hundred feet of tape ready for the next user.

If things went well, the next step was to load the run-time interpreter, another substantial spool of tape. Then the object tape could be loaded, and now the program would run. If it worked, it would produce its output, again on paper tape, which could be proudly printed on one of the ASR33s. If not - well, time to figure out why not.

Our programs were very simple - print the prime numbers under 100, print the first few Fibonacci numbers, that kind of thing. Just as well, because there were absolutely no debugging aids. With no interactive terminals, interactive debugging was unthinkable. What a luxury it seemed when I could use ODT (Octal Debugging Tool) on the PDP-8 at university!

The computer had a loudspeaker, wired to some internal signal which caused it to emit a tone that depended on what the computer was doing. There was a program that made it play simple tunes. Often you could tell how it was doing with a calculation by the noise it was making. One of my programming adventures was to code the highly recursive Ackermann's function (which involved some ingenuity to get around the lack of recursion in Elliott Algol). It made a very distinctive whoop-whoop noise which changed as it went up and down the recursion stack. You could even get it to play music with very careful tuning of instruction times.

The computer lab also had one of the very first electronic calculators, a Sumlock Anita. This was a wonder to behold. It could multiply and divide as well as add and subtract. It displayed its output on a row of Nixie tubes. Its internals were a very clever vacuum-tube arrangement using very few components to achieve all that it did.

The 903 had an 18-bit word, quite common before everything aligned around 8-bit bytes. There were 8192 of them, using core memory where every bit was represented by a little ferrite doughnut. Inside the cabinet, each of the 18 bits was implemented by a singe large board. When things weren't quite working, standard practice was to open it up and run a hand down the boards, reseating them.

It was a classic von Neumann architecture. There was a single register (the accumulator). An instruction used 4 bits for the opcode, 1 to mark indexing, and 13 for the operand address in memory. The memory access time was 6µS, and instructions generally took about 25µS. That included the time to read the instruction pointer and the accumulator, which were both stored in core memory to reduce the amount of expensive transistor memory required. There was hardware multiply and divide, taking about 75µS each, but no hardware floating point. If you needed that, there was a software library called QF that did about 1000 floating operations per second.

The Elliott 903 instruction set, including timings. The handwritten figures
to the right are for the new Elliott 905.
There was an assembly language called SIR, which was a classic assembler. Its one oddity was that there were no acronyms for instructions. You had to remember that 4 was "load accumulator", 5 was "store accumulator", and 14 others. I guess it wasn't hard, since I can still remember them 50 years later. It was rare for students to use assembler, I may even have been the only one. 

Bill Broderick had somehow persuaded Elliotts to give him paper listings of the Algol compiler and interpreter, all written in Assembler. It was a masterpiece to get a compiler into the available memory. It was also the first compiler implementation I saw. I spent a lot of time studying it, and I learned a lot from it. This was long before there were books about how compilers worked - though I do still have my copy of Gries from my student days.

Knowing both the assembler and the language internals led to an interesting adventure. In 1971 our town was twinned with Ludwigshafen in Germany. As part of the general junketing that accompanied it, the two respective police forces decided to organise some kind of car rally from one place to the other. To show what an advanced place Romford was, all of the associated calculations were to be undertaken using the school computer. Information was passed back and forth using the Telex network.

There was just one problem with this magnificent demonstration of 20th century technology. The telex network uses an ancient 5-bit code called Baudot, which was designed to minimize physical wear and tear on the mechanical internals of teleprinter machines. The order of character codes had nothing at all to do with alphabetical order. Our computer used wider tape and the ASCII 8-bit code, in which letters are arranged in the obvious order. How to convert from one to the other?

Somehow my name came up, and so I got to write library routines for the Algol system, in SIR, that would convert back and forth between the two character sets. Fortunately it was easy to adapt the paper tape readers and punches to work on the narrower 5-bit tape. This was my first taste ever of system programming, and I thoroughly enjoyed it. Maybe it was what encouraged me, a few years later in my first job at DEC, to develop a complete driver for 64 timesharing terminals and numerous different pieces of incompatible hardware for the PDP-11.

I spent the day at the operational headquarters of the rally. I forget the details, but I suppose they must have moved the computer there since there was certainly no remote access to it. It was my first, and I'm pleased to say so far only, close contact with the police.

Somewhere along the line our Elliot 903 was replaced by a newer machine, the 905. This had hardware registers for the assembler and instruction pointer, and faster core memory, bringing the typical instruction time down to about 3µS. Around the time I left school this was in turn replaced by one of the first HP computers. I don't know why they did this, but it seemed a bad idea. HP, being a US company, didn't have an Algol compiler. To satisfy the European market they had cobbled something together which was essentially Fortran using Algol syntax. I took one look at it and decided not to bother - I was off to university shortly afterwards anyway.

There are still several operational Elliott 903s, including one at the National Computer Museum in Bletchley, England. If you go when it is being demonstrated, you can listen to it play tunes, exactly as in 1966.

Friday, 30 September 2016

Startups and Expansionism - Just Don't

When our company first got some funding, we found some very inexpensive, pleasant office space and moved in. There was room for about 20 people in comfort. For the first few months the half dozen of us rattled around in all that space. Then we got our A-round, and we started to build up a team. I hired several really good engineers. Our product was, as we thought then, ready to start getting some customer exposure. We hired sales people, sales engineers, a head of operations... and so on. Quickly we were approaching the capacity of what had seemed until then our palatial office space.

It's human nature to anticipate the future, meet problems before they arrive, stay ahead of the airplane, all that stuff. So our new operations guy started worrying that we would soon fill up the space we had, and somehow we all tuned in to this mindset and agreed with him. This despite the fact that we were now operating at the burn rate assumed by the funding plan, and couldn't afford to hire any more people until we got a serious revenue stream. We had to get more space!

The ops guy started looking round, and then by chance a company in our building suddenly and instantly ceased to exist. They were in the pharma business and their new wonder drug failed its clinical tests. Instant death, in a way that doesn't happen in the computer industry. Literally, at 11am they told the landlord and their employees that they were closing down, and by 1pm we could go and look at the deserted space, which was about twice what we had - big enough for 35 people, including a huge board room. It was perfect for our "planned" (actually "dreamed of") expansion. Within a few weeks we'd reconfigured the space, got some more furniture, and moved ourselves and all our test systems into the new space.

I'm prompted to write this blog because this week we just completed an office move back into half of the new space, thanks to a very cooperative landlord. We never, ever needed more than our original space. The whole pair of moves, which cost us a month's runway in extra rent and moving costs, was completely unnecessary.

It's not just office space. We hired sales people before we had a product to sell. We hired even more sales people when we had a product, but no idea how to sell it. We hired operations people to make the sales process run smoothly when we had no sales. We hired support engineers to support the customers we didn't have. We hired an expensive CFO when we had no finances to speak of. All in the name of being "ready".

And it isn't just us. This has been the story at every startup I've been involved with. My first was in Germany, funded by some German banks who were desperate to jump on the high-tech startup bandwagon (this was 1998). They barely had a product, they had exactly one customer... and well over 100 people! There was a fully staffed support team of about 6 people to support the non-existent customers, there were about the same number working on a next-generation product before they'd either finished or sold the first one. All this to be sure of being ready when we did have customers - and guess what, they ran out of cash and closed down before those customers ever showed up.

The moral here is simple, but hard to get people to apply. Don't let expenses get ahead of income. Or even simpler: just don't. Wait for a problem to happen and then solve it. During the time when you have the problem but not the solution, improvise. Humans are good at that. Not enough space? Double up on desks. Not enough support people? Divert the engineering team for a couple of months. The worst that can happen is a bit of extra work, a bit of discomfort, maybe a few tricky incidents where you have to juggle customer problems. And at least you'll have the money still in the bank.

All this aggressive expansionism results from the belief that sales are suddenly going to surge ahead, leaving everyone struggling to deal with them and, much worse, losing sales because of lack of capacity. But the thing is, this never happens. In reality it always takes a while for sales to ramp up. There are lots of reasons for this: the need to build a reputation, the need to build channels, and many others. It's a different story if you're Apple launching the iPhone 7, when you know people will buy tens of millions on the first day. But that's just the next generation of an established product. It isn't a startup.

It's just so easy to seduce yourself into believing that you need to expand right now. And just about invariably wrong.

Sunday, 11 September 2016

Harold Hill Grammar School

What is a Grammar School?

In 1944, the UK Government passed the Butler Act, which defined how post-war education would be structured. As implemented, it meant that eleven-year old children took an exam called the Eleven Plus, which decided whether they would continue with an academically-oriented education. This took place at a Grammar School, and was aimed primarily at sending them to university or other further education.  Otherwise, they would attend a Secondary Modern School, whose goal was to give a basic education for children who would for the most part leave school at 15 and end up doing manual jobs (yes, they still existed in 1944, and even in 1964).

In theory there was an intermediate level, leading to Technical Schools which would produce future engineers and technicians. In practice very few were ever created, though as it happens my sister did attend one.

The system ended up being very controversial - it was true that once a child had failed the Eleven Plus, they were pretty much on the scrapheap, educationally speaking. A tiny handful managed to escape (including my first wife) and proceed to university, but this was very much the exception. In the 1970s it was abolished, along with the Grammar Schools. But since I was 11 in 1964, I got the full advantage of a system which, for all its injustices and failings, did an excellent job for the 10% or so it was designed to benefit.


I grew up on the largest of the London County Council's housing estates, Harold Hill, just east of London. This was a completely planned, largely self contained community, of about 30,000 people. It included numerous schools, one of which was Harold Hill Grammar School (HHGS). Just across the street was one of three Secondary Modern schools, Broxhill, but we had absolutely no contact with them except the occasional sports match.

In 1964 I took and passed the Eleven Plus exam. From then until 1971, I attended HHGS.

It had been open for about eight years by then. The headmaster, George Armstrong (universally referred to by pupils and staff alike as George) had created it very much in his own image. He was a language teacher by training (and still taught some Italian). At 11 years old I was terrified of him, somewhat justifiably since in those days the cane was still in use. Being "sent to George" for some breach of discipline invariably meant a stroke of the cane. It happened to me a couple of times. I remember being a bit underwhelmed by the experience, more daunting than painful.

From the school he created, it was obvious that he was a great leader. In about 1968 he moved on to become a Schools Inspector, to be replaced by a Mr Bracken. The latter was a huge disappointment, regarded with contempt by staff and pupils.

Every morning at 9am there was a full assembly of the whole school in the main hall. This consisted of a short morale-building address by one of the teachers, some prayers (strictly Church of England of course), a couple of hymns, and the reading of the school notices. I think we all enjoyed the hymns, whether religious or not - all those magnificent jingoistic words with their military tunes. Our school was very unusual in having an electronic organ, contributed by the Parent-Teacher Association, and a music teacher who could actually play the thing. I can still remember the sound of 400 teenagers singing "To Be A Pilgrim" (the official school hymn) accompanied by a full two-manual organ. It was magnificent, and the words are still in my head even today.

The catchment area of the school was much larger than just the Harold Hill estate. Pupils came from as far as ten miles away, from distinctly middle-class Brentwood, Gidea Park and Hornchurch as well as our very working-class area. One of my best friends came from sunny Shenfield, travelling for an hour on the bus every morning and afternoon. His Dad was something important in the UK nuclear power station industry, unlike mine who scraped a living selling zips and buttons. When I first went to HHGS, my mother threatened me that now I would have serious competition, I would have to struggle to keep up with all these privileged kids. For better or for worse they were no smarter than us street urchins, as it turned out.

George and his Acolytes

George was a distant figure, mostly seen only at school assembly in the morning or occasionally swishing around in his black gown. Many of the teachers still wore these, straight out of Goodbye Mr Chips. But his two deputies were much more visible. Miss Davies was the Headmistress and seemed to actually run the place as well as taking care of all the "girls' affairs" side of things. She was frankly a very unsympathetic character, a dry, small-boned woman in her 50s with frizzy grey hair who never had a kind word for anyone or anything. All the pupils called her Daisy, though her real name was Winifred. Little was known about her private life, even by the staff. In keeping with her character, she drove an elderly Morris Minor.

The Deputy Headmaster was a bluff Yorkshireman, Mr Bracegirdle (what a wonderful name!). Everyone called him Percy - and his son, who was a couple of years ahead of me, Young Percy - though his real name was Philip. He taught maths - including two years of my A Levels. He was a very kind and sympathetic man behind that exterior, who would sometimes drive me home from our visits to the Royal Liberty School's computer in his Ford Anglia. He smoked a foul-smelling pipe, whose miasma filled the car to the point that you could barely see the windscreen from the back seat.


Our first year form teacher was an attractive young woman who would sit on her desk showing off her stocking tops (no tights back in the pre-miniskirt era). I confess I'd forgotten that (well, I was only 11) until reminded recently by a fellow pupil. She disappeared mysteriously at Christmas, with a widespread rumour that she was pregnant. She was replaced by Michael Hursey, in his first year of teaching and determined to be a "character". He wore a red bow-tie to teach, and wrote everything in brilliant turquoise ink. His subjects were English and Drama which was, well, dramatic. I'm not really sure what it was for, neither then nor now, but we would prance around the stage pretending to be teapots or bananas for 40 minutes. It never extended to anything remotely resembling actual theatre.

The other first-year teacher who made a huge impression on me was Mme Julien, in French. At George's direction, the school was a testbed for a new way of teaching languages, the Nuffield Method. This was remarkably similar to the modern Rosetta Stone, where a mixture of graphics and recorded speech are used to avoid misleading exposure to the written language - a huge problem for English children learning French (and vice versa). Mme Julien injected her own unique twist to this. She wanted to write, yet wasn't allowed to use written French. Her solution was to use the International Phonetic Alphabet, a language-independent way of writing phonetically absolutely any language in the world.

This illustrated very well a characteristic of the entire school. Everything was aimed at making the best of the best pupils, and doing an OK job with the rest. Probably most of the pupils were completely baffled by this bizarre writing system with its unique characters like ə and ʃ, but I loved it so much that I studied phonetics as a minor subject at university.


It was a small school. There were three entry forms, of about 20 pupils each, organised alphabetically in the absence of better criteria. Tony, my best friend throughout school (we're still in touch today) was sitting behind me, simply because his name differed from mine only at the third letter.

For the first two years, we studied every subject: sciences, liberal arts, and foundations like English and maths. Or almost, because I dropped art (I was hopeless) and geography (boring beyond belief) at the end of the first year. It was decades later before I realised that geography is a fascinating subject - when it isn't focussed entirely on knowing the principal towns and industries of every county in the British Isles.

For the second year, we had to choose a second foreign language. We had a wide choice: German, Italian, Russian (very unusual for a school) and Latin. In practice what you asked for made little difference. If you were good at French you did Russian, if you were bad at it you did Italian (I guess on the basis that it's quite similar to French), and in the middle you did German. You did Latin if you were mad enough to ask for it. One of my friends was selected for Russian and his parents had to make a huge fuss for him to be allowed to do German, which they considered more useful.

Russian was taught the same way as French, using slide projectors and reel-to-reel tape recorders which would be in a museum now. We were allowed to see written Russian - had to be, because we had to learn the Cyrillic alphabet. Fortunately written Russian is quite phonetic. I can still remember господин кирш (Citizen Kirsh) and his dog.

An oddity of the British system then and for another couple of decades was that pupils had to have one lesson a week of Religious Studies. There was a teacher who taught nothing but this. He was very odd. His name was Mr Farnell, but everyone (I suspect including the staff) called him Creeping Jesus. I think he really did make an effort to make his subject interesting, utterly useless though it was. It wasn't just a case of pouring Christian dogma down our throats. But I'd been a convinced atheist since I was 10 (as soon as I realised that while "God created everything", there was no good answer to the question "So who created God?"), and I did everything I could to make the lessons at least slightly interesting by asking unanswerable questions. There was a very dogmatically religious boy in our year (he was insufferable in a number of other ways too) called Roger, who would always leap to the defence of both Christianity and Creeping Jesus as I quibbled with the lesson. It at least added spice to an otherwise unbearably tedious 40 minutes. Later on I learned that Mr Farnell lived, with a wife and child, in an almost completely unfurnished council flat, determined to live an ascetic lifestyle in accordance with some religious principle.

We were also required to do two lessons a week of physical education and sport. I hated both and the teacher, Jack Wilsmore, knew it. We did not have a good relationship, at least not until at 16 I went on a school ski trip and astounded him by being reasonably good at it. My report book consistently contains his entry, "Makes little effort". From time to time we would get sent on that classically useless English exercise, the cross-country run. Tony and I regarded it as a great opportunity to chat with each other while ambling through the mud, returning to school long after everyone else was showered and dressed.


Like all secondary schools at the time, we wore strictly enforced uniforms. For boys it was completely unremarkable - dark grey trousers, white shirt, and the inevitable blazer (a kind of summer jacket) with the school badge taking up the entire breast pocket. A simple striped tie completed the outfit. Sixth form boys had a different tie, and were permitted to wear straw boater hats in 1964, though sadly this completely archaic custom had ceased by my time in the sixth form,

Girls had distinct summer and winter uniforms. I remember little about the winter one, maybe a dark skirt, but the summer one was a very 1950s full-cut dress, below the knee, of a blue fabric with white spots. Even in 1964 it was distinctly retro. The rules laid down everything girls should wear, even the colour of their underwear (white, of course - what would you expect, black with red trim?) But very suddenly in about 1968 it changed, to the mini-est of minidresses, in either citrus yellow or electric blue. To a hormone filled young lad, the spectacle presented by a nylon-clad thigh as a girl sat on one of the high benches in the science labs was something to behold.


The school's buildings were quite imaginative considering they were part of a giant post-war estate, with sweeping rooflines. There were five parts to them. My own memories are mostly of the science block, with dedicated labs for each of chemistry, physics and biology, and three more general purpose labs. And what labs they were! They had vast teak benches with all the trimmings - gas taps for Bunsen burners, water, sinks. Mr Pryke insisted that the each and every session concluded with polishing the benches using vast drums of wax polish, so they always shined. Down the middle were bottles of ten common reagents, including both dilute and concentrated sulphuric, nitric and hydrochloric acids. It was a health-and-safety nightmare, but I don't recall any accidents beyond the occasional hole in a shirt.

There was a three-floor general purpose classroom block, the only part with more than a single story. Its staircases were very narrow, a constant source of congestion in the brief interval between classes. We were told that this was done deliberately to encourage people to mix, or something equally bizarre. Adjacent to that was the main hall, large enough for the whole school, and various offices. Leading from that was a wing with the "arty" classrooms - music, art, cookery, and at the very end the workshop for metal and woodwork, with a generous array of heavy machinery.

At the back of the hall were the changing rooms and gym, from which you could access the very generously sized sports fields with pitches for football and rugby, tennis courts, and large amounts of just grass.


At the start of the third year we had to choose whether to be artists or scientists, dropping several subjects. That's a surprise to most non-Brits, who generally study a broad range of subjects up to at least 16. The French (and International) Baccalaureat takes about ten subjects right up to 18. In Britain even now, past 16 it's normal to focus on just three or maybe four subjects. At 13 I chose the science track, meaning I could forget about music, history and geography for ever. History was taught in strict chronological order, so my knowledge of the subject stopped somewhere around Henry VIII. 

From then on I studied chemistry, physics, biology, French, Russian, English and maths. I was good at all of them but some were more interesting than others. I think it depended entirely on the teachers. Our chemistry teacher, Colin Pryke, was extraordinary. He loved his subject and, if you had natural talent for it, transmitted it effortlessly. He eschewed all traditional chemistry teaching, learning great lists of compounds and their properties. His view was that if you understood how chemistry works - the periodic table and electronic configuration - everything else followed by itself. And he was right.  I have loved chemistry ever since, though my attempt to study it at university came to a rapid end when I realised how badly most people teach it. I was saddened to learn that he died just a few months ago.

It has to be said though that he was quite a strange chap. He lived with his mother, in fact he lived in the same house in Goodmayes for the whole of his life, all 82 years. All of us were perfectly sure he was gay, or "queer" as we said then since the word "gay" had yet to be appropriated. Most likely we were right, though he never did anything even slightly inappropriate. His passion was making  amateur movies, at a time when this meant special cameras and fiddly Super 8 film, edited by splicing bits together with sticky tape. In 1966 he and Michael Hursey made a docu-drama called Sugar Nightmare, about the perils of using LSD. It won several awards though I think it did nothing to endear him to the local education department.

Every summer he would go on a holiday, often with one of the other teachers, and make a film documenting it, which he would show later in the year. The most memorable was when he and our physics teacher, Norman Bacrac, drove all the way to Turkey in his ancient-looking black Rover 75. The film was called "Istanbul or Bust", which indeed his car did, throwing a connecting rod on the autobahn and disappearing forever. He never took to its replacement, a very distinguished Rover 3-Litre, in the same way.

Physics, by contrast, was just boring. I have always thought of physics as a ragbag of odds and ends, all the bits of science that aren't something else (chemistry or biology).


The first formal school qualification, taken at 16 years old after five years of secondary school, was officially called the General Certificate of Education Ordinary Level, universally abbreviated to O-levels. That is still true today, although it is now called the GCSE. At that time you could leave school at 15, without any qualification at all, and probably half the population did, going on to manual labour or menial jobs.

That meant that teaching started to get serious in the fourth and fifth years. The Nuffield French course had been quietly abandoned after two years. We had been taught formal French grammar by the formidable Miss Davies for one year, whose knowledge of the theory of the French language was matched by an appalling pure-English accent - our French language assistant (a French lady studying English and on assignment for a year) said she was completely incomprehensible when she spoke French. As a result we got good results in French.

Russian was a different story. For some reason our Russian teachers (we got a different one part way through) had stuck rigidly to the slide projector and ancient tape recorders. As a result nobody really knew any Russian at all. It turns out (this is equally true for Rosetta Stone) to be a great way to get an initial ear for the language, but a terrible way to get anywhere close to mastery or fluency. You just have to do the hard work of learning the vocabulary and the grammar, all those irregular verbs and case endings and all the rest. I'd realised this in my last couple of years and thanks to my local library's extraordinary breadth of books, I'd borrowed some Russian grammars and textbooks and got my head around them. (I can still remember the Russian case endings, most of them anyway, 50 years later and despite having practically never used the language).

As a consequence I was the only pupil, out of twelve, to pass O-level Russian. Even then I only got a bare pass grade. but it was better than failing. I don't know what happened to the Nuffield method after that disaster, but I certainly hope it was rapidly abandoned.

For chemistry Mr Pryke insisted, over and over, that even though I was good at it, it was vital to revise, to learn all those inorganic analysis reactions that he had never actually taught us - "white powder A reacts with green solution B to form purple precipitate C, which dissolves in hydrofluoric acid... and so on and so on, identify A to M". So, in my usual contrarian way, I never spent a single moment doing chemistry revision. After I got the highest possible grade, I told him. I don't think he was amused.

English was taught as two subjects, language and literature. I can't for the life of me remember what we learned in English Language, other than writing pointless essays. For sure it wasn't English grammar, which I have never been taught in my life. Literature consisted of reading three or four novels and plays each year, with an exam consisting of a comprehension test. It was nearly as boring as geography, and completely useless as far as I can see. It gave me a lifelong distaste for Victorian novels. All I remember is tedious, uninspired readings of Shakespeare in our twice-weekly lessons. 

For one year we had an English teacher who was really rather a sad case. She was called Miss Mavor and she had a very strong Scottish accent, which (sadly) made her a bit of a laughing stock in southern England - apart from her, none of our teachers came from further north than Lancashire or Yorkshire, and most were from the home counties. It didn't help when the class learned that her first name was Morag - a perfectly fine Scottish girl's name but as foreign to us then as something in Chinese or Arabic. She simply could not control a class of 14-year olds and on one occasion ran crying from the classroom. She only lasted one year and I wouldn't be surprised if she abandoned teaching.

I managed to pass all nine of my O-levels, with Russian being the only one that was marginal. And now it was time to move to the next level.

Sixth Form

The last two years of secondary school, for those who stayed on past 16, were spent on just two or three subjects, in preparation for the GCE Advanced Level (A-level). That's still the case today. For some reason these last two years have always been the "sixth form", the "lower sixth" (16/17) and the "upper sixth" (17/18). The reason no doubt lies in the arcane history of the English public (i.e. private) school system.

At this stage, school was no longer mandatory. That meant all kinds of relaxations of the rules. For example, Religious Education and Games were no longer obligatory. Most people did three subjects (some only did two), meaning lots of free time in the Portakabin-like sixth form lounge that the Parent-Teacher Association had generously funded a couple of years before our time.

I was one of the few who took four subjects, Chemistry, Physics, and Maths taken as two distinct A-levels, Pure (mainly calculus) and Applied (mechanics). That meant practically no free time and a lot of homework. Each subject set us a past A-level paper every week for two years. That sounds impossible, until you understand that Britain had numerous GCE boards, which each set their own papers.

Colin Pryke continued to teach me chemistry, with much more emphasis on organic (carbon related) chemistry - his real love - than before. He was a bit worried by my approach to practical work and tried to scare me by saying "you won't survive the course". I took it lightly, but it certainly got my parents worried when he said it to them. In truth we never did anything very dangerous, although the abandon with which mercury, sodium, hydrofluoric acid and such were handled would never be accepted today. He once had us handle some potassium cyanide, saying it was the safest substance in the lab precisely because everyone was so scared of it - which we most certainly were. Yet we would cheerfully prepare the much more toxic hydrogen disulphide (bad egg gas) without any worry.

Pure Maths was taught by Percy. For Applied Maths we had another odd character, Malcolm Snow. He would often give me a ride home after our weekly computer sessions at a nearby school (the subject for another whole article), then we would sit outside my house for an hour or more while we talked about all sorts of things - though nothing inappropriate. It used to worry my mother, no doubt imagining all kinds of unhealthy goings-on, but there was no such thing. But he was most definitely an odd chap.

The GCE system had one odd feature, the S-level (scholarship) exams. I think these were originally intended to parallel the special entrance exams for Oxford and Cambridge, but they really had no practical use. But they were there, so I decided to tackle two of them - the maximum permitted - in Chemistry and Applied Maths. They were just a bunch of harder questions based on the same syllabus.

Finally the A- (and S-) levels came around. I did work hard for these, with lots of revision, so it was gratifying to get the highest possible grades in all of them. And that despite my Lower Sixth form teacher's report that "Harper does not appear to be making much effort and will probably struggle with his A-levels". That remark annoyed me enough that I persuaded my parents to insist on a formal retraction, which was grudgingly produced.

Friends and Colleagues

There was a little clique of four or five of us who hung around together in the sixth form. My friend Tony had saved up enough to buy himself a car, a pale blue Mini, and we would go out together in the evenings and at weekends when we weren't working. A handful of times we dared to go at lunchtime to a pub a few miles out in the country that would happily sell us pints of beer, completely illegally and obviously so considering that we were wearing our school uniforms.

In my science stream, there were just six girls. Then as now, most girls were in the arts stream.

This was the Swinging Sixties, when teenagers were supposed to be living wild sex lives. All I can say is that if they were, they were jolly discreet about it. There were a handful of boy/girl relationships (any other kind was most definitely not spoken of back then), but I suspect they were mostly pretty innocent.


The Grammar School system did not survive the Labour governments of the 1970s. I left HHGS in 1971, the same year my brother joined, and it was merged with the adjacent Broxhill to become a new-fangled Comprehensive (i.e. for everyone, of all ability levels) school in about 1975. George Armstrong would surely have been turning in his grave, except that he was still very much alive.

The buildings survived in various local government roles until about ten years ago. The whole thing has been flattened now, and new houses built on both the school site and the very extensive grounds and playing fields. Sadly, not even Google could find a picture of it in its heyday.