Monthly Archives: April, 2013

From the divine to the ridiculous?

I’m enjoying Remembrance of Things Past, but my expectation of completing the whole thing has been somewhat reduced by my calculating that it’s more than one-and-a-half times the length of the Bible.

Fortunately, Marcel Proust is a much better writer than God, but I fear that may not be sufficient…

Dr Qui

This, I think, is quite fabulous. A jazz rendition of the Dr Who theme, by Bill Bailey.

Digital Desk Revisited

Thanks to Richard Watts and Rob Hague for pointing me at Fujitsu’s system for interacting with paper using finger gestures.

It’s remarkably like the original DigitalDesk system created by my pal Pierre Wellner in 1991.

It’s funny to think, now, that when Pierre made this video, there was no web to post it on.

Goldilocks for grey-haired geeks

When I was an undergraduate studying Computer Science, in the late 80s, the course was accredited by the British Computer Society on the condition that, as part of the syllabus, we were taught some COBOL. For those who have not encountered it, COBOL – the Common Business Oriented Language – is a very early programming language designed with the idea, amongst other things, that managers and other non-technical business types should be able to read and understand it.

In retrospect this wasn’t really a great idea (any more than it was when Apple tried something similar with AppleScript in 1993). Computer languages tend to get a kind of uncanny valley problem when you try to pretend that machines speak the same way as humans; the results are neither good English nor good programming languages. It’s a bit like Franglais, except that Franglais is enjoyable to use.

But COBOL can be forgiven; this was after all still 1959, and the world’s experience in programming languages was somewhat limited. It was designed by people as eminent as Grace Hopper (who was brilliant at handling David Letterman, as well as computers!). And COBOL was incredibly successful – for some decades it was the most-used computer language, and it’s still in use today, though it’s bizarre to discover there are people doing .NET programming with it.

Anyway, it was Dr Frank King who taught us most of our languages, and since he had to include a bit of COBOL, he did it mostly as a joke, starting with a properly-constructed “Hello World” program, which I seem to recall was 77 lines long.

At the end of the final lecture, he handed out photocopies of “The Common Business Oriented Goldilocks”, which had been published in Datamation magazine back in 1968, and which is written in something approaching valid COBOL. Maybe it is valid COBOL… I never wrote another line of COBOL after that lecture, so don’t remember. But I may have readers who do!

        THE COMMON BUSINESS ORIENTED GOLDILOCKS
            --- ------ -------- -------- ----------

IDENTIFICATION DIVISON.
PROGRAM ID.           A COBOL FABLE.
SECURITY.             INSECURE.
PROGRAMMER-ID.        ARTHUR SHAPIRO.
REMARKS.              SLIGHTLY MORE MANGLED VERSION OF ONE IN JAN., 1968
               DATAMATION.
DATE WRITTEN.         ONCE UPON A TIME.

ENVIRONMENT DIVISON.
CONFIGURATION SECTION.
OBJECT COMPUTER.      ANY MUSIC BOX, MEMORY SIZE 8X64 BYTES,
                      19 TAPE DRIVES, 11 DISK DRIVES, 1 GOLDILOCKS, 3 BEARS.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
    SELECT TAPE DRIVES, ASSIGN THEM TO CREDITOR.
    SELECT DISK DRIVES.
    SELECT GOLDILOCKS, SELECT BEARS, ASSIGN TO ONE COTTAGE.
I-O CONTROL.
    APPLY RED TAPE TO TAPE DRIVES, APPLY BRAHMS RECORD TO DISK DRIVE,
    APPLY GOLDI, BEARS TO COTTAGE.
    DATA DIVISON.
FD GOLDI.
    LABEL RECORDS ARE STANDARD
    VALUE OF IDENTIFACTION IS "GOLDILOCKS"
    DATA RECORD IS GOLDILOCKS.
01  GOLDILOCKS.
    02    HGT   SIZE IS 62 INS.
    02    WGT   SIZE IS 110 LBS.
    02    VITAL-STATS.
          03    B     38.
          03    W     24.
          03    H     36.
    02    RATING      100%.
FD  THREE-BEARS.
    LABEL RECORDS ARE STANDARD
    VALUE OF IDENTIFICATION IS "BEARS"
    DATA RECORDS ARE DADDY-BEAR, MUMMY-BEAR, BABY-BEAR.
01  DADDY-BEAR.
    02    HGT   70 INS.
    02    WGT   750 LBS.
    02    COLOR-OF-EYES   BLOODSHOT.
    02    DISPOSITION     UNBEARABLE.
01  MUMMY-BEAR.
    02    HGT   65 INS.
    02    WGT   700 LBS.
    02    COLOR-OF-EYES   BLUE.
    02    DISPOSITION     BEARABLE.
01  BABY-BEAR.
    02    HGT   40 INS.
    02    DISPOSITION     INFANTILE.
WORKING-STORAGE SECTION.
01 COTTAGE      PICTURE IS COZY.
    02    KITCHEN.
          03    TABLE     SIZE IS LARGE, VALUE IS 1.
          03    CHAIRS    SIZE IS MEDIUM, VALUE IS 3.
    02    PORRIDGE.
          03    KING-SIZE    OCCURS 1 TIME.
          03    QUEEN-SIZE   OCCURS 1 TIME.
          03    PRINCE-SIZE  OCCURS 1 TIME.
    02    DOOR  SIZE IS USUAL, VALUE IS OPEN.
    02    BEDROOM.
          03    BED.
                04 LARGE     OCCURS 1 TIME.
                04 MEDIUM    OCCURS 1 TIME.
                04 SMALL     OCCURS 1 TIME.
          03    WINDOW    SIZE IS SMALL, VALUE IS OPEN.
01  CORRECT-COTTAGE REDEFINES COTTAGE, VALUE IS SAME.
77 KING-SIZE-BED-SLEPT-IN    SIZE IS BIG, VALUE IS ROCK-BOTTOM.
77 QUEEN-SIZE-BED-SLEPT-IN   SIZE IS MEDIUM, VALUE IS DEPRESSED.
77 NO-PORRIDGE               SIZE IS SMALL, VALUE IS ZERO.
77 SIP                       SIZE IS LITTLE, VALUE IS "SSSLURP".
77 SLUMBERLAND               SIZE IS UNLIMITED, VALUE IS ZZZZZZZZZ.
CONSTANT SECTION.
01 COMMENT1     SIZE IS 36, VALUE IS "SOMEBODY HAS BEEN EATING MY PORRIDGE".
01 COMMENT2     SIZE IS 36, VALUE IS "SOMEBODY HAS BEEN SLEEPING IN MY BED".
PROCEDURE DIVISION.
FOREST SECTION.
START-OF-TALE.
    OPEN STORY. READ FOLLOWING.
FIRST-MOVE.
    MOVE GOLDILOCKS TO COTTAGE.
    IF DOOR IS CLOSED OR BEARS ARE GREATER THAN ZERO ALTER ENTER-GO3
          PROCEED TO HASTY-RETREAT.
ENTER-GOLDILOCKS.
    GO TO KITCHEN-SCENE.
KITCHEN-SCENE.
    IF PORRIDGE IS KING-SIZE, PERFORM TASTE-ROUTINE VARYING PORRIDGE-
          KING-SIZE BY 1 UNTIL PORRIDGE EQUALS PRINCE-SIZE
          OTHERWISE COMPUTE IF COTTAGE = CORRECT-COTTAGE GO TO BEDROOM-SCENE.
TASTE-ROUTINE.
    SUBTRACT SIP FROM PORRIDGE(KING-SIZE).
    SUBTRACT SIP FROM PORRIDGE(QUEEN-SIZE).
    SUBTRACT SIP FROM PORRIDGE(PRINCE-SIZE) GIVING NO-PORRIDGE.
BEDROOM-SCENE.
    MOVE GOLDILOCKS TO BEDROOM.
    ADD GOLDILOCKS TO BED(LARGE). DISPLAY "IT IS TOO HARD".
    SUBTRACT GOLDILOCKS FROM BED(LARGE) GIVING KING-SIZE-BED-SLEPT-IN.
    MOVE GOLDILOCKS TO BED(MEDIUM). DISPLAY "IT IS TOO SOFT".
    SUBTRACT GOLDILOCKS FROM BED(MEDIUM) GIVING OUEEN-SIZE-BED-SLEPT-IN.
    MOVE GOLDILOCKS TO BED(SMALL). DISPLAY "IT IS JUST RIGHT".
    ADD GOLDILOCKS TO SLUMBERLAND.
BEARS-RETURN.
    MOVE DADDY-BEAR, MUMMY-BEAR, BABY-BEAR TO KITCHEN.
    MOVE CORRESPONDING BEARS TO PORRIDGE.
    DISPLAY "DADDY BEAR ", COMMENT1.
    DISPLAY "MUMMY BEAR ", COMMENT1.
    DISPLAY "BABY BEAR ", COMMENT1, " AND EATEN IT ALL UP".
    MOVE BEARS TO BEDROOM.
BEARS-IN-BEDROOM.
    EXAMINE BEDS, REPLACING ALL GOLDILOCKS WITH BEARS.
    DISPLAY "DADDY BEAR ", COMMENT2.
    DISPLAY "MUMMY BEAR ", COMMENT2.
    DISPLAY "BABY BEAR ", COMMENT2, " AND HERE SHE IS".
HASTY-RETREAT.
    IF WINDOW IS OPEN EXIT GOLDILOCKS OTHERWISE MOVE GOLDILOCKS TO DOOR.
END-OF-TALE.
    CLOSE STORY, DISPLAY "WOULD YOU BELIEVE CINDERELLA IN PL/I?".
    STOP RUN.

Digital Doppelganger

double

I’ve always liked the idea of a telepresence robot — a video-conferencing device that you can move around a remote location to give you a more tangible presence there — but suspected the number of really practical uses of these very expensive devices was somewhat limited.

So I was struck by the great story of Grady Hofmann featured in the latest BBC Click episode. Grady, an eight-year-old, was able to chat to his siblings in their bedroom, go to his school, and take his place at the family dinner table, all while he was confined to a hospital bed for 2 months during a bone-marrow transplant. OK, I thought – this stuff is worthwhile after all!

Double Robotics are creating a neat low-cost telepresence robot which uses an iPad as the face, eyes, ears and speaker, and Segway-type mobility. All for under $2000 (plus iPad) which means these are starting to be affordable. (The whole device would cost about the same as 4 months’ rail commute from Cambridge to London.)

There are two issues I think these devices still need to tackle, though. The first is that they need the ability to connect themselves to a charging device, to reduce their dependence on other people. The Roomba can do this, so it should be manageable.

But the second is something that may be rather more tricky. I know this because it took the Daleks fifty years to come up with a solution.

Django cross-site authentication

Richard wrote a nice bit of code to allow one Django app to authenticate users using another Django app’s database. It saves the users having to get a separate set of credentials.

This assumes that both apps can securely access the original database, but if you have a situation where, say, they both run on EC2 machines in the same Amazon account, this can be very handy.

It’s still fairly basic, so I’m sure he’d welcome contributions.

Inebriated cephalopod

I love this photo, posted on Facebook recently by Mark Littlewood.

octopus

Recherche du temps

wpid-Photo-17-Apr-2013-0745.jpgAbout a year ago, like many thousands of others, I backed the Pebble Kickstarter project. Yesterday, after forking over another 25 quid to the Queen (a combination of the Royal Mail and Her Majesty’s Revenue and Customs), I received my new toy.

My first impression was that it looks and feels much nicer than I expected. It’s hard to convey this in pictures: I don’t think it looks as cheap in reality as the black shiny plasticness of many photos would suggest, and after years of a fine but heavy stainless–steel–and–titanium Citizen, this feels light and comfortable.

At present, there’s a limited amount you can do with it. Incoming texts and iMessages are forwarded to it, incoming calls can be accepted or rejected from your wrist, and you can stop or start music and skip backwards and forwards. But there’s a buzz of activity on the forums around the newly–released SDK. In just a couple of days, people have contributed range of new watch faces, and, of course, there’s already a Tetris and a Pong clone!

wpid-Photo-17-Apr-2013-0822.jpg The really interesting apps, though, will depend on the watch’s connectivity with your phone, and thence with the outside world. I must have a play with the SDK soon, but I suspect the facilities offered by the phone’s Bluetooth APIs will be the limiting factor there, especially on my iPhone.

In the meantime, the ability to stop and start playback of my audiobooks and podcasts is very handy. I tend to put my phone in my breast pocket while walking the dog, so I can listen to things without the need for headphones, but this can make me look a little eccentric to passers-by. Appearances can be deceptive. So being able to stop the audio as someone approaches, simply by pressing a watch button, helps preserve my dignity.

wpid-Photo-17-Apr-2013-0733.jpgAt present, I’m listening to a splendid version of Proust’s À la Recherche du Temps Perdus. It seems somehow appropriate.

But I think it’s time for a new translation. The title is typically rendered in English as ‘Remembrance of Things Past’, or — and this is perhaps poignant for those exploring their watch’s user interface — ‘In Search of Lost Time’.

But my upcoming version will be a whole new translation of À la Recherche du Temps Perdus for the modern age, entitled, “In Research, Much Time is Wasted”…

Some are more equalised than others…

Here’s a gadget I’d really like to have: a programmable in-car graphic equaliser.

My car audio system sounds fine at speeds below about 20mph, but certain parts of the audio spectrum tend to get lost when going faster, and I’ve never found a car stereo that copes well with this.

Having the volume increase with speed helps a bit, but I’d really like to be able to set equalisation to be reasonably flat when going slowly, and adjust it to boost, say, tenor vocals so that things sound good at 40mph and 70mph. Then it should interpolate between my various settings at intermediate speeds.

Anyone seen anything like this, or should I patent it? 🙂

I guess it could be an iPhone app, since most of my audio comes from there, and it has a GPS…

Wait a minute, Mr Postman

My friend Rob Berwick sent me a kind gift of a Blinkstick. Here‘s an example of what you can do with it, in this case, by plugging it into a Raspberry Pi.

You can get the Blinkstick as a kit, and solder it together yourself (which isn’t difficult) or, for a few quid more, get it ready-assembled.

Some links to other things mentioned in the video:

Alas, poor PC… I knew him, Bill…

An IDC press release, out today, reports that PC sales have fallen again. That’s expected now, but they’ve fallen noticeably faster than predicted: the last quarter was a surprising 14% down on the same time last year.

“At this point, unfortunately”, says an IDC staff member, “it seems clear that the Windows 8 launch not only failed to provide a positive boost to the PC market, but appears to have slowed the market…” And it’s not just Windows – Apple’s desktop/laptop sales are down, too.

A big contributor, I’m sure, is that we’ve finally reached the point where operating system manufacturers and other software developers can no longer convince users that it’s worth buying a new machine just to run their latest offerings. I’m currently a software developer, for heaven’s sake, and even I am feeling no particular desire to replace my four-year-old iMac in the near future.

But a lot of it also comes from the fact that fewer people need to do, on a regular basis, what PCs were designed to be good at doing.

Phones and tablets don’t replace a PC, but if you drew a Venn diagram of

  • What PCs do
  • What mobile devices do
  • What people do

over the last few years, it would resemble a lapsed-time animation of plate tectonics. And my point is that ‘What PCs do’ would be largely stationary, while the others moved around it in ever-more-overlapping zones…

I write quite a lot, but I use a word-processor about once a month. I manage my company accounts, but much more of that is done on a web service than on a spreadsheet. I give talks, but the days when PowerPoint was the only game in town are long gone. And I read emails… while I’m walking the dog.

So, if I’m at all typical, where does that leave Microsoft Office, the core of most PCs’ raison d’être? And remember, I’m an old guy. For most people under the age of 25, it probably never was that important. The office suite is dead, and has been for a long time. Long live the browser. On whatever device.

On which note, I should shut down the browser on this iPad and go to sleep…

Thanks to Charles Arthur for the IDC link

Further TextExpander thoughts

TextExpander is one of the most useful utilities on my Mac — I’ve used it since it was called Textpander, many years ago — and it’s becoming more and more important on my iOS devices too, since almost every app I use, with the notable exception of the Apple ones, now supports it. And the configuration synchronises across all my devices automatically, making things even easier.

It’s arguably more useful on iOS, where it can help overcome some of the limitations of the keyboard. Typing email addresses can be tedious, for example, so I have three-letter abbreviations for most of mine. (Simple expansions like this can also be done using the built-in keyboard shortcuts available in Settings, which will work anywhere, but they don’t have the power of the TextExpander ones.)

A current favourite example, since I’m writing more and more in Markdown, is my .mdl abbreviation. It inserts a Markdown link, taking the contents of the clipboard as the URL (which I’ve typically just copied using the little ‘share’ button in Safari), and positions the cursor at the right place to type the link text. A link in Markdown, for the uninitiated, looks like this:

[Status-Q](http://statusq.org)

If you work out how many key presses are needed on a standard IOS keyboard just to do the brackets, you’ll realise that, though this is already a lot better than writing HTML, to do the equivalent with just .mdl and have it position the cursor in the right place, is a great help if you do it regularly. Which I do!

All very clever, and a great timesaver. But today I added a very simple abbreviation, vvv, which also makes use of the ‘insert the clipboard here’ capability. In fact, that’s all it does: as soon as you type the third v, all three are replaced by the contents of the clipboard, a bit like typing Cmd-V on a regular keyboard. I find this rather easier, particularly in small text boxes on a phone screen: to have a keyboard-based paste function, instead of having to move from the keyboard and tap carefully in the right place, with the right precision and timing not to select anything.

It really is too bad the Apple apps don’t support it, but I hope it may be useful for others anyway.

© Copyright Quentin Stafford-Fraser