January 2005

anc_rollover Plugin for Textpattern

About

This plugin allows you to specify two Textpattern images by name or ID, which will be displayed in the browser as a JavaScript rollover. (Try it out on the image to the right.)

Download

anc_rollover_0.1.txt

Documentation

This plugin behaves very much like the <txp:image/> tag, except that instead of a single id or name attribute, it requires two attributes:

  • idoff (The id of the image that will be displayed initially, and when the mouse rolls back out)
  • idon (The id of the image that will be displayed on mouse over)

or

  • nameoff (The name of the image that will be displayed initially, and when the mouse rolls back out)
  • nameon (The name of the image that will be displayed on mouse over)

You can’t mix and match; you must use idoff and idon together, or nameoff and nameon together. If either of the images are not found in the database, the tag returns nothing.

There are two more optional attributes:

  • style (The same as the style attribute of a normal XHTML Transitional tag
  • align (The same as the align attribute of a normal XHTML Transitional tag

Note that the rollover only swaps the image source; it does not alter the image’s dimensions, align, style, or alt properties, which are based on the ‘off’ image.

Examples

Assume you have two images in your Textpattern site:

  1. ‘Button Off’, whose ID is 27
  2. ‘Button On’, whose ID is 30

You can produce a rollover using either of these configurations:

  • <txp:anc_rollover idoff="27" idon="30"/>
  • <txp:anc_rollover nameoff="Button Off" nameon="Button On"/>

If you wanted the image to have a beveled, dark blue border you could also use the style attribute:

  • <txp:anc_rollover idoff="27" idon="30" style="border:2px outset #000066"/>

License

©2005 by Andy Chase

This plugin is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Also

Ukulele Kit Construction, Part IV

I applied five coats of Tru-Oil to the ukulele, letting each one dry for at least 12 hours and using steel wool between each coat. Informal Google reasearch indicates that a lot of instrument makers who use Tru-Oil apply as many as a dozen coats, but it really looked quite nice after five coats – nothing I’d call professional quality, but well-sealed with a nice sheen.

I will also admit to being a tad eager to get the thing finished and strung by this point!

Also

Ukulele Kit Construction, Part III

Next step: applying finish to the ukulele.

Also

Ukulele kit Construction, Part II

After letting the neck/body joint dry overnight, it’s time to put the fretboard in place.

Also

Ukulele Kit Construction, Part I

As soon as the second half of my workbench was built and my tools hung, the overwhelmingly manly urge to build something hit me. Given my long-standing interest in luthery, my small budget, and my limited selection of power tools I decided to try putting together a Grizzly H3125 ukulele kit as seen on BoingBoing in December 2004.

Conveniently, the kit was available from Amazon.com for the princely sum of $24.99 plus about $6 shipping. (as of January 24, 2005, the Amazon product page says the kit is not stocked or discontinued – you may have to order it directly from Grizzly.) The order shipped from Grizzly, and arrived as scheduled 4 or 5 days later.

Also

Strange Spam

See also: Spamusement

Also

Tags

Installing RubyGems on Mac OS X 10.3

I decided to install RubyGems and the Rails framework on my PowerBook so that I might follow along with ONLamp’s breathless Rolling with Ruby on Rails tutorial, but when I tried to complete the installation of RubyGems with the following statement in the Terminal:

% sudo ruby setup.rb install

It kept bombing out with the error

hook /Users/andy/Desktop/rubygems-0.8.4/./post-install.rb failed:
wrong # of arguments(2 for 1)

You know you’re in trouble when Google comes up with fewer than ten results for the exact error you’re researching.

However, given that OS X has a relatively old version of Ruby preinstalled (1.6.8), I suspected that might be the issue and gave the slightly newer Ruby package for Fink a try instead. (You do have Fink installed, don’t you?) The install went like a charm – just be sure to use the Fink executable, not the native OS X one:

% sudo /sw/bin/ruby setup.rb config
% sudo /sw/bin/ruby setup.rb setup
% sudo /sw/bin/ruby setup.rb install

Also

Endlessly Bookmarking Ways to Get Stuff Done

Sites about improving personal organization and productivity have been hovering on the del.icio.us popular list for weeks now. 43 Folders, Getting Things Done, 50 Strategies for Making Yourself Work, Life Hacks and so on.

If other people use del.icio.us anything like I do, they read about these sites at BoingBoing, MetaFilter, Slashdot, or the del.icio.us popular list itself, think to themselves, “Great! Somebody else has figured out why I keep putting stuff off. I need to read this but I’ve got too much stuff to catch up on right now,” bookmark the site, and then go off on their merry way.

When I do go back to these sites and start reading, I glaze over after about three paragraphs. I’m a terrible procrastinator, and although these sites, books and essays contain a wealth of tips and strategies, when you boil them all down the Big Secret, the One Thing they’re all getting at, is that the best way to get a task done is to stop hemming and hawing about it, and actually DO it.

It’s like listening to sportscasters vamp during a time-out, talking about how the game is going to come down to which team scores more points than the other.

Also

anc_header plugin for Textpattern

The anc_header plugin allows you to specify custom HTTP headers within your templates.

Download

anc_header 1.0

Installation

After downloading the plugin file, browse to your Textpattern site’s administrative interface, click the admin tab, then click plugins. Click the Browse button, locate the file on your computer, then click the Install button.

The plugin should now appear in your list of installed plugins. Be sure it is enabled before you try to use it. Look under the Active column of the plugin list. If you see the word No next to the anc_header plugin, click it to change it to Yes.

Documentation

anc_header provides one simple tag:

txp:anc_header

Attributes:
content – the header content (Such as ‘HTTP/1.0 404 Not Found’, or ‘Location: /some/other/page’)
replace – True or false. True indicates that the header should replace a previous header of the same name, and false will add another header of the same type. Default value is true.

License

©2005 by Andy Chase

This plugin is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Also

Missing the Point

While it's nice that scientists have found a way to Making plastic from oranges" href="http://www.news.cornell.edu/releases/Jan05/Orangeplastic.deb.html">make plastic from something other than oil, wouldn't it be nicer if we came up with something that could be made from oranges and is biodegradable?

Sure, you're using orange peels and CO2 instead of oil, but you're still crapping up the planet with shit made out of plastic!

Resizing Multiple Images from the Terminal in OS X

Until I decide to spend the time hacking together a Folder Action to accomplish the same thing, here’s a one-line solution for quickly resizing a bunch of images.

Prerequisites

  • ImageMagick – I think there are a number of OS X ImageMagick binaries floating around out there, but probably the easiest way to get it is to install the Fink imagemagick package. (If you don’t have Fink, you should get it!) This solution makes use of the convert utility, and assumes it is somewhere in your path.
  • Terminal – You should have a passing familiarity with the Terminal application, which you’ll find under Applications/Utilities. See this Apple PDF for a gentle introduction.

Resizing the Images

Open up a terminal window, and cd to the directory your images are in; for instance, if they’re in a folder on your desktop called resizethese you would type:

cd ~/Desktop/resizethese

IMPORTANT: Make sure you’re doing this with copies of your original images, as this next step will affect the files permanently; it does not make new, resized copies in another folder somewhere, it operates on the files directly. If you run this on your original, 3 megapixel photos they will be irrevocably downsized. There is no undo in the Terminal!

Say you want to resize these images for use on the web, with a maximum 475 pixels for both width and height. Use the find command with the -exec option to invoke convert on all of the JPEGs in the current directory (If you have a directory full of some other file type, substitute its extension for *.jpg; ImageMagick can handle most common formats:

find . -iname "*.jpg" -exec convert -resize 475x475 {} {} ;

Depending on how many images you’re resizing and how large they are, your computer may chug away for a few seconds. When it returns you to the prompt, your images have been resized. To go straight to the current directory in a Finder window, type:

open .

If you’re a bit squeamish about the whole instantaneous, irrevocable resizing of the images in the current directory thing, you can use the -ok option instead:

find . -iname "*.jpg" -ok convert -resize 475x475 {} {} ;

This will prompt you to respond y or n before executing convert on each image.

Room for improvement

Is this the best way to resize a bunch of images in one fell swoop? People who live, breathe and eat Photoshop/ImageReady probably wouldn’t say so, and people who know AppleScript and Panther’s Image Events are probably snickering at my use of a third-party tool like ImageMagick, but OS X is an interesting beast; I often find that although there may be a native, “out of the box” solution to a problem like this, learning how to do it and understanding the hows and whys (as opposed to just copy/pasting somebody else’s scripts) would often take longer than it would for me to use a tool I already know from Linux. That flexibility is one of the best things about OS X.

Also

Maybe Next Time

No worries. Next time you have that extra $1.28 rattling around the bottom of your account, you know where to get rid of it.

Best,

-Andy

Also

Thank You!

It brings me tremendous satisfaction to know that

  1. You’re using a library, plugin, or application that I wrote, and
  1. It has proven valuable enough to you that you felt it was worth contributing whatever you have just contributed.

Thanks again,

-Andy

Also

anc_hide plugin for Textpattern

The anc_hide plugin allows you to comment out areas of a page or form opaquely; using the anc_comment tag instead of HTML comments around a block of code will hide it from the rendered output.

Download

anc_hide 1.0

Installation

After downloading the plugin file, browse to your Textpattern site’s administrative interface, click the admin tab, then click plugins. Click the Browse button, locate the file on your computer, then click the Install button.

The plugin should now appear in your list of installed plugins. Be sure it is enabled before you try to use it. Look under the Active column of the plugin list. If you see the word No next to the anc_hide plugin, click it to change it to Yes.

Usage

<txp:anc_hide><h1>Test</h1>
<p>This is some code I want to hide from the browser.</p>
</txp:anc_hide>

License

©2005 by Andy Chase

This plugin is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Also

Why Write Interactive Fiction?

Joel Ray Holveck has written some nice thoughts on the subject on rec.arts.int-fiction.

Like Joel, I have never played any of the old Infocom games to completion. I played Zork I for hours and hours on the Commodore 64, but I never got anywhere. I haven’t even played that many of the more recent, shorter games in the Interactive Fiction Archive.

I have a fairly low tolerance for getting stuck, and most of the games I try lead all to quickly to dead ends where I have overlooked a crucial piece of whatever puzzle is keeping me from the rest of the game. Furthermore, when I am stuck there are almost never any hints forthcoming, and I am usually reduced to the exercise of trying to blindly guess at what it is the author wants me to do:

>PUT CHEWING GUM ON BEDPOST

Apart from losing its flavor overnight, nothing happens.

>PUT CHEWING GUM ON DOORKNOB

You don't need to worry about the doorknob.

>PUT CHEWING GUM ON WINDOW

I only understood you as far as wanting to put the chewing gum.

>EAT CHEWING GUM

But you don't know where it's been!

>THROW CHEWING GUM

(at the floor) You shouldn't litter.

And so forth. It’s actually more frustrating when the author has anticipated all of the foolish things you’re going to try than if every action resulted in a stock You don't need to worry about the [foo] response, because it only confirms the fact that whatever you’re supposed to do is so non-obvious and contrived that the author knows you’re going to be grasping at all of the logical straws.

So, I haven’t actually played a lot of IF, which for a long time has made me feel unqualified to try writing it. I’ve had the sneaking suspicion that I just haven’t played enough good games, or maybe I just don’t have the knack for playing IF, or I’m just missing some damn thing that everybody else in the IF community instinctively groks about playing these games.

Maybe Joel is right, though; maybe other people just don’t write the games I want to play. I’m still getting familiar with the mechanics of the Inform language, but with time there’s no reason I shouldn’t be able to write a perfectly good adventure on my own terms.

The other, purely selfish reason I am attracted to writing interactive fiction is that opens a tiny doorway back to the time, before the 7th grade, when I was encouraged by my teachers to be creative and find enjoyment in the process of writing.

All of my writing instruction from junior high onward seemed like a systematic attempt to destroy any possible interest I might have had in the activity. Fiction, which was always the most fun to write, was completely neglected in favor of tedious research papers and nonfiction essays. My tenth grade “Creative Writing” class was anything but. I learned to hate writing anything until I was required to write a journal for my humanities course in 12th grade (proto-blogging on paper, really). The screenwriting courses I took in college were also very enjoyable. I wasn’t much good at it, but the process was absorbing.

Screenwriting, like IF languages such as Inform or TADS, is an interesting way to write; the fun fiction aspect of it gets tempered by the structural requirements of the medium… scene and character descriptions and lines of dialog in screenplays, and program code in IF.

That split between creative and technical breaks up the writing process and forces you to examine your story in managable chunks, which I find tremendously helpful. When putting together an IF story many of the logistics of your plot fall naturally into the realm of programming logic, which goes a long way towards keeping you honest when writing your descriptions and dialog, and considering matters of character (both player and non-player) motivation.

So, why write interactive fiction? I’m still figuring that out, but for me it’s as much about the process as it is about creative compulsion or the desire for critical acclaim. I’m rediscovering that it can be fun and rewarding to make up your own worlds.

Also

Workshop Wishlist

As soon as my workbench was complete, my mind began to fill with all the things that I can now make or attempt to make.

Shortly thereafter, my mind began to fill with all the tools I’ll need to execute most of those projects satisfactorily. The mental list grows longer every day, so before things start to fall off the bottom I’m going to start adding them here in no particular order.

Power Tools

  • Table Saw (a small, benchtop one)
  • Band Saw (ditto)
  • Table Router
  • Dremel Tool w/ Router attachment
  • Belt sander
  • Drill Press (not all that critical, but a ‘nice to have’ item.)

Hand Tools

Etc.

  • A good vise
  • Various clamps (c-clamps, strap clamp, etc)
  • RocketFM (So I can play music from my PowerBook in the other room, and listen on the shop radio, assuming the range is decent)

This list will, no doubt, be amended frequently.

Also

Feral City of Angels

I was reading an essay by Richard J Norton called Feral Cities when I came across this bit:

"Yet a feral city does not descend into complete, random chaos. Some elements, be they criminals, armed resistance groups, clans, tribes, or neighborhood associations, exert various degrees of control over portions of the city. Intercity, city-state, and even international commercial transactions occur, but corruption, avarice, and violence are their hallmarks. A feral city experiences massive levels of disease and creates enough pollution to qualify as an international environmental disaster zone. Most feral cities would suffer from massive urban hypertrophy, covering vast expanses of land. The city's structures range from once-great buildings symbolic of state power to the meanest shantytowns and slums. Yet even under these conditions, these cities continue to grow, and the majority of occupants do not voluntarily leave."

If you substitute 'scientology' for 'disease', you get Los Angeles!

Hacking the Textpattern Comments Form

I like the automated aspect of the Textpattern comments form, except for how darn big the Message textarea is. Unfortunately, this is not something that can be remedied via CSS, since the form size is specified in the style attribute of the textarea itself, which trumps any styles declared further up the food chain. It is easy enough to fix, however.

Hack that Form

Open up textile/publish/comment.php in your Textpattern installation directory, and head for line 183, which should look like

$textarea = '<textarea name="message" cols="1" rows="1" style="width:300px;height:250px" tabindex="4">'.htmlspecialchars($message).'</textarea>';

I changed the height attribute to a shorter 100px, and it looks much less intrusive.

Apache, Gnusto, and Z-Code MIME-Type

The other night I came across the Gnusto plugin for Mozilla, and promptly installed it in FireFox.

The first (and only) thing I tried was my own entry in the 24 Hours of Inform contest, and I was disappointed when FireFox just prompted me to download the file to disk; no different than before I had installed the plugin.

Just now it occurred to that Gnusto might expect Z-Code files to be served with a particular MIME-Type. The rec.arts.int-fiction archives didn’t provide a clear consensus, but application/x-zmachine z1 z2 z3 z4 z5 z6 z7 z8 seemed a likely candidate, so I added the following to the .htaccess file in my web server root:

AddType application/x-zmachine z1 z2 z3 z4 z5 z6 z7 z8

That did the trick. I put the URL of my .z5 file into FireFox, and after a few seconds Gnusto opened a familiar-looking Z-Machine window. It even supports SAVE and RESTORE – very slick!

Also

Ripping Off The Band-Aid

After a week of tinkering with Textpattern and putting together a pleasing variant of the Kubrick template I decided to just go for it and throw it up at the root of my new achase.net domain.

This is not as drastic as I had been thinking. My ancient portfolio site is still on its own second level domain, as is my mishmash of a weblog.

This is, theoretically, the site where I exorcise the ghost of siegel. I hope for achase.net to become the synthesis of my languishing portfolio site and the more universally useful bits that can be found on Sundown, which itself will probably stick around in some capacity as the place where I continue to post rambling ruminations about getting older.

Also

Syndicate content

Twitter

Older

Contact

Andy Chase
(978) 297-6402
andychase [at] gmail.com
GPG/PGP Public Key