Archive for March, 2004

Having It All

Note: This is the first in a series of posts I’m planning to write to help focus my thoughts on electronic clutter… like the 5000+ items in my inbox at work, or the 2000+ unread items in my aggregator.

I am a collector. I do not always collect, but I have the collector’s mentality. As a child, I collected stamps and baseball cards. Although I spent some time admiring the designs of the stamps, I was never more than a passing pro baseball fan. I collected not because of a raw interest in what I collected, but because of a need to collect. To count and categorize. To compare what I had against a known universe of what I could collect.

Like any good (bad) habit, this didn’t end in childhood. At my previous job (over 6 years ago), the cafeteria carried Nantucket Nectars juices. I was a serious fan of their cranberry juice coctail, and had at least one a day. If you’ve never seen Nantucket Nectars drinks, they come in bottle very similar to Snapple. On the underside of each bright purple metal bottlecap was a little piece of trivia about the town of Nantucket and its residents. Some of it was pretty esoteric, but it was interesting, different. So I found a box and began to collect these bottle caps. I don’t know why. Even today, my TiVo is filled with episodes of Good Eats waiting to be put onto tape, because I’m collecting them.

I am also a pack rat… a related condition. Over the past weekend Sherri and I cleaned our garage. We have a two-car garage which has never seen a car inside it in the three years we have lived here. This is half due to things like bicycles, lawnmowers, and other items for which I have no other place to store. But it is also half due to a large number of boxes (and a few other large items) that we stored in the garage temporarily when we moved into the house. Alot of this stuff was mine, and alot of it was only there because I’m a packrat. I have a Commodore 64 and a disk drive for same, plus many, many floppies for it that are sure to no longer work. I have the first PC that I bought after Sherri and I were married, a 75mhz Pentium that may or may not have had a processor upgrade (don’t remember). I have two old Sun machines, I think they are Sparc 1’s. They were originally network clients, and have no internal HDs. Tried to get one working with a SCSI hard drive someone gave me a few years ago, to no avail. Wouldn’t mind getting them to net-boot Linux (if I knew how). I have an HP600 inkjet printer that might work, and an HP LaserJet III that mostly works, but needs a new infeed roller. I used to have a real live VAX complete with teletype, but I finally threw that out when we moved here. I have a 40+ year old oscilloscope and a 25+ year old portable reel-to-reel tape deck, and I have no idea if either work. And that’s just (most of) the technology stuff. Nevermind the books, old papers, etc.

I got rid of alot of junk and clutter, but most of the computer stuff is still in the garage (and yes, there’s more in the basement)… you just never know when you’re going to need it. I did manage to throw away a box I found, full of slightly rusted purple bottle caps.

Googlebot Needs Your Help!

Via ~stevenf, here’s a list of tips to help the Googlebot understand your website. I’m already doing most of these, but one tip on the use of the “robots” meta tag leapt out at me:

Webloggers: use the meta tags to help the Googlebot index only your permalinks, not your constantly changing front page. To do this, use
<meta name="robots" content="noindex,follow" >
on your front page and
<meta name="robots" content="index,follow" >
on your posts’ permanent locations.

I’ve often noticed that Google searches of my site not only return individual posts, but also category and date archives. For an example, see this Google search for GarageBand on jclark.org. This tip should help alleviate the extraneous matches. I intend to implement this change as soon as I have a few minutes to do so (but changing the <meta > tags to <meta /> tags, to remain valid XHTML 1.1).

Implementing this via Blosxom shouldn’t be too hard. Those who use separate flavours for individual posts will have no problem at all. I don’t; instead I use my storystate plugin, which exposes the variable $storystate::permalink, which is true when viewing an individual post. Used in conjunction with Rael’s interpolate_fancy plugin (sort of a must with storystate), this will allow me to change the meta tags as needed.

Markdown Redux

As I’ve mentioned previously, I’ve recently started using Markdown to format my blog entries. After using it for a few posts, I honestly think it’s lowered the “friction” it takes to compose an entry. When I first saw it, my immediate reaction was, “Why? We already have Textile.” However, Textile is a tool to “mark up” plain text to be formatted as (x)html, where Markdown is a tool to render plain text as (x)html. In other words, Markdown strives to remove the need to insert markup; instead it uses existing plain text idioms, especially from email. It doesn’t have as many features as Textile, but it has all the features I use. It also handles certain things much more easily; I’m not sure I ever figured out how to mark up multi-paragraph blockquotes in Textile.

The Blosxom interface in the current beta releases (1-3) apply markdown formatting to every post. In my previous post on Markdown, I offered a updated version that used the Blosxom meta plugin and a “meta-markup” header to enable Markdown on a per post basis. John Gruber, author of Markdown, stated on the Markdown mailing list that he’d rather make this behavior optional. I agreed, and have produced version 2 of my Markdown-Blosxom patch:

Update 3-25-04: John Gruber has released Beta 4 of Markdown, which incorporates (and improves) these changes. The code patch below is now deprecated; go grab a new (post-beta-3) copy of Markdown. :

#### Blosxom plug-in interface ##########################################

# Change $blosxom_always to 0 to use "meta-markup: markdown" story
# headers to enable Markdown on a per-story basis
my $blosxom_always = 1;

#don't change; auto-detects
my $blosxom_hasmeta;

sub start { 1; }
sub filter {
    $blosxom_hasmeta = defined(%meta::);
    1;
}
sub story {
    my($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_;

     if ($blosxom_always or 
         ($blosxom_hasmeta and 
          defined($meta::markup) and 
          $meta::markup =~ /^\s*markdown\s*$/i))  {
        $$body_ref  = Markdown($$body_ref);
    }
    1;
}

Notes: * Install is as before. Replace the existing Blosxom plug-in interface with the code above; remember to rename Markdown.pl to Markdown when you put it in your plugins directory.

  • By default, it will always apply Markdown (as it was originally). Even if the Meta plugin is present, we can’t assume the user wants to use it to control Markdown. If you want to use meta-markup, set $blosxom_always to 0.

  • I check for the presence of meta instead of assuming it’s avilable. If blosxom_always is 0, but meta plugin is not available, Markdown will never be invoked.

  • the check for meta occurs in blosxom interface’s filter() method. start() is a poor choice because Markdown could be loaded before meta (and will be by default, which is alphabetical). filter() will run for every plugin after all plugins are loaded.

Updates:

  • the meta-markup check is now a case insensitive regex.

  • No longer applying markdown processing to the story title. This was causing <p> tags wrapped around the title, which is not appropriate in places like RSS feeds.

Second Update:

  • Astute reader ArC points out that if you are using meta but a post has no meta-markup in the header, the check of $meta::markup would cause perl to complain. I’ve added a defined($meta::markup) test.

Senseless Acts of Perl

At work I spend alot of time working on one of our Solaris dev servers via xterm. Via many xterms simultaneously, most of the time. Since I run a local X client on my PC under cygwin, I have a shell script that I run locally that connects to the dev box and launches three xterms in pre-determined screen locations, setting DISPLAY along the way.

Over the course of a busy morning, this number can grow. Since I’m still on a Windows PC, however, I do tend to use my task bar to find windows. Having six or more taskbar buttons that all say “xterm” isn’t very helpful. For a while I tried setting my titles to reflect what I’m doing in each xterm, but this futile. Partially because I often create, destroy, or repurpose xterms on a whim; but largely because I’m lazy.

A while ago, I updated my launch script to label my initial three windows Alpha, Beta, and Gamma. While the names aren’t very descriptive, it does differentiate the windows, and I can usually remember what each window is being used for. When I start launching additional xterms, things can get confusing; I try to remember to add a -title and pick a Greek letter not in use, but I did mention I’m lazy, right? So today, I decided to do something about it.

The result is addterm, one of the more senseless perl scripts I’ve ever bothered with. When run, it creates a new xterm with the title set to the name of the first greek letter not currently in use. If all 24 greek letters are in use, and error message is printed and no xterm is launched. This is a feature, not a bug. Close some windows! The version below is my OS X port. :

#!/usr/bin/perl -w

my $user = `whoami`;
my @ps = split("\n", `ps -o command -U $user`);
my @alpha = qw/Alpha Beta Gamma Delta Epsilon
               Zeta Eta Theta Iota Kappa Lambda
               Mu Nu Xi Omicron Pi Rho Sigma
               Tau Upsilon Phi Chi Psi Omega/;
my $k=0;
my %greek = map {$_=>$k++} @alpha;

for(@ps) {
    my ($title) = /^xterm\s+-title\s+([^\s]+)/ or next;
    $alpha[$greek{$title}]=) {
        $next = $_;
        last;
    }
}

if (defined $next) {
    open STDERR, ‘>/dev/null’; #discard xterm’s whining
    system(”xterm -title $next & “);
} else {
    print STDERR “ERROR: No greek letters free!\n”;
}

This required a port from the original Solaris version because the script uses ps to look for running xterms. The Solaris version uses ps -o args -u $user. The command should list (only) the full command + args for every process for the username $user. If you want to use this on another *nix, just test your ps command first and adjust accordingly. You could also change the Greek letters to another finite set, just remember to update the error message.

Of dubious interest is that fact that I used an array to keep the letters in order and a hash to allow quick indexing into the array. I dislike having to store the letters twice, but this seemed the best solution. I have a vague sense that some kind of tied vars may do this more elegantly, but my perl-fu isn’t quite that strong without cracking the Camel; did I mention I’m lazy? Perhaps tommorow. Improvements welcomed.

It’s Alive… Alive!

As I noted previously, my TiVo required a reboot the a couple of days ago, after which It reported a severe error. This was accompanied by instructions to wait three hours while it tried to phone home for repairs. I went to bed before the three hours were up.

When I checked on it again last night, it was still displaying the error message. Before calling customer service as directed, I decided to try one more time. I performed a reboot with extreme prejudice (a.k.a. unplugging), and waited while it cycled through startup screens. Three or four minutes later, success!

While I love my TiVo, and do not begrudge TiVo, Inc. the $13 a month I pay for programming info, this episode has gotten me thinking once again about exploring MythTV. One of the things I’d really like to do is run MythTV on my existing TiVo hardware, since A) I already paid for it, B) It’s got a hardware MPEG-2 encoder built in, and C) it’s already a working Linux box. Accoring to the MythTV docs, you can’t run MythTV on TiVo hardware. It seems to me that when I read the documentation several months ago, the stated reason was that the MythTV interface runs under X windows, and the TiVo couldn’t run X11. However, the 0.14 release notes state that directfb is now supported; throw in QT/embedded and X is no longer required.

Unfortunately, the documentation now states that the TiVo has non-standard hardware for which no drivers (or programming info) exist. Of course, Tivo has released their kernel mods (GPL), but that doesn’t mean they had to release custom drivers. Still, I remeain hopeful. I’ve been looking for any related threads in mailing list archives, so far with no luck. If anyone knows more, please comment below.

Get Well Soon, TiVo

My TiVo has been acting a bit fishy for the last week or so. A little sluggish in the menus at times; an occaisional stutter or lag during playback. I’ve been meaning to reset it to let it clean up its swap partition.

Tonight when I flipped over to my TiVo, it appeared to be paused 45 minutes into a hour recording. This seemed odd, since I’m the only one who uses the TiVo and I’m pretty sure I didn’t leave anything paused. Attempting to play the paused program yielded no change. The menu button did bring up the menu, eventually… overlaid on the paused show. I tried the live tv button, and changing the channels. The Live TV guide worked, but the paused program never changed. Eventually, I went to the menu and rebooted the TiVo.

After a brief pause, I saw a graphical TiVo start up screen. A minute later, this changed to a “Almost ready” prompt. Shortly after this I got a new message, which pleases me not.

A severe error has occurred.

Please leave the Receiver plugged in and connected to the phone line for the next three hours while the Receiver attempts to repair itself.

DO NOT UNPLUG OR RESTART THE RECEIVER.

If, after three hours, the Receiver does not restart itself, call Customer Care at 1-877-367-8486.

It’s been about 20 or 30 minutes. The message hasn’t changed. At first I heard lots of hard drive noises, but now all is silent. I haven’t seen the yellow light indicating that E.T. is phoning home either. I’ll probably be in bed before the 3 hours is up. Come morning, I may have an expensive door stop.

Get well soon, TiVo. I guess if I can’t watch TiVo I’ll just surf the web.

Markdown

John Gruber has released Markdown, a plain text to (X)HTML language and tool. It is similar in function to Textile, which I’ve been using since I started this blog. Markdown’s formatting is inspired by plaintext e-mail formatting, and has the added advantage that Markdown-encoded text is, basically, legible; even more so than Textile-encoded text. To really see this in action, look at the Markup-encoded version of the Markup home page. This really sold me on the idea of using Markup here on the blog. At some point I intend to do a rigorous, feature-by-feature comparison of the two at some point; for now I just want to play with Markdown.

Markdown (the tool) is implemented in Perl, and is both a command-line tool and a Movable Type plugin in a single file. I had intended to write a Blosxom plugin for Markdown, however, Markdown.pl is also a Blosxom plugin! Very nice. One caveat - You must rename the file to Markdown in order for Blosxom to recognize it as a plugin.

As written, Markdown-as-Blosxom-plugin processes every entry as Markdown-encoded text. This would require me to convert all of my existing entries, which I’m not looking to do. Instead, I modified Markdown.pl slightly to work like the Blosxom Textile plugin- if the Blosxom story header includes meta-markup: markdown, then Markdown is invoked to process the story text (requires the meta plugin). The modified story() looks like this: sub story { my($pkg, $path, $filename, $storyref, $titleref, $bodyref) = @;

    if ($meta::markup eq 'markdown') {
        $$title_ref = Markdown($$title_ref);
        $$body_ref  = Markdown($$body_ref);
    }
    1;
}

So how does it work? You’re soaking in it. This entry is written Markdown. So far, so good. I’ll post again later on my Markdown-vs-Textile impressions.

Update: The code above is obsolete. A much more robust version is here.

Regression

As I noted at the time, Mozilla Firebird 0.7 was upgraded (and renamed) to Mozilla Firefox 0.8 in early February. I’ve been using Firefox 0.8 since the day it was released on my Windows PC at work. I works wonderfully. On my OS X Powerbook, however, things are different.

I downloaded 0.8 for the Powerbook the day it was released, and tried it out. Within two minutes I had decided that I do not like the new “default” theme for OS X, Pinstripe. No knock on the fine folk(s) who put the theme together; but I simply dislike it. The actual pinstriping is fine, but the buttons, tabs, etc. were so different from Qute (the default theme for 0.7 and non-OSX builds of 0.8) that I found it distracting. Adding insult to injury, Pinstripe is incompatible with the Tabbrowser Extensions extension, which I find indespensable. After some searching, I found the home page of Arvid Axelsson, creator of the Qute theme. According to his FAQ, Qute should be available for Firefox for OS X “Relatively Soon”. Having read that, I closed Firefox and returned to Firebird 0.7 to wait.

It’s been three weeks since 0.8 was released, and Qute is still not available for OS X. Being that I stayed home (sick) today, I decided to give 0.8 a try again. I still don’t care for pinstripe, so I decided to try some other themes. I tried three or four, and all had the same problem… scroll bars are missing. They are functional, if you click in the right place, but they do not render. I’ve had this problem with themes on OS X before, in older versions of Firebird. I went looking for a bug in Bugzilla, but couldn’t find one. This seems unlikely, so I wonder if I searched correctly. I may try again later, and then submit a bug if I can’t find it already written up.

So, I’m back to using 0.7. I don’t especially mind, but I’d rather be using the newest version. I do think that changing OS X’s default theme, or at least not including Qute in the distribution, was a poor decision. One of the biggest selling points of Firefox for me is that I can use the same browser on OS X and on Windows. Without the availability of the “default” theme on all platforms, however, it doesn’t feel like the same browser.