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 ]

Journal of LTjake (4001)

Friday June 27, 2008
11:12 AM

Catalyst 5.71 is nigh

We're approaching the two-year anniversary of the first release in the 5.7x series of the Catalyst framework. I'm really proud of how 5.7x has gone -- it has given the project some much needed stability that was missing in the early goings. It still amuses me to look back at the changelog to watch it go from version 3.X (which is basically "Catalyst 1.0") to 5.X in the span of about two and a half months.

Although development was obviously very fast-paced then, with 14 releases since 5.7000 I wouldn't say we've stalled. Naturally, the bulk of the changes since then have been bug fixes. We've also increased the test suite from 1416 tests to 1805 (the old test suite actually ran most tests twice by default, but, by setting CAT_BENCH_ITERS=1, you will see the "1416" result).

A 5.71 dev release (5.7099_01) was recently shipped which includes a new method: go(). As marcus describes it, it "works like an internal redispatch to another action, while retaining the stash intact." I believe one more dev release will happen as I've recently checked in the long lost PathPrefix attribute.

5.71xx will be more of a short-lived series of releases to act as a buffer between 5.70XX and 5.8000. 5.8000 being the Moose conversion (see this interview for more information).

Tuesday May 27, 2008
06:36 AM

5 more down

Catalyst 5.7014 is out the door. Hopefully that will stop the flood of questions about a "strange uri_for() behavior." With that done, I've taken out 5 more RT tickets.

Two extremely old wishlist items were rejected (RT #26758, RT #24132). This is basically due to the fact that they were over a year old, and really should be talked about on the dev list if they are still inclined to have them resolved.

A couple others required that I cook up a test or two to ensure the patch was applying was satisfactory (naturally, we would always hope to have a test submitted along side the patch): RT #26455, RT #34437.

The last ticket seems to have been related to a regression in 5.7013, as the ticket author claims the latest release fixed the issue. Closed! (RT #35994)

Friday May 23, 2008
02:15 PM

More Catalyst fixes

I've put the 5-a-day thing away for a bit to focus on other things. Firstly it was trying to get a new release of Catalyst-Runtime out the door (5.7013 hit CPAN on the 17th). One of the last bits preventing that release was some back-compat methods for Catalyst::Stats so it could mimic Tree::Simple behavior, which is what $c->stats() used to return.

Unfortunately, this release introduced two regressions, now fixed in svn:

1) "sub foo : Path {}" in the root controller didn't work.

This was as a result of my attempt to allow Path(0) to match properly. A simple 1-line fix resolved this problem. This bug also prevents some components' tests from working successfully (so far Catalyst-Model-Adaptor and Catalyst-Plugin-Unicode) as they used this idiom in their test apps.

2) invalid namespace for relative arguments to uri_for from an action that was run from a $c->forward() command.

Since there are a few conditions to satisfy before this bug appears I'm not too suprised it snuck in to the release. Peter Karman provided a much needed test case and the simple fix (remove "local $c->{namespace} = $self->namespace") which i've included in the 5.70 trunk.

I hope we can get 5.7014 out the door relatively swiftly.

I've also fixed up a couple of Catalyst::Plugin::Authentication RT tickets. Both were simple pod fixes: RT #36062, RT #36063

Saturday May 10, 2008
09:34 AM

Five a day, May 10

My latest five:

RT #33158 - rejected (DBIx::Class)
RT #25445 - already applied (DBIx::Class)
RT #26978 - closed (DBIx::Class)
RT #31473 - closed (DBIx::Class::Schema::Loader)
RT #29041 - fixed this last year (Catalyst::Plugin::Session::PerUser)

Friday May 09, 2008
09:58 AM

Five a day, part 3

I ventured into some DBIC related bugs this time.

RT #32497 - rejected (Catalyst::Model::DBIC::Schema)
RT #31848 - doc fixed (Catalyst::Model::DBIC::Schema)
RT #29282 - duplicate (DBIx::Class::Schema::Loader)
RT #23749 - already patched this last year (Catalyst::Plugin::Session::State::URI)
RT #20142 - closed (Catalyst::Plugin::UploadProgress)
RT #32276 - rejected (Catalyst::Runtime)
RT #26732 - closed (Catalyst::Runtime)
RT #34293 - duplicate (DBIx::Class)
RT #32988 - pod fixed (DBIx::Class)
RT #33217 - closed (DBIx::Class)

Thursday May 08, 2008
04:21 PM

(Five a day) x 2

I ended up doing twice my quota for today (it's easy to take care of the low-hanging fruit). A variety of Catalyst::* and DBIx::Class tickets were closed.

RT #15941 - rejected (Catalyst::View::TT)
RT #32254 - duplicate (Catalyst::Plugin::Authentication)
RT #30506 - closed (Catalyst::Plugin::Authentication)
RT #33302 - closed (Catalyst::Manual)
RT #32091 - closed (Catalyst::Manual)
RT #29496 - duplicate (Catalyst::Manual)
RT #32636 - pod fixed (Catalyst::Manual)
RT #34256 - dependencies updated (DBIx::Class)
RT #33667 - patch applied (Catalyst::Session::Store::FastMmap)
RT #32393 - closed (DBIx::Class)

07:17 AM

Five a day, plus two.

The Ubuntu "5-A-Day" campaign has caught my eye. It's turned a heinous task into a bit of a game. It reminds me a little bit of the ESP Game for image tagging (i.e. boring task => game).

I don't expect I could ever really take care of 5 bugs every single day, but I've given myself a little jump start by closing 7 Catalyst-related bugs yesterday. Only one of them took a significant amount of time to fix as it required some patching to the various parts of the Catalyst dispatch cycle.

Here are my five (plus two):

RT #30660 - Just needed to be closed
RT #30087 - Again, just needed to be closed
RT #35690 - Fixed POD
RT #33236 - Tiny grammar fix
RT #29334 - Fixed in trunk
RT #26452 - Test workaround in trunk
RT #24743 - Latest Catalyst::Manual upload fixes this

Friday May 02, 2008
07:28 AM

Quick! grab two of *everything*

So, we're experiencing the worst flooding we've ever had in 35 years. [1] [2] My $work is only a few blocks from the river, but we've lucked out and haven't had any water in the building. What's even more remarkable is that they didn't shut the power off to our section of the grid so all of our services remain online! (disaster planning? ppfft! who needs it?)

The office was closed Thursday as the city wanted people to stay out of the downtown district. We came down anyway (as did a pile of other people) to try and grab some photos.

To view the photos, please check out my blog on vox.

Friday April 25, 2008
09:00 PM

Import Amarok stats into Rhythmbox

I've been using Ubuntu since Dapper was released. As Hardy is the next LTS release, I decided now would be a good time to blow the whole thing away and start fresh. At the same time, I thought I could give rid of some KDE-based software I've been using and stick to a strictly Gnome environment.

I've been using Amarok as my media player, but, as stated above, that doesn't jive with a pure Gnome setup. By default Rhythmbox is installed. I can import all of my tunes in no problem, but I'm missing some play stats.

Given my old Amarok database, which is just an SQLite database, and a Rhythmbox database, which is a simple XML file, with freshly imported tunes I was able to write a script to pull out some of my old data including: rating, import date, last play date and play count. NB: Rhythmbox ratings don't understand half-star ratings, though it doesn't complain.

Usage: rhythmdb.xml collection.db

use strict;
use warnings;

use XML::Simple;
use DBI;
use URI;

my $xml = shift;
my $data = XMLin( $xml, KeepRoot => 1, ForceContent => 1 );

my $dbh = DBI->connect( 'dbi:SQLite:dbname=' . shift, undef, undef );
my $sth = $dbh->prepare( 'select rating, playcounter, createdate, accessdate from statistics where url = ?;' );

for my $row ( @{ $data->{ rhythmdb }->{ entry } } ) {
    my $mp3 = URI->new( $row->{ location }->{ content } );

    next unless $mp3->scheme eq 'file';

    $sth->execute( '.' . $mp3->file );

    my $dbrow = $sth->fetchrow_hashref;
    $row->{ rating }->{ content } = $dbrow->{ rating } / 2;
    $row->{ 'play-count'}->{ content } =  ( $row->{ 'play-count'}->{ content } || 0 ) + $dbrow->{ 'playcounter' };
    $row->{ 'first-seen' }->{ content } = $dbrow->{ 'createdate' };
    $row->{ 'last-seen' }->{ content } = $dbrow->{ 'accessdate' };

XMLout( $data, KeepRoot => 1, XMLDecl => 1, OutputFile => $xml );

Wednesday April 09, 2008
09:48 AM

non-blocking USB access

Dear lazy-perl-web,

Has anyone done non-blocking access to USB devices? Device::USB uses libusb 0.1.x -- which only does blocking access. libusb 1.0 is to include callback-based access -- it's under development at least, but no perl bindings exist.

Is there anything else out there to try?