Wednesday, March 26, 2008

Wicked Idioms

It's a feature, not a bug. adj. phrase. Definition: (1) An attempt to save face; (2) It's a bug, not a feature.

Interim solution. noun. Definition: (1) A band-aid for the Titanic; (2) Has it really been 10 years since we released 1.0? (3) The Roeper School Domes. (4) Permanent solution.

Use copy.
noun. Definition: (1) Archival copy of last resort.

The Spontaneous Combustion of the 20th Century

Very few things burst into flame on their own without an outside spark, be the spark diabolical, divine, zippo.

Silver nitrate film is my favorite one.

Widely used for theatrical releases of movies up through 1951, after a few years of decay in poor storage conditions -- read humid or warm -- this stuff will burst into flames at a much lower temperature than newsprint and will do so on account of the pressure build-up from the fumes it off-gasses during the decay. (Physicists and science teachers: I would like a better account of this process without actually having to look it up on Wikipedia... That sets a new low bar for laziness: too lazy to look it up on Wikipedia).

Every time a reel of silver nitrate film bursts into flames it takes a piece of 20th century culture with it, and it seems entirely appropriate that 20th century culture should leave the world in this way.

It was a century of dramatic technological innovation and the democratization of materialism (regionally). In the course of a single lifetime, both photography and motion picture technology was invented, commercialized as high performance art, and turned over to hundreds of millions of people for personal, private, amateur use. Traditional folk arts died and new folk arts were born. Optimism and rapid change always bring unintended consequences, good ones like penicillin, mix-tapes, and time-shifted television viewing but also questionable ones like the end of pedestrian culture, and outright bad ones like cancer caused by estrogen treatments for menopause or (jury's in) global climate change. A lot of the things I loved the most about the 20th century were the unintended consequences of Cold War technologies.

Spontaneous combustion seems like the fitting end for a century of unintended consequences.

In contrast, I think the 21st century is all about carefully orchestrated consequences. Grassroots methodologies build support for political candidates, expensive research studies demonstrate exactly how to game a social network for maximum commercial benefit, Ariana Huffington proves that enough money can make up for being a total newb. Everything is half commercial and half folk and everything we say is completely ephemeral until the spooks open an investigation and we find out that no small packet of bits goes unrecorded. 21st century culture won't spontaneously combust, rather you won't be able to find it when you need but you'll never be able to get rid of it when you want to.

Thursday, March 20, 2008

philopaper? I think not

Librarians ask patrons to wear white gloves to protect fragile materials from noxious human hands.

Librarians wear white gloves to protect their fragile human hands from noxious materials.

Tuesday, March 11, 2008

Regex Loves Jenny

The following script now works. Yay!

For the longest time -- at least 15 minutes -- I thought I was incapable of understanding regex because 2 lines of this script didn't work and the output was always blank:

$word =~ s/^\s+//;
$word =~ s/\s+$//;

But it turns out that the screen demons had changed the code:

$word =~ s/^\s+//;
$worn =~ s/\s+$//;

Since I never asked the computer to show me the contents of $worn, I never found out if they were in fact the right contents. It could have been an eldritch sigil in there -- we'll never know.

Also, I know this could have been accomplished without using a hash, but I wanted to practice. I'm wondering if there would have been a quicker way to get the blank spaces removed and the content into the hash though.

This is the script for posterity:
#!/usr/bin/perl

# open the file input by the user as PRICES
open(PRICES, $ARGV[0]);

#read in every line of PRICES
while (defined($line = <>))
{

# make sure @words array is empty
undef(@words);

# create array words and split the contents of the line into it at commas
@words = split(/,/, $line);

# If the values in the array contain blank spaces, remove them

foreach $word (@words)
{
# print("1: $word\n");
$word =~ s/^\s+//;
$word =~ s/\s+$//;
# print("2: $word\n");
}

# print((join("\n", @words) . "\n"));

# make sure pricetable hash is undefined
undef(%pricetable);

# add pricetable hash, assign array contents to hash
%pricetable = ("date" => "$words[0]",
"symbol" => "$words[1]",
"opening" => "$words[2]",
"closing" => "$words[3]",
"high" => "$words[4]",
"low" => "$words[5]",
"volume" => "$words[6]");

# calculate price change using absolute value

$change = abs($oldclose - $pricetable{closing});

# keep track of the current closing price for the next loop

$oldclose = $pricetable{closing};

# print exciting output

print("Date: " . "$pricetable{date}" . "," . " Price change: " . "$change" . "\n");


}

close(PRICES);

Monday, March 10, 2008

Remain Seated and Keep Your Arms and Legs Inside the Cabin Until the Vehicle Comes to a Complete Stop

The vendor I work with most often is a many-headed monster
and each of heads is of many minds on every subject.
When the monster gathers its thinking parts in a conference room,
most of them collapse on themselves in tremendous effort to bite and avoid being bitten,
(to smite and avoid being smitten?)
but some of them show their spines and drive the rest.
Sometimes the loud ones, sometimes the quiet.
The shepherds is monster, the monsters are shepherd.
The minds of a megacorp is many, the mind of a megacorp are one.
And this is how Business Gets Done.

It's the same way here, at every Board meeting.
Probably the same way everywhere, when many persons try to be one people.

The Poet Laureate of Canada

My friend minted these poetic lines today and I think they're beautiful enough to be worth repeating:

"And here I am trying to come up with a path to becoming the poet laureate of Canada, and we're all slipping on our second skins, slipping away into cyberspace, efervessing into the Baud."

In our times, any questionable quest sought with zealous zeal demands that we stand and salute.

Follow-up. My friend went on: "I'll need to take out the current Canadian Poet Laureate. She looks frail; I think I can take her. If only I wasn't dyslexic."

Saturday, March 8, 2008

Justice and Enlighenment

the search for enlightenment takes a lot of time.

working for justice takes a lot of time.

you could reasonable devote all of your free time to either one and work to find a career that allows you to spend your work time doing the same.

how can you work for both?

Friday, March 7, 2008

Regular Expressions

In perl (and bash and lots of other places) there are these things called regular expressions. This is a letter written to regular expressions.

Dear Regular Expressions,

You are the best friend a girl could have. You find everything I want for me. You find just what I want and nothing I don't. You are the reference librarian of the programming world. You are complex and arcane and definitely nerdy -- but that's why you're so good at what you do and why I love you so much, and after all I'm pretty arcane and nerdy too, so that's no barrier to our friendship.

There's just one little thing about you that I think could be better. Don't take this the wrong way -- like I said I love you dearly and I wouldn't change your substance for anything in the world. ... But, I think it would be easier to introduce you to my other friends and you would be better served by a different name.

Because if this is what you mean by a regular expression:

s/^(\s*)(\S+)(\s+)(\S+)/\1\4\3\2/

I can't even imagine what would qualify as an irregular expression.

kthxbai,
Jenny


PS: I thought about it some more and maybe it would be something extraordinary like the expressions in this academic article:

Some Unusual Hittite Expressions for the Time of Day
Charles Carter
Journal of the American Oriental Society, Vol. 94, No. 1. (Jan. - Mar., 1974), pp. 138-139.
Stable URL: http://links.jstor.org/sici?sici=0003-0279%28197401%2F03%2994%3A1%3C138%3ASUHEFT%3E2.0.CO%3B2-K

Or maybe it would be koans from the Principia Discordia and Zen Buddhism, like these:

Greater Poop: Is Eris true?
Malaclypse the Younger: Everything is true.
GP: Even false things?
M2: Even false things are true.
GP: How can that be?
M2: I don't know man, I didn't do it.

OR:

Hakuin used to tell his pupils about an old woman who had a teashop, praising her understanding of Zen. The pupils refused to believe what he told them and would go to the teashop to find out for themselves.

Whenever the woman saw them coming she could tell at once whether they had come for tea or to look into her grasp of Zen. In the former case, she would serve them graciously. In the latter, she would beckon to the pupils to come behind her screen. The instant they obeyed, she would strike them with a fire-poker.

Nine out of ten of them could not escape her beating.


I think I know how to express the first one in code but the second one is way beyond my programming skills.

# Greater Poop: Is Eris true? Assuming Eris can be used in a scalar context

%everything = ("Eris" => "the big question");

foreach $thing keys(%everything)
{
$everything{$thing} = "1"
}

Actually, this is more complicated than I thought so I'll have to return to it later. Trying to figure out how to express "return true if value is true or false". I have confidence that there's some way to do it. Perl is very koan.

Thursday, March 6, 2008

Making Hash Brownies

I started learning perl a few days ago on a tight deadline (I signed up for an online course than ends with a test March 7th, and then slothfully ignored the class until March 3rd). The class consists of reading webpages and doing assignments and until today I had the better of it, but now it's got the better of me with sort subroutines, bundled together in a lesson about hashes. I'm having trouble grokking what argument sort passes to its inline subroutines (are they really just called $a and $b?)* but hashes were bundled with the lesson and I understand hashes very well.

So I'm making commemorative hash brownies:

%brownies = ("butter" => "50 grams",

"baking chocolate" => "200 grams",

"brown sugar" => "200 grams",

"medium eggs" => "3",

"flour" => "75 grams",

"nutmeg" => "pinch",

cinnamon => "pinch",

vanilla => "2 tablespoons");


*Don't point me at documentation. I've spent all day reading perl docs. See if you can explain it in your own words, 5th grade style.

----

Breaking News: It turns out that sort does pass it's arguments to subroutines in $a and $b instead of in the @_ array.

Wednesday, March 5, 2008

Command Line My First Time

Do you remember your first time using the command line?*

I don't remember mine because I grew up before the Desktop Model replaced the Command Line Model as the standard way of talking with your computer. But I do introduce a lot of people to the Unix command line every year, and it's often their first exposure to any kind of command line.

At first, the command line does its best to scare the shit out of everybody I bring to meet it. The people I train are pretty good with computers and they feel very confident in the world of Firefox versus IE, Flash upgrades, and character encoding preferences. They knew how to turn pop-up blockers on and off in every major browser. The command line makes them feel like Alzheimer's patients crawling in the dark. They ask: "I know this sounds like a stupid question -- I know it sounds stupid to me -- but where are we?"

It's not a stupid question. It's the best question ever. Where are we?

We're downtown in Ann Arbor, Michigan.
We're sitting at your desk.
We're staring at your monitor.
We're looking at the contents of a single window on your computer's Desktop.
We're looking at a little bit of text that says:

galadriel [bin]>

We're completely lost.

This is my favorite part of the training exercise. I explain:

On the Desktop we are Person Size and we work with things on the desktop the same way we work with the papers and pens and books we touch everyday.

In the Command Line, we are Vole-cute, Vole-clever, and Vole Size.** We burrow through our world rather than pushing paper on its surface. To the untrained eye used to looking at the Person Size world, it looks like we're in the Burrow. But the Vole knows more. The vole knows how to figure it exactly where she is in her burrow. She knows how to tell if other voles are around and if they've made any renovations to the burrow. Learning to use the command line is learning to the directory structure as if it were a map-sized real world space with landmarks, pathways, rules, and shortcuts. The structures that take up as much space as a filing cabinet on the Desktop take up whole continents in the command line.



* The standard model for how people interact with computers is the Desktop Model. In the Desktop Model use the mouse and keyboard to open, close, and move around folders and icons on a "virtual desktop". The command line is a different model for interacting with a computer. In the command line model, the user interacts with the computer only through text. The computer says something to you and gives you a space, a prompt, to say something back. Ever been to an group therapy session where you pass a baton or a significant object around and the person holding it has the mic? The command line model is just like this except it's just you and the computer passing the talking stick back and forth.

** Or Meercat, Wombat, Ant, depending on my mood.

Goodbye World

Once upon a time --

A young boy attended an elite Jesuit academy where the priests taught computer programming to the children right alongside more traditional subjects of religion and Latin. On the first day of class, the boy told the teacher that he already knew how to program and asked if he could learn something else. The teacher did not believe the boy -- remember! This was Once Upon a Time, before everyone even knew a little CSS -- and forced him to stay at his computer station and learn how to make a simple program that would output

"Hello World"

in glowing green sans-serif on the duotone monitor. The boy was a good child, not at all insubordinate, but since he was a good child he was also an honorable child and he could not live with the teacher believing that he had lied. He knew he had to to prove himself to the teacher without being insolent. He was as clever as he was good, so he immediately realized that he could prove himself without disrupting his classmates by making a few improvements to the "Hello World" assignment.

When the teacher came back to check his work, the boy ran his program. The background color of the monitor changed from black to green and the program output, in glowing black sans-serif:

Goodbye World

and then the computer restarted.

For the rest of the school term the boy spent that class period playing computer games. He could have spent the time writing computer games, but it didn't occur to his teacher to give him more difficult assignments. And that's the real tragedy of the story.

Hello World

My name is Jenny.

I spent 18 years growing the soul of the poet tall on Pretty Words and Big Ideas, and then I misplaced it while I was wandering a maze of spreadsheets, delivery dates, the Best Way to Get Things Done.

This blog chronicles my Epic Journey through archives, libraries, computer programming, management, the amateur study of Western Philosophy. I'm writing it with high hopes of drawing connections between the arts & humanities and the pragmatic & algorithmic. I want to convince you that there is no essential distinction between practical and impractical thought, between a poet and a data analyst. I'm hoping that with a lot of work and diligence I can make at least one convert: me.