Life, Mozilla


Sep 1st, 2011

A bit quiet here for the last few months. What’s been happening?

  1. I got married and had a wonderful honeymoon in France.
  2. I started a fantastic new job with Mozilla’s tools & automation group. Currently working on bringing down the build/test times for Firefox (part of a project called GoFaster), which has been really interesting.
  3. I moved into a fantastic new apartment in an old victorian building near Vendôme metro.

In short, life has been treating me really well! More updates soon.

BIXI, Data Visualization, Montreal

A better BIXI web site

Jun 10th, 2011

There’s much to like about the BIXI bike-sharing system in Montréal: it’s affordable ($78 for a year of biking), accessible and fun to use. There’s absolutely no doubt in my mind that it’s made cycling more of a main stream activity here in Montreal, which benefits everyone (even drivers indirectly gain from less congested streets).

With the arrival of the first BIXI stations in NDG, I decided to subscribe to it this year even though I have a bike of my own. So far, it looks like I’m going to easily use it enough to justify the cost. I still use my regular bike for my commute from NDG to the Plateau, but on the edges there’s a ton of cases where it just makes sense to use something that I don’t have to worry about locking up and returning home. Sometimes I only want to go one way (for weather or whatever other reason). Other times I want to take public transit for one leg of my trip (or day), but need/want to take a quick jaunt elsewhere once I’m downtown.

I do have to say though, their new web site drives me crazy. I’ve thought prety deeply about the domain of creating user-friendly transit-focused web sites, so I think I can speak with some authority here.

Leaving aside it’s value as a promotional tool for the service itself (not my area of expertise), the experience of trying to find a nearby station is complicated by a slow, multi-layered UI that requires repeated clicking and searching to find the nearest station that has bikes available. Why bother with this step when we can just display this information outright on the map? iPhone applications like Bixou have been doing this for years. It’s time we brought the same experience to the desktop.

Thus, I present a clean, useable interface to BIXI’s bike share system that presents the information you care about as effectively as possible, without all the clutter. I’ve already found it useful, and I hope you do too. Think you can do better? Fork the source on github and submit your changes back to me! Minus some glue code to fetch station info server side, it’s entirely a client-side application written in HTML/JavaScript.

Note that the site uses a bunch of modern HTML5 features, so currently requires a modern browser like Firefox, Chrome, or Safari to display properly. I may or may not fix this. Other notable omissions include support for other cities with the BIXI system (Toronto, Ottawa, …) and French localization. Patches welcome!

Free Software, hbus, Open Data, Transit to Go

Routez opensourced

Apr 19th, 2011

Just a quick note to say that I just opensourced the software behind, nicknamed “Routez” under the Affero GPL. You can get the code on github.

For those new to the project, is a generic trip planning / transit information site for Halifax, Nova Scotia written using the Django web framework. It currently has two main features:

  • A trip planning front-end much like Google Transit (built from the ground up using the libroutez library).
  • A “nearby” routes feature which gives you all the bus departures near a particular location.

On the backend, both of these features are accessible via JSON APIs, for use in transit apps, etc. Transit to Go uses these to great effect.

There is nothing particularly Halifax-specific to the underlying Routez software, aside from various references in the web front end to Halifax and In fact, we use Routez to provide information for Transit to Go Edmonton right now, with no modification.

Originally my plan was to release something that was completely generic out of the box so that anyone could trivially make up a version of this site for their favourite city. I’ve made some headway towards that goal over the last week or so, but there’s still some ways to go. There’s basically two major issues:

  1. The geocoder depends on information gleaned from the geobase road network dataset. The intent behind this is noble (provide an end-to-end solution that doesn’t depend on third parties) but in practice this limits the software’s usefulness. It would be better to optionally allow a Routez-based site to use Google’s geocoder on the front-end. Unfortunately, to comply with Google’s terms of service, we’d also need to use their Maps API for the base map as well. Perhaps the best option here would be to use something like Mapstraction to allow users to select their preferred mapping provider.
  2. The trip planning software used in the backend, libroutez, is getting a bit long in the tooth and is quite finicky about what kind of data it will accept. I think the long-term solution to this is to switch to Graphserver (which is more mature and better supported), but some features would have to be added to it to support the kind of things that Routez needs (like a list of upcoming departures at a particular transit stop).

Even with these problems, I figured it would be better to open up what I have for people to check out and play with. Have a look and let me know what you think!

Free Software, iphone, Montreal, Open Data, Usability

Déchets Montréal goes mobile

Feb 19th, 2011

A few weekends ago, there was a Montréal Ouvert hackfest at the Notman House. I decided to take a bit of a break from my usual transit hacking and built up a mobile friendly interface to the wonderful Déchets Montréal, which lets residents easily get information on their garbage collection schedule.

The interface is intentionally quite simplistic, the idea being that if you’re accessing the site using a mobile device you’re probably only interested in the collection schedule for the current week and nothing else. If you want something more complicated you probably should just be using the full site.

Anyway, another fun opportunity to play with mobile web technology (a bit of break from my current consulting gig, which is mostly native iPhone apps). A few things that I learned this time around:

  • It’s easy to give your application a nice icon when added to the iPhone home screen by using a webpage icon.
  • Related to the above, you can give the user a nice hint to add your webpage to their homescreen by using Google’s mobile bookmark bubble library.
  • The iPhone’s form interface will persist after pressing “Search” unless you change the focus using an anchor element.
  • jQuery is the best thing since sliced bread for dynamic web applications (ok, I actually knew this already but I just can’t get over how great it is).

Thanks muchly to Kent Mewhort, the brains behind Déchets Montréal, for helping me incorporate my work into his Drupal-based site.


Rice & Barley, Rae Spoon at Casa del Popolo

Nov 29th, 2010

This weekend my girlfriend’s band (Rice & Barley) did a show at Casa del Popolo. It was great, you should have been there. I made some videos using my trusty new iPhone:

Rae Spoon, the headline act, was awesome. I recorded one of his songs, which he kindly gave permission to post:

Vidya (the other opening band) was good too, though I didn’t get a chance to record them. Next time!


Ginger Tea and Channa Masala

Nov 19th, 2010

Channa Masala

Originally uploaded by William Lachance

Ok, I’ll be the first to admit that the content on this blog has been rather nerd-heavy, somewhat breaking the promise I made when I first started it to have “approximately the same mix of personal, political and technical content” as my old livejournal. I’ve been meaning to correct that for a while, but as often happens, other things have taken priority.

Well, it’s time to make a stab at it.

I’ve noticed that a good numbers of searches on this blog have been for ginger tea and/or channa masala (chickpea curry). Must have something to do with this blog’s name. Unsurprisingly, these hits tend to have a high bounce rate (people coming to the site and immediately leaving, probably dissatisfied). Well, it’s about time these people get satisfaction with these wonderful, easy to follow recipes:

Channa Masala (recipe courtesy of Mark Côté)

1 medium-sized onion
1 clove garlic
1 2-cm cube ginger
2–3 fresh or dried chilis
1 tsp salt
1/2 tsp turmeric
1 small tomato
2–3 curry leaves
1 540 mL can chick peas
1 tsp garam masala

Saute onion, garlic, and chilis as usual, adding ginger at the same time as the garlic. Place the tomato in boiling water until you are easily able to remove the skin. Add salt, turmeric, tomato, and curry leaves, and cook for another minute. Add chick peas and cover with water. Cook for 15–20 minutes, until water is absorbed and chick peas are tender. Add garam masala, stir, and serve.

Ginger Tea (very informal recipe)

1 hunk of ginger, coarsely chopped (perhaps 4 tablespoons worth)
4 tablespoons honey
3–4 cups water

Put above ingredients into pot, at maximum heat. Bring to boil. Turn heat to low, let cook for 30 minutes or so. Consume. It’s the best medicine for a cold that i know.

Free Software

Back to WordPerfect: libwpd 0.9.0

Nov 17th, 2010

Those who’ve known me for a while have probably heard about my first major open source project, libwpd. In a nutshell, it’s a parser for WordPerfect documents with the primary aim of converting them into something usable by the major opensource office programs out there. It’s used by LibreOffice,, AbiWord, and KOffice. WordPerfect isn’t the most popular word processor out there, but there’s still quite a number of legacy documents in that format, especially in the legal community (which was almost exclusively using WordPerfect until very recently).

This project goes way back: I started work on it with Marc Maurer way back in 2002 (just after I graduated from University). I put a rather ridiculous amount of unpaid work into it for a few years. WordPerfect’s streaming document format is a bit esoteric to say the least, and figuring out how to map into the document model used by more modern software was a pretty interesting problem. I still remember spending sleepless nights trying to reliably convert WordPerfect’s outlining into structured lists (I mostly succeeded).

Since then, I’ve mostly moved on to other things, leaving the project in the capable hands of Fridrich Strba, who’s been steadily working on adding a number of important features to the library that massively improve import fidelity. I did have time this summer to add page numbering support (thanks to Yam Software for sponsoring that work) and move the project over to git from cvs, but for the most part it’s been his show since late 2004.

Even if I’m not as actively involved as I once was, when there’s major developments, I still get excited (perhaps in the way that a parent might about a child who’s left the household). And yesterday brought something pretty big: libwpd 0.9.0. With this release, we finally supports graphics (thanks to the work of Fridrich and Ariya Hidayat on libwpg), notes, the page numbering that I mentioned above, and support for encrypted documents. It’s a big deal. Here’s some before and after screenshots:







All this goodness should be available transparently whenever you import a WordPerfect file in an upcoming release of LibreOffice. AbiWord and KOffice filters should come soon enough as well (the updates needed to support libwpd 0.9 are fairly minimal).

Integration with is another story. Without going into great amount of detail on the situation (see this article on Ars Technica for the gory details if you’re really interested), it’s quite unlikely that WordPerfect support will advance unless (1) someone volunteers to do it and (2) Oracle drops their copyright assignment policy. The chances of these things happening seem rather low to me. My personal recommendation would be to switch to LibreOffice as soon as the first production version is released. I expect it to rapidly overtake in functionality due to its more open participation model.


Google Transit Halifax is down (but hbus and Transit to Go are still up)

Aug 29th, 2010

Due to some schedule adjustments, it appears as if Metro Transit’s Google Transit is temporarily out of service while they wait for Google to process their new transit feed.

However, fear not! Unlike Google, obsessive compulsive computer programmer William Lachance works on weekends for free (or the low, low price of $1.99 in the case of iPhone applications) so your thirst for updated transit information can be satisfied. I link to these things often enough on this blog, but here they are again, for the benefit of first time viewers:

  • Transit to Go In other news, it appears as if Metro Transit has finally seen the light and made their transit information available to anyone who wants it. I would like to think that I might have had something to do with this, but I honestly have no idea. Anyway, if you want to check it out, it’s available here.


hbus is back

May 24th, 2010


After a month long hiatus, I finally had a chance to get back into a working state. The big difference is that we’re now using the official HRM transit data. Lots more remains to be done to make this site competitive for 2010 (most of the recent work has been back-end infrastructure stuff), but at least it’s usable again.