Don't Follow the Script

When his weblog moved in March, Michael Fioritto put JavaScript in the first item of his RSS feed to redirect visitors to his new site.

The news aggregator AmphetaDesk read the script tag and executed the redirect, making it impossible for me to use the software until I unsubscribed from his feed, which probably wasn't the effect he was going for.

An aggregator that doesn't strip out script and other dangerous tags is a security exploit waiting to happen.

Java 2 in 24 Hours Panned

Just read an old review by Pan Pantziarka shredding Sams Teach Yourself Java 2 in 24 Hours, my beginner's Java book last revised in 2002.

By the end of the book, assuming you haven't been stunned into a coma by the author's humor (yep, it's a US thang), you'll have a very superficial view of Java programming. What you won't have is the knowledge or the insight to produce anything useful.

Mommy.

This book, which has done well with new-to-Java novices, will occasionally receive a total ass-kicking at the hand of a professional coder like Pantziarka.

Without challenging his conclusion that my work sucks big rocks, I think that some coders misunderstand the target audience for a 24 Hours title.

My goal was to write a Java tutorial that could be tackled successfully by total beginners and people scared off the subject by the complexity of college courses and existing books. My imaginary target reader was a person who needed a moment to get his head around the concept of a multi-dimensional array.

You can't serve that audience without reducing to the language elements you believe are most crucial to understanding.

There are plenty of books that assume some level of comfort with basic programming concepts, but I didn't think that Java had a tutorial that could evoke an aspiring programmer's first "by George, I think I've got it!" experience.

Turning Off the Radio

Because I wrote the book on Radio UserLand, my decision to stop using the software on Workbench has raised a few eyebrows.

By tradition, the first thing a weblogger must do with new software is publish a vicious excoriation of the old software, warning others to keep away, like a courageous relief worker marking a land mine.

Textbook example: When Mark Pilgrim concluded that a Movable Type licensing change would have cost him $535, he declared the software a dead end, switched to WordPress, and donated $535 to its open source developers:

Movable Type 3.0 changes the rules, and prices me right out of the market. I do not have the freedom to run the program for any purpose; I only have the limited set of freedoms that Six Apart chooses to bestow upon me, and every new version seems to bestow fewer and fewer freedoms.

I migrated from Radio for more prosaic reasons. I need software that can handle the Drudge Retort, a server-hammering menace that in seven months has amassed 4,500 weblog entries and 110,000 visitor comments. Though Radio development has been hearteningly brought back to life by Steve Kirks and UserLand, it's a desktop tool that publishes Web content as static files. That's a poor fit for a psychotically active site with constant user contributions (or should that be a constantly active site with psychotic user contributions?).

I could have chosen a server-based program such as Movable Type, the subject of my next book, or Manila, the software I'm using to host 3,000 free weblogs on Buzzword.Com. But I work faster in PHP than I do in either Perl or UserTalk, the scripting languages required to extend those two programs, and I'm skeptical that either program can handle a million-comment-a-year onslaught.

The money I would have paid for Radio, $39.95 a year, will be spent on Guinness and hookers.

My normal loathing of thimble-deep New York Times columnist Maureen Dowd has been temporarily suspended. She agrees with me about how Kerry rattled President Bush in the first debate:

Senator Kerry evoked the voice of Bush 41 to get under 43's thin skin. The more Mr. Kerry played the square, proper, moderate, internationalist war hero, the more the president was reduced to childish scowling and fidgeting, acting like a naughty little boy who refuses to sit in his seat and eat his spinach and do all the hard things a parent wants you to do.

Dick Cheney, Pitcher of Warm Spit

In my house, last night's vice presidential debate lost out to the latest episode of The Wire after an hour. The event had about as much chance of influencing voters as the position papers on each candidate's Web site. You'd have to be a political junkie like me to watch the veepstakes, and people who mainline elections already know who we're voting for.

I do, however, give Cheney a slight nod as the winner. He radiates battle-tested authority and experience, making it hard to lay a glove on him even when he's brazenly lying, as he did when stating "I have not suggested there's a connection between Iraq and 9/11." As Joshua Marshall and countless others have pointed out, no Bush Administration official has made that pants-on-fire claim more strongly than Unfrozen Caveman Vice President, trading in his future credibility for a headlong rush to war.

As far as I'm concerned, this point can't be made often enough in the next 27 days by Kerry and Edwards. When a president sells a war on false pretense, we'd be crazy to reward him with another term, even if the sight of Saddam Hussein in an orange jumpsuit pleases the eye.

A re-elected Bush would be the lame duck who cried wolf. If he receives intelligence in 2006 that requires a pre-emptive strike on North Korea or Iran, to pick two possibilities, millions of Americans won't believe him. His ability to prevent another 9/11 has been undercut by the deep-tissue truth massage that led us into Baghdad.

Brian Carnell, a Web publisher who has written thousands of articles for his animal rights extremism site and other projects, describes his computer backup policy.

Now, when I experience a catastrophic crash, I'll be able to look back to this entry and lament that I wasn't smart enough to secure my data.

Deciding Whether to Drop Anchor

One goal in the move to new software on Workbench is to salvage incoming links from other sites. When you break weblog entry permalinks, you break links on every site that referred to your entries. Because I use weblog archives as a research tool often in my programming, I don't want to hose permalinks switching from Radio UserLand to my hand-coded LAMP software.

I thought I could write a short PHP script to redirect each old Radio-style link to its new link -- just grab the anchor portion of the URL that follows the pound sign ("#"), make a MySQL database query to match the old anchor to the new one, then redirect the request to the proper resource.

No such luck.

The portion of a URL that follows "#" is called the fragment identifier. Radio finds an entry's internal ID number with this fragment -- for instance, #a1833 refers to entry 1833 in the weblogData.posts table.

Much to my surprise, fragment identifiers are not passed by a Web browser to a server as part of a URL request. Instead, they're used strictly by the Web browser, as described by the W3C:

Interpretation of the fragment identifier is performed solely by the agent that dereferences a URI; the fragment identifier is not passed to other systems during the process of retrieval. This means that some intermediaries in Web architecture (such as proxies) have no interaction with fragment identifiers and that redirection (in HTTP [RFC2616], for example) does not account for fragments.

When you request http://ekzemplo.com/view.html#note, the server only receives http://ekzemplo.com/view.html. The browser loads the page and jumps to the anchor named note.

Because the browser doesn't share the fragment identifier, there's no way for a Web application, Apache's mod_rewrite module, or anything else on the server to take action based on that part of the URL.

More details can be found in a proposed Internet draft about fragments and URL redirection.

To retain old permalinks, my new software puts two anchors in an old entry -- its Radio ID and new ID, as in this example:

Perhaps this is old news, but I'm amazed at the design implications of this fragment issue for entry-based publishing tools like Radio. Web servers never see the full permalink generated by the software (or my own, which also uses "#" links). I'm thinking about recoding to drop fragment identifiers in permalinks, but I can't figure out how without adopting a one-entry-per-page approach to archives, which I'd like to avoid.