Ben Galbraith’s Blog

Archive for January 2009

New Conference Room?

with 3 comments

mozilla_conf

Perhaps it’s time for Mozilla to get a new office space with a bigger conference room.

Written by Ben Galbraith

January 28, 2009 at 8:00 am

Posted in Life

Sexy, Fast, Exciting!

with one comment

Some time ago I found myself on a United Airlines flight and flipped through their on-flight magazine, Hemispheres:

hemispheres

I found this particular ad immensely amusing:

myvu1

There are so many things to love about this ad, but the lower left-hand corner is the best part:

myvu2

Yes, they do.

Written by Ben Galbraith

January 21, 2009 at 8:00 am

Posted in Technology

Tech Luminaries: Chris Wilson

with 2 comments

Dion and I just posted another episode of Tech Luminaries: an interview with Chris Wilson, the Platform Architect of Internet Explorer. We explored a bunch of interesting stuff with Chris, like how he got his start in the software field, the back-story on how Internet Explorer got support for CSS, and so forth. I find it really interesting to climb into the minds of folks like Chris, and I others do as well!

Written by Ben Galbraith

January 14, 2009 at 11:33 am

Posted in Technology

Usability Hall of Shame: Comcast

with 6 comments

I think we all have experience with this little gem: the handy JavaScript-based field focus advancer which when poorly coded merrily forces you on to the subsequent field, even when you actually do want to go back and make changes. Observe in this video, embedded below for those whose feed readers don’t omit it:

But even better. After filling out the entire “Register Now” Comcast form to sign up for an account, I’m given this little bit of news:

comcast

No warning before-hand that if I didn’t have this code I was wasting my time. Nice.

Written by Ben Galbraith

January 14, 2009 at 8:00 am

Posted in Usability

Short Analysis of Bay Area Peninsula Rental Market

with 8 comments

golden gate bridge, alcatraz & farallon islands at night

Recently, I moved my family from Utah to the Bay Area for my new job at Mozilla. It’s a homecoming for me; I grew up in the East Bay. To keep my commute times down, we decided to rent a place on the west side of the San Francisco Bay, called simply “the Peninsula”.

As with most major metro areas, the best way to find a rental these days is on Craigslist. In my searching for housing, I thought it would be interesting to analyze the listings on Craigslist to get a feel for the differing rental prices of each of the various Peninsula cities. Because I’ve got quite a few kids, I didn’t bother looking at listings with less than three bedrooms.

As I did my analysis, I worked out the average price of rentals with at least 3 bedrooms in all of the major areas of the Peninsula that Craigslist covers; here’s the data as of November 2008 in graph form:

rental3

One problem with this approach is that it combines rental units with different numbers of bedrooms; here’s a graph with the price of the rental divided by the number of bedrooms:

rental4

For a little context, it might also be helpful to share the total number of rentals by area:

rental5

Declining Rental Prices?

Out of curiosity, I decided to re-run the analysis on the rental market as of last week. No surprise, there was a general mild decline across the entire peninsula. In terms of rent, the combined average went from $3,562 to $3,500 (~1.75%); by room, that’s $1,046 down to $1,019 (~2.5%).

You can see that the characteristics of each area is quite different:

rental6

Note that I had to leave out a few areas where there simply wasn’t enough data to compare; I probably should have thrown out Atherton, Portola Valley, and Woodside as the number of listings was few and their prices varied greatly, as you can see from the graphs.

Obviously, to draw any real conclusions from this data, I’d need to do more work to extract duplicate listings (folks often re-list the same property before a listing expires to keep it at the top), include 1 and 2 bedroom properties, and look at the data for a longer period of time.

Still, it is relatively safe to say that there is a very small price decline, but it is probably just as likely to be explained by the slower winter market than the macro-economic conditions.

I’m going to keep capturing data periodically and analyzing it, and if I see any interesting trends, will post again.

Written by Ben Galbraith

January 10, 2009 at 11:03 am

Posted in Life

HTML 5 Canvas Lessons: Zooming and Reusing

with 7 comments

I noticed an interesting bug today while working on a browser-based user interface rendered with the HTML 5 <canvas> element. A little rectangle was appearing fuzzy:

nib4

Let me zoom in a bit:

nib3

Whereas it should have appeared crisp, as in this:

nib2

My first thought was that it would be due to fractional coordinates. I have years of experience with drawing APIs that force integer coordinates, so I’m used to having the fractional part of a coordinate whacked off and making up the difference when necessary in a second pass. Canvas, on the other hand, supports fractional coordinates, which I’m told is the fancy thing to do these days. (How the fraction is converted to an actual pixel is depenendent on whatever drawing system is doing the heavy lifting somewhere down the stack.) When your coordinates are fractional, you can get this kind of fuzziness.

Because the interface I’m working with involves a few layers of rendering code, ensuring that integers ruled the roost took some time. (I did this by wrapping the various canvas functions with versions that dumped their parameters before calling back to the real functions.) But after quite a bit of poking around, I found no evidence of fractional coordinates. It was around this time I saw Vlad (Mozilla’s graphics guru) walking around the office and asked for some help.

We started looking for evidence of transforms that would introduce fractional coordinates–but ultimately came up empty handed. As we went through this process, he pointed out that the <canvas> context instances are reused, so it’s a really good idea to save() and restore() when obtaining a canvas to avoid polluting the context:

var ctx = canvas.getContext("2d");
ctx.save();
// painting here
ctx.restore();

I had assumed each call to getContext() produced a fresh, stateless context, so this was welcome news indeed.

But, we didn’t find a source for the fractional coordinates. And then we noticed when right-clicking and selecting “View Image” from the context menu, the resulting image that was physically smaller than the browser window.

And that’s when we noticed that I had zoomed in a click using Firefox 3’s fancy full page zoom feature, which was causing the image the be scaled up, and the blurriness.

May you avoid a similar fate.

Written by Ben Galbraith

January 6, 2009 at 5:25 pm

Posted in Technology