Category Archives: Technobabble

Skyfire 1.0 Has Arrived

We did it. We released Skyfire 1.0 this morning.

We’ve got a really great team of people here, and we’ve been pushing very hard to make this happen. For me, it’s particularly nice – this has happened just after I’ve been here two years.

I expected I’d be jumping off the walls in joy when we reached this point. Instead, I find myself with a quiet, professional satisfaction. I’m reminded of a couple lines from Star Trek: Deep Space Nine.

OBRIEN:  You look good in red.
WORF: It feels good.

For the web developer community, a note: We have not forgotten about you. We have some documentation in the works, talking about best practices in supporting Skyfire users. It’s not ready yet, but we’re working on it. Stay tuned!

No Shaving In… April?

All right, folks, I’ve had it. I’ve really, really had it. Bad enough you insist on my fuzzy logic face after a week… but you want me to be scruffy on my birthday? You want me shaggy at Christmas? Forget it! No way. It isn’t going to happen.

Shame on you parents who went No Shaving In December. Your babies don’t need to grow up thinking it’s cool to be Cro-Magnon. It’s because of you that Geico makes all their money: first, you make the Gecko cooler, then you take a whole fifteen minutes to save money on your car insurance. Most people take twelve minutes, tops.

Therefore, I must break my months-long silence and say Nay! There shall not be No Shaving In December! (I love the double negative. Don’t you?) Instead, by decree of a member of the Dogbert’s New Ruling Class, there shall be… No Shaving In April! Let us imitate our Glorious Leader’s furriness at a time when it’s not so cold outside! (Or so hot in Antarctica.) Let us itch baldly where no itch has been scratched before, leading up to the release of Star Trek Eleven: The Search For Shaving Cream!

Continue reading No Shaving In… April?

Twenty minutes a day

Sometimes, that’s all it really takes, when you’re hacking code. You know how I know? I tried it last week without even intending to.

In my case, I commute from San Jose to Mountain View every day. On the CalTrain, that takes twenty minutes. I also commute back on the CalTrain – another twenty minutes. That’s enough time to pick up where I left off, fix a little bug in my code, rerun the test, try to fix another little bug, and power down the laptop. I’m just fixing bugs at the lowest level of complexity – one component, one interface, one test case. For a twenty-minute session, that’s about all I need to think about debugging.

Now, of course, I spend a lot more than twenty minutes a day working on projects for the office. I’m also (I hope!) more efficient with my time at work – I can juggle a lot more files in my head at the same time when I have more time. For the really small stuff, you can achieve a lot in twenty minutes a day.

One other benefit, and I believe I’ve said this before: When you’re working with test cases, those test cases later become examples you can reuse in your actual production code. More importantly, they should produce code you can cut-and-paste into your real program, with only variable name changes. That greatly increases the chances your code will work as you intend it to – if you test code one way and it passes, use that way to implement your real work. (Or, just write your test to emulate how you’d really use your component.)

Arrays of strings in XPCOM

In my XPCOM Cheat Sheet (which I really should look at updating), I wrote:

As a rule of thumb, use XPIDL-based arrays for arrays of a single
primitive type, in or out (not inout). For anything else, use nsIArray or
nsIMutableArray.

Unfortunately, that doesn’t work with native string types like DOMString:

interface nsIFooArray : nsISupports
{
void setArray(in PRUint32 count,
[array, size_is(count)]
in DOMString strings);
};
Error: [domstring], [utf8string], [cstring], [astring] types cannot be used in array parameters

To which I say, “Well, that sucks.” Read on in the extended entry for more details.

Continue reading Arrays of strings in XPCOM

“Dancing Dude at Skyfire” – Hello World

Original video and YouTube

Yeah, that’s me. You’d think I’d burned through my fifteen minutes of fame already…

Yes, I wore the Mozilla shirt deliberately. My role at Skyfire is to basically customize Mozilla Firefox for our needs. So it seemed fitting to combine the shirt and the little Skyfire badge.

As for the dancing itself… I think I can hold my own. 🙂 I’ll say this much – at that level, it is a workout in addition to a whole lot of fun. I don’t care about being alone out there either. I basically make it up on the spot (or I used to, anyway…)

Cool tip of the day: Where in the DOM is your mouse?

What, elementFromPoint isn’t good enough for you? Well, in my case, no. For Verbosio, it would help a great deal to convert a mouse point to a DOM range point (think scripted selections, drag & drop like Pencil does, etc.). DOM ranges form, among other things, the basis for Mozilla’s selection algorithms.

Fortunately, there’s a way to figure it out. Just ask the mouse event for the range coordinates. Literally.

window.addEventListener("mousemove", {
handleEvent: function(aEvt) {
this.rangeParent = aEvt.rangeParent;
this.rangeOffset = aEvt.rangeOffset;
}
}, true);

This comes to us courtesy of the nsIDOMNSUIEvent interface.

The funny thing is, I knew about this back in 2002, when I was writing my book for Sams Publishing. I forgot about it sometime over the past six years (and I admit now that the book’s been only partially useful since then, missing certain bits of info I would’ve liked to know then).

Now, imagine using this to give a visual indicator where a given element you’re dragging will be dropped in a HTML or XML document…

Over Washington (west of the Cascades, anyway)

I’m planning a vacation in Washington State from August 14-24, back to Seattle and Vancouver. So if there are any Mozilla developers or fans in the Seattle or Portland, Oregon areas that want to meet up during that time, drop me a line in the comments section.

  • August 14-17: Seattle
  • August 17-20: Vancouver
  • August 21-23: Seattle
  • August 24: Back in San Jose