Margaret Hunter Young (Gammie), 15 Dec 1908 - 8 Dec 2010

Today my grandmother would have been 102. She was born in Aberdeen, Scotland in 1908, and moved to Vancouver, Canada with her family a few years later. She was a teacher of French and Latin when she married my grandfather, but stopped teaching when they married (this was required by law at the time).

My grandmother never learned to drive a car, and I don't think she ever even rode a bicycle. However, she traveled a lot with my grandfather, both for his work (teacher training) and for leisure. During these travels, they made many lifelong friends. I remember at Christmas time they always had dozens (or was it hundreds?) of greeting cards hung on string around their dining room.

She had an astounding memory. Some 35ish years ago, they traveled to New Zealand (and Australia, Fiji, etc), but the trip was still so fresh in her mind that she could even recall specific roads they had driven here in New Zealand. We would tell her about a trip we took the week before, and she could probably remember details better than we could.

When Amy and I would call to chat with her, she was always glad to hear from us but she always tried to keep the call short. After, all, it was long distance and must have cost us a fortune! (Really, it doesn't add up very fast at Skype rates.) She never quite got the hang of the modern electronic world; the most advanced device she learned to use was probably a microwave oven.

Amy and I took a quick trip to Canada in June to celebrate her 101½th birthday (when you get to that age, you get to choose what time of year you want to celebrate your birthday). It was great to see her, she was doing very well all things considered.

Margaret passed quietly in her sleep last week. Today we had cup of tea with dinner in her honour, that's what she would have wanted.

kiwi pycon 2010 notes

Last week I went to Kiwi PyCon 2010 in Waitangi (New Zealand, of course). I didn't take my laptop and the Kindle isn't really built for notetaking, so I scribbled notes the old fashioned way on a sheet of venue-provided note paper. The following is a dump of what I have.

  • Consider Fabric for automating deployment/admin tasks
  • A different approach is Chef, which is a declarative language for describing what you want your deployment to look like
  • Wikkid is a new wiki, similar to ikiwiki but in Python. It uses repoze.who for authentication, which needs OpenID support.
  • lettuce is like cucumber for Python
  • Learn Hudson. Probably more well-supported than Buildbot.
  • When creating automated test code, prefer anonymous "stock" object creation functions instead of specifying the full content of the object all the time. With the full content, how can you easily identify what's special or important about that object?
  • Use an addCleanup style method to localise cleanup of test objects
  • Apparently, reduce() is almost always used to sum numbers (now we have sum(), of course). In my code, I seem to have also used it for max(), string.join(), and all().
  • Does my Psil deserve to be on PyPi? Maybe.
  • Prefer elementtree over xml.dom
  • Investigate Mox for mock objects
  • Python has a pure functional subset. Write something to identify pure functional code. Introduce a pattern matching decorator. Offer some Erlang-like features for Python (easy message passing, lots of parallel processes, etc).
  • Wikkid again. Support Git in addition to Bzr.
  • There exists a 3to2 converter in addition to 2to3
  • Embed Unicode characters by name: "\N{LATIN CAPITAL LETTER H}ello world" == "Hello world"
  • Unidecode claims to be able to convert Chinese characters to Pinyin
  • Chardet can auto-detect character encodings

Kiwi PyCon was great again this year! Lots of good presentations and worthwhile discussion. Plenty of excellent giveaways too, nobody went away empty-handed.


kindle 3 and chinese text

A few weeks ago I started a beginner level Chinese (Mandarin) evening class at the local community college. We're about four weeks in and I'm really enjoying it, will definitely do more.

I thought it would be an interesting project to load a Chinese-English dictionary onto my Kindle for reference. I've already played with kindlegen, which takes a collection of HTML files along with some additional metadata and creates a MobiPocket .mobi format file for the Kindle. (I've got several ideas for reference documents that could be loaded onto the Kindle, more on that later.)

Anyway, I've now got a prototype Chinese dictionary loaded onto the Kindle. However, although many of the characters are displayed correctly, quite a few are just empty boxes (in the form of I ⬜ Unicode). I couldn't find any particular pattern to the missing characters, for example 他 (he) displayed correctly but 她 (she) did not.

Some research with Google showed that some people had hacked the Kindle and found a way to load different font files onto the device. I didn't try doing that, becuase I thought there should be a better solution. After all, Chinese text is displayed correctly in the Kindle web browser! Furthermore, if I copy a UTF-8 format file directly to the Kindle for display, it will have the missing character problem. But if I email the file to Amazon where they automatically reformat it to a .azw book file and deliver it to the Kindle, the characters show up correctly. If I convert to a MobiPocket book file myself, missing characters.

After laboriously paging through dozens of threads on (typical internet "forum" software really is awful), I finally found a solution. It uses an undocumented debug feature of the Kindle. Press <Home> <Search> and enter the following commands:

    ;debugOn <Enter>
    ~setLocale zh-CN <Enter>

That's it, that is all that was required. I have no idea what this actually does or how it changes the Kindle's interpretation of UTF-8 documents (UTF-8 is supposed to be an unambiguous encoding of Unicode). But I now have a very basic Chinese-English dictionary in my Kindle.

my weekend in pictures

Saturday: Removed a tonne of bricks from the front path, piled them in the back. Sunday: Laid down weed mat and installed close to a tonne of gravel. The bricks had grass and weeds growing between them and were always damp and slippery.

Monday: Bathroom renovation begins. Removed grotty old shower door, bathtub, and shelves. Now we have an (almost) empty box inside the house which will (eventually) contain a new bathroom.

What I didn't get to:


bad math: pet ownership and lottery winners

A headline in the local paper this morning reads Lucky Lotto winnners like cats with the first two paragraphs:

HAVING A cat could improve your chances of winning Lotto - by a whisker.
A survey released today by New Zealand Lotteries shows 39 percent of big Lotto winners have cats, making felines the most popular pets among lucky Lotto winners. Dogs are second but way behind with only 27 percent of big winners preferring man's best friend to moggies.

My first reaction upon reading that was, "so what?". Surely the pet ownership statistics among the general population would be reflected in those statistics for the small number of lotto winners. The New Zealand Petfood Manufacturers Assocation claims the ownership numbers for New Zealand as a whole are 53% for cats and 35% for dogs.

What does this tell us? These numbers show that a greater proportion of non-pet owners win the lottery than there are non-pet-owners in the general population. Having a cat certainly doesn't "improve your chances" as the article claims. (These are just rough numbers because we don't know what proportion of either the general population or lottery winners own both a cat and a dog.)

They say the lottery is a tax on people who are bad at math. Apparently, the "bad at math" part extends to those writing about the lottery, too.


amazon kindle first impressions

I got my Amazon Kindle 3 earlier this week! I pre-ordered it around the end of August and seemed to receive it here in New Zealand before some US users received theirs. It was packed in an integrated protective/shipping box, and my first thought upon opening it was, "Amazon has been taking lessons from Apple." The device was sitting face up with clear plastic film on both sides that was easy to remove. Since the e-ink display doesn't take any power to hold the display, they had already displayed basic instructions on the screen ready to go (just where to plug it in and where the power switch is).

The display is fantastic! It's super high resolution, quite high contrast, and the brighter the ambient light is, the easier it is to read. The first day after I got it, I sat on a beach in full afternoon sun and it was brilliant. Any other LCD display would have been struggling.

I got the model with both WiFi and 3G, and both seem to work well enough. There was no trouble connecting to my home network, and the 3G works fine even if I'm on the bus. The price of 3G networking is included in the cost of the device itself and books you buy, so there's no contract and I need to have no relationship with whoever provides the 3G. The Kindle now has an experimental web browser which can browse any web site on WiFi but is limited to the Kindle store and Wikipedia on 3G. However, with Wikipedia on free 3G this device actually is the Hitchhiker's Guide to the Galaxy. All it needs is DON'T PANIC in large friendly letters on the front.

For the first few days, I didn't spend anything on content because Project Gutenberg (among others) provide free ready-to-download ".mobi" format files for the Kindle. Downloading books is a simple click and the book magically shows up on the Kindle home page. The first (and only, so far) book I bought was Erlang Programming which I bought on my way home on the bus the other day. The purchasing experience is seamless so I'm going to have to watch that I don't spend all my money on books.

The Kindle comes with two dictionaries built in, the "Oxford Dictionary of English" and "The New Oxford American Dictionary". Both these are books in their own right that can be read and browsed, but also when reading any other content you can point to a word and look it up in the dictionary (you can choose which one is your default). I often look up words to be sure I know what they mean (I'm a big user of so having the dictionary available everywhere is excellent.

There are some highlighting and note-taking features, and these seem to integrate into the social media space somehow so you can see what other people have highlighted and annotated. I haven't played with any of those features yet.

The web browser itself feels quite clunky and difficult to use (this is partly because the screen isn't a touch screen and you have to use the little navigation buttons to move a pointer around to point to things). I could log in and use some sites like Twitter, but the browser wouldn't let me type my name into the Gmail login screen for example (I tried both the regular and "mobile" sites). I look forward to upgrades on the browser, hopefully they will correct these problems. But the Kindle will never match an iPhone/iPod/iPad for general browsing capability.

I'm very happy with the Kindle and I believe I will find myself reading more because of it.

one hundred year old heirloom

When I was young, my grandparents had a fancy marble clock in their home. It always fascinated me, because it would chime every half hour (they would turn on the chime for me). At some point, a picture frame fell on the clock, which broke apart nearly all the marble pieces. The clock got put in a box where it stayed for 30 years. But my grandparents always said it was my clock.

Fast forward to earlier this year. Amy happened to be looking at antique clocks as she was thinking that something like that would go well on the mantel above the fireplace. I said, "Hey, did I ever tell you about my clock?" Apparently, I hadn't. The next day we called my parents, who found the box of clock parts under the stairs, and we managed to coordinate its transport to here in New Zealand with only minor damage.

Some of the marble bits were broken and one of the metal movement supports was bent, but everything was present and the movement (all the mechanical bits) worked. I researched its history and found that it was probably made in France in the late 19th or early 20th century, and the adhesive used at that time was roughly, plaster of Paris and egg white. This probably protected the marble pieces because the adhesive wasn't that strong and came apart first before breaking the marble. However, we decided to put it back together with a modern glue (not too strong, but not just white glue).

The more interesting part about this clock is its history as it relates to my family. The inscription reads:

Sons of Temperance Friendly Society
Birmingham District Grand Division
Presented to Bro. William Aucott J.P.
as a mark of esteem and appreciation
on completion of 44 years continuous service
as Trustee of the above Society
August 27th 1910

William Aucott was my great great great grandfather. He was born in 1830 in Leicestershire in England, was an early trade union leader when such things were being founded for the first time in 1863, became president of the National Association of Ironworkers in 1874, and served in a number of different roles in different labour organisations throughout his lifetime. He was involved in the Methodist church, helped establish the Sons of Temperance Society in Wednesbury, and was a magistrate on the Wednesbury bench.

Exactly one hundred years ago today, William Aucott was presented with this very clock as thanks for his service to the society. I'm sure he would be happy to know that the clock remains a treasured posession in our family.


web site content management using git

For the past several years, I've managed my web site content using a local copy (of everything) on my home machine, and a simple rsync script that transfers changed files up to my web site host. While this works, it's limited (there's only one "source" copy of my content) and fragile (if I need to change something on the server, I need to remember to make a local copy before syncing again).

I've always known it would be better to manage the content using a real source control system. When I first started managing my web site like this, the state of the art in source control was Subversion, but I never got around to actually setting it up. Today, my source control system of choice is Git, and it seems like a natural fit.

Importing all my content into a new repository is easy, and I pushed up the repository to my web host overnight. The compressed repo size is 2.6 GB and Git handles it just fine. It feels much better to have multiple mirror copies of the site content, and it's much nicer to be able to manage it using a powerful tool like Git.

HP-15C calculator simulator

I'm a bit of a calculator geek. My favourite calculator is the HP-15C, an advanced scientific programmable RPN calculator made in the 1980s. It's got a distinctive form factor:

I bought mine in 1987 and it got me through university, and still runs on the same set of batteries it came with 23 years ago. The HP-12C financial version of this calculator did so well that it continues to be sold to this day.

These days it's a bit awkward to actually carry a calculator around (since there are computers everywhere), so I've implemented a (nearly complete) simulator for the HP-15C in Javascript. You can find it at along with some more information about its capabilities and current known issues.

If you're unfamiliar with this calculator, you can find a scanned copy of the Owner's Handbook (and the Advanced Functions Handbook) online. There is even a Petition to Bring Back the 15C that you can sign.

If you've ever used this calculator, or one like it, I hope you find this simulator entertaining. Feedback, bug reports, and even contributions are welcome!


Yesterday Amy and I adopted a young black male cat from the SPCA. We had been talking about getting a cat for a while, and while we were out yesterday decided to go have a look. They had quite a few cats available, and we both quite liked the look of a small grey female with a very distinguished narrow face. However, this black one seemed much friendlier and purred a lot. It was a toss-up for a while but we were both won over by the black one.

We had just finished watching the movie "How to Train Your Dragon", which features a rather feline black dragon named "Toothless". That would be a fitting name for a black cat, we thought. While we were doing the paperwork, they noted that he was due for his deworming pill, so they gave him the pill right there. But while he was taking the pill, we noticed one of his teeth didn't look right. Sure enough, it was askew and fell out in Amy's hand! They suspected that it may have been like that for a while and that he would be fine without it. We realised right then that the name "Toothless" would stick.

He's very friendly and purrs almost continuously when sitting near us (right now I'm slouching on the futon with my laptop propped up on my knees, with Toothless sitting on my chest purring). He knows where his food and litter box is, but we're definitely going to have to get him a scratching post to save our furniture. For now he's got full reign over the living room and kitchen, and we'll introduce him to the rest of the house in time. Ultimately he will be an outdoor cat too, because we regularly leave windows and doors open to let the air through the house. Hopefully he won't get too tangled up with the other cats in the neighbourhood (of course he's been fixed).

Very happy with him.