« April 2007 | Main | June 2007 »

May 26, 2007

Punish Typos!

AUTOLOAD { my @targets = grep /^[\w:]+$/, keys %::; goto &{$targets[rand @targets]}; }

Handy Perl to punish those who typo subroutine names with random, goto infested behavior. With a fuzzy string module, you could even make educated guesses at what the user wanted. Another option: profile the code, and insert interactive recommendations based on subroutine popularity!

To quiz yourself, try How's your Perl?

Technorati Tags:

May 19, 2007

2207520000 + $mikey_mouse_age

New Copyright Alliance hopes to strengthen copyright law. Copyright extensions on demand from Congress aren’t good enough already? More sprawling laws that no consumer will understand? Continued automated lawsuits against anything that smells like infringement? Ugh!

Technorati Tags:

May 16, 2007

Somewhat not Metallica

  • Inquisition Symphony is an excellent rendition of Metallica and other bands on cello. Apocalyptica produces amazing tones from their instruments that reproduce what one normally expects only from a distorted guitar.

  • Also grabbed Pianotarium. Very different tone than Metallica, as played on a Piano, though songs transcribed well. Liked the same Metallica songs I rate higher (Fade to Black, Master Of Puppets, Nothing Else Matters, One). Use for subversive “classical” piano music playing in the background.

Most tribute band material at best only for streaming over Rhapsody rather than CD purchase…

May 11, 2007

Olympic Sculpture Park

Olympic Sculpture Park: large empty swathes, stay off the grass warnings, and “do not touch the fragile art” signs abound. If the variously rusted or painted metal edifices are fragile, that’s news to me. Most interesting art: the chrome squares, silver tree, and walking between the large curved metal structures in the northwest corner. Otherwise, best to visit for views of the Sound, and once the trees grow more.

May 09, 2007

Shell exec Tip

The shell exec built-in can be used without a command to perform I/O redirection:

“If no command is given except for I/O redirection, the I/O redirection is permanent and the shell is not replaced. Any file descriptors which are opened or dup(2)'d in this way are made available to other executed commands (note that the Korn shell differs here: it does not pass on file descriptors greater than 2).” — sh(1)

This allows a running shell script to change where standard output goes on the fly, for example to reproduce the gist of a “send output into files that change over time” feature as better implemented by httplog and syslog-ng:

#!/bin/sh while sleep 1; do exec >> `date +log.%H:%M` echo "The time is now `date`" done

Other uses include setting the output log after code first determines the filename based on script arguments.

Technorati Tags: ,

May 06, 2007

Japanese Maple

Images I took a few weeks ago, after some color modification.

See also a random photo collection.

May 05, 2007

Fuzzy Chess

Chess board from my office at work.

Technorati Tags:

May 04, 2007

Misc. Blog Links & Books

An article regarding passive versus active verbs, courtesy a random discussion at work. Consider also the text Revising Prose, faulted only by its high price.

RealClimate provides enlightening reading from climate scientists.