Stuff…

I know I will forget.

Stuff… header image 1

Task::Kensho A Glimpse at an Enlightened Perl

July 27th, 2010 · No Comments

Found Task::Kensho interesting to get an idea of the most common and recommended Perl modules out there.

Task::Kensho is a first cut at building a list of recommended modules for Enlightened Perl development. CPAN is wonderful, but there are too many wheels and you have to pick and choose amongst the various competing technologies.

Links:

→ No CommentsTags: Coding

Unable to load schema – chosen moniker/class naming style results in moniker clashes

July 22nd, 2010 · No Comments

Was trying to generate the Perl module DBIx::Class schema files from a database using DBIx::Class::Schema::Loader.  Using the example on the CPAN page for DBIx::Class::Schema::Loader the following error came up.

Unable to load schema – chosen moniker/class naming style results in moniker clashes. Either change the naming style, or supply an explicit moniker_map: tables ‘dm_pp_hn’, ‘dm_pp_hns’ reduced to the same source moniker ‘DmPpHn’

The table names were obviously very similar and causing a problem when generating the schema.  Additional information could be found in: DBIx::Class::Schema::Loader::Base

http://search.cpan.org/~rkitover/DBIx-Class-Schema-Loader-0.07000/lib/DBIx/Class/Schema/Loader/Base.pm#moniker_map

Basically changed the code from:

#!/usr/bin/perl

use DBIx::Class::Schema::Loader qw/ make_schema_at /;
make_schema_at(
‘dbname::Schema’,
{ debug => 1,
dump_directory => ‘./Schema’,
},
[ 'dbi:mysql:dbname=dbname', 'user', 'pass',
#         { loader_class => 'MyLoader' } # optionally
],
);

To:

#!/usr/bin/perl

use DBIx::Class::Schema::Loader qw/ make_schema_at /;
make_schema_at(
‘dbname::Schema’,
{ debug => 1,
dump_directory => ‘./Schema’,
moniker_map => { ‘dm_pp_hn’ => ‘DmPpHn’,
‘dm_pp_hns’ => ‘DmPpHnS’,
},
},
[ 'dbi:mysql:dbname=dbname', 'user', 'pass',
#         { loader_class => 'MyLoader' } # optionally
],
);

And the schema was dumped successfully.

→ No CommentsTags: Coding

CGI::Application examples

July 14th, 2010 · No Comments

It has been a while since writing a CGI frontend to an application… In fact, CGI.pm was the way to do things when I last wrote a CGI application with Perl.

Was having a look at Catalyst and CGI::Application as MVC frameworks.  I decided that the learning curve for Catalyst was a little too great to start with and opted for CGI::Application (Catalyst does look really good though).

Some example code which I have found useful knocking up a test application:

* Found the reply from “Belgarion (Chaplain) on Dec 12, 2005 at 16:38 UTC” useful explaining the order in which CGI::Application (CAP) runs:

  1. cgiapp_init()
  2. setup()
  3. cgiapp_prerun()
  4. your selected run mode
  5. cgiapp_postrun()
  6. teardown()

Links:

→ No CommentsTags: Coding

UK wall socket with built in USB socket

July 7th, 2010 · No Comments

Came across this the other day and thought it was pretty cool:

→ No CommentsTags: Hardware

Page speed included in search ranking results?

July 5th, 2010 · No Comments

Just wanted to jot this down to remember the URL:

http://googlewebmastercentral.blogspot.com/2010/04/using-site-speed-in-web-search-ranking.html

→ No CommentsTags: Networking