Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

statico (5018)

statico
  ian.langworthNO@SPAMgmail.com
http://langworth.com/
AOL IM: eisforian (Add Buddy, Send Message)

PAUSE-ID: IAN [cpan.org]

Co-author of Perl Testing: A Developer's Notebook [oreilly.com]

Journal of statico (5018)

Friday October 21, 2005
09:26 AM

5003

I really like street art. Some, like darkcloud, are artsy and original. Others, like 5003, amaze me with their omnipresence. One tag, "Goner," is everywhere -- from newspaper stands in Allston to Fenway to doorways in the most remote alleys of Cambridge.

Just like the drawings, paintings and stickers these people plaster everywhere, many of them have equally as cryptic web sites. I'm guessing that 5003world.com is the same guy/group that plasters cities with sheep doodles.

Friday October 14, 2005
02:08 PM

a serious construction flaw

Poor Tom!

Tom publishes a weekly satire column at UNH. As usual, people can't take a joke, and he's gotten into a bit of trouble over his most recent article:

These documents, mostly emails between SKANSKA and the
university, show that university officials have expressed
"serious concerns" regarding allegedly serious flaws in the
new construction.

First among these is the presence of several odd angles in
roofs and walls throughout the new structure. Most egregious
of these according to the emails is the "strangely-shaped
roof" of the building's southern edifice.  According to the
mailings, the "long, shallow angle" of the roof is "seemingly
a serious construction flaw, for there could be no rational
or aesthetic reason for such a shape." These strange and
sometimes very sharp angles seemingly occur in several places
around the building, and are so glaring that one email
wonders if the construction workers were "engaged in some
kind of prank."

Thursday October 13, 2005
08:46 AM

a transaction

Subway "T" tokens in Boston cost $1.25. It's still cheaper for me to buy tokens as I go than to buy a commuter pass since I only take the train around 4-6 times a week. Lately I've developed a habit of leaving purchased tokens at home, so when I went to purchase tokens yesterday with a ten-dollar bill, I figured that I'd only need four, not eight.

Here's what happened:

  1. I walked up to the booth next to the turnstiles and slipped my $10 bill under the glass. I said, "Four, please," with good articulation and volume to avoid confusion -- a touristy faux pas.
  2. The following mix of currency and tokens was pushed back toward me:
    • 4 brass T tokens
    • 2 Sacagawea golden dollar coins
    • 1 Susan B. Anthony dollar coin
    • 1 $2-dollar bill
    • 1 $1-dollar bill

For those of you not in America, the only part of the above that people typically trade is the $1 bill -- at least, where I live. Golden dollars are unpopular. The $2 bill? Hell, there's even urban legend about the service industry thinking that they're fake.

Because I was busy talking to a friend on the ride to school, I didn't fully understand what had happened until I got there. The only logical explanation is that the T attendee recognized my inner nerdiness via scent. He must have decided to test my automata knowledge by presenting a denomination whose correctness can only be calculated in polynomial time.

I figure the extra dollar makes up the the tens of dollars the stupid token machines have eaten over the years, anyway.

Tuesday October 11, 2005
10:20 PM

fixing screen and ssh-agent

The Problem

I use Screen to leave programs running and an SSH key agent to shell between machines and use CVS without reentering my password. Disconnnecting from the server that the screen session is running on removes the connection to the SSH agent.

What should happen:

  • I should be able to run a command, say latestssh, to reattach my current SSH agent to the screen window
  • New screen windows should pick up on the new agent immediately

The Solution

A shell snippet (Zsh, but easily portable):

local agentdir=~/.latestssh
local agentfile=$agentdir/$HOST.sh
mkdir -p $agentdir
chmod 0700 $agentdir >/dev/null

if [ -n "$SSH_AUTH_SOCK" -a -z $STY ]; then
    echo "export SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >$agentfile
    chmod 0600 $agentfile >/dev/null
fi

# ...existing windows can run this alias
alias latestssh="source $agentfile; ls \$SSH_AUTH_SOCK"

# ...new windows get it automatically
if [ -n "$STY" ]; then
    source $agentfile
fi

10:10 PM

what's in a remix?

In browsing Magnatune and looking for music to feature in our student radio show, I stumbled accross Brad Sucks, a one-man band with lots of fans, despite what he claims. Usually kids that get their hands on microphones and copies of Cubase produce junk, but this guy has stellar multiinstrumentalist talent and a record deal with a net-label. His album, "I Don't Know What I'm Doing is tasty and enjoyable.

All of the music on Magnatune is licensed under a Creative Commons license, and some of the artists even release the "source" of their work. Brad did just that. When I learned of this, I immediately imagined every kid pirating a copy of Reason and cranking out songs consisting of the stock drum loops, synthy bleeps and as many effects as possible. Luckily, only a few of the remixes sound that way. Brad even picked eighteen of his favorite remixes to release as a separate "album."

Always wanting to see "behind the scenes," I downloaded all remixes that didn't make it to the remix album. After 76 or so songs, it got pretty tiring to hear the same, although good, vocal tracks over and over again. It's pretty hard to work in the confines of someone else's samples -- you can't change the rhythm or melody of the vocals without serious work/money/equipment and the risk of having it sound fake. I wanted to hear mixes, if not covers, that added some serious creativity to the original tracks. Here's what I jotted down.

You can download all of these songs from the extras page:

  • Borderline (Stutterbug mix)
    • This had a good feel to it and added some additional melodies.
  • Dirt Bag (Fear is Key)
    • Best cut-up music mix. Mix 70's cinema music and a little drumandbass. Most (but not all) of the vocal melody mesh into some really, really nice hooks.
  • Making Me Nervous - Melody Generator Space Funk Remix
    • A good, clean trip-hop mix with some synth pads as backup.
  • Overreacting (Nosve mix)
    • Sweet! Additional instruments [female] vocals and acoustic backup give it a great sound, ala-Air.
  • Making Me Nervous (Mandola Mix)
    • Adds original acousting strumming and harmony. Like Brad Unplugged at a folk festival.
  • SexyJosh - Making Me Nervous (Brad Sucks Cover)
    • Tired of the vocal track yet? Here's a breathy acoustic cover.
  • Bad Attraction (Future Boy Sambadelic mix)
    • Original, quick, clean, bleepy, fast, interesting. (Also the same guy who did the 8bit remix on the album, I believe)
  • Sick as a Dog - (Bill Berry mix)
    • Techy-grungy, and the most driving variant of the song that I've heard. I bet there's a little bit of Norman Cook influence.
  • Bad Attraction (w00dy mix)
    • Neat-sounding surf/spy mix.
  • Sick as a Dog (Future Boy Old-Timey Mix)
    • Honerable mention. The swing feel doesn't quite match up with the vocals, but it's a fun listen.
  • Making Me Nervous - fourstones.net's Lox Mix
    • Honerable mention. Fun.
Monday October 10, 2005
10:40 PM

mind mapping, editing, markup, parsing

I've been reading How to Make a Complete Map of Every Thought You Think, a not-so-well-written, edge-of-your-seat homebrew guide on how to organize everything that goes through your head. I finished "chapter" five while waiting for the bus, and I've learned how the author organizes his notebooks, what kinds of pens he keeps around, and how to organize topics into "maps" and entire pages.

I'll chirp about the content later, as it's the style of the "book" that's hooked my attention. The author explains that he wrote the entire document in one fell sloop with nearly no use of the backspace key. The result is a firehose of information, which is organized into "chapters" that are really markers of how many pages to print at a time.

The book screams for an editor. My designer and editorial instincts are simply dying to take over. With every other paragraph I imagine dumping the document with w3m, starting to mark it up with POD or KWID, converting it to LaTeX sections, refactoring the content, and playing with the style. The author describes techniques for marking notebook pages, and my reading is constantly interrupted with ideas of how to autogenerate figures to exemplify his techniques. If only I had time!

A little yak-shaving is needed, however, because I'd much rather use KWID and WAFL markup than POD. (KWID is kind of the name for Kwiki markup, which may also become an alternative to POD for Perl6 documentation.). What I really, really want is an extensible KWID parser, but there doesn't seem to be anything like it!

Parsing wiki text is different from parsing, say, the output of diff. When you parse wiki text, if there is incorrect syntax, nothing happens. There don't seem to be any events, only things to replace other things with, so a stream interface wouldn't apply.

The original CGI::Kwiki::Formatter (the Olde Kwiki Era) seemed to have the right idea by specifying a list of things to to format and in what order. Kwiki::Formatter (the New Kwiki Era) specifies a class heirarchy, and each class specfies what other classes it contains, and supports the new extensible WAFL syntax. Kwiki::Formatter, however, doesn't seem to be able to stand alone easily.

Basically, a formatter of this type turns markup into a data structure, and the data structure is turned into output markup, whether it be XHTML, XML, LaTeX, POD, plain text, etc. The question is, how do I go about doing it, and how do I do it well?

Sunday October 09, 2005
09:58 PM

a bounty for irssi programmers

I don't always remember what time zone some people are in, and there are many occasions when knowing this information would be convenient. I propose a bounty:

<statico> I'll give someone a six-pack if they'll write me an irssi
          plugin that lets me associate time zones to hostmasks so the
          user's local time will appear when I /msg them on IRC.
<knewt>   statico: course, then someone irc's in from a box the other
          the world to where they actually are
<ayrnieu> that's why statico will have a /set_tz $nick $tz

Irssi would read in the TZ environment variable or something, then I'd enter a few settings:

/set_tz someguy -800

When I get a private message, I'd like to see:

>>> Irssi: Starting query in FreeNode with someguy
>>> Local time is 8:06 AM
<someguy> honk

I'd be satisifed if the configuration file was a simple file, say ~/.irssi/timezones.

Saturday October 08, 2005
12:24 PM

you can't please everyone

It had to happen eventually. It was only a matter of time before a negative review of Perl Testing: A Developer's Notebook would appear.

As a rebuttal, I could pick apart the reviewer or sing songs about the amount of effort it took to produce the book. Instead, I'll be content knowing that previous generations have already dealt with this, and friends will always be on my side. Please amuse yourself, and read from the bottom review upwards.

Friday October 07, 2005
10:35 AM

coke, panzer tanks

Advice: If the opportunity arises, do not pour Coke into your industrial laser printer. Printers run on electricity, not corn syrup.

Lesson learned: Pouring Coke into printers makes them sound like a rusty Panzer tank, as seen in Saving Private Ryan.

Thursday October 06, 2005
04:09 PM

limited lookahead

<statico> This is driving me nuts. Can anyone find the syntax error: my
           @lines = map { "$_.foo\n", "$_\_bar.baz\n" } map { quux($_) }
           @$quuuuux;
<integral> are those hashes or blocks?
<statico> Blocks.
<statico> Or, at least, they should be.
<integral> did you remind perl of that?
<statico> "Remind?"
<integral> add a ; after the { of the first "block"
<integral> your code will then work.  perl only uses limited lookahead
           to decide
<statico> Weeeeeeeeeeird. Thanks!