<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Fayland and Perl Programming</title>
    <link rel="alternate" type="text/html" href="http://blog.fayland.org/" />
    <link rel="self" type="application/atom+xml" href="http://blog.fayland.org/atom.xml" />
    <id>tag:blog.fayland.org,2011-01-06://2</id>
    <updated>2011-12-04T08:56:28Z</updated>
    
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 5.04</generator>

<entry>
    <title>Plack::Middleware::FileWrap</title>
    <link rel="alternate" type="text/html" href="http://blog.fayland.org/2011/12/plackmiddlewarefilewrap.html" />
    <id>tag:blog.fayland.org,2011://2.22</id>

    <published>2011-12-04T08:51:48Z</published>
    <updated>2011-12-04T08:56:28Z</updated>

    <summary>When you really go coding, you&apos;ll meet lots of issues. then you&apos;ll write solution for them. that&apos;s straight.Today I have another CPAN module Plack::Middleware::FileWrap out to fit my demand: I&apos;ll have lots of plain HTML files, they&apos;ll share the same...</summary>
    <author>
        <name>Fayland Lam</name>
        
    </author>
    
    <category term="kindergarden" label="KinderGarden" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="plack" label="Plack" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.fayland.org/">
        <![CDATA[<div>When you really go coding, you'll meet lots of issues. then you'll write solution for them. that's straight.</div><div><br /></div><div>Today I have another CPAN module <a href="http://search.cpan.org/dist/Plack-Middleware-FileWrap/">Plack::Middleware::FileWrap</a> out to fit my demand: I'll have lots of plain HTML files, they'll share the same header/footer and I don't want to use stupid iframe.</div><div><br /></div><div>under Plack, it just means wrap $res-&gt;[2] with file content or strings.&nbsp;</div><div><br /></div><div>so here comes Plack::Middleware::FileWrap, very simple if you looked at the <a href="https://github.com/fayland/Plack-Middleware-FileWrap/blob/master/lib/Plack/Middleware/FileWrap.pm">source code</a>.</div><div><br /></div><div>then I used it in the KinderGarden project, with snippets:</div><div><br /></div><div>&nbsp; &nbsp; mount '/static/docs/' =&gt; builder {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; enable 'FileWrap', headers =&gt; ["$root/static/docs/header.html"], footers =&gt; ["$root/static/docs/footer.html"];</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Plack::App::File-&gt;new( root =&gt; "$root/static/docs" )-&gt;to_app;</div><div>&nbsp; &nbsp; },</div><div>&nbsp; &nbsp;&nbsp;</div><div>Live demo as <a href="http://kindergarden.fayland.org/static/docs/TestLocally.html">http://kindergarden.fayland.org/static/docs/TestLocally.html</a></div><div><br /></div><div>now all the files under static/docs will wrapped with header.html and footer.html (header.html/footer.html itself too!)</div><div><br /></div><div>for some advanced example, like if you just want to apply to html files, then you can code something like:</div><div><br /></div><div>&nbsp; &nbsp; mount '/static/docs/' =&gt; builder {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; enable_if { $_[0]-&gt;{PATH_INFO} =~ /\.html/ } 'FileWrap',</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; headers =&gt; ["$root/static/docs/header.html"], footers =&gt; ["$root/static/docs/footer.html"];</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Plack::App::File-&gt;new( root =&gt; "$root/static/docs" )-&gt;to_app;</div><div>&nbsp; &nbsp; },</div><div>&nbsp; &nbsp;&nbsp;</div><div>I didn't put the Content-Type check b/c I think it's better to be handled with enable_if.</div><div><br /></div><div>Enjoy. Thanks</div>]]>
        
    </content>
</entry>

<entry>
    <title>git submodule</title>
    <link rel="alternate" type="text/html" href="http://blog.fayland.org/2011/12/git-submodule.html" />
    <id>tag:blog.fayland.org,2011://2.21</id>

    <published>2011-12-03T10:56:57Z</published>
    <updated>2011-12-03T11:30:13Z</updated>

    <summary><![CDATA[When you include another open source in your own project, it's usually pretty hard to keep it up to date. it becomes even more harder if you have some modification on it.recently I have bootstrap&nbsp;in my KinderGarden&nbsp;project, it's very easy...]]></summary>
    <author>
        <name>Fayland Lam</name>
        
    </author>
    
    <category term="git" label="git" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="kindergarden" label="KinderGarden" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.fayland.org/">
        <![CDATA[When you include another open source in your own project, it's usually pretty hard to keep it up to date. it becomes even more harder if you have some modification on it.<div><br /></div><div>recently I have <a href="https://github.com/twitter/bootstrap">bootstrap</a>&nbsp;in my <a href="https://github.com/PerlChina/kindergarden">KinderGarden</a>&nbsp;project, it's very easy to use git submodule to handle it.</div><div><br /></div><div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div>kindergarden&gt; git submodule add https://github.com/twitter/bootstrap.git static/bootstrap</div></div><div>kindergarden&gt; git add .gitmodules static/bootstrap</div><div>kindergarden&gt; git commit -a -m "remote bootstrap"</div><div>kindergarden&gt; git push</div><div><div>kindergarden&gt; git submodule init</div></div></blockquote><br /></div><div>in delopy or other machine:</div><div><br /></div><div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div>kindergarden$ git submodule init</div><div>kindergarden$ git submodule update</div></div></blockquote><div><br /></div>pretty easy and simple, and the logic behind is simple too. reference as <a href="http://help.github.com/submodules/">http://help.github.com/submodules/</a>&nbsp;or&nbsp;<a href="http://progit.org/book/ch6-6.html">http://progit.org/book/ch6-6.html</a></div><div><br /></div><div>BTW, I added Live.com OAuth2 supports to KinderGarden.</div><div><br /></div><div>Enjoy. Thanks</div>]]>
        
    </content>
</entry>

<entry>
    <title>2011 CN Perl Advent</title>
    <link rel="alternate" type="text/html" href="http://blog.fayland.org/2011/12/2011-cn-perl-advent.html" />
    <id>tag:blog.fayland.org,2011://2.20</id>

    <published>2011-12-01T11:16:26Z</published>
    <updated>2011-12-01T11:17:33Z</updated>

    <summary><![CDATA[Hi, it's time for advent again!and here it is:&nbsp;http://perlchina.github.com/advent.perlchina.org/the repos is at&nbsp;https://github.com/PerlChina/advent.perlchina.orgEnjoy!...]]></summary>
    <author>
        <name>Fayland Lam</name>
        
    </author>
    
    <category term="advent" label="advent" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.fayland.org/">
        <![CDATA[Hi, it's time for advent again!<div><br /></div><div>and here it is:&nbsp;<a href="http://perlchina.github.com/advent.perlchina.org/">http://perlchina.github.com/advent.perlchina.org/</a></div><div><br /></div><div>the repos is at&nbsp;<a href="https://github.com/PerlChina/advent.perlchina.org">https://github.com/PerlChina/advent.perlchina.org</a></div><div><br /></div><div>Enjoy!</div>]]>
        
    </content>
</entry>

<entry>
    <title>KinderGarden</title>
    <link rel="alternate" type="text/html" href="http://blog.fayland.org/2011/11/kindergarden.html" />
    <id>tag:blog.fayland.org,2011://2.19</id>

    <published>2011-11-27T04:43:24Z</published>
    <updated>2011-11-27T04:46:45Z</updated>

    <summary><![CDATA[as talked yesterday, I get it uploaded into github. well, under PerlChina.&nbsp;https://github.com/PerlChina/kindergardenI really want to draw more people to add more features and fix more bugs.and I added one new feature with Mojolicious&nbsp;which is&nbsp;http://kindergarden.fayland.org/app/whereilivefeel free to view the source and...]]></summary>
    <author>
        <name>Fayland Lam</name>
        
    </author>
    
    <category term="kindergarden" label="KinderGarden" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mojolicious" label="Mojolicious" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perlchina" label="PerlChina" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.fayland.org/">
        <![CDATA[as talked yesterday, I get it uploaded into github. well, under PerlChina.&nbsp;<a href="https://github.com/PerlChina/kindergarden">https://github.com/PerlChina/kindergarden</a><div><br /></div><div>I really want to draw more people to add more features and fix more bugs.</div><div><br /></div><div>and I added one new feature with <a href="http://mojolicio.us/">Mojolicious</a>&nbsp;which is&nbsp;<a href="http://kindergarden.fayland.org/app/whereilive">http://kindergarden.fayland.org/app/whereilive</a></div><div><br /></div><div>feel free to view the source and let me know what you think!</div><div><br /></div><div>Thanks.</div>]]>
        
    </content>
</entry>

<entry>
    <title>Dancer::Template::Xslate</title>
    <link rel="alternate" type="text/html" href="http://blog.fayland.org/2011/11/dancertemplatexslate.html" />
    <id>tag:blog.fayland.org,2011://2.18</id>

    <published>2011-11-26T05:50:34Z</published>
    <updated>2011-11-26T06:10:21Z</updated>

    <summary><![CDATA[I'm writing some toy once again with Plack and Dancer (and Mojo later).this time, I'm playing Plack::Middleware::OAuth and Dancer::Template::Xslate a bit. the website is&nbsp;http://kindergarden.fayland.org/&nbsp;and I'll open source it if someone is interested. for now, it's just 'Login with ...' OAuth...]]></summary>
    <author>
        <name>Fayland Lam</name>
        
    </author>
    
    <category term="dancer" label="dancer" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="Perl" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="plack" label="Plack" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="xslate" label="Xslate" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.fayland.org/">
        <![CDATA[I'm writing some toy once again with Plack and Dancer (and Mojo later).<div><br /></div><div>this time, I'm playing <a href="http://search.cpan.org/perldoc?Plack::Middleware::OAuth">Plack::Middleware::OAuth</a> and <a href="http://search.cpan.org/perldoc?Dancer::Template::Xslate">Dancer::Template::Xslate</a> a bit. the website is&nbsp;<a href="http://kindergarden.fayland.org/">http://kindergarden.fayland.org/</a>&nbsp;and I'll open source it if someone is interested. for now, it's just 'Login with ...' OAuth and nothing else. (layout is built with&nbsp;<a href="http://twitter.github.com/bootstrap/">twitter bootstrap</a>)</div><div><br /></div><div>the Dancer::Template::Xslate has some bugs and I tried to submit few commits through github to fix it. (at least it's working for me now)</div><div><br /></div><div>here is a tip to add function like&nbsp;gravatar into Xslate within Dancer.</div><div><br /></div><div>problem as <a href="http://search.cpan.org/perldoc?Text::Xslate">Text::Xslate</a> supports <b>function</b> param when -&gt;new but Dancer YAML config can't have Perl code inside. and it's very tricky or hard to fix the engine 'template' b/c we can never modify it. it has 'my $_engine;' inside code and you can't modify it at all.</div><div><br /></div><div>after a while, I find a good solution with the <b>module</b> param of the Text::Xslate. it's very neat. sample code as below:</div><div><br /></div><div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div># config.yml</div><div>template: xslate</div><div>engines:</div><div>&nbsp; xslate:</div><div>&nbsp; &nbsp; syntax: 'TTerse'</div><div>&nbsp; &nbsp; extension: 'tt'</div><div>&nbsp; &nbsp; header:</div><div>&nbsp; &nbsp; &nbsp; - 'layout/header.tt'</div><div>&nbsp; &nbsp; footer:</div><div>&nbsp; &nbsp; &nbsp; - 'layout/footer.tt'</div><div>&nbsp; &nbsp; module:</div><div>&nbsp; &nbsp; &nbsp; - KinderGardenX::Text::Xslate::Bridge::KinderGarden</div></div><div><br /></div><div>#&nbsp;KinderGardenX::Text::Xslate::Bridge::KinderGarden</div><div><div>package KinderGardenX::Text::Xslate::Bridge::KinderGarden;</div><div><br /></div><div>use strict;</div><div>use warnings;</div><div>use parent qw(Text::Xslate::Bridge);</div><div><br /></div><div>use Gravatar::URL;</div><div><br /></div><div>my %funtion_methods = (</div><div>&nbsp; &nbsp; gravatar_url =&gt; \&amp;gravatar_url,</div><div>);</div><div><br /></div><div>__PACKAGE__-&gt;bridge(</div><div>&nbsp; &nbsp; function =&gt; \%funtion_methods,</div><div>);</div><div><br /></div><div>1;</div></div><div><br /></div><div># template</div><div><br /></div><div><div>&nbsp; &nbsp; &lt;img src="[% gravatar_url( email =&gt; user.email, size =&gt; 30) %]" /&gt;</div><div>&nbsp; &nbsp; &lt;img src="[% gravatar_url( email =&gt; user.email, size =&gt; 50) %]" /&gt;</div><div>&nbsp; &nbsp; &lt;img src="[% gravatar_url( email =&gt; user.email) %]" /&gt;</div></div><div><br /></div></blockquote>Note there is always more than one way to do it.&nbsp;</div><div><br /></div><div>Thanks.</div>]]>
        
    </content>
</entry>

<entry>
    <title>new baby</title>
    <link rel="alternate" type="text/html" href="http://blog.fayland.org/2011/11/new-baby.html" />
    <id>tag:blog.fayland.org,2011://2.17</id>

    <published>2011-11-08T11:47:34Z</published>
    <updated>2011-11-08T11:50:24Z</updated>

    <summary>I&apos;m very happy to share the good news with all the world. my second kid, another boy, was born today. 9:45am Beijing Time, Nov 8th, 2011. 2800g. and everything is good. Thanks....</summary>
    <author>
        <name>Fayland Lam</name>
        
    </author>
    
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.fayland.org/">
        I&apos;m very happy to share the good news with all the world. my second kid, another boy, was born today. 9:45am Beijing Time, Nov 8th, 2011. 2800g. and everything is good. Thanks.
        
    </content>
</entry>

<entry>
    <title>remove/add job to crontab by commandline</title>
    <link rel="alternate" type="text/html" href="http://blog.fayland.org/2011/10/removeadd-job-to-crontab-by-commandline.html" />
    <id>tag:blog.fayland.org,2011://2.16</id>

    <published>2011-10-13T03:30:03Z</published>
    <updated>2011-10-13T03:35:55Z</updated>

    <summary><![CDATA[1. add job to crontab(crontab -u fayland -l ; echo "*/5 * * * * perl /home/fayland/test.pl") | crontab -u fayland -2. remove job from crontabcrontab -u fayland -l | grep -v 'perl /home/fayland/test.pl' &nbsp;| crontab -u fayland -3. remove...]]></summary>
    <author>
        <name>Fayland Lam</name>
        
    </author>
    
    <category term="crontab" label="crontab" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="linux" label="linux" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.fayland.org/">
        <![CDATA[1. add job to crontab<div><br /></div><div>(crontab -u fayland -l ; echo "*/5 * * * * perl /home/fayland/test.pl") | crontab -u fayland -</div><div><br /></div><div>2. remove job from crontab</div><div><br /></div><div>crontab -u fayland -l | grep -v 'perl /home/fayland/test.pl' &nbsp;| crontab -u fayland -</div><div><br /></div><div>3. remove all crontab</div><div><br /></div><div>crontab -r</div><div><br /></div><div>nothing is tricky. expect it took me 10 minutes to figure out '-' is the one I want. (- is STDOUT in Linux).</div><div><br /></div><div>Thanks.</div>]]>
        
    </content>
</entry>

<entry>
    <title>sphinx 0.99 bug (attributes count vs fields count)</title>
    <link rel="alternate" type="text/html" href="http://blog.fayland.org/2011/09/sphinx-099-bug-attributes-count-vs-fields-count.html" />
    <id>tag:blog.fayland.org,2011://2.15</id>

    <published>2011-09-29T10:33:00Z</published>
    <updated>2011-09-29T10:39:29Z</updated>

    <summary>when you have 4 columns in sql_query, and you want 3 columns as attributes. you&apos;ll get a failure. 0 size sphinx files.it&apos;s quite annoying, and it cost me almost 4 hours to figure it out. I&apos;m so dumb and so...</summary>
    <author>
        <name>Fayland Lam</name>
        
    </author>
    
    <category term="sphinx" label="sphinx" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.fayland.org/">
        <![CDATA[when you have 4 columns in sql_query, and you want 3 columns as attributes. you'll get a failure. 0 size sphinx files.<div><br /></div><div>it's quite annoying, and it cost me almost 4 hours to figure it out. I'm so dumb and so are you, SPHINX.</div><div><br /></div><div>a simple solution is to add a dumb col in the SELECT of sql_query like</div><div><br /></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>SELECT id,&nbsp;radians(longitude) as long_radians, radians(latitude) as lat_radians, 'dumb' FROM table</div><div><br /></div></blockquote>OK. actually 'dumb' is dumb because it takes more disk than 'a'.<div><br /></div><div>for a detailed issue description, please check&nbsp;<a href="http://sphinxsearch.com/forum/view.html?id=8345">http://sphinxsearch.com/forum/view.html?id=8345</a></div><div><br /></div><div>Thanks.</div>]]>
        
    </content>
</entry>

<entry>
    <title>Net-GitHub 0.40_02</title>
    <link rel="alternate" type="text/html" href="http://blog.fayland.org/2011/09/net-github-040-02.html" />
    <id>tag:blog.fayland.org,2011://2.14</id>

    <published>2011-09-25T13:56:06Z</published>
    <updated>2011-09-25T14:09:47Z</updated>

    <summary>it&apos;s a story following the previous one. and this one will be shorter.I got Net-GitHub 0.40_02 released few minutes ago. with* Gists, Git Data, Orgs supports* methods on flythere are still something to do like Pagination and MIME-Types. but most...</summary>
    <author>
        <name>Fayland Lam</name>
        
    </author>
    
    <category term="cpan" label="CPAN" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="git" label="Git" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="github" label="GitHub" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="moose" label="Moose" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.fayland.org/">
        <![CDATA[it's a story following the <a href="http://blog.fayland.org/2011/09/net-github-040-01.html">previous one</a>. and this one will be shorter.<div><br /></div><div>I got Net-GitHub 0.40_02 released few minutes ago. with</div><div>* Gists, Git Data, Orgs supports</div><div>* methods on fly</div><div><br /></div><div>there are still something to do like Pagination and MIME-Types. but most of the functions should be working now.</div><div><br /></div><div>big thanks to <a href="https://metacpan.org/module/Moose">Moose</a> team, I becomes a little smarter than yesterday.</div><div><br /></div><div>yesterday I was dumb. I wrote every methods with sub, with arguments fix, with -&gt;query or check DELETE status. lots of duplication codes.</div><div><br /></div><div>I cleaned all the code up with __PACKAGE__-&gt;meta-&gt;add_method. now all the code looks very clean and easy to maintain.</div><div><br /></div><div>old code looks like (<a href="https://github.com/fayland/perl-net-github/blob/3c7cb3393834d5dd5d5bc4b583fcb1669ef8ef2d/lib/Net/GitHub/V3/PullRequests.pm">https://github.com/fayland/perl-net-github/blob/3c7cb3393834d5dd5d5bc4b583fcb1669ef8ef2d/lib/Net/GitHub/V3/PullRequests.pm</a>)</div><div><br /></div><div>new code is really much better:&nbsp;<a href="https://github.com/fayland/perl-net-github/blob/master/lib/Net/GitHub/V3/PullRequests.pm">https://github.com/fayland/perl-net-github/blob/master/lib/Net/GitHub/V3/PullRequests.pm</a></div><div><br /></div><div>the main tricky here is the -&gt;meta-&gt;add_method.</div><div><br /></div>## build methods on fly<br /><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div>sub __build_methods {</div><div>&nbsp; &nbsp; my $package = shift;</div><div>&nbsp; &nbsp; my %methods = @_;</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; foreach my $m (keys %methods) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; my $v = $methods{$m};</div><div>&nbsp; &nbsp; &nbsp; &nbsp; my $url = $v-&gt;{url};</div><div>&nbsp; &nbsp; &nbsp; &nbsp; my $method = $v-&gt;{method} || 'GET';</div><div>&nbsp; &nbsp; &nbsp; &nbsp; my $args = $v-&gt;{args} || 0; # args for -&gt;query</div><div>&nbsp; &nbsp; &nbsp; &nbsp; my $check_status = $v-&gt;{check_status};</div><div>&nbsp; &nbsp; &nbsp; &nbsp; my $is_u_repo = $v-&gt;{is_u_repo}; # need auto shift u/repo</div><div>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; $package-&gt;meta-&gt;add_method( $m =&gt; sub {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $self = shift;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # count how much %s inside u</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $n = 0; while ($url =~ /\%s/g) { $n++ }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ## if is_u_repo, both ($user, $repo, @args) or (@args) should be supported</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ( ($is_u_repo or index($url, '/repos/%s/%s') &gt; -1) and @_ &lt; $n + $args) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; unshift @_, ($self-&gt;u, $self-&gt;repo);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br /></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # make url, replace %s with real args</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my @uargs = splice(@_, 0, $n);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $u = sprintf($url, @uargs);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # args for json data POST</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my @qargs = $args ? splice(@_, 0, $args) : ();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($check_status) { # need check Response Status</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $old_raw_response = $self-&gt;raw_response;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $self-&gt;raw_response(1); # need check header</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $res = $self-&gt;query($method, $u, @qargs);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $self-&gt;raw_response($old_raw_response);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return index($res-&gt;header('Status'), $check_status) &gt; -1 ? 1 : 0;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return $self-&gt;query($method, $u, @qargs);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; } );</div><div>&nbsp; &nbsp; }</div><div>}</div></div></blockquote><br /><div>next step will be Pagination and MIME-types. and later.</div><div><br /></div><div>Thanks</div>]]>
        
    </content>
</entry>

<entry>
    <title>Net-GitHub 0.40_01</title>
    <link rel="alternate" type="text/html" href="http://blog.fayland.org/2011/09/net-github-040-01.html" />
    <id>tag:blog.fayland.org,2011://2.13</id>

    <published>2011-09-24T14:49:15Z</published>
    <updated>2011-09-24T15:38:12Z</updated>

    <summary><![CDATA[it's a quite long story. but it's all about Net::GitHubGithub released their&nbsp;V3 API&nbsp;few months ago.the reason why I didn't update the module is super simple, I'm kind busy recently. my wife is during pregnancy. we'll have another kid 2 months...]]></summary>
    <author>
        <name>Fayland Lam</name>
        
    </author>
    
    <category term="cpan" label="CPAN" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="git" label="git" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.fayland.org/">
        <![CDATA[it's a quite long story. but it's all about <a href="https://metacpan.org/module/Net::GitHub">Net::GitHub</a><div><br /></div><div>Github released their&nbsp;<a href="http://developer.github.com/">V3 API</a>&nbsp;few months ago.<br /><div><br /></div><div>the reason why I didn't update the module is super simple, I'm kind busy recently. my wife is during pregnancy. we'll have another kid 2 months later. and I even don't use in my daily life. I wrote it because I enjoy writing stuff for people.<br /><div><br /></div><div>There is a CPAN module&nbsp;<a href="https://metacpan.org/module/Pithub">Pithub</a>. it is great. even he is reinventing another wheels instead of contributing, I have to say: nice module, well written. I&nbsp;was thinking to add some notes in Net-GitHub to say that if you're looking for V3 implemention, please try Pithub.</div><div><br /></div><div>I changed my idea suddenly after c9s patched the module for access_token supports. if I accept it and write POD for it, why not write V3 API too?</div><div><br /></div><div>Writing code for public is enjoyable. you can't write messy code because people use it and rate you as dumb guy. I don't want to be dumb so I have to be smarter.</div></div></div><div><br /></div><div>Writing code is easy and simple. The most hard part is to design the API. how it works so that user will feel comfortable to use it.</div><div><br /></div><div>Here comes few thoughts on Net-GitHub.</div><div><br /></div><div>1. raw query should be supported so if Github add any new API, people can at least use it without waiting for another release.</div><div><br /></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>use Net::GitHub;</div><div>my $gh = Net::GitHub-&gt;new( login =&gt; 'fayland', pass =&gt; 'secret' );</div><div><br /></div><div>my $data = $gh-&gt;query('/user');</div><div><div>$gh-&gt;query('PATCH', '/user', { bio =&gt; 'another Perl Programmer and Father' });</div><div>$gh-&gt;query('DELETE', '/user/emails', [ 'myemail@somewhere.com' ]);</div></div></blockquote><br /><div>so most of the methods is just a wrapper like:</div><div><br /></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div>sub emails {&nbsp;(shift)-&gt;query('/user/emails'); }</div></div><div><br /></div></blockquote>2. more than half of the Github API is binded with :user/:repo. but it will be really very boring to type user/repo for every call.<div>but for one-off call, pass user/repo should be better. so both of them should be supported.</div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><br /></div><div>$gh-&gt;set_default_user_repo('fayland', 'perl-net-github');</div><div>my @issues = $gh-&gt;issue-&gt;issues;</div><div>my @pulls &nbsp; &nbsp;= $gh-&gt;pull_request-&gt;pulls;</div><div><br /></div><div># or one-off call</div><div>my @contributors = $gh-&gt;respo-&gt;contributors($user, $repo);</div><div><br /></div></blockquote>I kicked out the version to public today. but there are still a lot of stuff missing. I released it because I want to hear some feedback from the users. below are some todos.<div>1. Orgs, Gists, Git Data</div><div>2. Pager and MIME types</div><div>3. Moose handles like $gh-&gt;pulls = $gh-&gt;pull_request-&gt;pulls to ease keyboard.</div><div>4. method builder so there isn't too much duplication code like now.</div><div><br /></div><div>but I may not be able to finish all of them soon. so if anyone is willing to help, please fork on&nbsp;<a href="https://github.com/fayland/perl-net-github">https://github.com/fayland/perl-net-github</a>&nbsp;and patches are welcome!</div><div><br /></div><div>Thanks</div><div><br /></div>]]>
        
    </content>
</entry>

<entry>
    <title>print raw TT2 syntax</title>
    <link rel="alternate" type="text/html" href="http://blog.fayland.org/2011/09/print-raw-tt2-syntax.html" />
    <id>tag:blog.fayland.org,2011://2.12</id>

    <published>2011-09-22T03:45:56Z</published>
    <updated>2011-09-22T03:49:06Z</updated>

    <summary><![CDATA[The tricky is TAGS:&nbsp;http://search.cpan.org/perldoc?Template#TAGS[% a = 1 %] var [% a %] blabla; [% TAGS &lt;$ $&gt; %] var [% a %] blabla &lt;$ TAGS [% %] $&gt; var [% a %] blabla;it will print out stuff like:var 1 blabla;...]]></summary>
    <author>
        <name>Fayland Lam</name>
        
    </author>
    
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="tt2" label="TT2" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.fayland.org/">
        <![CDATA[The tricky is TAGS:&nbsp;<a href="http://search.cpan.org/perldoc?Template#TAGS">http://search.cpan.org/perldoc?Template#TAGS<br /></a><br /><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>[% a = 1 %]
<br />
<br />var [% a %] blabla;
<br />
<br />[% TAGS &lt;$ $&gt; %]
<br />var [% a %] blabla
<br />
<br />&lt;$ TAGS [% %] $&gt;
<br />var [% a %] blabla;</div></blockquote><br /><div>it will print out stuff like:</div><div><br /></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>var 1 blabla;
<br />var [% a %] blabla
<br />var 1 blabla;</div></blockquote><br /><div>simple, set tags to &lt;$ $&gt; and get it back to [% %]. &lt;$ $&gt; can be anything you like.</div><div><br /></div><div>Thanks</div>]]>
        
    </content>
</entry>

<entry>
    <title>DELETE post with Facebook::Graph</title>
    <link rel="alternate" type="text/html" href="http://blog.fayland.org/2011/09/delete-post-with-facebookgraph.html" />
    <id>tag:blog.fayland.org,2011://2.11</id>

    <published>2011-09-07T13:46:23Z</published>
    <updated>2011-09-07T13:52:14Z</updated>

    <summary><![CDATA[Facebook::Graph&nbsp;doesn't provide DELETE method by default. but we can do it for sure. below is one sample code:use Facebook::Graph;use LWP::UserAgent;use HTTP::Request::Common ();my $fb = Facebook::Graph-&gt;new(&nbsp; &nbsp; app_id &nbsp; &nbsp; =&gt; $app_id,&nbsp; &nbsp; secret &nbsp; &nbsp; =&gt; $app_sec,&nbsp; &nbsp; postback &nbsp;...]]></summary>
    <author>
        <name>Fayland Lam</name>
        
    </author>
    
    <category term="facebook" label="Facebook" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="Perl" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.fayland.org/">
        <![CDATA[<a href="http://search.cpan.org/perldoc?Facebook::Graph">Facebook::Graph</a>&nbsp;doesn't provide DELETE method by default. but we can do it for sure. below is one sample code:<div><br /></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>use Facebook::Graph;</div><div><div>use LWP::UserAgent;</div><div>use HTTP::Request::Common ();</div></div><div><br /></div><div><div>my $fb = Facebook::Graph-&gt;new(</div><div>&nbsp; &nbsp; app_id &nbsp; &nbsp; =&gt; $app_id,</div><div>&nbsp; &nbsp; secret &nbsp; &nbsp; =&gt; $app_sec,</div><div>&nbsp; &nbsp; postback &nbsp; =&gt; $postback_url,</div><div>);</div></div><div><br /></div><div><div>my $uri = $fb-&gt;query-&gt;find($post_id)-&gt;uri_as_string;</div><div>my $req = HTTP::Request::Common::DELETE($uri);</div><div>$req-&gt;header('Content-Length', 0);</div><div>my $response = LWP::UserAgent-&gt;new-&gt;request($req);</div></div><div><br /></div></blockquote>Note we have to set Content-Length to 0. or we'll get 400 Bad Request.<div><br /></div><div>Thanks</div>]]>
        
    </content>
</entry>

<entry>
    <title>tips for snaked</title>
    <link rel="alternate" type="text/html" href="http://blog.fayland.org/2011/08/tips-for-snaked.html" />
    <id>tag:blog.fayland.org,2011://2.10</id>

    <published>2011-08-12T14:24:22Z</published>
    <updated>2011-08-12T14:33:24Z</updated>

    <summary><![CDATA[I'm giving snaked a try today. it's my first time to try it. and I heard it from last year's CN Perl Advent:&nbsp;http://advent.perlchina.org/2010/snaked.htmlfor those people who don't know what snaked is, snaked is like crontab and written in Perl.so far...]]></summary>
    <author>
        <name>Fayland Lam</name>
        
    </author>
    
    <category term="cpan" label="CPAN" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.fayland.org/">
        <![CDATA[I'm giving <a href="http://search.cpan.org/perldoc?snaked">snaked</a> a try today. it's my first time to try it. and I heard it from last year's CN Perl Advent:&nbsp;<a href="http://advent.perlchina.org/2010/snaked.html">http://advent.perlchina.org/2010/snaked.html</a><div><br /></div><div>for those people who don't know what snaked is, snaked is like crontab and written in Perl.<br /><div><br /></div><div>so far so good. here are two cents.</div><div><br /></div><div>1. if you put your configuration files under /home/fayland/snaked, please don't put the log there.</div><div>it you have /home/fayland/snaked/log which contains /home/fayland/snaked/snaked.log</div><div>as soon as you run snaked --configure, you'll find your snaked.log expands very fast soon with some weird log like</div><div>'new value for option snaked.log'.</div><div><br /></div><div>that's because in snaked.pm, it will try to read all files under the snaked configure directory and load them as options.</div><div>snaked.log is a file, so the content is loaded as the value, and append to the snaked.log</div><div>so if you run 'snaked --configure' many times, you'll find the snaked.log becomes quite large with all log repeated again and again.</div><div><br /></div><div>the fixes is to move snaked.log into another directory instead of /home/fayland/snaked</div><div><br /></div><div>2. another tip should be simple but useful</div><div>export PS_SNAKED_CFG=/home/fayland/snaked/</div><div><br /></div><div>then you don't need put --cfg again and again when you run snaked command.</div><div><br /></div><div>Thanks.</div></div>]]>
        
    </content>
</entry>

<entry>
    <title>MySQL two tips</title>
    <link rel="alternate" type="text/html" href="http://blog.fayland.org/2011/08/mysql-two-tips.html" />
    <id>tag:blog.fayland.org,2011://2.9</id>

    <published>2011-08-10T09:10:13Z</published>
    <updated>2011-08-10T09:11:38Z</updated>

    <summary><![CDATA[that's not new and many people may already know it. but it's really very helpful when some SQL locked.tip 1. use -A to start fasterif mysql somedatabase command didn't return mysql&gt; for you. you really can try it with -A....]]></summary>
    <author>
        <name>Fayland Lam</name>
        
    </author>
    
    <category term="mysql" label="MySQL" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.fayland.org/">
        <![CDATA[<span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; height: 90%; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); color: rgb(51, 51, 51); font: normal normal normal 13px/normal arial, helvetica, hirakakupro-w3, osaka, 'ms pgothic', sans-serif; background-position: initial initial; background-repeat: initial initial; ">that's not new and many people may already know it. but it's really very helpful when some SQL locked.<div><br /></div><div>tip 1. use -A to start faster</div><div><br /></div><div>if mysql somedatabase command didn't return mysql&gt; for you. you really can try it with -A. that loads faster.</div><div><br /></div><div>tip 2: set pager for large result.</div><div><br /></div><div>mysql&gt; pager less;</div><div><br /></div><div>so that if you do 'SHOW FULL PROCESSLIST' that you can find the exact one you want without scrolling back or missing anything.</div><div><br /></div><div>for sure it can be configured into ~/.my.cnf like</div><div><br /></div><blockquote class="webkit-indent-blockquote" style="margin-bottom: 0px; margin-left: 40px; border-style: initial; border-color: initial; border-width: initial; border-color: initial; "><div><div>[mysql]</div><div>pager=less -inFX</div><div>prompt='(\u@\h) [\d]&gt; '</div></div></blockquote><br /><div>Thanks for Alex who sharing it.</div></div></span>]]>
        
    </content>
</entry>

<entry>
    <title>BerkeleyDB</title>
    <link rel="alternate" type="text/html" href="http://blog.fayland.org/2011/06/berkeleydb.html" />
    <id>tag:blog.fayland.org,2011://2.7</id>

    <published>2011-06-11T13:03:58Z</published>
    <updated>2011-06-11T13:37:29Z</updated>

    <summary><![CDATA[BerkeleyDB is quit popular and nice to use.there is one interesting article from&nbsp;The Architecture of Open Source Applications&nbsp;worth reading:&nbsp;http://www.aosabook.org/en/bdb.htmlBerkeleyDB is not available under Windows. and usually you can use apt-get or yum to install it on Linux, eg: $ sudo&nbsp;apt-get...]]></summary>
    <author>
        <name>Fayland Lam</name>
        
    </author>
    
    <category term="berkeleydb" label="BerkeleyDB" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="fork" label="fork" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.fayland.org/">
        <![CDATA[<a href="http://search.cpan.org/perldoc?BerkeleyDB">BerkeleyDB</a> is quit popular and nice to use.<div><br /></div><div>there is one interesting article from&nbsp;<u>The Architecture of Open Source Applications</u>&nbsp;worth reading:&nbsp;<a href="http://www.aosabook.org/en/bdb.html" style="text-decoration: underline; ">http://www.aosabook.org/en/bdb.html</a></div><div><br /></div><div>BerkeleyDB is not available under Windows. and usually you can use apt-get or yum to install it on Linux, eg: $ sudo&nbsp;apt-get install libberkeleydb-perl</div><div><br /></div><div>all the modules are usually down to "When to use it?" and "How to use it?".</div><div><br /></div><div>BerkeleyDB is suitable when you meet:</div><div>1. you have a VERY big file and you want&nbsp;manipulate it like remove duplication lines or sort on string inside each line. but you don't have enough memory.</div><div>2. you want to share data in 'forks'. that can be an option.</div><div>3. and more ...</div><div><br /></div><div><b>Case A</b>: you have enough disk, but limited memory</div><div><br /></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div>use FindBin qw/$Bin/;</div><div>use BerkeleyDB;</div></div><div><br /></div><div>my $berkeleydb_temp_file = "$Bin/tmp.berkeleydb"; # temp file for BerkeleyDB</div><div><div>tie my %data, 'BerkeleyDB::Hash',</div><div>&nbsp; &nbsp; -Filename =&gt; $berkeleydb_temp_file,</div><div>&nbsp; &nbsp; -Flags &nbsp; &nbsp;=&gt; DB_CREATE|DB_TRUNCATE</div><div>&nbsp; &nbsp; &nbsp; &nbsp; or die "Cannot create file: $! $BerkeleyDB::Error\n";</div></div><div><div>open(my $fh, '&lt;', 'RealBigFile.log') or die "Can't open: $!";</div><div>while (my $line = &lt;$fh&gt;) {</div></div><div>&nbsp; &nbsp; ## some code that %data will be a real very big hash</div><div>&nbsp; &nbsp; ## we just need the first line and the last line which matches the $pattern</div><div>&nbsp; &nbsp; my $pattern = get_pattern($line);</div><div>&nbsp; &nbsp; if (exists $data{"start_$pattern"}) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; $data{"end_$pattern"} = $line;</div><div>&nbsp; &nbsp; } else {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; $data{"start_$pattern"} = $line;</div><div>&nbsp; &nbsp; }</div><div>}</div><div>close($fh);</div><div># now working on the %data</div><div><br /></div></blockquote><b>Case B</b>: in forks<div>I shared some thoughts on <a href="http://blog.fayland.org/2011/01/tips-around-parallelforkmanager.html">tips around Parallel::ForkManager</a>&nbsp;previously. in that article, I suggested&nbsp;Parallel::Scoreboard and Cache::FastMmap. but really,&nbsp;BerkeleyDB is a good choice too.</div><div><br /></div><div>but that's not so easy to write the correct code from the first glance. if you don't use&nbsp;cds_lock, you may get some wrong results. I wrote two tests (hosted on github):</div><div><a href="https://github.com/fayland/fayland.org/blob/master/blogs/wrong-forks-BerkeleyDB.t">https://github.com/fayland/fayland.org/blob/master/blogs/wrong-forks-BerkeleyDB.t</a></div><div><a href="https://github.com/fayland/fayland.org/blob/master/blogs/right-forks-BerkeleyDB.t">https://github.com/fayland/fayland.org/blob/master/blogs/right-forks-BerkeleyDB.t</a></div><div><br /></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div>fayland@fayland:~/git/fayland.org/blogs$ perl right-forks-BerkeleyDB.t</div><div>ok 1</div><div>1..1</div><div>fayland@fayland:~/git/fayland.org/blogs$ perl wrong-forks-BerkeleyDB.t</div><div>not ok 1</div><div># &nbsp; Failed test at wrong-forks-BerkeleyDB.t line 30.</div><div># &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;got: '656'</div><div># &nbsp; &nbsp; expected: '1000'</div><div>1..1</div><div># Looks like you failed 1 test of 1.</div><div>fayland@fayland:~/git/fayland.org/blogs$ perl right-forks-BerkeleyDB.t</div><div>ok 1</div><div>1..1</div><div>fayland@fayland:~/git/fayland.org/blogs$ perl wrong-forks-BerkeleyDB.t</div><div>not ok 1</div><div># &nbsp; Failed test at wrong-forks-BerkeleyDB.t line 30.</div><div># &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;got: '661'</div><div># &nbsp; &nbsp; expected: '1000'</div><div>1..1</div><div># Looks like you failed 1 test of 1.</div></div></blockquote><br /><div>without the lock, you may get some weird results.</div><div><br /></div><div>snippets code below:</div><div><br /></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div><div>my $env = new BerkeleyDB::Env</div><div>&nbsp; &nbsp; -Home &nbsp; =&gt; $tmp_dir,</div><div>&nbsp; &nbsp; -Flags &nbsp;=&gt; DB_CREATE|DB_INIT_CDB|DB_INIT_MPOOL</div><div>&nbsp; &nbsp; &nbsp; &nbsp; or die "cannot open environment: $BerkeleyDB::Error\n";</div></div><div><div>my $db = tie my %data, 'BerkeleyDB::Hash',</div><div>&nbsp; &nbsp; -Filename =&gt; $berkeleydb_temp_file,</div><div>&nbsp; &nbsp; -Flags &nbsp; &nbsp;=&gt; DB_CREATE,</div><div>&nbsp; &nbsp; -Env &nbsp; &nbsp; &nbsp;=&gt; $env</div><div>&nbsp; &nbsp; &nbsp; &nbsp; or die "Cannot create file: $! $BerkeleyDB::Error\n";</div></div><div><br /></div><div>my $lock = $db-&gt;cds_lock();</div><div>$data{$i} = $i * 2;</div><div>$db-&gt;db_sync();</div><div>$lock-&gt;cds_unlock();</div></div><div><br /></div></blockquote>BerkeleyDB is not only for Hash, it also supports&nbsp;Btree,&nbsp;Recno,&nbsp;Queue and others.<div><br /></div><div>I hope it helps when you meet same issues in your daily life.</div><div><br /></div><div>Enjoy, Thanks</div>]]>
        
    </content>
</entry>

</feed>

