Categories
Etc

Object cannot be created in this context, Code: 9

We’d been running into this wonderfully informative error message from Firefox recently and finally found some time to track it down. If you’re running into it, check your code to see if you’re trying to grab a reference to the computed style on a null reference. So code like this:

function foo() {
  var n = dojo.byId("a-bad-id");
  console.log(dojo.getComputedStyle(n));
}

Here’s a simple repro case. If you’re using dojo, you can tickle this a number of ways as a bunch of functions use dojo.getComputedStyle under the hood, like marginBox, contentBox, style when used as a getter, and others.

So the moral of the story: make sure you’re passing a valid node reference or a valid node id to functions that work with computedStyle objects.

Categories
Etc

Finding those damn trailing commas

Internet Explorer has this wonderful behavior where it completely refuses to load a JavaScript file when it encounters a trailing comma. That is, something that looks like this:

var f = { foo: "bar", baz: { go: "yes" }, };

I got sick of trying to find these beasties and came up with this regex instead:

}[\s\n]*,[\s\n]*[^\[{\w\n\s/\*\"]

Works like a charm in TextMate. Might work in grep too? Anyway, it’s a good way to find your headache quickly. :)

Categories
Etc

Grand Valley State’s New Music Ensemble

Today I stumbled into something new. On NPR (via Dave Winer), I found a wonderful recording of Steve Reich’s Music for 18 Musicians by the Grand Valley State New Music Ensemble.

GVSU is on west side of Michigan and not that well known for their music program, but this recording and the amount of time they put into perfecting it is rather astounding. It’s a bit like listening to live ambient, but amazingly rich and textured. I’m not usually into this kind of thing, but this particular composition is just wonderful. There’s also a much higher quality Quicktime of the trailer available if you’re interested.

Categories
Etc

Noise

In an attempt to cut down on the noise on this blog, I’m starting another one based on Chyrp for all the random crap I find.

Update: I pulled noise back down. Everything is back to living right here in the main blog.

Categories
Food

Truffled

Today we’re making truffles for a neighborhood holiday party. I’d never done it before and I’m a bit shocked at how easy it is to make what’s usually a fairly pricey treat at a store. It’s just twice as much chocolate as heavy cream (by weight), plus a bit of vanilla extract and maybe some liquor (we’re using Grand Marnier).

  1. Bring the cream to a light simmer
  2. Dump over the chopped up chocolate
  3. Whisk until smooth
  4. Add the vanilla and liquor, whisk a bit more
  5. Cover and chill

In a couple hours we’ll pull ’em out, roll them into truffle looking balls and cover in confectioner’s sugar or cocoa power or roasted hazelnuts.

I think “easy as making truffles” is my new saying.

Oh, and Mandy had never had Grand Marnier in a snifter before… I think she likes it. She’s also picking up some barista skills with the Silvia, just needs some more practice steaming milk and I’ll be out of a job.