San Francisco.

Two things:

  1. Where I live now is not far from anywhere, really. Market Street (and the rest of the Financial District) is in walking distance, or you can take the bus which gets you there is 5 or 10 minutes; Chinatown is essentially on my doorstep; there’s a bus to Fisherman’s Wharf; the cable car runs just a little up Russian Hill, and further up from that is the famous wiggly bit in the road; in the other direction you can walk down the Filbert St. Steps right down to Levi’s Plaza and the Embarcadero. The walk up Russian Hill affords views over the Golden Gate to Alcatraz, while the summit of Telegraph Hill offers a look over the Bay itself to the Bay Bridge, Yerba Buena Island and the city of Oakland beyond.

    Not to forget the neighbourhood of North Beach itself, full of fantastic independent stores (local planning laws dictate that no chain store with more than 11 branches may open up shop here) and characterful buildings. (My apartment is certainly characterful, and not without its quirks, but it’s very liveable.) Not to mention the fact that this is San Francisco’s version of Little Italy. It’s pizza neighbourhood: just poke your head outside in the evening and you can smell it. North Beach is truly one of the greatest places I’ve ever been, in what may be the greatest city I’ve ever been to.

  2. I love this city more with every step I take. I can honestly say, much-missed family and friends notwithstanding, that if the stupid immigration services told me that I could live the whole rest of my life here, I would unreservedly accept.

Point, counterpoint.

  • Aaron Swartz: the Existential Terror of San Francisco. I can certainly feel this walking around on Friday or Saturday evening, or near the shadier parts of town. That said, Swartz seems to indicate that he was living in the Tenderloin, which is kind of like living in a tree and complaining about the monkeys.

Acoustically optimised Chipotle queueing.

Yesterday I had my first experience of ordering at Chipotle. (/tʃɨˈpoʊtleɪ/) The food itself was great, but the process of buying it was frustrating because I could barely hear what the servers were saying. It was kind of loud in the restaurant, and the acoustics didn’t really help: we were basically speaking to each other through a piece of solid glass, absorbing everything either of us said.

One possible solution would be for all the servers to carry loudhailers and speak to all customers through them. This would be a little patronising, not to mention loud. It could well make the situation worse, in fact, since multiple concurrent orders would be interrupted by the noise of each other.

Another solution would be to aim microphones in the general direction of the servers, install a hearing aid loop system, and issue all customers with free hearing aids. This would be prohibitively expensive, though. (Do you know how expensive hearing aids are?)

My solution is to issue every server with a pocket microphone, and an RFID card reader attached at waist level. The edge of the counter on the server side has uniquely-identified RFID cards attached at very regular intervals. On the customer side, the same number of speakers minus one are attached.

As the server walks along the counter, the reader registers the cards, sends a wireless signal to a control computer, which activates the two speakers corresponding to the server’s current position, and connects them with the server’s pocket microphone. (It also deactivates whatever speakers the microphone was previously connected to.)

This way, wherever the server walks along the counter, there are speakers amplifying their voice and nothing else, out to the exact point where it’s needed.

Questions you might be asking right now:

Why not put RFID readers on the counters, and cards on the servers?

There are probably more attachment points on the counter than servers, and RFID cards are cheaper than readers.

But you could eliminate the control computer if you did it that way, and computers are expensive!

Not this one.

Why not just attach microphones regularly along the counters, each connected to one speaker?

This would amplify all noise behind the counter, including the various noises that make it hard to hear in the first place.

Why not just ask the server to speak up?

I’m shy.

Why specifically Chipotle?

I’ve never had this problem at Subway or any other fast food chain with an ‘assembly-line’–style ordering process. But it could work anyway.


On Emeryville.

Right now I live on a quiet-ish suburban-ish road in Emeryville, California. It’s quite a nice place. It’s a few blocks from the Amtrak station, which is neither convenient (they don’t go anywhere that isn’t more conveniently reached by BART) nor quiet. (If you’re used to the short, tuneful (minor-third) toots that British trains make on their horns, you will find the long blasting horn noises of American trains maddening.)

It’s amazing that some of Emeryville’s amenities serve the whole of San Francisco, because nothing here is really huge. The Amtrak station, which serves multiple long-distance express services, only has two platforms. Or Target, which doesn’t stock much given that the next nearest store is in Daly City. (That said, there is a Walgreens on practically every street in the city itself, plus a Costco in SOMA and a Safeway at Church and Market.)

The Internet’s favourite navigation tool will tell you that it takes twenty minutes to walk from where I live to the nearest BART station. This is a lie: it takes a full hour. There is a free bus service that will take you there, going by the quaint name of ‘Emery-Go-Round’, but it apparently only runs on weekdays. I say ‘apparently’ because while walking to the BART, one of them drove past me in the opposite direction.

I’ve passed Pixar a few times on the bus. Apparently to go in you either have to work there, or be Merlin Mann or Rob Corddry. Even from outside it looks like a fun place to work: there’s a football field and a giant (4 feet in diameter) colourful ball rolling around outside, and you can just about peek at some memorabilia for Toy Story, WALL-E, etc.

Emeryville seems like a sensible enough town, on the whole. To remedy this, next week I will be moving to Berkeley. Fortunately, my stay there is equally short, for thereafter I will be moving to San Francisco proper, away from the hippies and into North Beach, which seems to be full of hipsters.


Resources for processing Internet mail.

A current project of mine (announcement to follow) involves a lot of processing Internet mail, doing the sorts of things one does with email: sending, receiving, parsing, threading, etc. One thing I’ve discovered is that when you work on the backend of an email system, you pretty quickly come to see some people as heroes. djb and jwz in particular know how to handle mail, and they’ve written their knowledge up so that anyone can learn how to build mail-handling programs with relative ease. (Internet mail has layers of cruft going back almost 50 years, and the specs are almost all wrong.)

There are also anti-heroes in the email world. (Naming no names, sendmail, Outlook, and Ruby’s Mail gem come to mind.) There’s a lot of shitty mailing software out there, and in order to handle mail robustly, you have to listen to the right people. Fortunately, the right people have a habit of making it easy to listen to them.

djb’s guides to SMTP and the 822 message header format are excellent guides to how qmail’s famously robust mail routines work, with practical advice for avoiding common pitfalls. Read these before you read the RFCs. You might find you don’t even need to read the specs: you could build a far better mail system than any of the common solutions by just reading these. (Unfortunately, the message header documentation doesn’t cover MIME. As soon as I can, I’ll write up an addendum to cover the modifications MIME made, and offer similarly pragmatic advice where I can.)

jwz offers a guide to his own message threading algorithm, used by Netscape 3.0, carelessly abandoned by 4.0 but since re-adopted by several well-known mail readers. And a guide to the hacks needed to make processing mbox files reliable and efficient. (Note: from a purely theoretical standpoint, Maildir is probably a better choice than mbox. I don’t have personal experience with this, but there do seem to be a lot of mail clients which prefer it these days.) Remember that mbox isn’t just one file format, but a family of similar, but incompatible formats. (Also, the Content-Length style mbox is to be avoided.)

jwz also has product design advice regarding mail servers and readers, which could be just as useful to people writing any kind of software.

One thing that’s missing from this panoply of pragmatic mail resources is a guide to the Maildir format, and how to process it reliably given the Maildir++ extensions. I would write this myself if I had the expertise. It clearly isn’t that complex, especially compared to the mbox mess, but could probably still be treated with a short guide.


Restartable search in Plan.

I’d usually post this on Gist but as this blog has been rather quiet lately, I thought I’d share it here.

(deffn (search f default xs)
  (if (nil? xs)
        default
        (let (res (f (car xs)))
          (if res
                (list (car xs) res (fn () (search f default (cdr xs))))
                (search f default (cdr xs))))))

This function searches a list, xs, for a value matching the function f. If it doesn’t find one, it returns default; otherwise, it returns a list of three items:1 first, the item in the list which matched; second, the value that function returned when we tried it; and last, a thunk which, when called, will resume the search and return another, similar list when it finds a second matching item. (Or, the same default value if there is no other value.)

Here’s the transcript of a REPL session demonstrating this new function.

> (set res (search odd? 'no-more '(1 2 3 4 5 6 7))) 
(1 t #<function>)
> (set res ((caddr res)))
(3 t #<function>)
> (set res ((caddr res)))
(5 t #<function>)
> (set res ((caddr res)))
(7 t #<function>)
> (set res ((caddr res)))
no-more

(set, like in most languages, returns the value that was assigned to the variable. This differs from Scheme, which returns an unspecified value, which is usually no value at all.)

This could be made more powerful by making it search through multiple lists together, making it behave like map when passed more than one list.


  1. Schemers will argue that this sort of thing is why we need multiple-value return, but I disagree. There is probably a better way to handle situations like this than passing out a list, but I want to find a way that’s better than multiple-value return. (At least, better than it is in Scheme.) 


How to get all your friends to compliment you on your blog.

Completely abandon it for a month, apparently.

I’m working on AllParty.org, a public database of All-Party Parliamentary Groups run by Paul Birch and Michael Halls-Moore.

This month has been pretty crazy, except I didn’t regularly blog about it. I’ve met some amazing people and done some great stuff.

Josh and I have been working together for the last couple of days in Manchester. We work in the Triangle shopping centre, which is very quiet because nobody ever goes in there. We work in the café on the bottom floor, using their Wi-Fi network. Sometimes we go up to Caffè Nero because they have one table hidden in the corner that has a power socket, so we can take turns at charging our MacBooks. Then we go to Tampopo or Zizzi’s for lunch and go back to the café when we’ve eaten. It’s a good fit, and it lets us get a lot done together.

Last night was my schoolfriend Sam’s 18th birthday party. It was fun seeing a load of people from school again, and explaining how my life is going outside of school. I mostly resisted the temptation to explain how school is a device for keeping students unaware that it’s a pointless exercise to convert people into factory and office workers. Can’t be having any more young delinquent dropouts. A number of people said they were reading this blog regularly, which was fun.

Anyway. I’ll try and keep this a bit more regularly updated now.


Dropout: Day 29.

I’ve had been a crazy time since last Friday. Too crazy and busy for me to write about. I came back from London yesterday evening.

I’m no longer moving to London. I have a pretty good work offer, which only needs me to be in London part-time. I have the solid base of a long-term plan. Things are looking good.

(Editorial note (which nobody will care about): I’m considering ending the “Dropout” series. I originally planned to start a new series called “London” when I moved in, but as that doesn’t seem to be going ahead I’m going to have to think of another title, and another reason. The diary entries will continue under a new title.)


Dropout: Day 23.

Today was a day spent working in front of the computer, which is not nearly as exciting to write about as galavanting off to conferences is, but it was good to have a day of rest after the intensity of LWF.

I worked on YRS-related stuff most of the time: assigning applicants to centres, drawing centres up on a map, etc. (The latter was done with awk, which was a terrible idea but I blame Adam for encouraging me.)

It’s been over a week since I interviewed with a certain London-based internet company. I was supposed to arrange another interview with them during this week, but I sent them an email telling them when I was available but never they never replied. I’m a bit disappointed that, after calling me in for an interview, they don’t even have the decency to even send an email saying that “Sorry, we’re a bit busy, we might take a while to get back to you,” or something along those lines.

A a short interview with John Roderick has just been published. He talks about his next album, and getting a band together to form the new The Long Winters. (Since Eric Corson, the bassist, left the band, it’s now just John alone. The upcoming record will feature the first all-new line-up of backing band members since the band’s formation in 2002.)


Dropout: Day 22.

What a fucking tiring day.

Another early start, with my alarm interrupting a dream again. I think that is probably incredibly bad for one’s mental health and sanity, because it is so deeply jarring.

Josh and I checked out, took a cab from our hotel in Kew back to Olympia (which took almost an hour in the rush-hour traffic) and got started immediately on our new project. We had barely got it working in time for the presentations.

Most of today was spent hacking, which is a rather boring thing to write about in an online diary. But a few cool things happened: I talked for a while (well, Josh talked with me in the middle because I was incredibly busy coding) with Dallas Campbell, one of the presenters of the television show Bang Goes the Theory. Not that I watch that or any other TV programme: I only knew who he was because he presented the awards yesterday.

The time came to present, and it mostly went well. Then we had to dismantle everything around the Rewired State pod, which was a bit chaotic because Henry had to park the van many miles away, so while everyone else was finishing packing away, the Rewired State stand was still mostly intact while we waited for our van to arrive.

While we were doing this, Josh (whose original plan had been to stay in London all week) realised he had to go back to Manchester. That just left me to stay at Emma’s house tonight and tomorrow.

Eventually we grabbed a Micro each and headed across the road to a Persian restaurant. The food there is pretty good, actually. (Sorry, I can’t remember the name.)

I had (deliberately, not realising we couldn’t go back in) left my bag in Olympia, so Henry found it while dismantling the stand, and had to stop in the street to give it to me.

Emma is at a big dinner for all the people who spoke at LWF. She had tried to get me into it, given that I’m staying at her house and it would have made sense to head back there together, but she couldn’t. So I caught the Overground to Clapham Junction, then a (very late) train from there to Guildford. I was greeted by Emma’s boyfriend Phill, who has an early morning start and usually slept early, but kindly opened the door for me.

Sleep time now.


Dropout: Day 21.

I woke at 6:00 am and showered, dressed, and was ready to set off to LWF at 7. I jumped in the back of the van (it was my turn) and waited for us to arrive at Olympia. We couldn’t go in the easy way so we had to walk all the way round to the other side of the conference centre, then once we were in we had to all the back to near where the sensible entrance was. But we bumped into John Bevan on the way, so it wasn’t all bad.

Once the conference had started, I headed to the main theatre to catch Noam Chomsky’s video speech. It turned out that would be the last speech I would see, because after that they started turning away people with exhibitor’s badges because only conference attendees could watch the talks.

We spent a while playing with the BBC Micros in the BBC’s tent (implementing the inevitable 10 PRINT "HELLO WORLD"; 20 GOTO 10; RUN program almost immediately), then with Lego in their tent, which invited visitors to “build the campus of the future,” in Lego, of course.

After that we needed to do some actual hacking. I had a barely-formed idea for a hack involving natural-language processing. Using stuff I half-remembered from building the natural-language parser in SICP, I was able to string together a roughly-working parser in Ruby but didn’t get much else done coding-wise because of various distractions, like food, sweets, and a Mario mascot posing next to Rewired State’s Storm Trooper dummy.

After the excitement of not doing enough coding, we headed to Pizza Express, where I was indecisive (as always at restaurants) but eventually managed to choose. We then headed upstairs to a ‘networking reception,’ met a few people we knew, then to an awards ceremony where Emma had been nominated for an award. She was worried about it and hopeful that she wouldn’t win it because she would have to give a speech, and wasn’t really prepared for it.

Fortunately, she didn’t win. We headed back to the hotel in a cab, left Emma to head back to her house in Guildford, and Josh and I split up in the lobby to our individual rooms.