Category Archives: Uncategorized

App-perlbrew, rvm for Perl?

Rvm seems to be pretty popular with the Ruby / Rails crowd. It lets you install and switch between different versions of Ruby really easily. I have been working on more and more Perl code and wanted to find something similar so that I can make sure the code that is currently working with Perl 5.6 will continue to work with 5.12.

I found App-perlbrew the other day and have been using it and so far it seems pretty compilable to rvm.

Installing a local copy of Perl is as easy as

$ perlbrew install perl-5.12.2

You can then list your installed versions of perl with

$ perlbrew list
* /usr/bin/perl

One thing that bugged me was it didn’t tell me the version of Perl /usr/bin/perl was. The nice thing about open source is the ability to modify it to do what you want, which is exactly what I did.

Setting the @author in Eclipse.

It seems there are basically two ways to set the correct author name (opposed to the system user name Eclipse is using per default) in Eclipse as it appears for example within the autogenerated javadoc comments.

First using -vmargs settings:
eclipse -clean -showlocation -vmargs -Xms512m -Xmx900m -XX:PermSize=128m -XX:MaxPermSize=128m"Your full name"

The other one is just by  changing the associated templates in Window -> Preferences -> Java -> Editor -> Templates -> @author , hardcoding the author’s name.

Converting Poker Stars Play Money Logs to Real Money

I wanted to use Poker Tracker to keep track of my stats when playing at the play money tables of Poker Stars. Poker Tracker doesn’t support the play money tables.

I wrote some Perl to convert the the lots from the play money format into the real money format.

use strict;
use Cwd;
use File::Find;
my $some_dir = "Z:\\HandHistory";
my $startDir = &Cwd::cwd();
find(\&processFile, $some_dir);
sub processFile {
    return if not /\.txt$/;
    my $inFileName = $_;
    my $infile = "$startDir/$File::Find::name";
    my $outfile = "$startDir/outHands/$inFileName.$$.converted.txt";
    open (inFILE, "<$infile") or die "can't open in file!: #$infile# ($!)";
    open (outFILE, ">$outfile") or die "can't open out file!:#$outfile# ($!)";
    my @players;
    while(<inFILE>) {
        @players = () if (s/^(PokerStars Game .*\()(\d+)\/(\d*)(\).*)$/\1\$\2.00\/\$\3.00\4/);
        push(@players, $1) if (/^Seat [\d+]: (.*) \(\d+ in chips\)/);
        foreach my $key (@players) {
            my $value = $key;
            $value =~ s/\s+/_/;
            ($value = $1) =~ s/($1)/_\1/ if ($key =~ /^(\d+)$/);
        s/([\( ])(\d+)([\) \.])/\1\$\2.00\3/g;
        s/\(Play Money\) //g;
        print outFILE "$_\n";

Candy theme for mac os 9?

I remember a theme for mac os 9 that I’m pretty sure came with the bondi blue style iMacs. There was one theme with matching colors for each of the iMacs. I’m pretty sure I’m not making this up. I’ve googles around but can’t come up with anything. Does anyone remember this?