May 31, 2009 at 2:49 pm
I was going to link to his savage words on the Operation Rescue website, but it appears to be down at the moment. I hope moderate and liberal Christians turn out it droves to condemn this killing and Terry’s horrid statement.
Categories: Politics, Religion
Tags: abortion, crime
May 28, 2009 at 11:04 am
This is nuts. Oklahoma Highway Patrol officer pulls an ambulance over for failing to yield, while the ambulance is transporting a patient to the ER, and assaults one of the medics after the officer tries to ticket the ambulance. I’m stunned that cops would harrass EMTs while the EMTs are trying to do their job. It just boggles my mind. I’m glad the patient came through everything OK and I hope that the leadership of the OHP and the EMT service sit down and work this out and proper discipline is applied to the wrongdoers. What a sad situation. Sourced from The Agitator.
Categories: Miscellaneous
Tags: police
May 24, 2009 at 4:12 pm
In my last Perl post I said IC::File fits my needs better and let me serve files using Static::Simple. Well, it did that, but issues with properly handling deletes and updates forced me to re-evaluate my decision and switch to InflateColumn::FS.
The application will manage an archive of discussion papers, including abstracts, BibTeX citations, and supplemental data files. I need to store uploaded files and provide links to download them from the application.
Retooling for IC::FS included subclassing IC::FS to tune its operation for my needs and writing my own utility method to serve up the files instead of using Static::Simple. IC::FS uses UUIDs for filenames in the filesystem and I want the original filenames in the URLs in the application. Serving up files directly isn’t difficult so I wrote my own Catalyst controller method, cribbing code from Static::Simple:
sub send_file : Private
{
my ($self, $c, $file, $filename) = @_;
my $type;
my $stat = $file->stat;
# Get MIME Type - swiped from Static::Simple
if ( $filename =~ /.*\.(\S{1,})$/xms )
{
my $ext = $1;
my $types = MIME::Types->new(only_complete => 1);
$type = $types->mimeTypeOf($ext);
}
else
{
# Don't know type, so punt
$type = 'text/plain';
}
$c->res->headers->content_type($type);
$c->res->headers->content_length($stat->size);
$c->res->headers->last_modified($stat->mtime);
$c->res->headers->header("Content-Disposition" =>
"filename=\"$filename\"");
# More code swiped from Static::Simple
if ( Catalyst->VERSION le '5.33' )
{
# old File::Slurp method
my $content = File::Slurp::read_file( $file );
$c->res->body( $content );
}
else
{
# new method, pass an IO::File object to body
my $fh = $file->openr;
if ( defined $fh )
{
binmode $fh;
$c->res->body( $fh );
}
else
{
Catalyst::Exception->throw(
message => "Unable to open $file for reading" );
}
}
return 1;
}
Categories: Perl
May 14, 2009 at 10:12 am
I play poker, specifically No Limit Texas Hold’em. It’s been my hobby activity and minor passion for a few years now. Last night I was playing in my weekly World Tavern Poker league game at Durham Pizza and ran into the brick wall of variance at the final table. My tournament game is somewhat spotty. I tend to either go out early or run deep and make the final table. The first tourney last night saw me walking out the door less than 45 minutes after starting, but the second went much better. I stayed alive by playing tight, aggressive poker and avoiding playing marginal hands that have been getting me in trouble lately.
I went into the final table of eight players in probably 5th or 6th position chip-wise and continued playing tight, knowing that the blinds would force action on the other short stacks. Sure enough, we were soon down to seven players, then a three-way allin hand took out two more and we were five-handed. I had chipped up somewhat during this and was now a mid-size stack and the short stack was the current points leader, but he was very short stacked after loosing a big hand and had to put half his remaining stack in as the big blind. He pushed the rest in with a couple low cards against one caller, but didn’t hit and we were down to four-handed.
Very soon after, we had another all-in including the chip leader, resulting in an elimination and we were down to three. At this point I went on a rush, winning the next 4 or 5 hands by either raising preflop or limping in and betting the flop. The blinds were high and I more than doubled my stack, making me the chip leader.
Then I hit a brick wall, twice.
I min-raised from the small blind with K7 offsuit after the button folded. The big blind called and the flop came 2-7-9 rainbow. I had less than the pot left in my stack so I went all in. The big blind tanked for a coupe minutes and then called and turned over A6 offsuit. The turn was a 6, giving him two live cards again, and the river was a sickening Ace, making him two pair. I was 85% to win that hand and lost about 80% of my chips on it.
The very next hand I’ve got the button and deal myself pocket Aces! I limp in, the small blind folded, and the big blind went all-in. He had just gotten a phone call and it was sounding like he needed to leave. I immediately called his all-in and he showed K5 offsuit. He had me covered so I refunded his extra chips and ran out the board: X-X-X-5-K. Sure enough, my aces got cracked with another runner-runner hand on the turn and river. Another 90% favored hand beaten into the ground.
Variance is a bitch.
Still, I made third place so I can’t argue too much.
Categories: Poker
May 12, 2009 at 12:07 am
Last year I wrote a Catalyst-based application to manage the workflow for the team of reporters, editors, and publishers providing web reporting for the the annual Unitarian Universalist General Assembly. This includes tracking each event at GA, assigning reporters, photographers, videographers, and managing the writing/editing/publishing workflow for each article to be posted on the GA website.
I didn’t know about DBIx::Class::InflateColumn::File at the time, so I wrote my own system using Catalyst::Model::File to store the uploaded files. It was a mild pain in the ass to deal with the files separately from the DB model, but it worked and got the job done.
Lately, I’ve been working on another application that requires uploading and storing files: a discussion paper archive and search system for the Department of Statistical Science at Duke University. Again, I was struggling with using Catalyst::Model::File to store the uploaded manuscripts and associated data files. I don’t like using C::M::File because it breaks the model paradigm. I’d rather put all the data for each discussion paper in the DBIx::Class based DB model I built. I’m thinking of writing some command line utility scripts for the archive and using C::M::File binds me to Catalyst in ways I don’t want. So I went looking.
I saw discussion of DBIx::Class::InflateColumn::FS on the Catalyst mailing list and started investigating it. Then I found DBIx::Class::InflateColumn::File. Both provide the filesystem-based storage of files tied into my DB model I need, but I’m going to use InflateColumn::File. It fits my needs better and lets me serve up the files using Static::Simple in a straightforward manner.
I love the CPAN! It gave me not one, but two!, good alternatives to Catalyst::Model::File, and I don’t have to write it. I only wish I’d noticed InflateColumn::File last year.
Categories: General Assembly, Perl
Tags: cpan, uuaga09
May 5, 2009 at 7:48 am
Yahtzee! I just scored my airline tickets for my trip to General Assembly in June for less than $300 with direct flights in both directions! The only bad part is my flight out to Salt Lake City leaves at 6:30AM. Ugh.
I figured I was going to have to do at least one layover on both flights and it would cost me around $400 so I’m quite pleased. Kayak.com’s daily emailed price search is your friend!
Categories: General Assembly
Tags: ga2009
May 4, 2009 at 10:20 am
Weirdness abounds. I’ve dealt with ant intrusions into my home while living in various apartments all my life. It’s just something that happens occasionally. A call to the apartment complex to get the exterminator out usually ends things quickly.
Last week, I experienced a first. It appears that large black ants have taken up residence in the overflow opening of the sink in my guest bathroom. We saw them wandering around the bathroom so we had the exterminator out. They set out traps and sprayed and we saw several dead ants when we got home that day. I thought the problem was solved.
This morning, I went into the guest bathroom to fill our cat’s water bowl and noticed ants hanging around the overflow hole in the sink. A closer look revealed large headed soldier-looking ants just standing there guarding the hole with jaws large enough for a good bite. Uh oh… Looks like the traps haven’t done the job yet.
I’ve got another call into the apartment complex management. If I didn’t have a cat to worry about, I’d buy some Terro, put it out, and be done with the little buggers.
Categories: Miscellaneous
Tags: home
April 30, 2009 at 10:39 am
Vice President Joe Biden has an amazing appetite for the taste of shoe leather. This morning he went off responding to a question about what he would tell his family about the current flu situation. Joe, really. Just shut up already, damn. Or at least stick to the scripted answers. You really don’t help things when you run your mouth.
I knew this was going to be a problem when Obama picked him for VP.
Categories: Politics
April 22, 2009 at 10:35 am
I’ve always felt we should investigate and prosecute the people responsible for making the decisions to use torture on detaines at Guantanamo Bay and elsewhere. I’m angry with the Democratic leadership in Congress for not standing up for what’s right while they held control of the Congress during the Bush administration and with President Obama for not pushing to investigate how it came to be that the United States of America used torture to extract information from its prisoners.
I don’t care about any repurcussions such an investigation might have. I don’t care that it might cause a “tit for tat” response from the Republicans when next they hold the Whitehouse again. That doesn’t matter. Investigating and prosecuting the men and women who brought our country to this storry state is more important.
Malcolm Nance has a biting op-ed piece in Sunday’s New York Daily News that coldy and calmly lays out the reasons why the Bush torture architects need to be prosecuted. Everyone should read it.
Categories: Politics
April 14, 2009 at 1:19 pm
President Obama has tapped yet another RIAA lawyer for a top spot in his Justice Department.
Gershengorn, left, a partner with RIAA-firm Jenner & Block, represented the labels against Grokster (.pdf) and will be in charge of the DOJ Federal Programs Branch. That’s the unit that just told a federal judge the Obama administration supports monetary damages as high as $150,000 per purloined music track on a peer-to-peer file sharing program.
How is this not a conflict of interest? Gershengorn is going to direct the people that are involved with current and future cases of copyright infringement. I guess Obama’s rules covering the ethics commitments of executive branch personnel don’t apply here. I’m sorely disappointed by these appointments.
Categories: Politics
Tags: ethics, obama