niceperl's Journal
http://use.perl.org/~niceperl/journal/
niceperl's use Perl Journalen-ususe Perl; is Copyright 1998-2006, Chris Nandor. Stories, comments, journals, and other submissions posted on use Perl; are Copyright their respective owners.2012-02-09T13:10:35+00:00pudgepudge@perl.orgTechnologyhourly11970-01-01T00:00+00:00niceperl's Journalhttp://use.perl.org/images/topics/useperl.gif
http://use.perl.org/~niceperl/journal/
fibonacci numbers
http://use.perl.org/~niceperl/journal/37432?from=rss
<tt>I wrote a small script in Perl to calc the N first terms of Fibonacci serie:<br><br>#-- fibo script<br><br>sub fibo {<br> return 1 if( $_[0] < 2 )<nobr> <wbr></nobr>;<br> return fibo($_[0]-1) + fibo($_[0]-2);<br>}<br><br>for($i=0; $i<=40; $i++) {<br> $f = fibo($i);<br> print "$i : $f\n";<br>}<br><br>#-- eof fibo.pl<br><br>I tried to calc the first 40 numbers, it tooks in my PC about 16 minutes. I weren't worried about writting a fast algoritm, just curious about the performance of a recursive call algorithm.<br><br>A friend of me, advertised me that the similar Java version code, ran fast, so I tried:<br><br>// Java fibonnaci class<br><br>class fibo {<br><br> public static long calc(long x) {<br> if( x < 2 ) return 1;<br> return calc(x-1) + calc(x-2);<br> }<br><br> public static void main(String s[]) {<br> for(int i=0; i<=40; i++) {<br> System.out.println(i + " : " + calc(i));<br> }<br> }<br>}<br>// EOF Java fibonnaci class<br><br>----------------------------<br>The results (40 terms calc):<br>1) Perl: 16 minutes<br>2) Java: 16 seconds (!)<br><br>I'm sure that Java does some kind of optimization at the Virtual Machine.<br>I hope that Parrot team will be able to make a very fast virtual machine...</tt>niceperl2008-09-13T09:53:40+00:00journalPerl Message System
http://use.perl.org/~niceperl/journal/36461?from=rss
I used JMS (Java Message System) in order to provide async message communication between applications. It supports other key features like persistence and transanctions. <br> <br>
I always ask myself why there is no equivalent PMS - Perl Message System in the Perl World.niceperl2008-05-18T18:48:36+00:00journalPerl ORM
http://use.perl.org/~niceperl/journal/36382?from=rss
I have used Perl DBI and sometimes SQL::Abstract for data-layer. I'd like start to use DBIx::Class or Rose::DB (not decided yet), but I'm not sure about the tunning facilities of this ORM's.
<br>
Sometimes, we have complex (very complex) querys writed with no standar SQL (i.e. Oracle rules for using concrete indexes, or PL/SQL calls, etc).
<br> <br>
DBI works well for us, perhaps ORM fails in this concrete scenario.niceperl2008-05-11T06:44:56+00:00journalFirst note
http://use.perl.org/~niceperl/journal/36373?from=rss
Hi, this is my first note at this journal. I use Perl every day at my work, it's great and nice. I hope next years our favourite language will add amazing new features, modules and frameworks; I'm sure if all of us help.
<br>
<tt>
print "my hello world!\n";
</tt>niceperl2008-05-09T20:56:23+00:00journal