ES6 Templates

One of my favourite upcoming features in ES6 is Template Strings. I’ve used JQuery’s templates in some previous code I’ve worked on, and while it was very useful in finishing the feature on time, it’s aged now and relying on third-party libraries which we don’t have time to keep up to date isn’t the best idea and so we’re in the middle of some work to remove them. So having said that, I’m quite happy to see something similar arriving in the base language, so that we can take advantage of it without having to add any extra code.

As an aside, all the code below was tested in Firefox 34, using the Scratchpad. The comments are pasted in below the code when you select it and choose the Execute » Display menu item or hit Ctrl+L (Cmd+L on Mac). I hear they also work in Chrome, but they didn’t seem to in the version I was running (39.0.2171.95), and I didn’t want to start messing with an --es-staging flag. If someone can confirm whether they work or not, I would certainly appreciate it! :)

Read more…

New Year’s Resolutions…

Well, I managed to spend New Year’s Eve lying sick on the couch, and then went to bed semi-delirious from lack of sleep at 12:08, which kind of sucked, but I’m still hopeful that 2015 will be better than 2014 was. I mean, it almost has to be, right?

Anyways, my first, and so far only, resolution is to consume less and create more. When I look back on the year, I find I have spent more of my free time than I’ld like passively consuming other people’s content instead of making new things of my own, and that kind of bothers me. I’m very glad that a large part of my job involves making things, and that has definitely been rewarding, but there are also a lot of personal projects I want to start or finish or just push forward. And it doesn’t have to be code. I’ld like to write more blog posts, to explain the things I’m doing, and why they interest me enough to spend time on.

Listening to things…

In high school and university, I used to listen to a lot of music. As I went about my day, there would continually be something on the cd player. But these days I find myself listening to podcasts1 in my spare audio time instead, and that strikes me as interesting because without meaning to I seem to have moved from (largely) mass-produced, mass-marketed entertainment to (mostly) independent, informational2 entertainment.


  1. The list, in alphabetical order, is: Accidental Tech PodcastAfter DarkBitsplittingCore IntuitionEdge CasesFear the BootIsometricJavaScript JabberLESS THAN LIVE with KATE OR DIELostcastNo Such Thing As A FishThe DiecastThe Dungeons & Dragons PodcastThe IncomparableThe Stack Exchange PodcastThe Web AheadTotal Party KillWebcomics Weekly 

  2. I’ll readily agree that most of the things I learn aren’t going to impact my life in any significant way. I’m not going to read many comics, or play many role-playing games, or do, uh, whatever QI does, but they’re still fun to listen to. :) 

Minecraft and orcs.

I’ve been playing a bunch of Minecraft on a survival-mode server recently, and it occurred to me that when I’m playing, I basically act like an orc — cutting down all the trees, digging up all the stone, killing all the animals — all so that I can build whatever fancy strikes my mind.

In my normal life, I bike (or take public transit) for all my trips; I recycle cans, bottles, cardboard boxes; I compost vegetables in my back yard, and other organic waste through the city’s compost program; I keep the house fairly cool in winter, and we barely ran our (window) air conditioner at all this summer. But as soon as I log on to the server all the normal behaviour is right out the window.

Maybe when I build a house of my own, I’ll try to only use sustainable materials, and see how it is to live in a Minecraft world…


New kinds of thoughts.

Earlier in my life, I would have looked at the new window in the door, and thought “Nice! They must have put that in so that people wouldn’t slam the door into other people when they opened it.” But now I find myself thinking “Nice! They probably put that in so that people wouldn’t slam the door into other people when they opened it, but it also has the beneficial effect of letting people know if there’s someone lurking in the stairwell before they open the door.” I’m not completely sure what’s changed in my life (other than I’m exposing myself to more varied viewpoints than I did when I was younger), but it seems like a positive thing from where I’m standing.

(There are a bunch of things I’ve been thinking recently, and they don’t tend to fit in 140 characters, so I’m going to try and post more of them here)


Figuring out where things are in an image.

People love heatmaps.

They’re a great way to show how much various UI elements are used in relation to each other, and are much easier to read at a glance than a table of click- counts would be. They can also reveal hidden patterns of usage based on the locations of elements, let us know if we’re focusing our efforts on the correct elements, and tell us how effective our communication about new features is. Because they’re so useful, one of the things I am doing in my new role is setting up the framework to provide our UX team with automatically updating heatmaps for both Desktop and Android Firefox.

Read more…

New Year’s Resolutions

I know. It’s a bit late. I meant to post this earlier, but then life…

(And I realized that the reason you post your New Year’s Resolutions as soon as you can is that it’s embarrassing to post them after you’ve already broken them.)

Here they are:

1. Increase my machine time at the gym from 20 minutes to 30 minutes.

My gym routine is almost literally the least I can do: twenty minutes on a machine, usually the elliptical, and then fifteen minutes or more of stretching. I’m really there for the stretching, because if I don’t do it regularly sooner or later my back goes into spasm.

But I figured another ten minutes can’t be too hard to come by, and a bit more cardio three or four times a week can’t be a bad idea.

2. Double-veg

Another simple one: whenever I have fruit or vegetables, have twice as much. I like fruit and vegetables, and it’s really only habit which stops me from eating more of them.

3. Write more.

This is your classic poorly-planned, doomed-to-fail resolution. There is no plan here, no list of steps, no schedule, just a vague intention to “write more”.

Nothing specific, not a novel or poems or a book on the history of quick breads, but more little things: more book reviews on Goodreads, more blog posts, more letters to family, more entries in my journal.

Needless to say, this one needs more work. I don’t want to give it up, though.

2013 Year in Review

I'm writing this a little late, as it's already 2014. I suppose this way I can be sure I'm not missing anything, as one never knows if 11:42 pm on December 31 might be the highlight of the year.

Well, it wasn't. But at about that time someone did ask me what the highlight of 2013 was, and I was stumped. I thought of our trip to Buffalo, but that was in December; not even a month prior. So to write this post I'm going to have to look at calendars, to-do lists, photos, old emails... Clearly my own brain won't suffice.

In January I wrapped up work on Shamans Among Us with Joseph Polimeni. I edited and typeset the book, as well as designing the cover and overseeing proofreading and website design. It was a fascinating book to work on; I learned a tremendous amount.

But after Shamans wrapped I set aside my editing work to join Greg Wilson at Software Carpentry. That's a big deal, really. It's my first regular, non-freelance job since Delphine was born. It's so nice to be part of a team, to be useful and wanted for something other than knowing where the clean socks are and what we're having for dinner.

We all did a lot of travelling this year, mostly by ourselves. Delphine went to a few Guide camps and week-long sleepover camp in summer, and Cordelia went to Brownie camp. Blake went to Pittsburgh, London, Brussels, San Francisco and Minneapolis, and I went to Portland OR, Boston, and London (but not at the same time as Blake). The girls and I went to Saskatchewan in June, and in December we all went to Buffalo, which sounds lame but might have been the best trip of all.

In June my first-cousin-once-removed Emily came to visit with her boyfriend Dan. I never met her before (I don't think? I feel like I should know this) so that was pretty cool, because she's awesome and Dan is too. The girls loved them because Emily is from New Zealand and that's pretty much Middle Earth, and because Dan played Lord of the Rings Risk with them. (Emily was also written up in the Huffington Post, which is more than pretty much anyone else I know can say.)

This is a pretty uneventful year in review, so I guess 2013 was a pretty uneventful year. I'm okay with that! I hope 2014 is also uneventful, and with some interesting trips. And maybe more cats.

Ice Storm Christmas

On Saturday, December 21 the girls and Blake and I went to a Christmas carolling party at a friend’s house. We sang lots of old-fashioned Christmas carols (the ones they don’t sing at school because there’s too much Christmas in them) and drank wine and talked about the coming storm. “Charge your phones,” I said, “make sure you have milk and bread!”

“Is it going to be all that bad?” My friends moved here from England just over a year ago — they weren’t here for the ice storm in Ottawa and Quebec back in 1998.

“It could be nothing, or it could be a few days without power,” I said.

By the time we left it was raining, cold hard rain which was starting to freeze on the ground. Blake walked us home and went out again to meet some friends at a pub. I plugged my phone in, made sure my computer was charged, tucked the girls in and headed to bed with The Sea-Captain’s Wife.

Sunday, December 22

When we woke up the power was out but the house was still warm. I lit some candles and boiled a saucepan of water for tea. I shuffled to the gym and back, and the power came back on around 10:30. Easy!

The city was covered in ice, part of the subway was shut down and people were being advised not to go out if they didn’t need to, but Delphine and I had tickets for the Sing-Along Messiah. When we heard at around 11:00 that Massey Hall was open and the Sing-Along Messiah was on, we still weren't sure whether to go or not.

My friends who were going to come with us decided not to go --- they told a very long story about a branch in their driveway and ice on their car and the subway might not be running and it would be hard and they’d rather just not bother. That was disappointing and we thought about staying home too, but we decided that an adventure of any kind would be preferable to staying cooped up at home being sullen.

Waiting for the bus, a lady shuffled towards us with unkemped hair and flushed skin, sprinkling rock salt from a gallon jug on the sidewalk ahead of her. “The subway isn’t running from Eglinton to Bloor,” she said. “No trains! They’re running shuttle buses!” Again we thought about giving up, but decided to forge ahead.

At Yonge Street three shuttle buses drove past, each too crammed to pick anyone up. A small CBC TV crew was shooting some B-roll of people giving up; Delphine wanted to be interviewed for TV but they found someone less hopeful.

Finally I decided to work around the Yonge Street problem altogether by catching the number 14 bus over to the University-Spadina line. The number 14 was diverting from its usual route because of branches on the roads, too, but it was only a twenty minute ride to Glencairn

The subway train we caught at Glencairn was the Hobbit train, which pretty much made the whole trip worthwhile. We got to Dundas station ten minutes before show time and didn’t miss a single note. Dame Emma Kirkby sang. (I wonder how she enjoyed it.) There might have been a bit of a trainwreck in the Amen fugue, but we pulled it together with lots of help from Ivars. Delphine had a good time and she’s starting to learn the choruses and sing along. All in all, going was absolutely the right choice.

After the sing-along we wandered the mall with Janet, who had joined us for Messiah, and then met Blake and Cordelia for dinner. We ate at Mr Greenjeans, our favourite mall restaurant. After a lot of food we went home and noticed that it was very dark on our block; the power had just gone off again.

Monday, December 23

The lights were still out Monday morning. I was supposed to go grocery shopping for Christmas dinner ingredients, but the grocery store was closed. I’m actually not sure what we did all day; cooking and washing dishes, tending to candles. I wrapped Blake’s Christmas gifts in the basement by the light of a single candle. I spent a lot of time checking the @TorontoHydro Twitter account. The girls and Blake decorated their gingerbread houses, which they had cleverly baked the day before the power went out.

At 8:45 pm on Monday, after the power had been out for over 24 hours, it was 16.3° Celsius in the house. People kept inviting us over to their house to warm up, and I didn’t realize why until later when I heard that other houses cooled down to 10 degrees and lower within a day. I don’t think there’s any one thing which made our house stay so warm; it’s a combination of factors:

  • really small house (about 1200 square foot)
  • a layer of rigid foam insulation on the inside of every outside wall (making the house even smaller)
  • semi-detached, so one wall of the house is insulated by an entire other house
  • protected on the north side by another house which is about three feet away
  • newish, small windows
  • honeycomb blinds

And finally, we have a gas water heater and a gas stove, so we were able to warm the place up with hot showers and cooking. I'm feeling pretty good about our little house these days.

Tuesday, December 24

On Christmas Eve morning it was 13.4°C when we woke up; it went up to 15.3°C by the end of breakfast. We went out for lunch and to see The Hobbit; when we got home the temperature had gone down to 11.4°C. We lit some candles and made pasta for dinner, and managed to drag the temperature up to 13°C before bed. Blake and I had to stay up later than the girls because of Christmas, but I lit lots of candles and we managed.

Christmas Day

When we woke up on Christmas Day it was 9.3ºC, which is perhaps too cold for comfort. But Christmas, like the show, must go on, so we made tea and breakfast and lit a bunch of candles and opened presents. Lots of books, lots of chocolate and lots of Lego, so satisfactory all ‘round. Oh, and the girls got rubber swords, which they immediately fought over. Of course.

After opening presents we went over to Baba’s house to warm up, do the cryptic, read (me), knit (Delphine), and watch TV (Cordelia). I kept checking Twitter for news about the power, and at around 3:30 I got a text message from a neighbour to say we were back on. Hooray — we could sleep at home!

The biggest conundrum of the no-power Christmas was where, and if, Christmas dinner would happen. Normally I host, and I was thinking about cancelling dinner, but my sister-in-law is the best ever and offered to have it at her place rather than cancel or postpone. So I brought Christmas pudding and cookies, and made Yorkshire puddings to go with the roast beef, and it was delicious and perfect. And the evening ended very satisfactorily, in our own cozy little house.