Padre I18N translation

15 January 2009

(updated on June 23, 2009)


the first time:
* msginit -i messages.pot -o zh-cn.po -l zh_CN

later then message.pot get updated.
* msgmerge -o zh-cn.po messages.pot
open the file, grep 'fuzzy'. and fix them

check the syntax
* msgfmt -c zh-cn.po

check the difference
* msgcmp zh-cn.po messages.pot


The Art of SQL

14 January 2009

I bought it from dangdang and started to read last night. it's a good book and I'm glad I bought it.



12 January 2009

Google::Code::Upload - uploading files to a Google Code project.

see you have a google code project like
then you want to upload some files to Downloads section.
it's OK to upload through web interface, and if you want to upload through command line, there is a python script:

I'm a Perl guy, so I decided to port it to Perl. then there comes out
mainly there is a Perl script which you can just simply type:
$> Google-Code-Upload-0.02.tar.gz
then type project:fayland, username:fayland, password:lovekitty, summary:xxx

just Enjoy!

Learn Moose X: handles

09 January 2009

Writing Moose is really very fun and happy.

I'm happy that sunnavy picked up the Moose for Net::Google::Code.

Today I'm implementing some attributes for the Net::Google::Code. the code would be something like
    use Net::Google::Code;
my $project = Net::Google::Code->new( project => 'net-google-code' );
print join(', ', @{ $project->owners } );
so in old plain Perl code, you must write code in Net/Google/ or else you need sub owners { Net::Google::Code::Home->new()->owners }, something like that.

with Moose, with hanldes, we can simply write code like
has 'home'  => (
isa => 'Net::Google::Code::Home',
is => 'ro',
lazy => 1,
default => sub {
require Net::Google::Code::Home;
Net::Google::Code::Home->new( parent => $_[0] );
handles => [ 'owners', 'members' ],

in this way, it makes the code really clean and small.

the magic is $project->owners == $project->home->owners, more example can be found:

if you never use Moose before, you SHOULD use Moose today!


2009 plan

02 January 2009

well, 2008 is a fruitful year. I got married, bought a house and my son is 9 months old now. :)

To review the 2008 plan, I can give myself 70 points.

2009 is here. and the plan is
* write another 100 articles.
* read 10+ books.
* maintain all my CPAN modules and release some more if I can

I'm willing to write a Chinese Perl book for free, but it's really not so easy because my son costs most of my time. but I can promise to write at least
** Be a CPAN Tester
** Be a CPAN Author
* Catalyst + DBIx::Class + TT2
please remind me if I'm too lazy.



18 December 2008

I just uploaded my yet another module JavaScript::Beautifier to CPAN.

The module is mostly a Perl-rewrite of

The js demo is which is really cool.

I'm going to write a plugin for Padre soon or later.

just enjoy!


15 December 2008

Catalyst::Action::Fixup::XHTML is on CPAN now.

as what I said yesterday, I just made up a Catalyst Action for XHTML header.
the code is really very simple and most are copied from Catalyst::View::TT::XHTML.
and the test code too.

I also wrote tests for my MojoX::Fixup::XHTML. you can find here:

Just enjoy!



14 December 2008

inspired from Day 13. Using XHTML Strict mode during application development., I just created a MojoX::Fixup::XHTML based on Catalyst::View::TT::XHTML

but it's more than TT. every template render can use it, it's in sub dispatch.
I'm thinking to create a Catalyst::Action::Fixup::XHTML to do more than TT, but I don't have much time now.

at last I applied to

the source code is simple which can be found here:


another perl advent

08 December 2008

from Badger, the Template-Toolkit author.



02 December 2008

we are using mysqlsla to parse MySQL slow.log, but we have an issue that our slow.log is pretty huge, it contains 2 years' data. somehow I just need 3 month or half a year.

I'm searching around to find a script to do the things I want and I find
it's python(php) script and I do want a Perl script.

then is out.
and a script:

have fun