yui iconperl icon

Comparing CPAN Modules with YUI DataTable

Posted in , Fri, 09 Nov 2007 06:09:00 GMT

There is a lot of choice on the CPAN for open source Perl libraries and sometimes it's difficult to get an idea of how modules compare to each other. CPAN Ratings is a good source of reviews but it's not convenient to compare one module with another. To provide a partial solution, I whipped up a quick CPAN Compare page which will pull the CPAN Ratings from a number of modules and summarize them for you.

CPAN Compare Modules
Read more...
del.icio.us:Comparing CPAN Modules with YUI DataTable digg:Comparing CPAN Modules with YUI DataTable reddit:Comparing CPAN Modules with YUI DataTable spurl:Comparing CPAN Modules with YUI DataTable wists:Comparing CPAN Modules with YUI DataTable simpy:Comparing CPAN Modules with YUI DataTable newsvine:Comparing CPAN Modules with YUI DataTable blinklist:Comparing CPAN Modules with YUI DataTable furl:Comparing CPAN Modules with YUI DataTable fark:Comparing CPAN Modules with YUI DataTable blogmarks:Comparing CPAN Modules with YUI DataTable Y!:Comparing CPAN Modules with YUI DataTable smarking:Comparing CPAN Modules with YUI DataTable magnolia:Comparing CPAN Modules with YUI DataTable segnalo:Comparing CPAN Modules with YUI DataTable

3 comments

postgresql iconcatalyst iconperl iconmysql icontypo iconphp icon

Database Abstraction - code vs infrastructure

Posted in , , , , , , Wed, 05 Sep 2007 04:38:00 GMT

I've worked on a number of database-driven projects and no matter how much people want database abstraction, it was always difficult to code and maintain. I was recently reminded of this when I read this Drupal article on dropping PostgreSQL support. Not only can it be difficult to maintain support for multiple databases, but it may be difficult to find developers.

One solution of modern programming is to move database abstraction from the code to the infrastructure using a ORM (Object-Relational Mapper) or Data Mapper. A ORM and Data Mapper abstracts the database for you so you no longer have to do tie db abstraction to each app. Not only does it let you code once for multiple databases it lets your users migrate their data from one database to another. This blog runs Typo which is based on Ruby on Rails and ActiveRecord. I've been contemplating migrating Typo from MySQL to PostgreSQL and I've been told that it would be as simple as exporting the data with YAML, updating the database.yml file and importing the data. I haven't gotten around to doing it yet but it is a powerful idea. ActiveRecord is a data mapper and isn't as flexible as a full blown ORM but it gets the job done for the most part. For a full-blown ORM, I think of Perl's DBIx::Class which provides a full OO interface to the RDBMS allowing you to code just once for multiple DBs without limiting you when you want to use some esoteric database-specific SQL. DBIx::Class is often used with the Catalyst Framework but is also used by itself.

There are PHP frameworks out there like Symfony and Cake but do any of them have stand-alone ORMs? If so, could Drupal move to something like that and solve their maintainership problems once and for all? Drupal is part of the Go PHP5 effort so there should be no issue using PHP 5 OO. Something to think about for the Drupal folks if a PHP ORM is available.

del.icio.us:Database Abstraction - code vs infrastructure digg:Database Abstraction - code vs infrastructure reddit:Database Abstraction - code vs infrastructure spurl:Database Abstraction - code vs infrastructure wists:Database Abstraction - code vs infrastructure simpy:Database Abstraction - code vs infrastructure newsvine:Database Abstraction - code vs infrastructure blinklist:Database Abstraction - code vs infrastructure furl:Database Abstraction - code vs infrastructure fark:Database Abstraction - code vs infrastructure blogmarks:Database Abstraction - code vs infrastructure Y!:Database Abstraction - code vs infrastructure smarking:Database Abstraction - code vs infrastructure magnolia:Database Abstraction - code vs infrastructure segnalo:Database Abstraction - code vs infrastructure

6 comments

perl iconmysql iconunicode icon

Perl, MySQL and UTF-8

Posted in , , , Mon, 02 Oct 2006 15:35:00 GMT

One of the mysteries of Perl to me is that why, as of yet, is there no UTF-8 support in DBD::mysql although this issue has been discussed on the msql-mysql-modules list since at least 2003 (using the MARC archives). This is also given that MySQL does have UTF-8 support itself.

Read more...
del.icio.us:Perl, MySQL and UTF-8 digg:Perl, MySQL and UTF-8 reddit:Perl, MySQL and UTF-8 spurl:Perl, MySQL and UTF-8 wists:Perl, MySQL and UTF-8 simpy:Perl, MySQL and UTF-8 newsvine:Perl, MySQL and UTF-8 blinklist:Perl, MySQL and UTF-8 furl:Perl, MySQL and UTF-8 fark:Perl, MySQL and UTF-8 blogmarks:Perl, MySQL and UTF-8 Y!:Perl, MySQL and UTF-8 smarking:Perl, MySQL and UTF-8 magnolia:Perl, MySQL and UTF-8 segnalo:Perl, MySQL and UTF-8

6 comments

perl iconmysql iconxapian icon

Encoding Hashed UIDs: Base64 vs. Hex vs. Base32

Posted in , , Mon, 02 Oct 2006 08:08:00 GMT

I recently looked at using various encodings for hashed UIDs, e.g. UIDs generated by a crytographic hash algorithm such as SHA-1 or MD5. These are often useful when the UID does not need to have human meaning but should exhibit some uniformity, such as character set and length. I considered Base64 and hexadecimal first because they are commonly used by crypto libraries and then decided on Base64 and Base32 where appropriate. Base36 is actually the most compact case insensitive encoding (using Arabic numbers and Roman letters) but is not an option for me at the moment because there's no Perl module for it that will take arbitrary text and binary input at the moment. Math::Base36 exists but only handles numbers.

Read more...
del.icio.us:Encoding Hashed UIDs: Base64 vs. Hex vs. Base32 digg:Encoding Hashed UIDs: Base64 vs. Hex vs. Base32 reddit:Encoding Hashed UIDs: Base64 vs. Hex vs. Base32 spurl:Encoding Hashed UIDs: Base64 vs. Hex vs. Base32 wists:Encoding Hashed UIDs: Base64 vs. Hex vs. Base32 simpy:Encoding Hashed UIDs: Base64 vs. Hex vs. Base32 newsvine:Encoding Hashed UIDs: Base64 vs. Hex vs. Base32 blinklist:Encoding Hashed UIDs: Base64 vs. Hex vs. Base32 furl:Encoding Hashed UIDs: Base64 vs. Hex vs. Base32 fark:Encoding Hashed UIDs: Base64 vs. Hex vs. Base32 blogmarks:Encoding Hashed UIDs: Base64 vs. Hex vs. Base32 Y!:Encoding Hashed UIDs: Base64 vs. Hex vs. Base32 smarking:Encoding Hashed UIDs: Base64 vs. Hex vs. Base32 magnolia:Encoding Hashed UIDs: Base64 vs. Hex vs. Base32 segnalo:Encoding Hashed UIDs: Base64 vs. Hex vs. Base32

no comments

postgresql iconperl iconunicode icon

Perl - Strictify utf8 to UTF-8

Posted in , , Fri, 29 Sep 2006 18:21:00 GMT

Perl has two UTF-8 encodings, utf8 which is Perl's liberal version and UTF-8 which is a strict interpretation, aka utf-8-strict. The liberal version allows for encoded characters outside the UTF-8 character set, however you can run into problems when interoperating with applications that expect utf-8-strict, such as PostgreSQL. Here's a function I wrote to strictify utf8 to UTF-8 using the Encode core module:

use Encode;

sub strictify_utf8 {
    my $data = shift;
    if (Encode::is_utf8($data) && !Encode::is_utf8($data,1)) {
        Encode::_utf8_off($data);
        Encode::from_to($data, 'utf8', 'UTF-8');
        Encode::_utf8_on($data);
    }
    return $data;
}
del.icio.us:Perl - Strictify utf8 to UTF-8 digg:Perl - Strictify utf8 to UTF-8 reddit:Perl - Strictify utf8 to UTF-8 spurl:Perl - Strictify utf8 to UTF-8 wists:Perl - Strictify utf8 to UTF-8 simpy:Perl - Strictify utf8 to UTF-8 newsvine:Perl - Strictify utf8 to UTF-8 blinklist:Perl - Strictify utf8 to UTF-8 furl:Perl - Strictify utf8 to UTF-8 fark:Perl - Strictify utf8 to UTF-8 blogmarks:Perl - Strictify utf8 to UTF-8 Y!:Perl - Strictify utf8 to UTF-8 smarking:Perl - Strictify utf8 to UTF-8 magnolia:Perl - Strictify utf8 to UTF-8 segnalo:Perl - Strictify utf8 to UTF-8

no comments

perl iconunicode icon

Perl - Getting a Unicode Character's Hex Codepoint

Posted in , Fri, 29 Sep 2006 18:00:00 GMT

I recently responded to someone asking how to get a Unicode hex codepoint from a Unicode literal on DevShed Forums. Since I think it may be more generally useful, here's my solution. The following function takes a unicode literal, converts it to a decimal representation using unpack and then converts it to hex usning sprintf:

sub codepoint_hex {
    if (my $char = shift) {
        return sprintf '%2.2x', unpack('U0U*', $char);
    }
}

my $cp = codepoint_hex('カ'); # eq '30ab'
Read more...
del.icio.us:Perl - Getting a Unicode Character's Hex Codepoint digg:Perl - Getting a Unicode Character's Hex Codepoint reddit:Perl - Getting a Unicode Character's Hex Codepoint spurl:Perl - Getting a Unicode Character's Hex Codepoint wists:Perl - Getting a Unicode Character's Hex Codepoint simpy:Perl - Getting a Unicode Character's Hex Codepoint newsvine:Perl - Getting a Unicode Character's Hex Codepoint blinklist:Perl - Getting a Unicode Character's Hex Codepoint furl:Perl - Getting a Unicode Character's Hex Codepoint fark:Perl - Getting a Unicode Character's Hex Codepoint blogmarks:Perl - Getting a Unicode Character's Hex Codepoint Y!:Perl - Getting a Unicode Character's Hex Codepoint smarking:Perl - Getting a Unicode Character's Hex Codepoint magnolia:Perl - Getting a Unicode Character's Hex Codepoint segnalo:Perl - Getting a Unicode Character's Hex Codepoint

1 comment

catalyst iconperl icon

Perl 5 - Powering Web 2.0

Posted in , Tue, 05 Sep 2006 15:07:00 GMT

Whenever popular Perl sites are discussed, a number of large websites are mentioned with the usual suspects being Amazon, IMDB, LiveJournal, Slashdot and others. While this is a good list, what often doesn't get mentioned is the new Web 2.0 sites that Perl 5 is powering. Perl 5 web frameworks (such as Catalyst and Jifty), OO models (Moose) and other techniques (PAR) dramatically improve Perl for web development and large-scale projects making many complaints about the language irrelevant. These, when combined with CPAN, continue to make Perl 5 a very attractive language for new web apps.

Examples of Perl-powered Web 2.0 sites include del.icio.us, (which uses the Mason templating system / mini-framework), EditGrid (an AJAX-enhanced online spreadsheet running on the Catalyst framework) and Vox (a multi-user blogging site by Six Apart, maker of LiveJournal, MovableType and TypePad). Other sites include HiveMinder, IUseThis, and MighTyV. Of these six sites, four are running on the Catalyst framework. HiveMinder is built on the Jifty framework. Yahoo is even interested in developers with Perl/Catalyst skills along with C and Java for this Senior Software Engineering position (screenshot from jobs.perl.org). Screenshots and links of active sites are provided below.

del.icio.us del.icio.us
Description: Social Bookmarking
Perl Framework: Mason
editgrid EditGrid
Description: Online Spreadsheets
Perl Framework: Catalyst
Read more...
del.icio.us:Perl 5 - Powering Web 2.0 digg:Perl 5 - Powering Web 2.0 reddit:Perl 5 - Powering Web 2.0 spurl:Perl 5 - Powering Web 2.0 wists:Perl 5 - Powering Web 2.0 simpy:Perl 5 - Powering Web 2.0 newsvine:Perl 5 - Powering Web 2.0 blinklist:Perl 5 - Powering Web 2.0 furl:Perl 5 - Powering Web 2.0 fark:Perl 5 - Powering Web 2.0 blogmarks:Perl 5 - Powering Web 2.0 Y!:Perl 5 - Powering Web 2.0 smarking:Perl 5 - Powering Web 2.0 magnolia:Perl 5 - Powering Web 2.0 segnalo:Perl 5 - Powering Web 2.0

4 comments

perl icon

Recommendations for The Perl Foundation

Posted in Sun, 27 Aug 2006 02:28:00 GMT

Bill Odom, President of The Perl Foundation, recently posted a blog entry called TPF RFC. My comment to that blog entry wasn't approved for some reason so I figured I'd post some easy-to-accomplish recommendations here.

Read more...
del.icio.us:Recommendations for The Perl Foundation digg:Recommendations for The Perl Foundation reddit:Recommendations for The Perl Foundation spurl:Recommendations for The Perl Foundation wists:Recommendations for The Perl Foundation simpy:Recommendations for The Perl Foundation newsvine:Recommendations for The Perl Foundation blinklist:Recommendations for The Perl Foundation furl:Recommendations for The Perl Foundation fark:Recommendations for The Perl Foundation blogmarks:Recommendations for The Perl Foundation Y!:Recommendations for The Perl Foundation smarking:Recommendations for The Perl Foundation magnolia:Recommendations for The Perl Foundation segnalo:Recommendations for The Perl Foundation

10 comments

perl icon

Lucene on CPAN

Posted in Tue, 22 Aug 2006 01:15:00 GMT

Lucene is a Java-based fulltext indexing and search solution run under the Apache Foundation. It is arguably the most popular of many fulltext solutions now but its use of Java makes it a secondary choice for many non-Java projects. To improve the speed of Lucene, there are several C/C++ ports including:

  • Lucene4c: Apache Foundation project
  • Lucy: Apache Foundation project
  • CLucene: Sourceforge project
Read more...
del.icio.us:Lucene on CPAN digg:Lucene on CPAN reddit:Lucene on CPAN spurl:Lucene on CPAN wists:Lucene on CPAN simpy:Lucene on CPAN newsvine:Lucene on CPAN blinklist:Lucene on CPAN furl:Lucene on CPAN fark:Lucene on CPAN blogmarks:Lucene on CPAN Y!:Lucene on CPAN smarking:Lucene on CPAN magnolia:Lucene on CPAN segnalo:Lucene on CPAN

5 comments

imagemagick iconie iconperl icon

Automated web screen shots with Perl

Posted in , , Fri, 21 Jul 2006 15:02:00 GMT

I've been looking for a program that will take full screen shots of web pages even when the web page is larger than the window size on my physical screen, requiring scrolling. This morning I found such a program in Petr Šmejkal's Win32::CaptureIE when it was mentioned by Displeaser on DevShed Forums in the "Screenshot of webpage" thread. It uses ImageMagick for image manipulation.

Read more...
del.icio.us:Automated web screen shots with Perl digg:Automated web screen shots with Perl reddit:Automated web screen shots with Perl spurl:Automated web screen shots with Perl wists:Automated web screen shots with Perl simpy:Automated web screen shots with Perl newsvine:Automated web screen shots with Perl blinklist:Automated web screen shots with Perl furl:Automated web screen shots with Perl fark:Automated web screen shots with Perl blogmarks:Automated web screen shots with Perl Y!:Automated web screen shots with Perl smarking:Automated web screen shots with Perl magnolia:Automated web screen shots with Perl segnalo:Automated web screen shots with Perl

3 comments

Older posts: 1 2