January 2008

Album Cover: Narrow Stairs

"As the flashbulbs burst, she holds a smile like someone would hold a crying child."
Death Cab For Cutie / Cath...

Is John Oliver's Grandma Young at Heart?

January 29, 2008 1:43 AM

In an article at USA Today titled Seniors singing hip tunes a must-see at Sundance, I spotted this photo:

Young at Heart Chorus

Is it me, or does the woman in the upper-left look like she could be John Oliver's (of The Daily Show fame) grandmother?

John Oliver

Television | Post Comments | View Comments (17) | Permalink

Back from the Southwest

January 27, 2008 10:35 PM

My fiancée and I returned from a week-long trip to Arizona this morning. We flew out last Saturday and spent a good amount of time sleeping, which I think makes for a very good vacation. When we weren't sleeping, we spent time with her family, and — given that her family members are getting older, dispersing around the globe and having babies — such occurrences are getting harder to come by, and are therefore that much more rewarding when they happen. Both my fiancée and I got sick toward the latter half of the trip, but it was worth it to see everyone and find a chance to make up for time lost over the holidays last month.

One of the highlights of the trip was spending our eight-year anniversary together and eating lunch at Duck and Decanter, the sandwich shop we ate at on the very first day we were together.

Tomorrow, it's back to the daily grind — and back to weather in which the sun isn't such a major player.

Personal | Post Comments | View Comments (3) | Permalink

On Sex, Lies and Robots

January 25, 2008 10:31 PM

If you read (or watch) this and follow it up with this, you may infer, like I did, that it won't be long before robots are telling you "it was good for me, too."

Elsewhere | Post Comments | View Comments (1) | Permalink

Firefox 3 Beta 2 Forgets Window Size and Location

January 19, 2008 1:46 AM

As I've been playing around with Firefox 3 Beta 2, I've noticed that it no longer seems to remember the last window size and location after a shutdown and restart in a maximized state. So if you size the browser window to something like 800x600 on your 1024x768 desktop and center it, if you maximize the browser, shut it down and restart it, when you attempt to un-maximize it, it doesn't go back to 800x600 in the center of your desktop, but rather switches to a size only slightly smaller than the size of the desktop. It's pretty annoying when you're used to switching back and forth between fully maximized and a very specific size and position when it isn't maximized, so I've written up Bugzilla bug #413022.

As a side note, it appears that my other recent bug, Bugzilla bug #411095, which involves an overly pesky blocked popup icon, may have been fixed. I'll have to try and verify that with a nightly build soon.

Browsers | Post Comments | View Comments (2) | Permalink

Ferrari F430 Scuderia

January 18, 2008 12:21 AM

Ferrari F430 Scuderia

A guy can dream.

Cars | Post Comments | View Comments (31) | Permalink

Post 1,000

January 15, 2008 11:32 PM


It took just a few days over five years, but I've finally reached my 1,000th post here at bernzilla.com.

I guess I could kick things into nostalgic mode and touch on the breadth of things I've covered here over the past five years, but somehow a moment of silence seems more appropriate.


On to the next thousand...

Blogging | Post Comments | View Comments (17) | Permalink

Dreamhost Screwup

January 15, 2008 9:46 PM

I first caught wind of Dreamhost's major screwup via Ian Clifton, then found the following in my inbox when I arrived home tonight:

Hi Bernie!

Ack. Through a COMPLETE bumbling on our part, we've accidentally attempted to charge you for the ENTIRE year of 2008 (and probably 2009!) ALREADY (it was all due to a fat finger)!

We're really really realllly embarassed about this, but you have nothing to worry about. Please ignore any confusing billing messages you may have received recently; we've already removed all those bum future charges on your account (#<snip>) and already refunded the $<snip> charge on your credit card.

You should get the money back on almost immediately, within a day or two max, and there's no need to contact your credit card company or bank for the refund.

Thank you very very much for your patience with this.. we PROMISE this won't happen again. There's no need to reply to this message unless of course you have any other questions at all!

The Foolish DreamHost Billing Team!

All I can say is that I hope that fat finger was dealt with Four Rooms style.

In the meantime, if you're looking for a replacement, I highly recommend Hard Hat Hosting.

Computers | Post Comments | View Comments (3) | Permalink


January 15, 2008 6:03 PM

Let there be slugs!

If it wasn't obvious, I've been taking a look at how WordPress handles post slugs in an attempt to support the same URI strategy here at my own blog. Since my blog is home-grown and doesn't utilize the many man hours that have gone into creating WordPress' advanced rewriting routines, the problem presented a learning opportunity and a chance to tinker with my CMS, something I haven't done in quite a while.

Luckily for me, I don't have to support all the user-configurable, dynamic URI structures that WordPress does, so I was able to come up with a solution I'm happy with in a couple of hours.

In an effort to maintain the Google Juice I've already collected at blog posts that were structured using the now "old school" /item.php?id=n URI scheme, I've left those posts as is. Because recent posts like Hal0 Ski11z and Matching Digits in a mod_rewrite RewriteRule haven't had the benefit of the time it takes to gather the juice, I hacked away at those posts to test how my CMS would handle the new URI scheme. Now that I seem to have it working correctly site-wide, I've decided to incorporate the automatic generation of slugs to the posting process, so this post should be the first real post to have automatically had a slug generated for it (and corresponding feed entry).

This change should make my URIs more readable and should address an SEO issue I've been aware of for a while.

If you spot anything acting funky, or links not working, please leave a comment or contact me via email.

However, if things seem "sluggish," it's by design! ;)

Web Development | Post Comments | View Comments (2) | Permalink

Matching Digits in a mod_rewrite RewriteRule

January 15, 2008 1:49 PM

If you read up on the syntax of RewriteRule in Apache's mod_rewrite support, you may be led to believe that the full extent of Perl Regular Expressions is supported. After all, the following shows up verbatim in the RewriteRule documentation:

For more information about regular expressions, have a look at the perl regular expression manpage ("perldoc perlre").

However, I've found that it just isn't so. In an attempt to match a string of digits in a request and redirect to a page when the condition is met, I did something like the following:

RewriteRule ^\d\d\d /flames/ [L]

If working properly, a request to http://www.example.com/666 would redirect to http://www.example.com/flames/. However, it wasn't doing what I wanted to. I even tried using ^\d{3} as my pattern, but no dice.

As it turns out, it appears that mod_rewrite prefers character sets in RewriteRule patterns. Therefore, the following works as expected:

RewriteRule ^[0-9]{3} /flames/ [L]

So if you're trying to match numbers/digits in a RewriteRule, be sure to use a character set instead of the \d digit shortcut so you can avoid wasting half-an-hour of your time like I just did.

Web Development | Post Comments | View Comments (17) | Permalink

Hal0 Ski11z

January 15, 2008 12:23 PM

From My life as suicide bomber in Halo 3:

A lot of teenage kids out there play dozens of hours of multiplayer Halo a week. They thus become insanely good at the game: They can kill me with a single head shot from halfway across a map -- or expertly circle me while jumping around, making it impossible for me to land a shot, while they pulverize me with bullets.

I can't do those things. I haven't got enough time to practice as they do: I'm an adult, with a job and wife and kid, so I get maybe an hour with Halo on a good day. I wind up sucking far, far more than most other Halo 3 players, and despite the best attempts of Xbox Live to match me up with similarly lame players, I usually wind up at the bottom of my group's rankings -- stumbling haplessly about while getting slaughtered over and over again.

I could have written this (other than the whole wife and kids part).

Video Games | Post Comments | View Comments (5) | Permalink

Much Needed Standards Coming to Real Estate Data

January 13, 2008 8:36 PM

In an article on Seattle-based Zillow over at TechCrunch:

Zillow is joining Yahoo Real Estate, Trulia, Oodle, Homes.com, Realestate.com, Vast.com and others in adopting a standard way for brokers and multiple listings services (MLSs) to send in their real estate listings in a feed format. That way brokers can use the same data format for all the different real estate search engines and Websites...That should make it easier for brokers to propagate their listings everywhere.

As someone who has loosely followed the rise of real estate sites like Zillow and Estately (formerly known as "ShackPrices") and who has even given some thought to the development of useful real estate-related applications, this news of a more open standard sounds like a real opportunity for advancement in the field of real estate information.

Miscellaneous | Post Comments | View Comments (0) | Permalink

The Weiner Circle

January 13, 2008 7:36 PM

Via Hood Fever - Hip Hop News.

Miscellaneous | Post Comments | View Comments (1) | Permalink

How WordPress Post Slugs Work

January 10, 2008 1:39 AM

For a while now, I've been meaning to look into how WordPress, one of (if not the) most popular blogging platforms, handles post slugs. If you don't know what the heck a "slug" is, the WordPress Glossary describes it as follows:

A slug is a few words that describe a post or a page. Slugs are usually a URL friendly version of the post title (which has been automatically generated by WordPress), but a slug can be anything you like. Slugs are meant to be used with permalinks as they help describe what the content at the URL is.

Tonight, as you may have already noticed, I dove head first into the WordPress source code to find out exactly what those clever folks at Automattic (and their worldwide counterparts) are up to.

What I found is a very, very complex system for managing all the various configurable URL structures that WordPress users may choose to put to use at their blogs. However, at a very high level it is fairly straightforward to break down how they are doing what they do. So here goes...

First off, whenever you publish a new post using your WordPress dashboard, a sanitized version of your post title is stored in the posts (or wp_posts) table in your database along with the post's ID, the date of the post, your original post title, and several other post-specific pieces of information. The ID, date and sanitized version of your post's title, though, are the attributes of note in this particular exercise, so we'll focus on those.

To generate the sanitized version of your post title, it is sent through a function called sanitize_title_with_dashes() that lives (at the time of writing, at least) in the /wp-includes/formatting.php file. If you take a look at this function, you'll see that the WordPress folks have taken sanitation very seriously, looking out for anything from escaped octets (which are temporarily replaced and then restored) to accents to non-standard characters and symbols. In doing so, the function converts a post title like "How WordPress Post Slugs Work" to something that looks like "how-wordpress-post-slugs-work." This is the sanitized version that ends up in the posts table (in the post_name field).

Once your post has been sanitized and all of its information has been stored in the database, it is ready to be matched up against any forthcoming web queries against your web server that include the post slug, which likely includes some representation of the date (e.g. /2008/01/how-wordpress-post-slugs-work/). However, before WordPress-specific scripts get any chance at performing that matching, the web server must know to translate the post slug into a meaningful request that hands over the processing to WordPress. That's where an .htaccess file comes in.

As David Walsh so eloquently points out, WordPress' use of the .htaccess file is pretty ingenious. Here's how he breaks it down:

We must first establish that mod_rewrite is available on the server. If so, turn on mod_rewrite. Set the base of all rewriting to the web root folder [and] if the requested filename isn't a file...and it isn't a folder…send the person to "index.php."

Once inside the index.php file, the index.php file processes the request and presents you with the page based upon the slug in the URL.

So really, the .htaccess file is ingenious in its simplicity. It's inside the index.php file where the real magic kicks in. Or, if you've taken a look at the actual WordPress code, you know that index.php is really a meta-ish file that really pulls in a whole metric ton of other, well-organized but complex code that manages all the magical things WordPress can do from that single entry point.

To keep things focused though, we'll look next at how WordPress manages to translate the post slug into a single and correct post that can be returned to the UA and therefore displayed to the user.

Remember how I mentioned that the ID, date and sanitized title would be important later on? Well here's where those particular pieces of information become vital. In order to display the proper post, the code needs to be able to ascertain the post ID based on the post slug information alone. Since the post slug contains three important elements — the year, the month and the sanitized title — those can be used to generate a database query that will fetch the one unique post in the posts table that matches the user's request.

If you take a look at the get_posts() function in /wp-includes/query.php, you'll see something like the following:

$where .= " AND YEAR(post_date)='" . $q['year'] . "'";

This and a similar call for checking the month become part of a more detailed database query for fetching all the post information, which also includes a search for the sanitized post title during the associated time period (this allows for duplicate post titles that occur in different year/month combinations). Once the database query returns the one post ID associated with the original post, WordPress has all it needs to return the post-specific information to the UA, and then its job is done (until the next user interaction, that is).

So there you have it — a relatively high-level look at how WordPress handles post slugs from both the perspective of the publisher and the consumer. Please keep in mind that this is my understanding of the process based on about an hour's worth of digging through PHP source code, so it's not guaranteed to be dead on, especially for older releases of the software or versions that have yet to be released. However, as always, I invite you to leave a comment if you have any additional insight or corrections to share.

Blogging | Post Comments | View Comments (18) | Permalink

My First WordPress Bug

January 10, 2008 12:01 AM

I was browsing through the functions.php file that comes with WordPress 2.3.2 tonight, and I spotted this function:

function xmlrpc_getposttitle($content) {
 global $post_default_title;
 if ( preg_match('/<title>(.+?)</title>/is', $content, $matchtitle) ) {
  $post_title = $matchtitle[0];
  $post_title = preg_replace('/<title>/si', '', $post_title);
  $post_title = preg_replace('/</title>/si', '', $post_title);
 } else {
  $post_title = $post_default_title;
 return $post_title;

The two calls to preg_replace() immediately stood out, and upon closer inspection I realized that they are completely unnecessary.

Since preg_match(), which is called as part of the containing if statement, will store "the text that matched the first captured parenthesized subpattern" in $matchtitle[1], the two calls to preg_replace() can be removed completely as long as the following line:

$post_title = $matchtitle[0];

...is changed to:

$post_title = $matchtitle[1];

I just created a simplified test case and verified it, so I followed that up with a WordPress bug. I guess we'll see what happens.

Web Development | Post Comments | View Comments (2) | Permalink


January 09, 2008 9:08 PM

On my way into work this morning, my car registered its 150,000th mile, or the equivalent of driving about six laps around the Equator.

Cars | Post Comments | View Comments (5) | Permalink

Kevin Fox

January 08, 2008 10:23 PM

As I'm catching up on my TechCrunch feed, I just noticed a name that seemed familiar. Apparently Kevin Fox is leaving Google to join an unnamed startup.

Kevin Fox is the guy who set me up with a Gmail account (long before I probably should have had one) back in April of 2004.

Thanks again for that, Kevin, and good luck with your new endeavor.

Miscellaneous | Post Comments | View Comments (0) | Permalink

Blocked Popup Icon in Firefox 3 Beta 2

January 07, 2008 12:06 AM

As I've been using Firefox 3 Beta 2, I've noticed that the blocked popup icon has been appearing very frequently in the status bar, and once it shows up it never really seems to go away. Seems like an obvious bug to me, so I've filed my first Bugzilla bug in quite a long while, bug 411095.

Browsers | Post Comments | View Comments (0) | Permalink

On to Lambeau Field

January 05, 2008 11:46 PM

Seattle Seahawks Logo

Sports | Post Comments | View Comments (1) | Permalink

It's Wildcard Weekend!

January 05, 2008 2:16 AM

Training camp, preseason, the regular season — they've all been leading up to this, the playoffs. To say that I'm excited would be quite an understatement. Even though I need to get some rest before kickoff in about eleven hours, I can't sleep.

Go Seahawks and go 12th man!

12th Man Flag

Sports | Post Comments | View Comments (0) | Permalink

Big Pussy on Celebrity Apprentice

January 05, 2008 1:29 AM

Television | Post Comments | View Comments (5) | Permalink

To the Nines

January 04, 2008 12:59 AM

Number 9.
Number 9.
Number 9.

Blathery | Post Comments | View Comments (1) | Permalink

Trent Reznor and Transparency

January 04, 2008 12:55 AM

Trent Reznor has released the download and financial details of his experiment with Saul Williams' latest album. Subsequently, the information has gotten a lot of attention on Digg and will likely be getting attention from several other outlets (if it isn't already).

I don't know if it's a coincidence or not that three of my favorite bands are so interested in pushing the envelope not only in music, but in distribution (and packaging) as well.

Have I mentioned that Trent Reznor is the man?

Music | Post Comments | View Comments (0) | Permalink

Windows Live Hotmail and the Firefox 3 Betas

January 04, 2008 12:25 AM

I went to check my Hotmail account tonight — something I very rarely do — and found that the full version of the Windows Live Hotmail interface refuses to load in Firefox 3 Beta 2. Only the "classic" version of the web-based email service seems to work.

Sure enough, I found that in both the Firefox 3 Beta 1 release notes and the Firefox 3 Beta 2 release notes, the following is listed in the Known Issues section:

Windows Live Mail will not work; users must use Hotmail Classic Mail

The release notes also refer to a Bugzilla bug unfortunately titled hotmail.com - Hotmail (Classic interface) cannot be accessed from non-Firefox Gecko browsers. The contents of the bug seem to indicate that it's a browser sniffing error on the part of Microsoft. The only apparent workaround at present is to spoof another browser, which can be accomplished pretty easily using an extension like User Agent Switcher. Unfortunately, the extension's Firefox Add-ons page seems to indicate that the extension is only supported on versions of Firefox up to 2.0.0.*.

Browsers | Post Comments | View Comments (32) | Permalink

In Rainbows Deja Vu

January 03, 2008 5:33 PM

I just picked up a copy of In Rainbows again. However, this time around I picked up the meatspace version. It came in cool cardboard packaging with a flap and contained a couple stickers, a little booklet and a nice sleeve surrounding the CD inside.

Music | Post Comments | View Comments (0) | Permalink

First Impressions of Firefox 3 Beta 2

January 02, 2008 11:34 PM

This post won't be quite as lengthy as my post about Firefox 3 Beta 1, simply because most of those initial thoughts still apply to the latest release of the forthcoming browser, Firefox 3 Beta 2. However, there are a few new things I've noticed in the most recent release, which I am now using 100% of the time at home, and one thing I forgot to mention in my post about the first beta.

What I forgot to mention is that the Downloads window (available via Tools, Downloads) has been reorganized and provides some additional information, such as when the file was downloaded, where it came from and where it was saved to. This seems like useful information that doesn't clutter up the UI much, so it's a welcome touch. I also recall reading somewhere that Firefox 3 supports pausing and resuming downloads, even perhaps across browser restarts, but I haven't had a chance to try this out myself.

Now for the new things I've noticed in Beta 2, one of which isn't a good thing. Unfortunately, it appears that middle-clicking on items in the chrome, such as bookmarks on the bookmark toolbar and the Home button, for example, no longer opens those targets in a new tab. This is something I've gotten so used to and have become so fond of that I'm really struggling to deal with it in the latest release. As things stand right now, whenever I middle-click on items in the browser's chrome, I'm shown a strange interface that takes up my entire desktop and allows me to choose among any of the open applications on my desktop. This includes non-Firefox applications such as Thunderbird, Opera, etc. It really seems odd to me, so I'm hoping it's either a bug or a bad feature that they'll pull before Firefox 3 goes gold.

Now on to the good things. I've definitely noticed less RAM suckage from the browser than I've seen in the past, and that is a very welcome change. I also like the way they've improved the tab handling. When you start scrolling through a lot of open tabs, they start to spin across the tab bar at speeds relative to the amount of clicking you're doing. It's a nice visual effect, and it even kicks in when you choose a tab from the drop-down menu to the right if the tab isn't in the current set of focused tabs. Be sure to give that a whirl if you haven't already.

Google Reader Notifier and IE Tab still aren't compatible with the latest beta out of the box (you might be able to hack this in as Ian suggested), but I'm making do since Gmail Notifier does work and that is the most important extension to me.

Since I've removed Firefox 2 from my home computer completely (my Windows box, at least), I'll be forced into getting more experience with the latest beta, so I'll be sure to post here (or maybe over at Browsersphere) if I come across any other useful observations. If you've been playing around with either of the latest betas and came across anything you thought was interesting, please leave a comment and share.

Update: I'm an idiot. I got a new keyboard tonight and in the process had to reinstall my mouse. Doing so changed the default middle-click behavior in Windows, and not just Firefox, so that is why I was seeing the strange behavior. Phew!

Browsers | Post Comments | View Comments (1) | Permalink