zen.org Communal Weblog

October 23, 2007

Hallowe’en Music

Filed under: — sven @ 23:55 GMT

Sure, Samhain doesn’t start for a week, but having a three year old means it is on! ZoĆ« just watched this little bit, like, ten times in a row. This is Hallowe’en music:

Squirrel Nut Zippers already has a great Christmas album, they should make a Hallowe’en one too. Or is that every album but the Christmas one?

October 16, 2007

Stupid Perl Trick

Filed under: — sven @ 15:08 GMT

Where I work we have to processes files from many sources, we have found three different line endings: “\n”, “\r\n”, and “\r”. We didn’t want to process all the files before, er, processing them so I wrote the following:

#!/usr/bin/perl
use warnings;
use strict;

until (($/ = getc(STDIN)) =~ m/[\r\n]/) {
die “no new line!” if (eof(STDIN));
};
if ($/ eq “\r”) {
$/ .= “\n” if (getc(STDIN) eq “\n”);
}
seek(STDIN,0,0); # rewind()

This will set $/ to which ever of the three file endings we have so you can then process them without thinking. Well, almost no thinking, you will need to use chomp instead of chop. I’m sure it could be nicely abstracted too, bit I didn’t.

October 4, 2007

The Boy Who Cryed WMD

Filed under: — sven @ 03:25 GMT

According to Wikipedia, the attack on Perl Harbor killed 2,388 people, the September 11, 2001 attacks killed 2,993. The 9/11 sum includes the terrorists, I don’t think the Perl Harbor deaths include any invaders, but all but 55 of them where military. The 9/11 deaths were predominantly civilians.

The Japanese invasion united the country, al Qaeda united the country. As I watch Ken Burns and Lynn Novick’s The War I am amazed at the lessons forgotten. I would of bought a war bonds, I would of (I did) limit my gas usage, I wanted to sacrifice. When George W. Bush was first running for President I remember hoping John McCain would win, and there is only one Republican I have ever voted for, but Mr. Bush won, so I wanted him to succeed. I’m a patriot, what the masses thought was more impartant then what I thought. One of these posts I’ll figure out what I think now.

October 3, 2007

The fine art of spam writing

Filed under: — alice @ 16:03 GMT

This arrived in my mailbox just a few minutes ago; couldn’t resist sharing:

“Dear Customer
We are coorporate lenders. we give out loans to A very honest and reliable
personalities. we give out our loans at low interest rate and moderate values as cheap as
4% rate. Becuase of scam we tender our qualifications if it satisfies, you can continue
with the transaction, but if you are not satisfied you can go to another lender. Channel
your reponse to this email.
jamespeter16@gmail.com
Greatest Regards
Marketing Manager

Mr Peter James.”

Powered by WordPress