Monthly Archives: July, 2017

Slowly getting the hang of this…

Since I last wrote about electric unicycles, I’ve commuted in to work a couple more times, and have used it to zoom around the West Cambridge campus in search of decent coffee.

I still only get to play on it for about 15 mins per week, but it’s good fun!

Geek quote of the day

Any fool can write code that a computer can understand. Good programmers write code that humans can understand.

— Kent Beck

But soft, what light…

Some of the wonderful windows at Binham Priory, Norfolk

The Digital Towbar

The ideal transport for most families, my mother used to say, would be two small cars that you could bolt together to make one big car when you went on holiday. I still think she’s right, and I was pondering this last week when I came up with an idea I call ‘The Digital Towbar’….

Traditionally, if you wish to take your accommodation with you on a journey, you have the option of towing a caravan, or driving a campervan/motorhome. Both of these involve compromises.

Caravan owners have a suboptimal driving experience while towing, and may have to purchase a larger and less environmentally-friendly car than they would otherwise need. They also have to fit it with a towbar and related electronics. Motorhome drivers may have an even more compromised driving experience, and their accommodation must be fitted with a large engine and a driving cab. Some drivers even tow a car behind the motorhome for use at the destination.

Now imagine an alternative model, where your electric car is equipped with the battery capacity for its own use and the necessary sensors and processing power for full autonomy, but where it can also manage a self-powered trailer that follows behind. This trailer might be half-way between an electric motorhome and a caravan; it would not need a cab for drivers, nor would it need a full range of sensors and associated processing and navigational capabilities for independent self-driving. It would maintain a fixed distance behind the car, under the control of an ‘digital towbar’, and its sensors would report back to the car’s systems through the same link. (For the moment, I assume it will be a wireless link, though there may be advantages in having some sort of lightweight physical coupling: a USB cable, perhaps, or a power lead which could balance the usage across the two sets of batteries.).

Anyway, such a trailer could combine the best bits of a caravan — a space designed for comfortable accommodation rather than for driving — with those of a motorhome — a self-powered vehicle which doesn’t require your car to be able to move a load of several tonnes. Instead of towing a little car behind your motorhome, you could tow a motorhome behind your little car. In addition, once you’ve reached your destination, decoupling the two is trivial, leaving you free to explore the local area with ease.

Cars which support the necessary protocols would not need to be fitted with any special hardware or a large engine in order to ‘tow’ such a trailer, making the loan or rental of caravans easy. There are other advantages too: the challenges that novices face when reversing a trailer could be greatly simplified by a car that understands the physics, or could do the reversing itself. The trailer could even shift around to put itself next to you in an adjacent parking space, rather than always needing to be behind.

And, of course, this model of self-powered trailers is not restricted to caravans. Small cars could now add trailers with which to tow boats, bicycles, or just general add load-carrying capacity when moving house. You could even have a separate passenger trailer in which to put noisy children while the parents travel in peace. My mother’s idea may come to fruition after all!

Finally, a single car would not necessarily be limited to towing a single trailer at once. The family of the future may once again travel as a wagon train.


Update, later This concept has already had some testing with trucks, of course, but my friend Eduardo also pointed me at this rather nice video from Hyundai! Perhaps, if you consign the kids to a rear compartment, you should assume they’ll stay there…

Old News

A couple of days ago, I received some suggestions for improvements to a program I had written. This isn’t unusual: I’m writing code all the time, and much of it needs improving. (Thanks, Sam!) No, the surprise in this case was that the suggested changes were to a little script called newslist.py that I wrote in 1994 and haven’t updated since. It wasn’t very important or impressive, but seeing it again made me a bit nostalgic, because it was very much an artefact of its time.

For a couple of years, I had been playing with early versions of a new programming language called Python (still at version 0.9 when first I fell in love with it). In those days, online discussions about things like new languages occurred on forums called Usenet newsgroups. (As an aside, I was also playing with a new operating system called Linux, which Linus Torvalds had announced on the comp.os.minix newsgroup with one of those throwaway phrases that have gone down in history: “I’m doing a (free) operating system — just a hobby, won’t be big and professional…”.)

Anyway, the Usenet group archives are still accessible now through web servers like Google Groups, but the usual way to read them back then was to fire up a news-reading program and point it at a local news server, which could serve up the messages to you using the ‘network news transfer protocol’ NNTP. Since you wouldn’t necessarily have a fast connection to anywhere else in the world from your desktop, organisations such as universities and the more enlightened companies would run their own NNTP servers and arrange with their pals in other organisations to synchronise everything gradually in the background (or, at least, to synchronise the newsgroups they thought would be of local interest). When a user posted a new message, it would trickle out to most of the servers around the world, typically over the next few hours.

But another novelty was catching my attention at that time… This thing called the World Wide Web. Early web browsers generally spoke enough NNTP to be able to display a message (and maybe even the list of messages in a group), so you could include ‘news://‘ URLs in your web pages to refer to Usenet content. But a browser wasn’t much good for more general news perusal because it didn’t have a way to find out which newsgroups were available on your local server. My newslist.py script was designed to fill that gap by connecting to the server, getting the list of its groups, and creating a web page with links to them displayed in a nice hierarchical structure. You could then dispense with your special newsgroup app, at least for the purposes of reading.

When version 1.1 of Python was released, Guido van Rossum added a Demo directory with some examples of things you could do with the language, and newslist.py was included. And there it remained for a couple of decades, until, I discover, it was removed in 2.7.9 because the comment I had casually included at the top about it being free “for non-commercial use” no longer quite fit with the current Python licensing scheme. (I would happily have changed that, had I known, but I wouldn’t have imagined anybody was still using it!) The Demo directory itself was dropped in Python 3, and so newslist.py was consigned to the historical archives.

So you can understand my surprise at discovering that somebody was still experimenting with it now! I didn’t know anybody had an NNTP server any more.

What’s almost more surprising is that one of my two email addresses, mentioned in the code, is still working 23 years later, so he was able to write and tell me!

All of which tells me I should probably pay more attention to what I put in the comments at the top of my code in future…

Setting non-standard screen resolutions on a Mac

I wrote about this a few years ago but it’s still a handy and not-very-well-known hidden feature of the Mac’s System Preferences.

NOTE that on some Macs, especially recent Mac Book Pros, this only works if you have external displays attached.

© Copyright Quentin Stafford-Fraser