<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' version='2.0'><channel><atom:id>tag:blogger.com,1999:blog-23855943</atom:id><lastBuildDate>Thu, 02 Oct 2008 03:09:10 +0000</lastBuildDate><title>Fayland and Perl Programming</title><description>Perl is not the whole part of life. I know!</description><link>http://www.fayland.org/blog/</link><managingEditor>noreply@blogger.com (Fayland)</managingEditor><generator>Blogger</generator><openSearch:totalResults>160</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-23855943.post-3552333629158807632</guid><pubDate>Thu, 02 Oct 2008 03:06:00 +0000</pubDate><atom:updated>2008-10-02T11:09:10.365+08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Catalyst</category><category domain='http://www.blogger.com/atom/ns#'>Foorum</category><title>Foorum 0.2.7 release</title><description>Please download from &lt;a href="http://foorum.googlecode.com/files/Foorum-0.2.7.tar.gz"&gt;http://foorum.googlecode.com/files/Foorum-0.2.7.tar.gz&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;it's a good code source to learn Catalyst+DBIx::Class+Template and others.&lt;br /&gt;&lt;br /&gt;try &lt;a href="http://www.foorumbbs.com/"&gt;http://www.foorumbbs.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Patches or suggestion is really appreciated.&lt;br /&gt;&lt;br /&gt;Thanks.</description><link>http://www.fayland.org/blog/2008/10/foorum-027-release.html</link><author>noreply@blogger.com (Fayland)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-23855943.post-5966492653974711598</guid><pubDate>Mon, 29 Sep 2008 11:35:00 +0000</pubDate><atom:updated>2008-09-29T19:38:20.103+08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Moose</category><title>My 3rd CPAN module Today: Sphinx::Control</title><description>the code and idea is directly from &lt;a href="http://search.cpan.org/perldoc?Lighttpd::Control"&gt;Lighttpd::Control&lt;/a&gt; and &lt;a href="http://search.cpan.org/perldoc?Nginx::Control"&gt;Nginx::Control&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://search.cpan.org/perldoc?Sphinx::Control"&gt;Sphinx::Control&lt;/a&gt; controls &lt;a href="http://www.sphinxsearch.com"&gt;Sphinx&lt;/a&gt; searchd.&lt;br /&gt;&lt;br /&gt;Thanks.</description><link>http://www.fayland.org/blog/2008/09/my-3rd-cpan-module-today-sphinxcontrol.html</link><author>noreply@blogger.com (Fayland)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-23855943.post-7656696578370718395</guid><pubDate>Mon, 29 Sep 2008 05:30:00 +0000</pubDate><atom:updated>2008-09-29T13:32:13.302+08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Catalyst</category><category domain='http://www.blogger.com/atom/ns#'>CPAN</category><title>two new CPAN modules</title><description>* &lt;a href="http://search.cpan.org/perldoc?Task::BeLike::FAYLAND"&gt;Task::BeLike::FAYLAND&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;OK, it's not so useful for u I think. just ignore it.&lt;br /&gt;&lt;br /&gt;* &lt;a href="http://search.cpan.org/perldoc?Catalyst::Plugin::CHI"&gt;Catalyst::Plugin::CHI&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;mix the CHI and Catalyst. :)</description><link>http://www.fayland.org/blog/2008/09/two-new-cpan-modules.html</link><author>noreply@blogger.com (Fayland)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-23855943.post-2435492544600163469</guid><pubDate>Thu, 25 Sep 2008 01:56:00 +0000</pubDate><atom:updated>2008-09-25T10:08:07.563+08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>PerlChina</category><category domain='http://www.blogger.com/atom/ns#'>YAPC</category><title>Beijing Perl Workshop on Nov 08, 2008</title><description>It is jointly organized with the postgresql china that means there will be some postgresql talks as well. We have also secured few sponsorships to fly Jesse Vincent and two other postgresql hackers to the workshop.&lt;br /&gt;&lt;br /&gt;If you are planning a trip to beijing in the early November, send a email to conference[at]perlchina.org to register the workshop, or even better come give a talk(20,40 minutes or lighting talk)!&lt;br /&gt;&lt;br /&gt;From &lt;a href="http://use.perl.org/~Qiang/journal/37527"&gt;http://use.perl.org/~Qiang/journal/37527&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;==============&lt;br /&gt;&lt;br /&gt;I'm not sure if I can go there, but I want to!</description><link>http://www.fayland.org/blog/2008/09/beijing-perl-workshop-on-nov-08-2008.html</link><author>noreply@blogger.com (Fayland)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-23855943.post-3040146667084883005</guid><pubDate>Fri, 19 Sep 2008 05:38:00 +0000</pubDate><atom:updated>2008-09-19T13:42:01.379+08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>CPAN</category><title>a busy release day today</title><description>I just kicked out 2 new modules and 1 refreshing module to CPAN.&lt;br /&gt;&lt;br /&gt;2 new modules:&lt;br /&gt;  * &lt;a href="http://search.cpan.org/perldoc?Pod::Simple::Wiki::Googlecode"&gt;Pod::Simple::Wiki::Googlecode&lt;/a&gt;&lt;br /&gt;  * &lt;a href="http://search.cpan.org/perldoc?Pod::From::GoogleWiki"&gt;Pod::From::GoogleWiki&lt;/a&gt; for &lt;a href="http://use.perl.org/~schwern/journal/37476"&gt;http://use.perl.org/~schwern/journal/37476&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;and 1 refreshing module:&lt;br /&gt;  * &lt;a href="http://search.cpan.org/perldoc?Foorum"&gt;Foorum&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;well, just enjoy!</description><link>http://www.fayland.org/blog/2008/09/busy-release-day-today.html</link><author>noreply@blogger.com (Fayland)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-23855943.post-1778761834496717354</guid><pubDate>Thu, 18 Sep 2008 04:40:00 +0000</pubDate><atom:updated>2008-09-18T12:49:52.909+08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Moose</category><title>Learn Moose 3: around</title><description>for example I want a shuffled list everytime when I can $t-&gt;shuffled_list;&lt;br /&gt;I know I can use a sub to do the request. but with Moose, it's much more elegant.&lt;br /&gt;&lt;br /&gt;the main code is like:&lt;pre&gt;&lt;code&gt;around 'shuffled_list' =&gt; sub {&lt;br /&gt;    my $next = shift;&lt;br /&gt;    &lt;br /&gt;    my $ret = $next-&gt;(@_);&lt;br /&gt;    $ret = [ shuffle( @$ret ) ];&lt;br /&gt;    &lt;br /&gt;    return $ret;&lt;br /&gt;};&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;full source code can be found in &lt;a href="http://fayland.googlecode.com/svn/trunk/script/learn_moose/002_around.pl"&gt;http://fayland.googlecode.com/svn/trunk/script/learn_moose/002_around.pl&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;the output looks like:&lt;pre&gt;1, 10, 6, 4, 2, 7, 9, 8, 3, 5&lt;br /&gt;3, 4, 7, 2, 1, 9, 5, 6, 8, 10&lt;/pre&gt;Here we use 'around' instead of 'before' or 'after' because 'before' doesn't work according to this FAQ: &lt;a href="http://search.cpan.org/~drolsky/Moose-0.57/lib/Moose/Cookbook/FAQ.pod#How_can_I_affect_the_values_in_@__using_before?"&gt;http://search.cpan.org/~drolsky/Moose-0.57/lib/Moose/Cookbook/FAQ.pod#How_can_I_affect_the_values_in_@__using_before?&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;the example above is a case of 'deflate' as &lt;a href="http://search.cpan.org/~drolsky/Moose-0.57/lib/Moose/Cookbook/FAQ.pod#How_can_I_get_Moose_to_inflate/deflate_values_in_the_accessor?"&gt;http://search.cpan.org/~drolsky/Moose-0.57/lib/Moose/Cookbook/FAQ.pod#How_can_I_get_Moose_to_inflate/deflate_values_in_the_accessor?&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;please read the FAQ and Cookbook for more details.&lt;br /&gt;&lt;br /&gt;Thanks.</description><link>http://www.fayland.org/blog/2008/09/learn-moose-3-around.html</link><author>noreply@blogger.com (Fayland)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-23855943.post-8914309486769414971</guid><pubDate>Wed, 17 Sep 2008 07:13:00 +0000</pubDate><atom:updated>2008-09-17T15:17:27.652+08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>git</category><title>jrock's git repos</title><description>http://git.jrock.us/?o=age&lt;br /&gt;&lt;br /&gt;well, it has a lot of beautiful code.&lt;br /&gt;&lt;br /&gt;git clone git://git.jrock.us/Ernst&lt;br /&gt;&lt;br /&gt;Thanks.</description><link>http://www.fayland.org/blog/2008/09/jrocks-git-repos.html</link><author>noreply@blogger.com (Fayland)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-23855943.post-4199912708354003829</guid><pubDate>Mon, 15 Sep 2008 05:32:00 +0000</pubDate><atom:updated>2008-09-15T13:34:20.170+08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Foorum</category><title>Foorum 0.2.2 release</title><description>0.2.2 Mon Sep 15 12:03:00&lt;br /&gt;        - use Catalyst::Plugin::PageCache '0.19' and key_maker&lt;br /&gt;        - split Model/Validation.pm into ResultSet and remove it&lt;br /&gt;        - use 'MooseX::TheSchwartz' and 'TheSchwartz::Simple' to replace 'TheSchwartz'&lt;br /&gt;&lt;br /&gt;Please download it from &lt;a href="http://foorum.googlecode.com/files/Foorum-0.2.2.tar.gz"&gt;http://foorum.googlecode.com/files/Foorum-0.2.2.tar.gz&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Thanks.</description><link>http://www.fayland.org/blog/2008/09/foorum-022-release.html</link><author>noreply@blogger.com (Fayland)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-23855943.post-3473664276277367439</guid><pubDate>Thu, 11 Sep 2008 10:16:00 +0000</pubDate><atom:updated>2008-09-11T18:33:28.214+08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Moose</category><category domain='http://www.blogger.com/atom/ns#'>TheSchwartz</category><title>MooseX::TheSchwartz</title><description>I just released a new version of &lt;a href="http://search.cpan.org/perldoc?MooseX::TheSchwartz"&gt;MooseX::TheSchwartz&lt;/a&gt; today.&lt;br /&gt;&lt;br /&gt;it's written on the way when I learn Moose. and most of the code is copied from &lt;a href="http://search.cpan.org/perldoc?TheSchwartz"&gt;TheSchwartz&lt;/a&gt; and &lt;a href="http://search.cpan.org/perldoc?TheSchwartz::Simple"&gt;TheSchwartz::Simple&lt;/a&gt;.&lt;br /&gt;yet that's cool to write such things with Moose.&lt;br /&gt;&lt;br /&gt;Moose rocks!</description><link>http://www.fayland.org/blog/2008/09/moosextheschwartz.html</link><author>noreply@blogger.com (Fayland)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-23855943.post-6560791987512244839</guid><pubDate>Fri, 05 Sep 2008 05:10:00 +0000</pubDate><atom:updated>2008-09-05T13:16:55.730+08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Moose</category><title>Learn Moose 2: trigger</title><description>I want a scoreboard on MooseX::TheSchwartz.&lt;br /&gt;so I defined one like "has 'scoreboard'  =&gt; ( is =&gt; 'rw', isa =&gt; 'Str' );", but that's not what I want for all, I want more.&lt;br /&gt;I want it to be a temp file related to $$ when I set it as 1 or 'on'.&lt;br /&gt;I want I can custom a temp file for it.&lt;br /&gt;&lt;br /&gt;I know I can write a method like the one in TheSchwartz. but with Moose, it's much more elegant as what u want!&lt;pre&gt;&lt;code&gt;has 'scoreboard'  =&gt; (&lt;br /&gt;    is =&gt; 'rw',&lt;br /&gt;    isa =&gt; 'Str',&lt;br /&gt;    trigger =&gt; sub {&lt;br /&gt;        my ($self, $dir) = @_;&lt;br /&gt;        &lt;br /&gt;        return unless $dir;&lt;br /&gt;        # no endless loop when it's a file&lt;br /&gt;        if ($dir =~ /\/theschwartz\/scoreboard\./is) {&lt;br /&gt;            # get the real dir from $dir regardless a file&lt;br /&gt;            my (undef, $dir) = File::Spec-&gt;splitpath( $dir );&lt;br /&gt;            unless (-e $dir) {&lt;br /&gt;                mkdir($dir, 0755) or die "Can't create scoreboard directory '$dir': $!";&lt;br /&gt;            }&lt;br /&gt;            return;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        # They want the scoreboard but don't care where it goes&lt;br /&gt;        if (($dir eq '1') or ($dir eq 'on')) {&lt;br /&gt;            $dir = File::Spec-&gt;tmpdir();&lt;br /&gt;        }&lt;br /&gt;    &lt;br /&gt;        $dir .= '/theschwartz';&lt;br /&gt;        unless (-e $dir) {&lt;br /&gt;            mkdir($dir, 0755) or die "Can't create scoreboard directory '$dir': $!";&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        $self-&gt;{scoreboard} = $dir."/scoreboard.$$";&lt;br /&gt;    }&lt;br /&gt;);&lt;/code&gt;&lt;/pre&gt;now I have all I want.&lt;br /&gt;&lt;br /&gt;just be careful, when u want to change itself in trigger like "$self-&gt;{scoreboard} = 'xxx'" or "$self-&gt;scoreboard('xxx');", u must make sure there isn't a endless loop since change itself will call trigger again.&lt;br /&gt;&lt;br /&gt;test code can be found here: &lt;a href="http://fayland.googlecode.com/svn/trunk/script/learn_moose/001_attribute_trigger.pl"&gt;http://fayland.googlecode.com/svn/trunk/script/learn_moose/001_attribute_trigger.pl&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Thanks.</description><link>http://www.fayland.org/blog/2008/09/learn-moose-2-trigger.html</link><author>noreply@blogger.com (Fayland)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-23855943.post-1149265457752706430</guid><pubDate>Thu, 04 Sep 2008 07:22:00 +0000</pubDate><atom:updated>2008-09-05T13:00:49.485+08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Moose</category><title>Learn Moose 1: subtype</title><description>finally I wrote my first Moose script.&lt;br /&gt;mainly I want to write a MooseX::Schwartz if I have enough time.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://search.cpan.org/perldoc?Moose"&gt;Moose&lt;/a&gt; is very powerful.&lt;br /&gt;I want a common function like set a flag to debug, besides that, we can define debug logger sub ourself.&lt;br /&gt;something like:&lt;pre&gt;&lt;code&gt;-&gt;verbose(1);&lt;br /&gt;-&gt;verbose(0);&lt;br /&gt;-&gt;verbose( sub {&lt;br /&gt;    my $msg = shift;&lt;br /&gt;    $msg =~ s/\s+$//;&lt;br /&gt;    print STDERR "[CUS] $msg\n";&lt;br /&gt;} );&lt;br /&gt;# then call -&gt;debug depends on -&gt;verbose.&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;final code is here: &lt;br /&gt;&lt;a href="http://fayland.googlecode.com/svn/trunk/script/learn_moose/007_subtype.pl"&gt;http://fayland.googlecode.com/svn/trunk/script/learn_moose/007_subtype.pl&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I'm not a Moose guru, but Moose sounds pretty exciting!</description><link>http://www.fayland.org/blog/2008/09/learn-moose-1-subtype.html</link><author>noreply@blogger.com (Fayland)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-23855943.post-8576744227224260467</guid><pubDate>Wed, 16 Jul 2008 02:37:00 +0000</pubDate><atom:updated>2008-07-16T10:40:51.692+08:00</atom:updated><title>upgrade pain</title><description>Recently I upgrade subversion to 1.5.0 on my WinXP box. but GOD, that's not working with svn+ssh at all. It's too painful to point out the plink is not working in svn 1.5.0 as before. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://sphinxsearch.com/"&gt;Sphinx&lt;/a&gt; 0.9.8 is out. but I think I would upgrade it after 1 week or more.&lt;br /&gt;&lt;br /&gt;upgrade is painful.&lt;br /&gt;&lt;br /&gt;Thanks.</description><link>http://www.fayland.org/blog/2008/07/upgrade-pain.html</link><author>noreply@blogger.com (Fayland)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-23855943.post-4695671680333826352</guid><pubDate>Mon, 07 Jul 2008 06:14:00 +0000</pubDate><atom:updated>2008-07-07T14:15:05.334+08:00</atom:updated><title>tip: one line force install CPAN module</title><description>$&gt; perl -MCPAN -e 'force("install","Foorum");'&lt;br /&gt;&lt;br /&gt;that's it. Thanks.</description><link>http://www.fayland.org/blog/2008/07/tip-one-line-force-install-cpan-module.html</link><author>noreply@blogger.com (Fayland)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-23855943.post-3630936259932610631</guid><pubDate>Tue, 17 Jun 2008 01:55:00 +0000</pubDate><atom:updated>2008-06-17T10:02:21.393+08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Foorum</category><title>3 day 3 release</title><description>CPAN generally means responsibility. I released 3 Foorum distribution in the last 3 days.&lt;br /&gt;&lt;br /&gt;CPAN means better document. so I tried to use &lt;a href="http://search.cpan.org/perldoc?DBICx::Autodoc"&gt;DBICx::AutoDoc&lt;/a&gt; to create docs for Foorum::Schema. it's a bit different from the original method in DBICx::AutoDoc. I changed a bit to write pod into Schema files directly.&lt;br /&gt;&lt;br /&gt;code are:(briefly)&lt;pre&gt;my $ad = DBICx::AutoDoc-&gt;new(&lt;br /&gt;    schema =&gt; 'Foorum::Schema',&lt;br /&gt;    output =&gt; File::Spec-&gt;catdir($Bin, '..', '..', 'docs'),&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;# rewrite the Schema pm POD&lt;br /&gt;use Template;&lt;br /&gt;&lt;br /&gt;my $tt2 = Template-&gt;new( { INCLUDE_PATH =&gt; $ad-&gt;include_path, POST_CHOMP =&gt; 0, PRE_CHOMP =&gt; 0 } );&lt;br /&gt;my $vars = $ad-&gt;get_vars;&lt;br /&gt;&lt;br /&gt;# first get the lists of all Foorum::Schema pm files&lt;br /&gt;my @sources = @{ $vars-&gt;{sources} };&lt;br /&gt;foreach my $source (@sources) {&lt;br /&gt;    my $class = $source-&gt;{class}; # Foorum::Schema::User&lt;br /&gt;    &lt;br /&gt;    # make file dir&lt;br /&gt;    my @parts_of_modules = split('::', $class);&lt;br /&gt;    $parts_of_modules[-1] .= '.pm';&lt;br /&gt;    my $file_dir = File::Spec-&gt;catfile( $Bin, '..', '..', 'lib', @parts_of_modules );&lt;br /&gt;    &lt;br /&gt;    my $output;&lt;br /&gt;    $tt2-&gt;process('pod.html', { source =&gt; $source }, \$output)&lt;br /&gt;        || die $tt2-&gt;error(), "\n";&lt;br /&gt;    &lt;br /&gt;    # replace POD in real module&lt;br /&gt;    open(my $fh, '&lt;', $file_dir);&lt;br /&gt;    local $/ = undef;&lt;br /&gt;    my $in = &lt;$fh&gt;;&lt;br /&gt;    close($fh);&lt;br /&gt;    &lt;br /&gt;    my ($code, $pod) = split(/\n1;\n/, $in);&lt;br /&gt;    open(my $fh2, '&gt;', $file_dir);&lt;br /&gt;    print $fh2 "$code\n1;\n__END__\n\n$output\n";&lt;br /&gt;    close($fh2);&lt;br /&gt;    &lt;br /&gt;    print "working on $class\n";&lt;br /&gt;}&lt;/pre&gt; Full code can be found in &lt;a href="http://foorum.googlecode.com/svn/trunk/bin/misc/dbicx_autodoc.pl"&gt;http://foorum.googlecode.com/svn/trunk/bin/misc/dbicx_autodoc.pl&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Thanks.</description><link>http://www.fayland.org/blog/2008/06/3-day-3-release.html</link><author>noreply@blogger.com (Fayland)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-23855943.post-8598686960447859868</guid><pubDate>Sun, 15 Jun 2008 08:45:00 +0000</pubDate><atom:updated>2008-06-15T16:46:46.840+08:00</atom:updated><title>Father's Day</title><description>&lt;a href="http://cn.zorpia.com/fayland/album/1078303/album/page=all/"&gt;http://cn.zorpia.com/fayland/album/1078303/album/page=all/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Today is my first Father's Day. :)</description><link>http://www.fayland.org/blog/2008/06/father.html</link><author>noreply@blogger.com (Fayland)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-23855943.post-7002196913929447467</guid><pubDate>Sun, 15 Jun 2008 07:55:00 +0000</pubDate><atom:updated>2008-06-15T15:59:09.379+08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Foorum</category><title>Foorum 0.1.5 release</title><description>Finally I release the Foorum 0.1.5 after 2 months later. &lt;br /&gt;&lt;br /&gt;CHANGES:&lt;br /&gt;1, Foorum::Search with backend Foorum::Search::Database and Foorum::Search::Sphinx&lt;br /&gt;2, change DATETIME to INT(11) for tables.&lt;br /&gt;&lt;br /&gt;it's a release for my little boy diudiu. :)&lt;br /&gt;&lt;br /&gt;u can get it from &lt;a href="http://foorum.googlecode.com/files/Foorum-0.1.5.tar.gz"&gt;http://foorum.googlecode.com/files/Foorum-0.1.5.tar.gz&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;and I uploaded to CPAN too. &lt;br /&gt;&lt;br /&gt;Thanks.</description><link>http://www.fayland.org/blog/2008/06/foorum-015-release.html</link><author>noreply@blogger.com (Fayland)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-23855943.post-4221369060881247809</guid><pubDate>Fri, 23 May 2008 15:36:00 +0000</pubDate><atom:updated>2008-05-23T23:44:24.577+08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Foorum</category><title>use INT(11) instead of DATETIME for time</title><description>well, don't use DATETIME or DATE in database for time, use INT(11) UNSIGNED instead.&lt;br /&gt;&lt;br /&gt;the benefits are:&lt;br /&gt;1, u don't need care about MySQL or SQLite or others. NOW() is used by MySQL while CURRENT_TIMESTAMP is used by SQLite. that's important while u developer in MySQL and write test cases by SQLite.&lt;br /&gt;2, compare. while in TT, if u want to compare topic.time with date.now, u need wrap date.now by String.Compare or convert topic.time to int. that's not so easy. and date.format can convert INT to any format u want.&lt;br /&gt;&lt;br /&gt;I spent some hours to do the upgrade for Foorum.&lt;br /&gt;and the upgrade pl is simple: create a temp column then update as UNIX_TIMESTAMP, then drop old column and rename temp column.&lt;br /&gt;&lt;br /&gt;code is here: &lt;a href="http://foorum.googlecode.com/svn/trunk/bin/upgrade/0.1.5/up.pl"&gt;http://foorum.googlecode.com/svn/trunk/bin/upgrade/0.1.5/up.pl&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Enjoy.</description><link>http://www.fayland.org/blog/2008/05/use-int11-instead-of-datetime-for-time.html</link><author>noreply@blogger.com (Fayland)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-23855943.post-1464896622809056447</guid><pubDate>Fri, 11 Apr 2008 07:32:00 +0000</pubDate><atom:updated>2008-04-11T15:36:01.186+08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Catalyst</category><title>Catalyst trap: param and params</title><description>well, if we write code as follows:&lt;pre&gt;&lt;code&gt;sub test : Local {&lt;br /&gt;   my ($self, $c) = @_;&lt;br /&gt;     my $test = {&lt;br /&gt;       a =&gt; $c-&gt;req-&gt;param('a'),&lt;br /&gt;       b =&gt; $c-&gt;req-&gt;param('b'),&lt;br /&gt;       c =&gt; $c-&gt;req-&gt;param('c'),&lt;br /&gt;   };&lt;br /&gt;   $c-&gt;res-&gt;body(Dumper(\$test));&lt;br /&gt;} &lt;/code&gt;&lt;/pre&gt; then try to visit test?b=1, guess what we get? that's not what we expected. &lt;pre&gt;&lt;code&gt;$VAR1 = \{&lt;br /&gt;           '1' =&gt; 'c',&lt;br /&gt;           'a' =&gt; 'b'&lt;br /&gt;         }; &lt;/code&gt;&lt;/pre&gt;a weird result!&lt;br /&gt;&lt;br /&gt;please use follows, that's much better.&lt;pre&gt;&lt;code&gt;sub test : Local {&lt;br /&gt;    my ($self, $c) = @_;&lt;br /&gt;&lt;br /&gt;    my $test = {&lt;br /&gt;        a =&gt; $c-&gt;req-&gt;params-&gt;{'a'},&lt;br /&gt;        b =&gt; $c-&gt;req-&gt;params-&gt;{'b'},&lt;br /&gt;        c =&gt; $c-&gt;req-&gt;params-&gt;{'c'},&lt;br /&gt;    };&lt;br /&gt;    $c-&gt;res-&gt;body(Dumper(\$test));&lt;br /&gt;} &lt;/code&gt;&lt;/pre&gt; and get what we want:&lt;pre&gt;&lt;code&gt;$VAR1 = \{&lt;br /&gt;            'a' =&gt; undef,&lt;br /&gt;            'b' =&gt; '1',&lt;br /&gt;            'c' =&gt; undef&lt;br /&gt;          };&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;so do remember that. and don't write dbix insert/update code like that.</description><link>http://www.fayland.org/blog/2008/04/catalyst-trap-param-and-params.html</link><author>noreply@blogger.com (Fayland)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-23855943.post-6844958914413092366</guid><pubDate>Fri, 11 Apr 2008 00:08:00 +0000</pubDate><atom:updated>2008-04-11T08:09:10.252+08:00</atom:updated><title>my shell history</title><description>-bash-3.00$ history|awk '{a[$2]++ } END{for(i in a){print a[i] " " i}}' |sort -rn|head&lt;br /&gt;290 perl&lt;br /&gt;235 svn&lt;br /&gt;67 ls&lt;br /&gt;60 screen&lt;br /&gt;46 vim&lt;br /&gt;27 mysql&lt;br /&gt;25 cp&lt;br /&gt;23 rm&lt;br /&gt;22 ps&lt;br /&gt;22 exit</description><link>http://www.fayland.org/blog/2008/04/my-shell-history.html</link><author>noreply@blogger.com (Fayland)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-23855943.post-2156783003518136342</guid><pubDate>Thu, 10 Apr 2008 04:06:00 +0000</pubDate><atom:updated>2008-04-10T12:13:23.562+08:00</atom:updated><title>please support Perl in Google App Engine</title><description>&lt;a href="http://code.google.com/p/googleappengine/issues/detail?id=34"&gt;http://code.google.com/p/googleappengine/issues/detail?id=34&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;star it please. so that we will have a free Perl host by Google!</description><link>http://www.fayland.org/blog/2008/04/please-support-perl-in-google-app.html</link><author>noreply@blogger.com (Fayland)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-23855943.post-4453328370691084813</guid><pubDate>Mon, 07 Apr 2008 13:35:00 +0000</pubDate><atom:updated>2008-04-07T21:37:37.035+08:00</atom:updated><title>I have a son</title><description>My son (nickname: diudiu 丢丢, formal name: 林锦喆) was born a week ago on April Fool's Day (4.1) and weight was 3kg. I'm pretty happy with that. I'll upload some photos later. :)</description><link>http://www.fayland.org/blog/2008/04/i-have-son.html</link><author>noreply@blogger.com (Fayland)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-23855943.post-7734739550227923028</guid><pubDate>Fri, 21 Mar 2008 03:40:00 +0000</pubDate><atom:updated>2008-03-21T11:40:43.164+08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>trip</category><title>KunMing Trip</title><description>I'll be in KunMing next week with all my Zorpia colleges. it would be a nice trip. :)</description><link>http://www.fayland.org/blog/2008/03/kunming-trip.html</link><author>noreply@blogger.com (Fayland)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-23855943.post-6264860916781034312</guid><pubDate>Wed, 19 Mar 2008 13:13:00 +0000</pubDate><atom:updated>2008-03-19T21:15:22.579+08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>memcached</category><title>memcached for Windows</title><description>&lt;a href="http://www.splinedancer.com/memcached-win32/"&gt;http://www.splinedancer.com/memcached-win32/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;have fun.</description><link>http://www.fayland.org/blog/2008/03/memcached-for-windows.html</link><author>noreply@blogger.com (Fayland)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-23855943.post-1763870688095471344</guid><pubDate>Fri, 14 Mar 2008 10:22:00 +0000</pubDate><atom:updated>2008-03-14T18:25:09.200+08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Catalyst</category><title>Catalyst Tip: bind STDOUT with res-&gt;body</title><description>&lt;pre&gt;&lt;code&gt;sub test_body : Local {&lt;br /&gt;    my ($self, $c) = @_;&lt;br /&gt;&lt;br /&gt;    $c-&gt;res-&gt;body(\*STDOUT);&lt;br /&gt;    print "a\n";&lt;br /&gt;    print "b\n";&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;I think that's pretty useful when u are trying to use "Benchmark" module (or others use STDOUT).&lt;br /&gt;&lt;br /&gt;Have fun!</description><link>http://www.fayland.org/blog/2008/03/catalyst-tip-bind-stdout-with-res-body.html</link><author>noreply@blogger.com (Fayland)</author></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-23855943.post-3028673279595254930</guid><pubDate>Wed, 05 Mar 2008 07:49:00 +0000</pubDate><atom:updated>2008-03-05T16:15:50.657+08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>MySQL</category><title>MySQL tip TIMESTAMPDIFF</title><description>Thanks for my college CY.&lt;br /&gt;&lt;br /&gt;UNIX_TIMESTAMP(birthday) is not working when birthday is before 1970.&lt;br /&gt;I should use TIMESTAMPDIFF(DAY, '1900-01-01', birthday) to get the DAY or SECOND&lt;br /&gt;&lt;pre&gt;&lt;code&gt;mysql&gt; select TIMESTAMPDIFF(DAY, '1900-01-01', '1998-05-01');&lt;br /&gt;+------------------------------------------------+&lt;br /&gt;| TIMESTAMPDIFF(DAY, '1900-01-01', '1998-05-01') |&lt;br /&gt;+------------------------------------------------+&lt;br /&gt;|                                          35914 |&lt;br /&gt;+------------------------------------------------+&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_timestampdiff"&gt;http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_timestampdiff&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;in Perl, we can do:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;use Date::Calc qw/Delta_Days/;&lt;br /&gt;print Delta_Days(1900,1,1, 1998,5,1);&lt;br /&gt;^Z&lt;br /&gt;35914&lt;/code&gt;&lt;/pre&gt;</description><link>http://www.fayland.org/blog/2008/03/mysql-tip-timestampdiff.html</link><author>noreply@blogger.com (Fayland)</author></item></channel></rss>