Category Archives: Meta

New Interview on Digital Web

There’s a new interview with me up on Digital Web that covers a lot of ground. The questions come from the lovely Meryl. As it tends to work in these things, most of the answers are actually a few months old, for instance it’s all from before I announced I’d be working at CNET. This is mostly my fault because I got so swamped after the move I didn’t have a chance to sync up with Meryl again. I’m willing to try something a little different though, something along the lines of the old Under the Iron model. If you have any questions you’d like to ask just leave them in the comments section for the article and I’ll do my best to answer everything there. Blogging is all about empowerment, right?

Random Photo Returns

The random photos are back. I wrote a quick hack to loop over every photo in every album and read its relevant info into a MySQL table. Now instead of taking a few seconds to get a random photo using the Gallery data stores, it uses a single query and takes a millisecond. Long-time visitors to the site remember that the random image in the corner has always been one of my favorite things about this site, but as the photolog grew to a thousand, two thousand, and then nine thousand images it slowed down more and more. I had to start caching it so it would change once every 15 seconds, then every minute, then every 5 minutes, and then I just manually rotated it for a while. Finally I put the random image out of its misery.

Now it’s fully dynamic, every page you view is completely unique, just like you.

(There goes my bandwidth.)

Well That Was Fun

I said I would take it down, I never said for how long. Thank you to everyone for taking a little time out with me in celebration of the big day. I was as surprised as everyone else, and watching the reactions come in was pretty interesting. The emails ranged from shocked to congratulatory to incredulous to angry. Thank you to everyone who wrote in. Many people linked to the site being down which should help solidify the #1 position in the eyes of the fickle mistress Google. Thank you all as well.

You’d think it would be cooler here in Houston, with hell freezing over and all, but it is as hot as ever. At the same time I’m told in San Francisco I need to dress in “layers.” I packed all my layers up months ago! Might have some <div>s around though…

I was able to get some of the work I was planning to do on the site done, mostly tweaks to the look and layout of things. I wouldn’t call it a redesign, more like a summer variation on a theme. Many of the changes are very subtle, but in my eyes important. The most obvious change, the sun in the corner, looks nothing like I want it to, so I’m not sure what will happen to that. (If you have any ideas, send them in.) Many other things still need attention, so expect to see occasional breakage and constant tweaking over the next week. I finally closed the comments on the mosaic. So it will stand at 1,017 comments,. The page is still huge, so I’m going to move the comments to a separate page just for that entry. The jazz quotes need some cleaning up, and I’d like to add a little information about each player to each page, including at least a picture. The photolog is being overhauled, and the long-promised classics section is almost done. Finally I promise that photo will be random again, any day now.

It was just a little over a day, but it feels good to be back. Let’s not do that again though. I really missed writing here.

I’m going to be in San Francisco next week, so if you are too I’d love to meet up. Drop me a line.

On Asides

As you may have noticed on this page or in your aggregator my normal entries are now interspersed with smaller link and commentary entries represented in an unordered list. These fall in chronological order with my other entries and are real posts with permalinks, comments, categories, trackbacks, and pingbacks. I have been wanting to do this for a long time and there was a flood of entries when I first got this working. I fully expect to post in this category with a much higher frequency than my normal posts. I come across things all the time that I want to link so badly but I just don’t have the time to write an entry about. Now every interesting tidbit I come across is just a click of a favelet away from my readers. It’s liberating.

The format of a weblog dictates its writing. There is no getting around this. Ever since my redesign I’ve had these big important titles that—as a writer—are intimidating. Everything I write has to be worthy of its 32-point Dante banner. This was a deliberate to force myself to put more thought and effort into my entries and it has worked; some of my best writing has been since the redesign. It has been stifling as well. To express what I want to express these days I need something more dynamic.

This type of linklog is nothing new. I first saw it at Kottke and since have enjoyed it at Charles Gagalac’s site. Charles was the first person I know of to do it in WordPress. This inline style fits my requirements very well, the biggest being that I wanted to use my existing post taxonomy so a second weblog would have been inconvienent. I also get the benefit of a combined RSS feed and combined update pinging. More than all of that though, I don’t want to limit myself to one type of post in a new weblog, or in this one. I already have plans to use this feature to not only highlight interesting links, but comments I make on other sites, upcoming gigs I have, photolog updates, and various activities and writing I now have spread out over a half-dozen blogs. It’s a perfect application for WordPress‘ multiple sub-categories feature. Technically, the whole thing was very easy to implement.

First I made a new category all of these posts would be a part of, it was late and I couldn’t think of anything too clever, so I went with “Asides.” This may have been subconciously inspired by Movable Blog. So I created the category in WordPress, and it had an ID of 33. Next it was simply a matter of telling my template that if a post was in the Asides category to lay it out a little differently. I wrote a quick function, in_category() that does this with no additional DB queries that is now in the WordPress CVS and will be in the 1.2 release. The function takes a single argument, a category ID, and it returns true if the current post is in that category. Here’s what I have in my post loop:

<?php if (in_category(33) && !$single) { ?>
<ul class="asides">
<li id="p<?php the_ID(); ?>"><?php echo wptexturize($post->post_content); echo ' '; comments_popup_link('(0)', '(1)', '(%)')?> <?php edit_post_link('(e)'); ?></li>
<?php } else { ?>

So basically what this is saying is that if the post is in category #33 and we’re not on a permalink page to format it using that code, otherwise do our normal thing. We have a simple unordered list with a uniquely ID’d list item. (The ID is a throwback to about two years ago when I had a heavily hacked version of b2 with monthly archives. Can’t let those permalinks break.) I get the post content directly because I didn’t want to mess with the normal filters (like autop) applied to the_content(). I run it through texturize to keep everything pretty. Then I have a simple comment link, and finally a link that only I see that allows me to easily edit any entry. This worked great, but you can see that I have a separate unordered list for each entry, which isn’t what I want; I want all consectutive aside entries to be part of a single list. This gets tricky because you have to start the list when the current entry is an aside but the newer entry and stop it when the next entry is not an aside. Tricky tricky, and I don’t want to think what would happen if someone decided to reorder my content. I had only allocated myself ten minutes for this entire project and I was at minute number eight, so it came time for ugly code:

function stupid_hack($str) {
return preg_replace('|</ul>\s*<ul class="asides">|', '', $str);

I swear that’s the actual code in my template. Put it somewhere around the top of the template, it really doesn’t matter where. It’s a hack, but it’s been working great. Simon says it is “ugly as sin,” and that’s what I thought when I wrote it. Since then, however, it has grown on me a bit. It’s like the supermodel who goes out every day dressed to the nines relaxing at home in a bathrobe, slippers, and no makeup. I keep the pretty code elsewhere, here at home I’m a little more casual. Perhaps when I have a little free time I’ll put in the more complicated logic I described above but if it ain’t broke…