May 16th, 2008

As of late, most people who find this blog via search engine are interested in one of three things: Lego, chess, or bathroom remodeling. (One day perhaps, I shall explore the intersection of those things. Susan will undoubtably object, but I believe there is some weekend’s worth of amusement therein.) Then there’s a small number of searches possibly related to people I’ve annoyed. I’m surprised there aren’t more of those.

Of the remaining search terms, here are some of the more interesting ones lately.

how to work at pixar
Well, the first step is to apply. (Okay, you need to prepare a resume first.) In fact, there are currently two openings in the RenderMan group, i.e. my group, although the positions are in Seattle.
exploding happy faces
That’s disturbing.
whale with fake eyebrows
Less disturbing, perhaps, but also weirder.
how to code enpassant rule in java
Well, here’s how I did it in Chess By Blog. Pawn.isEnPassantCapturable() is true if and only if that pawn has just advanced two squares on its first and only move.

if (m_square.getRank() == enpassantrank) { // from the POV of an attacking pawn = 5th rank
    if ((square = m_square.getNeighbor(left)) != null) {
        Piece pawn = square.getPiece();
        if ((pawn != null) && (pawn == m_board.getLastMovedPiece()) &&
            (pawn instanceof Pawn) && ((Pawn) pawn).isEnPassantCapturable()) {
            // Make sure our own king isn't in check by this move
            // ...
            // append to list of valid moves
        }
    }
    // likewise for right square
}
family tree of agamemnon
wikipedia to the rescue: Image:GenealogyAgamenon.jpg
The people in this tree are all associated with the greatest stories of Greek mythology: Tantalus’ crime against the gods (plus his unique punishment in Hades); the rivalry between Atreus and Thyestes, which is where the soap opera really begins; the Trojan War; the murder of Agamemnon by his wife; the vengeance of that murder by Orestes; the chasing of Orestes by the Furies. I could go on and on. Anyways, Edith Hamilton’s Mythology is a good place to start.
why canucks suck
Utter lack of offense, for one. They scored the fourth fewest goals in the Western Conference this year. That’s not the only reason though, since they scored more goals than Anaheim and the Ducks made the playoffs with room to spare.
san jose sharks suck
Not as much as the Canucks. The Sharks won all four matchups against Vancouver this year, and scored twice as many goals (or more) while doing it.
disney movie kid turns into cat
Don’t know about Disney movies, but Abandoned, by Paul Gallico is a very charming book along those lines.
Are parents tending to buy premade meals
Certainly. Evidence: presumably there is a market for Bagel-Fuls, introduced by Kraft Foods in April. Utterly ridiculous. You still have to put this in a toaster, so the convenience amounts to not having to spread cream cheese on a warm bagel, which literally takes seconds. Is unwrapping the foil from a block of Philly really that stressful? There is the off chance of getting cheese on your hands, or heck, under your nails - but this is what soap is for. Sheesh.
prius toxic fumes
I’m in my car for about seven hours a week, so I certainly hope not.
how many calculations in the movie cars
Billions. Trillions. Quadrillions. A lot.
I have failed green card blood test
Given that the green card blood tests are for STDs, tuberculosis, and other rather serious transmittable diseases, not getting that green card just might be the least of your concerns, buddy.
i hit a jogger
I hope you stayed and rendered assistance instead of being a hit and run bastard.
graham fisher hacking school computers
Sorry Graham, should have studied for that math test. Trying to get your report card changed after the fact is only asking for trouble. Trust me, I know.
SHAMBLING MOUND IMAGES
Step 1: mow lawn. (Preferably, your neighbor’s lawn which hasn’t been maintained in months.) Step 2: pile grass clippings in center of lawn. Step 3: take pictures.
adult superstore franchise
This is what happens when you blog about late night TV.
he-who-shall-not-be-Googled
And yet somehow, he got Googled :(
vanderzalm conflict of interest memorandum
vanderzalm lillian headband
See, I’m not the only one who vividly remembers the terrible succession of British Columbian premiers during the 1990s.
foreskin restoration emeryville
What the.. does that word even appear in my blog? Oh crap, yes it does. And now, twice.

Information for levork.org from Google Webmaster tools, since I’m a stats junkie:

All searches: (Canada) google.ca

Top search queries Average top position
1. julian fong 1
2. julian fong is stupid 1
3. julian fong is gay 2

Huh. I must have been very bad to someone in Canada lately. I have no idea how or who. It’s not like I’ve been back there for a while, and furthermore won’t be back any time soon since Ottawa’s had my passport in limbo since May due to a huge backlog on renewals (thanks American government for changing passport requirements!). Anyways, fellow annoyed Canadian: can I apologise? Buy you a beer?

May 30th, 2007

Our DSL modem died last Sunday, breathing its last wheezing gasp under an onslaught of BitTorrent traffic. It took over an interminable week for the replacement to arrive, including a visit from an AT&T technician who came out and verified that yes, it was a modem issue. We could have told him that. Susan rallied bravely under undue e-mail deprivation, while I fretted about lost webserver hits. Modem arrived last night; it took us two hours last night with the aid of three extremely patient DSLExtreme technical support people to get the replacement going again.

Note to future self: when technical support people tell you at the beginning of a conversation to check that you used the correct power supply, you double and triple check that. Just because the blinky lights are lit doesn’t mean it’s got the right juice.

So no longer do we have to drive back to work on a Friday afternoon just to print out a forgotten camping reservation confirmation; or wonder about Catherine Deneuve’s age in Les Parapluies de Cherbourg (she was no more than twenty); or try to rip a CD in iTunes and realise typing in track names is a pain in the ass. Huzzah!

January 14th, 2007

Fry's Cocoa advertising poster from 1901
The maximization of the data-ink ratio of Tufte didn’t last very long. For the new theme I decided to look for inspiration in posters from the turn of the 20th century. I found it in one from 1901 advertising Fry’s Cocoa. (Coincidentally, our cocoa of choice growing up; I’m not such a fan nowadays.) The color palette, typefaces, and restrained Art Nouveau elements appealed to me - and there were no rounded boxes! Bonus: the advertising text was amusingly nonsensical when used out of place.

So with the theme in mind I set about making the website match, which boiled down to a few stylesheet changes, drawing the top image, and drawing the side decorative element. For the banner, the closest font I could find matching the original was Ashley Inline, published by Monotype. For the “pure, concentrated” flag I loaded a higher resolution bitmap of the poster into Photoshop, cleaned up the outline, and loaded that into Inkscape, then converted it into a path. I drew the text on top as another path, and here is the resulting SVG (Users of Firefox and other SVG compatible browsers should be able to view this directly). The decorative element on the side was also drawn in Inkscape: another SVG. There is a certain lack of detail there, since I couldn’t find very high resolution source images to trace over.

As I mentioned previously, Wordpress surprisingly didn’t get in my way when it came to delivering data to the theme. I could reuse all the CSS class names I’d used earlier for the Tufte look, and take advantage of the work already invested battling floating boxes in various browsers. Getting the side elements positioned correctly was the only stumbling block (note to self: remember to use position:relative for a parent element before using position:absolute). Still trying to decide what to do about the sidebar (big empty space below it) and the footer (doesn’t match), but I think it’s now much more interesting than what was here before.

January 14th, 2007

Switched over for only a couple of days and I’m already annoyed.

By default, Wordpress pings on every edit of a published post. Given that I have 300+ published posts which I need to start categorizing, and changing categories is an edit, that’s potentially a lot of pings in a short interval; and some of the ping services will ban a site when confronted with such traffic. Installed Christian Davén’s Smart Update Pinger plugin to fix this - but I shouldn’t have to.

I scan my apache error log periodically to debug my own broken links, and to chuckle at the latest virus botnet infestation sweeping the Web. Unfortunately, Wordpress has a couple of issues with 404 (Not Found) errors, and these issues get magnified when you turn on date and name based permalinks, due to the mod_rewrite rules:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . /index.php [L]

Suppose a request comes in for http://www.levork.org/narf, narf obviously being a web page that doesn’t exist. Due to the rewrite rule, instead of being dealt with by apache (which would correctly return 404 to the browser) this gets passed to Wordpress’ index.php to deal with. Here lies the issue: by default, Wordpress doesn’t return 404 in the Status Code (the very first line in the HTTP response to the browser), it returns 200. Wordpress does stick a Status: 404 Not Found in the response header, but this is not the same thing. I don’t believe search engines respect Status in the header, they pay attention to the Status Code. For example, I found out that google’s filename based sitemap validation mechanism will bail because part of their check relies on ensuring your website responds correctly with a 404 Status Code (otherwise, anyone could verify ownership of your web site). The fix for this is to stick:

<?php if (is_404()) header("HTTP/1.1 404 Not Found"); ?>

directly into your 404.php template file. Wordpress’ default theme (Kubrick) doesn’t do this! The other related problem is to get system error logging of 404 errors (so the apache error log contains them), and Matt Read’s Log 404 plugin handles this one nicely.

If you link to an entry on your own blog with a relative url instead of an absolute one (/?p=1 instead of http://www.levork.org/?p=1), you won’t get a trackback. This is annoying: absolute URLs to your own website aren’t portable at all.

Embedding a script into a post is either very hard or next to impossible: try inserting a flickr flash badge. There seem to be plugins to deal with this, but I’ve only had to do this once so I’m not too bothered yet.

PHP is its own class of irk, but I’ll leave that for another day.

Oddly, I haven’t had any real complaint about the theming support in Wordpress. It presents the right hooks to get at my blog data and mostly doesn’t get in my way - apart from a propensity to insert H2 and LI tags where I don’t want them, and for the most part there appear to be ways around that.

January 11th, 2007

It’s a new year, decided it was about time to upgrade blogging software. I still remain fond of Blosxom and its chicken wire and duct tape sensibility (check out the old colophon). I continue to use it at work, but for this blog it was starting to feel a little long in the tooth. In blosxom, each entry is a file on disk. With the plethora of text manipulation tools available on Unix, this is great for hacking, especially compared to the database manipulation route for the SQL unsavvy. On the other hand, meta information about entries becomes a real pain to deal with: date stamps, tags, and comments associated with entries have to be either glommed onto the same file and parsed back out on the fly, or kept in separate files on disk from the entry. Neither approach is as straight forward as keeping it all together in one database entry.

There was also a lack of immediacy in the old way: editing a text file, uploading, finding typos, repeat. It’s okay if I’m sitting on the same machine as the web server, but for levork.org that’s not the case. Also, I’ve been using wikis a lot lately, and editing directly in a browser form is becoming natural despite the lack of emacs shortcuts I’ve grown used to. (Speaking of which, I hear they have these text editors now that allow you to see true formatting in real time. Whizzy-wig, I think they call them. How neat!)

I’ve set up Movable Type on this machine before, but I decided to try out Wordpress on another blog as a test. After getting past the MySQL setup hump, installation was a breeze, and I was impressed with the feature set compared to Movable Type. So I tried it here on levork.org: exported the RSS feed from blosxom after manipulating the story templates somewhat, removed the newlines from the resulting XML RSS file (I’m picky about word wrap), and imported that into Wordpress. Spent an evening fixing a bunch of intra-site links, correcting a bunch of unicode and HTML special characters mangled somewhere along the way, reintroducing newlines into preformatted text, wrote some mod_rewrite rules to preserve old links, and here we are: Wordpress and blosxom sitting in the same directory for now, with Wordpress handling most things. Right now the look is boring WordPress default, I’ll have to learn how to edit the themes along the way, and I have to figure out feeds, sitemaps, and other such things along the way.

And hey - you can comment now!

April 19th, 2006

I decided the blog needed upgraded search capabilities, since Fletcher Penney’s find plugin just really wasn’t cutting it for me. So today I installed swish++, easily compiled and installed it, and after a quick perusal of the man page, indexed my web page in a matter of seconds. I then looked at Matthew Gregg’s swish plugin to blosxom and decided it needed some sprucing up. Namely, the search results needed to look more like google: sorted by rank (not by date), and divided up ten per page with navigation controls. So I hacked that in, along with a new blosxom search flavour. Here’s my version of the plugin; just type in something to the left in the search box to see what it produces. The new flavour templates use $swish::search in the head, $swish::rank in the story, and $swish::navigation in the foot. Hope someone finds this useful!

April 17th, 2006

Just spent an hour restoring this web site from backup and reconstructing a few pages that had changed since then. It’s amazing how destructive

 find . -mtime +1 | xargs rm 

can be when you type it from the wrong directory. Yeah, I’m stupid.

September 15th, 2005

Someone interested in blogging asked me a while ago how my blog was put together; I told her “you really don’t want to know, you should probably just sign up for Typepad”. So today, I was trying to add a feature to the blog and (while trying to debug a plugin conflict) realised I’d forgotten what some of the pieces did. I went through and figured that all out again, and so mainly for my future reference here’s a new and updated colophon; some of this may prove useful to other blosxom bloggers.

Most of this blog is driven by blosxom, generating dynamic pages; the rest of it uses a Makefile, which is there mainly to create static copies of some heavily accessed files (e.g. feeds, since some of you readers have insane refresh intervals. You know who you are). Blosxom suits my particular blogging habits: I hate editing text in a web browser instead of XEmacs. And I’m perfectly happy writing everything to .txt files on disk, as I’ve found that there are often times I need to run Perl or sed scripts to do global edits, and I don’t really want to be bothered with pulling entries out of a database using SQL.

Blosxom relies heavily on a plugin and “flavour” architecture. This is both good and bad; good, because its modular design means you can easily customize it; and bad, because out of the box blosxom doesn’t do very much, and to get a somewhat conventional blog going, you pretty much have to customize it. Moreover, some of these plugins interfere with each other, and it can be a real headache figuring out their dependencies.

So here are the plugins that I find are absolutely essential (i.e. I wish their functionality had been built into blosxom):

  • I used to use entries_index until I discovered this conflicted with my usage of $num_entries in the config plugin (see below), so I switched to entries_cache. Besides speeding up processing times, it also serves the invaluable purpose of locking down the modification time on stories. Hence I can go and fix a story.txt file at a later date without disrupting the order of stories presented. The down side is that if the modification cache file gets deleted - which I’ve done a few times, accidentally - you now have to reconstruct file modification times, which might be impossible unless the information is stored elsewhere (in my case, file naming convention: my story files are usually named MMDDYY.txt).
  • Relative links tend not to work very well with blosxom, since slashes get introduced all over the place whenever you get entries grouped by month, day, or what have you; and relative links hence tend to break easily. Instead, I use paths relative to the root of levork.org that start with a slash, and rely upon the absolute plugin to change their paths appropriately depending on the context.
  • I used to use the paginate plugin until I installed the calendar. I had to put up with the off-by-one error which created a bogus oldest entry dated in 1970 (this was particularly noticeable when it interacted with the find plugin, below). If I were to use this again I’d probably use the paginate_simple derivative instead, which should fix this problem.

To get my RSS feeds all working requires several plugins by themselves:

  • The lastmodified plugin is used to provide RFC822 dates for my RSS 2.0 feed and ISO8601 dates for my RSS 1.0 feed. My version is modified (download here); the RFC822 encoding wasn’t quite correct (days aren’t 0-padded) and the ISO8601 encoding wrongly appended time zones to times which were already in Greenwich Mean Time.
  • The config plugin is essential for making sure my feeds have the right number of entries, as well as turning off any plugins that don’t need to filter those feeds. This plugin allows me to create a config.rdf with:
     $blosxom::num_entries=10; 

    while preserving the fact that the HTML flavour gets by with $num_entries=5.

  • RSS stories are truncated using the foreshortened plugin. My version (download here) is slightly different from Rael’s; the stopping criterion is a fixed number of characters, rather than the first sentence.
  • The rss10 plugin, as its documentation states, does all the work necessary to figure out the table of contents elements block necessary in a RSS 1.0 feed.

These plugins, as well as some of the ones below, are all used by my flavour files for RSS 2.0 (head.rss, story.rss) and RSS 1.0 (head.rdf, story.rdf, foot.rdf).

Other plugins add some common blog features:

  • The calendar plugin provides the calendar you see on the upper left of each page. It’s extremely configurable and customizable using CSS, since there are “an (over)abundance of classes used”.
  • The archives pulldown menu you see on the left below the calendar is created using my hacked up copy of the flatarchives plugin - it does just enough formatting to make it work wrapped with some Javascript in the head file of the HTML flavour.
  • The find plugin, as you might expect, supplies the search box on the sidebar. It’s not terribly sophisticated but I find it useful every once in a blue moon.
  • I don’t podcast, but I’ve attached some music files in a podcast-friendly format to my blog before, using Dave Slusher’s and Keith Irwin’s enclosures plugin.

Finally, some quirky plugins that only I find useful:

  • My flavour files use a very basic file inclusion mechanism which replaces comments of the form with the contents of FILENAME. This is a legacy of the old way I used to do things with template files, and isn’t very interesting. The very simple plugin I wrote that drives this is called includer and can be downloaded here.
  • Since this blog started I’ve written my blog entries with minimal markup. I have a script (download here) that processes this minimal markup and turns it into properly formatted HTML, saving me from having to worry about paragraphs, lists, and the interaction of those tags with tables or preformatted blocks; I now use a blosxom plugin version of this script to process my entries.

So there we have it. It’s certainly not the end user blogging experience I would foist upon my sister (who, by the way, started blogging again); however, after I figured out my plugin conflict, it took me all of five minutes to add the four flavour files (config.sitemap, head.sitemap, story.sitemap, foot.sitemap - note they depend on some plugins!) plus a Makefile rule that would properly generate properly formatted XML data for Google Sitemaps. Which is why I like it, warts and all.

April 16th, 2005

On April 16, 2000, Toy Story 2 was still in theatres, I still sat in front of an SGI workstation in Point Richmond sharing an office with Mark, NASDAQ had just logged its biggest single-day loss ever, and the NHL was still in the first round of the playoffs. And I made meatloaf, and decided that this was news worthy of being posted to the web.

82,000 words, 300 entries, and one hard disk crash later, levork.org turns five. I still haven’t figured out how to make a decent meatloaf, maybe that’ll happen before the tenth anniversary.

© 1999-2008 Julian Fong