Slash Boxes
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 ]

jdavidb (1361)

  (email not shown publicly)

J. David Blackstone has a Bachelor of Science in Computer Science and Engineering and nine years of experience at a wireless telecommunications company, where he learned Perl and never looked back. J. David has an advantage in that he works really hard, he has a passion for writing good software, and he knows many of the world's best Perl programmers.

Journal of jdavidb (1361)

Tuesday November 04, 2008
11:09 AM

Module installs becoming more interactive :(

I applaud the fact that module installation is becoming a more granular and customizable process. But absolutely not at the expense of reversing the trend in the past few years to eliminating interaction.

Today I got several "Module X is required temporarily during installation, but do you want to install it permanently?" questions while trying to update from CPAN. This is absolutely wrong. Any system advanced enough to recognize the difference between modules required for build and modules required at runtime is advanced enough to have been written by someone advanced enough to know that this is absolutely wrong and archaic.

Monday October 13, 2008
03:53 PM

Java gravel of the day: poor API design

What a piece of work is NodeList. Nobody seemed to think of making NodeList implement List, and that's somewhat bizarre, and worse, inconvenient.

Crying for XML::TreeBuilder over here, today...

As I always say, why reuse fundamental classes and interfaces when you can reinvent the wheel, and make it square in the process!

Friday October 03, 2008
09:03 AM

Review of Red Dawn

Sarah and I watched this last night from Netflix. I'm so disappointed. I'm more than ready to believe the premise of high-school guerrilla warfare. But this was clearly written by a soldier, not by someone with knowledge of emotion and plot. The emotions are completely wooden. The only love in the story is a girl going gaga for a married soldier, and even that was barely detectable. I couldn't feel anything for all but one of the deaths in the movie (and the only thing I felt for that one was shock).

The soldier who must have wrote this hammered in the following lesson over and over again: when you're dying, try to take out one last guy from the other side, and say something dramatic and glorious so your death will be meaningful. Yuck. He hammered it in for both sides, too. Be a good soldier, and fight for your state.

Speaking of which, that's the moral read to us explicitly at the end of the film: these people fought and died for their government. Not for their families. For their government.

My imagination was alive with ideas of young guys going off in the woods and keeping a shadow civilization going, starting families with the girls and defending themselves. A shame that didn't happen. In the mind of this script writer, girls fall only for old military guys (probably just like the script writer, I'll bet).

There were lots of action scenes, but they were boring as all get out. Obviously written by somebody who thinks the interesting part about wars is the battles and not the history and ideas and people involved. There was lots of senseless deaths, etc., so I guess he was trying to tell us how awful wars are from a first hand view.

The characterization was practically dead, as were most of the characters. Lots of people were defined at the beginning, and then we never heard from them again. Sometimes they were off to the side in the background, never being a personality. Sometimes we just learned they'd died somewhere along the way. The relationships between the characters weren't even good enough to be melodramatic. It was like seeing the very Soviet propaganda the film had, telling us how good families were and how they made us better citizens. Nothing genuinely worth fighting for, in my opinion.

The film also suffered from the long, long foreign language sequences. You have to be trilingual to understand it. (Seriously: Russian and Spanish, in addition to English, because of the film's laughable plot of Cuba launching part of the invasion.) Some short foreign language spots would have been great. Maybe one long one. But whole strategic planning sessions in Russian? Come on; at least The Passion of the Christ had captions!

I believe readily in the premise of guerrilla warfare in the unlikely event of invasion. I believe readily in the premise of fighting high schoolers. (Teenagehood is really a modern invention for delaying adulthood.) I'm willing to suspend disbelief for the idea of Cuba invading alongside the USSR. But I really didn't want to hear a lesson in dying for the state with no feeling at all.

Thursday October 02, 2008
09:30 AM

Turning JUnit into TAP

I'm finding ways to turn TAP output into something compatible with JUnit. Is there anything to go the opposite direction? I'm writing some JUnit tests and would like to make them output in a way that makes sense to me, possibly going right into some Perl harness code.

Monday September 29, 2008
09:31 AM

When Perl 6 builds Perl 5

When portions of the build framework for Perl 5 are written in rakudo/Perl 6/Parrot, then it'll be time to switch.

Friday September 26, 2008
01:25 PM

Java gravel of the day: no block scoped variables

I can't make this work because the inner block declares a variable of the same name as one in the outer block. Apparently variables belong to the method or class in which they are declared, not to the block in which they are declared, so I therefore can't write a short little temporary block for debugging that happens to push a variable in the outer scope off into shadow just for a moment:

void methodName() {
  int i = 7;
  for (int j = 0; j < 10; j++) {
    int i = j * 2;

Perl can do this. scheme can do this. C can do this. Why can't Java?

Thursday September 18, 2008
11:14 AM

I am not impressed with lolcats

Today I finally went to the trouble to figure out what the heck these silly cat images are. The term is lolcats.

Personally, I just think it's stupid. If you think the images are cute, great. I like cats, and cute cat pictures. I do not like having people attempt to address serious subjects on serious newsblogs I like with these pictures as commentary. What is happening here is a reduction of people's capacity to effectively communicate the message they want to convey. They are so obsessed with the results of their neurons repeatedly firing off random interest in these pictures that they can't think of another way to say what they want to say, apparently. Meanwhile, I guess the rest of us aren't "hip" and "mod" since we don't know (or care) what the point of these images are.

I'll be glad when interest in this fades.

Thursday September 04, 2008
09:34 AM

Our wiki is up and running

And it promises to be the most wonderful thing ever. Already I've put some machine configuration instructions in there for a change everybody needed to perform today, and I was permitted to just send the link instead of the instructions. I'm finding holes in the instructions and patching them, and building up a troubleshooting section. This got me out of having to write a formal document in a Word template that didn't even fit what I needed documented.

Meanwhile, the prime moving force behind wanting me to do this has started arranging the wiki, and somebody else has discovered it and started adding material. :)

Friday August 22, 2008
07:50 AM

Assigned to set up a Wiki!

I showed up to a wonderful and interesting new task in my queue this morning. This was completely unexpected:

Create a Wiki server on [localIP] server. It's a Windows 2003 machine.

I am of course a little disappointed about the Windows part, but this is awesome! I ran a MediaWiki server for my own notes for my first few months here, and it seemed to make a mild impression on a few folks. Apparently it made a bigger impression than I thought. Unfortunately, I destroyed that database earlier this year, and have never made time to start it up again.

Monday August 11, 2008
08:46 AM

How to determine file type from data stream

I'd like to use MIME::Lite to take arbitrary data as input and send an email with that data as an attachment. I presume that to do this I need to get the MIME type correctly set. So I'm looking for something that can examine that stream of arbitrary, presumably binary, data, and then spit out the MIME type, or else something that I can use to derive the MIME type.

Basically, I'm looking for the "file" command in Perl. I was just remarking with a co-worker the other day how "file"'s database is an incredible resource and how that utility really does an amazing job figuring out what formats things are. It takes a hard job that can never been done perfectly, and does it intelligently. (Actually, that's my definition of artificial intelligence. Maybe "file" is sentient.)

I thought of looking to see if Perl Power Tools has a file command, but seems to be unreachable from my position in time and space, and I'm not really sure I want to download the entire distribution and pore through it, especially since whatever I find probably won't be a library, anyway. I did find a module called MIME::Types, updated as recently as May of this year, but it doesn't really do this job; it will give me a MIME type based on a file extension or based on a filename, which does me no good since STDIN doesn't come with a filename. :) If I had a filename, I most likely wouldn't need the module I'm looking for. The docs for MIME::Types mentions a File::TypeInfo module, but that doesn't seem to exist on CPAN at this point in time.

Even if I need to do this some other way, or don't need to do this at all to achieve my goal, I'm still curious if anything like this exists.