Amazon.com’s MP3 Store

Overall I’m pleased with the Amazon mp3 store. Good interface. Good prices. Previewing tracks and albums is intuitive, the samples are high quality, and you don’t wind up with a desktop full of little .rm files after previewing them all.

The selection can be lean, even with slightly out of band tastes. I can only find one full VNV Nation album, while Rotersand turns up a remix album, and Seabound is MIA. That said, discovering new acts based on what you already know is easy and — dare I say it — fun, at least in the heavily incestuous world of electronica.

I didn’t enjoy having to install an application to download full albums. I also didn’t enjoy being forced to purchase using “one click” — why can’t I shop and then check out? I read through the terms of service, and there’s no mention of watermarking or inclusion of my account info in the files, but I wouldn’t call that conclusive. Will I get a nastygram from Amazon if someone swipes my SD card? Hopefully we won’t find out.

Once I’d made my purchase and installed the application, the downloads were quick. On my Mac, the Amazon application created an “Amazon MP3” folder in my music folder and generated subfolders for artist and album in the iTunes style. The tracks were automatically imported into iTunes, although I found it odd that the application didn’t create a playlist of the album. One question I haven’t found an answer to is whether, like in iTunes, I can purchase the remainder of an album for the (discounted) album price if I have already purchased tracks individually.

Bottom line, Barry Adamson’s “King of Nothing Hill” sounds great in iTunes, will play in TCPMP on my Palm Zire and can ride a thumb drive to my client onsites. At the same album price offered on the iTunes Store for a track that’s locked to play only in iTunes on my own machine, I’d call that a deal.

Plugins

The following are the plugins in use on the Space Toast Pages, in the order in which they were installed. Note that plugins should be saved into Blosxom’s plugins folder with no file extension: do not add .cgi or .txt, for example, or they will not run.

Excludez

Available here. Prevents Blosxom from reading designated directories. Necessary to keep certain text files in the old pages directory from appearing as Space Toast Pages. Minimal setup, no headaches.

Blox

Available here. Automatically inserts paragraph tags and line breaks. Big time saver. Minimal setup. Has an optional “wiki-like” markup system, on by default, which was disabled after it mangled a Creative Commons license. Grinds JavaScript to a bloody pulp. (Would do well to disable itself inside comment tags.)

File

Available here. Allows the contents of text files to be inserted dynamically into templates and stories. Used to add the “Current Addiction” to the sidebar. Minimal setup, no headaches.

MoreEntries

Available here. Creates the “Next” and “Previous” links that appear at the bottom of the page when needed. Smart about when to add the links and when not to. Basic setup minimal, but changing the default wording and styling of the links requires digging through Perl code.

Meta

Available here. Required by the Entries_Cache_Meta plugin below. No setup, pain-free.

Entries_Cache_Meta

Available here. Allows a story to specify its posting date. Needed to backdate the old weekly issue Space Toast Pages and to keep Blosxom from treating edits as brand new postings. Poorly organized variable configuration slows setup.

WritebackPlus

Available here. Invites readers to post their comments about Space Toast Pages. (Hint: Dig through the >Run Fight Heal Magic line.) Complicated setup, but not out of line with total functionality. May need to be rethought if comment spam ever becomes a problem. Update: Was rethought when Comment Spam became a problem.

The problem of Comment Spam will receive its own posting shortly.

Cloaking Blosxom

The correct form of a URL is where/what, as a web address exists to organize content. By default, Blosxom serves pages from www.spacetoast.net/cgi-bin/blosxom.cgi, a machine-centric where/how address which breaks the above guideline. A method was needed to disguise the address of the cgi script.

Blosxom’s main site includes instructions for hiding the …cgi-bin/blosxom.cgi address on an Apache server by means of an .htaccess file — a local preferences file. Unfortunately, the instructions did not work for this site.

The first method given for cloaking Blosxom (bullet three, step two) redirected requests for any address in the STP directory to Blosxom, including images, media files and old pages. For this site, it would have been written thusly:

RewriteEngine on

RewriteRule ^STP/?(.*)$ /cgi-bin/blosxom.cgi/$1

The second given method (bullet three) invoked Blosxom only if a real file could not be found. It had problems with directories. Since STP/web/blosxom/ is a real directory, Blosxom did not attempt to create a page there, defaulting to either listing the files in the directory or producing a missing/forbidden error. Here is how it would have appeared:

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^STP/?(.*)$ blosxom.cgi/$1 [L,QSA]

Venerable Apache Server’s developers are a strange, thundering race who produce suitably impenetrable documentation, but after some levelling up the following was arrived at:

Options +Indexes

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^STP(.*) http://www.spacetoast.net/cgi-bin/blosxom.cgi$1

Here is a breakdown. The first line overrides Laughing Squid’s default error when trying to browse a directory without an index file. The second turns the URL rewriting engine on. The third tells it when to work — in this case, when a file can not be found. (Notice that the missing directory line is now gone.) The fourth line tells Apache to remove “STP” and send the remainder of the address to the blosxom.cgi script.

This portion of the Blosxom installation took far more geekery than it should have. Strictly speaking though, it is optional.

Why Blosxom?

I’d been meaning to add blog software to my site for some time, and of all the content management systems I looked into, Blosxom seemed to best suite my prejudices:

  • Free and open source
  • Small and easy on the server
  • No annoying .php pages, as discussed in this rant
  • No database — nothing to yell at me if I make changes with FTP
  • Plugins to add missing features

With Blosxom now up and running, I can report that it delivers all of the above, at the cost of the following:

  • Missing, out of date and incomplete documentation
  • Missing, out of date and incomplete plugins

Blosxom is ancient in web terms, buoyed along by its simplicity of design. The original site is no longer updated, and while the current developers have mirrored the site to SourceForge, they appear to have done little to update it. Newer plugins can be found offsite, without documentation or generally even descriptions of what they do. Plugins listed on the conserved original site are often dead links; mirrors of the plugin code can usually be googled, but any documentation not included in the code itself is often gone. Blosxom has only basic functionality without plugins.

It is (apparently) possible for an artist with only a modest technical background to install, configure and use Blosxom. The core blosxom.cgi script is bulletproof, and the original installation instructions are quite good. Setup is minimal, and there are no dependancies. An understanding of Perl is not required.

Plugins can be another matter. Many of the plugin problems fall under a recurrent fallacy of open source: “It’s free, so I can be lazy.” Certain plugins expect the user to be a Perl hacker, which is counter to the philosophy behind the software. Others omit documentation, or are abandoned with features incomplete. Blosxom’s stop-and-go development over the years has not helped the problem. More on the plugins used on the Space Toast Pages will follow, after some notes on basic installation and the problem of “cloaking” the cgi-bin URLs.

Notes on Installing Blosxom

Blosxom’s official installation instructions are concise and straightforward. Installation required only a standard FTP client and a text editor. (I used JEdit with the FTP plugin installed.) The blosxom.cgi script ran as soon as it was installed; SpaceToast.net’s ISP, Laughing Squid, did not require it to be “blessed” first.

Configuration was straightforward. The settings are stored in the script itself. Many settings can be left at the defaults.

Fitting the Space Toast Pages’ existing layout into the Blosxom engine was equally straightforward. An old Space Toast Page was sliced into three “flavor” files, the head.html, story.html and foot.html files, with Blosxom markup tags added where dynamic content should be placed. (An additional date.html flavor file is required. On the Space Toast Pages it is an empty file, as date stamps are part of the story template.)

Blosxom stores posts as plain text files in the “data directory” and serves them as html files or rss feeds from the “blog directory.” The Space Toast Pages keep everything in SpaceToast.net/stp. Surprisingly, this doesn’t cause a problem. Any of the posts on the Space Toast Pages can be accessed as raw text files by simply substituting .txt for .html in the address bar. The text file is a real file sitting on SpaceToast.net; the html file is a fake created by Blosxom when it’s requested. An .htaccess file makes the ephemeral page look real — more on that in the next post on cgi cloaking.

SGV Artillery Game: Proof of Concept

Issue 173, for the week of 7/2/2006.

Toast Note: What with the site redesign (now complete), three concurrent jobs, and a bad summer cold, the Space Toast Page has been a bit neglected lately. Still, I have a treat for you this week. Thanks for waiting.

(If the above opens as plain text, save it to the desktop and drag the file onto your browser.)

This is a proof of concept for a tile-based artillery game using Scalable Vector Graphics (SVG) and JavaScript. SVG was meant to be an open, plugin-free alternative to Flash, but it was a relative failure. To date, only FireFox and Opera 9 fully support the SVG specifications, with Safari’s support still incomplete, and no native support in Internet Explorer. Adobe has released an SVG viewer plugin for most web browsers, but Adobe’s implementation is not fully compatible with standard SVG. Still, the Safari development team is making fast progress, and Google is reported to be working on a translator for Internet Explorer, so SVG may yet see a true dawn.

To date, the game has only been tested in FireFox 1.5 for Mac and Safari 2.0.4. It is buggy, but runs in FireFox. Safari will draw the initial game state, but does not loop.

The game runs at a resolution of 700×500 pixels. In a window smaller than that, FireFox creates scrollbars, which trap the arrow keys. I don’t know a way around this yet. It should be possible to make the game scale up or down to the size of the window automatically, as SVG is resolution-independent, but that may require redoing the artwork and JavaScript to use percentage measurements, rather than pixel measurements.

The game artwork was created in Inkscape, an open-source project which is making great strides toward creating an alternative to Adobe Illustrator. As of version 0.44, Inkscape is not suitable for directly editing graphics in an interactive SVG file. It has a tendency both to mangle JavaScript and to revert custom group names to generic ones. Additionally, Inkscape’s method of saving object attributes like color and stroke width is to bundle them into one long style element (i.e. style="fill:#574736;fill-opacity:1stroke-width:0;stroke-opacity:1") rather than splitting them into individual elements, which are easier to access with JavaScript. The Inkscape team’s progress remains impressive.

My biggest concern is speed. The game currently maintains its frame rate by idling for 10 milliseconds between loops, although I think I’ve come up with a better way to do it — please refer to the JavaScript’s comments. Although I doubt that FireFox’s SVG drawing routines are tuned for game speeds, my biggest worry is the speed of JavaScript execution. Some parts of the script store game data in JavaScript variables, others assign it to the game’s SVG objects — as whim desired, really. The latter seems to be considered more “correct,” in terms of modern programmers’ fetish for object-based programming, but I’m all but convinced it’s terminally slower than the former. Accessing elements (manipulating the DOM) is also an absolute pain in the ass in JavaScript. For both reasons, I suggest doing it as little as possible.

As near as I can tell, this is the most advanced SVG game anyone has written to date — which is sad, but telling. Owing to uneven support, sluggish speed and lack of an integrated development environment, I can’t see SVG supplanting Flash any time soon. Still, SVG is not without potential. Enjoy the game.

Further Reading:

With some previous JavaScript experience, it took me about a week of spare time to get this far. The following sources and examples were invaluable.

Clip Splicing Without QuickTime Pro

Issue 170, for the week of 4/30/2006.

QuickTime Pro wouldn’t have pissed me off if they hadn’t taken features out of the player to make a paid version. Add some good stuff, charge me extra for it and keep the basics free — fine — but cripple the software and charge me extortion money, and I’m not inclined to pay. I’ve been using Macintosh computers for a long time; I remember when it was exciting that a clip could actually maintain synch! I remember QuickTime 1, QuickTime 2, and the Waterloo that was QuickTime 3. Release three was when Apple gave us some nice codecs and tried to dance around the fact that they’d started charging for cut, copy and paste. It was also when they began nagging us to upgrade to Pro, but that, fortunately, has taken a more subdued tone lately.

Since I never use the second paragraph of a Space Toast Page to actually set up the essay, let’s just take a second to mention that it’s Apple’s botched QuickTime strategy that has gotten us to 2006 with no serious alternative to Flash. Full JavaScript-based interactivity, on-the-fly transitions, realtime filters, and unlimited dynamic tracks in any supported video, still, audio, 3D, panorama or sprite format were and remain possible in QuickTime, but without a real track-based development tool (which should have come standard with every Mac) these features remain hollow bullet points.

Never mind that you can’t cut, copy and paste anymore.

So what are our options? Let’s say, theoretically, that you’re working on an animation for a local science museum. Theoretically, they’re going to be running a QuickTime movie to a video projector from within a PowerPoint presentation. Imagine that it’s about Ben Franklin, and it’s going to be fantastic. This is all theoretical, mind you. Now lets imagine that, because it’s going to a video projector, you’re working at above DV resolution. You nursed Premier along for far too long, and when Apple did a trade-over promotion with Final Cut DV you jumped at it. Here’s the problem: Any editing, even splicing clips together or adding a sound track, will cause Final Cut Express (another creatively crippled program) to first scale down to DV resolution (720×480) and then scale back up when you export — resulting in a noticeable loss of image quality, especially on the kite strings. (Don’t forget how theoretical this all is.) All you really need is the 21st century equivalent of a Steinbeck, but QuickTime paywalled clip splicing in 1998.

The solution is to go back before 1998. QuickTime 2.5 was the final pre-3.0 release and, being freeware, installers can still be found all over the internet. Download a QuickTime 2.5 installer, choose Custom Install, and install only the MoviePlayer application. At the risk of talking out of my ass, at 164k, the MoviePlayer application seems to be little more than a pass-through for features wired into QuickTime, which means that MoviePlayer can now do more than it could when it came out. For instance, it can play .dv clips, or .mov clips compressed with the DV codec, even though digital camcorder support wasn’t added to QuickTime until 3.0.

MoviePlayer can’t do everything though. H.264 (one of what appear to be three different implementations of MPEG-4 video currently in QuickTime) runs only under Mac OS-X, and opening one of its clips in MoviePlayer will return an error — thought, impressively, not a crash. “Present Movie” will crash Classic however; don’t use it. As a Classic application, MoviePlayer is limited to QuickTime Classic’s codecs: Animation, BMP, Cinepak, Component Video, DV NTSC, DV PAL, DVC Pro PAL, Graphics, H.261, H.263, Intel Indeo Video 5, Motion JPEG-A, Motion JPEG-B, MPEG-4 Video, none, Photo – JPEG, Planar RGB, PNG, Sorenson Video, Sorenson Video 3, TGA, TIFF, and Video.

MoviePlayer has the old-fashioned design philosophy of a product without a marketing strategy. It’s remarkably intuitive by today’s standards. Drag on the timeline with the shift key to select part or all of a clip; a black bar appears to indicate how much you’ve selected. You can cut, copy, paste, delete, or drag and drop to your heart’s content. (Large clips sometimes return low memory errors with cut, copy and paste — dragging and dropping seems to avoid this problem entirely.) “Extract Tracks…”, in the Edit menu, creates a new clip with either the audio or video track. Tracks may be deleted individually, or temporarily turned off and on in the Edit menu as well. Choosing “Get Info” under the Movie menu and selecting “Time” from the “Files” popup menu will allow you to view timecodes.

To get back to that theoretical Ben Franklin animation, pretend that you have spliced together a final cut of the animation and need to replace the scratch track of the live actor’s lines with a sound effects track mixed in Audacity or Final Cut Express. Open the sound clip you’ve exported from either program, select it all and copy it. Go back to the animation clip, choose “Delete Tracks…”, delete the current sound track, and click on the first frame of the clip. Hold down option and go up to the Edit menu. The “Paste” menu item has become “Add,” which will allow you to paste the sound track under the video. Selecting “Paste” without holding down the option key will perform the default insert operation, moving all the video out of the way and inserting black video for the length of the audio clip. It’s weird, but it makes a kind of dumb sense.

We have successfully edited a QuickTime clip, and we have two options with which to save it.

The File menu’s familiar “Save As…” includes two choices of its own. “Save normally (allowing dependancies)” will display a much smaller file size than “Make movie self-contained.” Chances are the latter is your best bet though. “Make movie self-contained” will copy all of the track data you’ve added to the clip into one file, rather than looking up all of the individual files you spliced together to make the clip. When you select “Make movie self-contained” a new option will ungrey: “Playable on non-Apple computers.” Select this. QuickTime used to default to saving movie data into a “MooV” resource alongside the data fork, rather than into the data fork itself; non-Apple systems never used the split resource/data fork file structure, and see only an empty or corrupt movie file. Use the “Playable on non-Apple computers” option to avoid this problem. The advantage of “Save As…” with “Make movie self-contained” and “Playable on non-Apple computers” is that the resultant movie will be exactly the data that you fed into it. Nothing is recompressed. There is no digital generation loss (and yes, there is such a thing).

What if you need to recompress the movie though? Suppose you need a 320×240 version compressed for the web. What if the computer playing the animation has too slow a hard drive to keep up with the Photo-JPEG codec at maximum quality? Beneath “Save As…” is an “Export…” option. This brings up the standard QuickTime export dialogue, from which you can export to non-QuickTime formats, as well as change the frame size, frame rate, sound and video codecs, and streaming optimizations.

As usual, I’ve gone on for far too long with a very simple idea, and one week’s Space Toast Page has become another’s. If you can run Classic, get MoviePlayer. It’s a pawn shop Swiss army knife with a rusty corkscrew and the initials P.B.R. carved into the handle, but it still basically works. If you want a Big Message, which I’m sure you don’t, onward is not always upward, and Neil Young can kick it out better in nine days than John Melencamp could in his entire wasted career. Thank you for reading.

A Random English-Sounding Place Name Generator

Issue 166, for the week of 2/26/2006.

Here is a funny request:

I'm launching my new Feudalism inspired game next week, and I need a TON of english

sounding region names. Like Woodstown, or Clapshire.

I can TRY to think of them all myself (I'll need anywhere from 45-50), but the

prospect baffles my widdle mind. SO if you have time and inspiration, and feel like

inventing 4-5 of them FOR me, I'd really appreciate it.

Thanks (in advance)

-EvilMustache

Below are fifteen randomly generated English-sounding place names. Reload the page for fifteen more. Enable JavaScript if nothing appears: