Friday, October 31, 2008

Padre

Padre is Perl Application Development and Refactoring Environment.

install Padre with Perl 5.10 with Win32 is a bit painful.
the ppm in wxperl http://www.wxperl.co.uk/repository/ is fine with Perl 5.8 while broken with 5.10

while it would be OK if you follows the instruction in http://padre.perlide.org/wiki/Download
cpan> look Alien::wxWidgets
$ perl Makefile.PL
$ dmake
$ dmake test
$ dmake install
$ exit
cpan> look Wx
$ perl Makefile.PL
$ dmake
$ dmake test
$ dmake install
$ exit
cpan> install Padre

while install the Alien::wxWidgets it needs download wxWidgets-2.8.8.tar.gz from sourceforge. it's better to download it with your download tool instead of the Perl command.
it takes much more longer than what I thought. but finally it works.

Padre is good. it's pure Perl with Wx.
features:
- highlight for Perl
- open from last
- bookmark
- subs in right
and others. it's really good.

while it has bugs. like
- can open many instance of one file
- no highlight for HTML
and others.

OK, it's still worthing to try. and I'm reading the source code now to see if I can fix a bug or contribute a plugin.

Thanks.

Labels:

Thursday, October 30, 2008

OpenID module and Perl 5.10

that's just a tip for Win32 user

>ppm install http://ppm.tcool.org/archives510/LWPx-ParanoidAgent.ppd
>ppm install http://ppm.tcool.org/archives510/HTTP-Server-Simple.ppd
>ppm install http://trouchelle.com/ppm10/Cache-FastMmap.ppd
>ppm install http://ppm.tcool.org/archives510/Cache-FastMmap-WithWin32.ppd
>ppm install http://trouchelle.com/ppm10/Test-WWW-Mechanize.ppd
>cpan
cpan> force install Catalyst::Authentication::Credential::OpenID

well, when u try to install module in Win32, ppm is a good choice. and try these two repos:
http://ppm.tcool.org/archives510/
http://trouchelle.com/ppm10/

Thanks.
Wednesday, October 29, 2008

new Locale::Country::Multilingual

Bernhard Graf is making a huge step on Locale::Country::Multilingual

0.07 10/27/2008
- added correct Unicode support (Bernhard Graf)
- updated and fixed some errors in country data files (Bernhard Graf)
- tie language data to the class, not the instance (Bernhard Graf)
- possibility to preload language files at compile time (Bernhard Graf)
- added method assert_lang() to check availability (Bernhard Graf)
- changed from hashes to arrays where possible (Bernhard Graf)
- documentation (Bernhard Graf)
- tests for new features (Bernhard Graf)

and it has its own trunk now. http://code.google.com/p/perl-locale-country-multilingual/
hope you can join us.

Thanks.

Labels:

Sunday, October 26, 2008

new WWW::Contact code trunk and group

Sachin Sebastian sent me a new WWW::Contact::Rediffmail and I merged it into WWW::Contact core and release a 0.04 version to CPAN.

since it's not a project which I'm the only developer :), I move it from my personal trunk to a new public trunk:
http://code.google.com/p/perl-www-contact/

and it has a new group: http://groups.google.com/group/perl-www-contact

I hope u can join us!

Thanks.

Labels:

Monday, October 20, 2008

Acme::PlayCode 0.03

I uploaded the 0.02 of Acme::PlayCode yesterday evening and 0.03 this morning.

0.02 adds Acme::PlayCode::Plugin::PrintComma

0.03 adds Acme::PlayCode::Plugin::Averything

Have fun.

Labels: ,

Sunday, October 19, 2008

Acme::PlayCode and MooseX::Types::IO

I wrote Acme::PlayCode and MooseX::Types::IO and uploaded them to CPAN today.

Acme::PlayCode is just from:
learn PPI 1: double to single
Learn PPI 2: exchange in condition
I don't think it's useful now so I put it as Acme:: for fun.
Acme::PlayCode use MooseX::Object::Pluggable, so everyone can write a plugin for it.
the idea is directly from Devel::REPL. if you want to learn Moose, you should read the source. it's pretty elegant and clean. I think I'll write a plugin for it some days later.

MooseX::Types::IO is IO and IO::All type for Moose. I thought I would use it in Acme::PlayCode so I wrote it, but I didn't use it at last. hmm. but anyway, I'll use it one day later.

Have fun. Thanks.

Labels: , ,

Saturday, October 18, 2008

Learn PPI 2: exchange in condition

as what I posted before, I want to convert
if ( $a eq 'a' ) {
to
if ( 'a' eq $a ) {

PBP encourages it because it's less buggy.

I wrote another script today to fulfill the above request.
http://fayland.googlecode.com/svn/trunk/script/learn_ppi/02ExchangeCondition.pl

things like
my $a = "a";
my $b = "'b'";
my $c = 'c';
my $d = qq~d~;
if ( $a eq "a" ) {
print "1";
} elsif ( $b eq 'b') {
print "2";
} elsif ( $c ne qq~c~) {
print "3";
} elsif ( $c eq q~d~) {
print '4';
} else {
print '5';
}
if ( $a eq $b ) {
print '6';
}
if ( $c eq '$d' ) {
print 7;
}
if ( $a =~ /$b/ ) {
print 8;
}
if ( $a == '$b' or $c == '$d' ) {
print 9;
}
will be converted into
my $a = "a";
my $b = "'b'";
my $c = 'c';
my $d = qq~d~;
if ( "a" eq $a ) {
print "1";
} elsif ( 'b' eq $b ) {
print "2";
} elsif ( $c ne qq~c~) {
print "3";
} elsif ( q~d~ eq $c ) {
print '4';
} else {
print '5';
}
if ( $a eq $b ) {
print '6';
}
if ( '$d' eq $c ) {
print 7;
}
if ( $a =~ /$b/ ) {
print 8;
}
if ( '$b' == $a or '$d' == $c ) {
print 9;
}

I know it's not perfect. it's just a start.

hmm, I'm thinking about packaging the two scripts into modules then uploading to CPAN.
but I can't find a good name(or namespace) for them.

I'll try later.

Thanks and Enjoy!

Labels:

learn PPI 1: double to single

well, I'm very strict on Perl code (more than use strict;).
I want code like my $a = "a"; becomes my $a = 'a'; since it's better.
I'm not considering the speed since it's trivial for " to '. but u'd admit, 'a' is faster than "a".

PPI is really amazing.
it breaks Perl code down into the Perl document/structure we can read and analyze.

To do the task above. I just wrote a script based on PPI.
http://fayland.googlecode.com/svn/trunk/script/learn_ppi/01DoubleToSingle.pl
OK, it's my first time try with PPI, and it's really easy to understand and coding.

Many thanks to Adam Kennedy.

next time, I think I'll deal with
if ( $a eq 'a' ) {
to
if ( 'a' eq $a ) {

I think it's fun. and good to learn a new good thing.

Enjoy and have fun.

Labels:

Tuesday, October 14, 2008

Catalyst on Moose

http://search.cpan.org/~mramberg/Catalyst-Runtime-5.8000_01/

try it. it's new and on Moose.

$ cpan M/MR/MRAMBERG/Catalyst-Runtime-5.8000_01.tar.gz

ok, it fails, but u can download the source code and view a bit. I'm sure the next developer version will be kicked out ASAP.

Enjoy!

=updated

$ cpan parent
$ cpan M/MR/MRAMBERG/Catalyst-Runtime-5.8000_02.tar.gz

it should be working.

Thanks.

Labels: ,

Monday, October 13, 2008

irclog.foorumbbs.com

I just setup an irclog.foorumbbs.com to log the irc talk history.
http://irclog.foorumbbs.com/?C=M;O=D

and the script is here:
http://fayland.googlecode.com/svn/trunk/CPAN/IRC-Bot-Log-Extended/examples/03advanced.pl

have fun!

Labels:

Saturday, October 11, 2008

Learn Moose 4: augment and 0.02 IRC::Bot::Log::Extended

augment can be used as trigger in sub, to let user do something he wants.

for example, I want to let user custom $message before insert into $file in IRC::Bot::Log::Extended.
so that he can skip some lines or URI::Find some URLs.

full code are:
http://fayland.googlecode.com/svn/trunk/CPAN/IRC-Bot-Log-Extended/examples/02b_with_filter.pl
http://fayland.googlecode.com/svn/trunk/CPAN/IRC-Bot-Log-Extended/examples/03advanced.pl

I also write a simple test script:
http://fayland.googlecode.com/svn/trunk/script/learn_moose/008_augment.pl

hmm, that's simple. just think about u defined a virtual sub in parent pm, then user can override it in child pm.
nothing special.

Thanks.

Labels: ,

Friday, October 10, 2008

IRC::Bot::Log::Extended

well, I do NOT want to miss the irc talk history when I go sleep. I want to store the talk into plain text, and read it when I'm free.

that's a simple and straight. IRC::Bot is good. really fast and have a logger built-in.
The only thing I don't like IRC::Bot is that it stores all talk history into one file channel.log regardless channel and day. I want to split them, to ease the reading.

so that's why IRC::Bot::Log::Extended is kicked out.
and the example script is http://fayland.googlecode.com/svn/trunk/script/web/irclog.pl

so it's logging for me. all #catalyst #dbix-class #tt #moose talk history.

Thanks.

Labels: , ,

Thursday, October 02, 2008

Foorum 0.2.7 release

Please download from http://foorum.googlecode.com/files/Foorum-0.2.7.tar.gz

it's a good code source to learn Catalyst+DBIx::Class+Template and others.

try http://www.foorumbbs.com/

Patches or suggestion is really appreciated.

Thanks.

Labels: ,