Thursday, January 15, 2009

Padre I18N translation

(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


Labels: ,

Wednesday, January 14, 2009

The Art of SQL

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



Monday, January 12, 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!

Labels: ,

Friday, January 09, 2009

Learn Moose X: handles

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!



Friday, January 02, 2009

2009 plan

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.