From jhannah at omnihotels.com Mon May 1 11:42:05 2006 From: jhannah at omnihotels.com (Jay Hannah) Date: Mon, 1 May 2006 13:42:05 -0500 Subject: [Omaha.pm] Validating XML Messages with Perl on Linux/Unix Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B04432C31@exchange2k3.omnihotels.net> Neat... Any XML gurus lurking in the Omaha Perl Mongers? j -----Original Message----- From: OTA-Impl-Forum at googlegroups.com [mailto:OTA-Impl-Forum at googlegroups.com] On Behalf Of Stephen Adkins Sent: Saturday, April 22, 2006 11:36 PM To: OTA-Impl-Forum at googlegroups.com Subject: [OTA-Impl-Forum] Validating XML Messages with Perl on Linux/Unix Hi, I found an interesting utility on CPAN to validate XML files: XML-Validate. It will validate with XML::LibXML (which is built on Gnome's libxml2, see http://xmlsoft.org/), with XML::Xerces (which I described how to install in a previous post, and see http://xml.apache.org/xerces-c/), or with MSXML (if on Windows), whichever is installed. Assuming that you have installed XML::Xerces as per the earlier post and the OTA specification files as per another post, you can get validation going with the following commands. INSTALL XML::Validate su - perl -MCPAN -e "install XML::Validate" exit VALIDATE THE SAMPLES cd $HOME mkdir tmp cd tmp cp $PREFIX/share/ota/2005B/schema/*.xsd . cp $PREFIX/share/ota/2005B/samples/*.xml . validxml.pl OTA_VehResRQ.xml for file in *.xml do validxml.pl $file done Stephen --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "OTA Implementers Forum" group. To post to this group, send email to OTA-Impl-Forum at googlegroups.com To unsubscribe from this group, send email to OTA-Impl-Forum-unsubscribe at googlegroups.com For more options, visit this group at http://groups.google.com/group/OTA-Impl-Forum -~----------~----~----~----~------~----~------~--~--- From jay at jays.net Tue May 2 03:28:47 2006 From: jay at jays.net (Jay Hannah) Date: Tue, 02 May 2006 05:28:47 -0500 Subject: [Omaha.pm] next meeting In-Reply-To: <9ac12b1c0604301541k57e28e34l9905b5ab7a7bf53c@mail.gmail.com> References: <9ac12b1c0604301541k57e28e34l9905b5ab7a7bf53c@mail.gmail.com> Message-ID: <4457345F.1040005@jays.net> Dave M wrote: > I had time to kill this morning, so I took the "nextmtg" script > (informs you of the next pm meeting) from the front page > (http://omaha.pm.org/nextmtg_pl.txt) and turned it into a gui. > > Attached is also an rpm which should work with any Fedora/RH system. > Note that you may have to install a few modules (Gtk2, Gnome2) if > you're interested. It's not fully tested, but at least appears to > work. It doesn't need Fedora, though - it can be run manually. I don't run X-Windows anywhere. Can you post a screen shot? (Or an OS X Widget? -grin-) I've been meaning to rewrite the Date::Calc stuff in that script into Class::Date, but haven't gotten around to it. > This program reminded me that unfortunately I'll be out of town during > the next meeting... Sorry to hear that. Hope you can make it out soon! j From dave.nerd at gmail.com Tue May 2 14:26:13 2006 From: dave.nerd at gmail.com (Dave M) Date: Tue, 2 May 2006 16:26:13 -0500 Subject: [Omaha.pm] next meeting In-Reply-To: <4457345F.1040005@jays.net> References: <9ac12b1c0604301541k57e28e34l9905b5ab7a7bf53c@mail.gmail.com> <4457345F.1040005@jays.net> Message-ID: <9ac12b1c0605021426l184af3f4j7e33495aaa48e4de@mail.gmail.com> On 5/2/06, Jay Hannah wrote: > Dave M wrote: > > I had time to kill this morning, so I took the "nextmtg" script > > (informs you of the next pm meeting) from the front page > > (http://omaha.pm.org/nextmtg_pl.txt) and turned it into a gui. > > > > Attached is also an rpm which should work with any Fedora/RH system. > > Note that you may have to install a few modules (Gtk2, Gnome2) if > > you're interested. It's not fully tested, but at least appears to > > work. It doesn't need Fedora, though - it can be run manually. > > I don't run X-Windows anywhere. Can you post a screen shot? (Or > an OS X Widget? -grin-) See attached. > > I've been meaning to rewrite the Date::Calc stuff in that script into Class::Date, but haven't gotten around to it. I took some liberties with what was there so it would come out in a format that Gtk2::Calendar would accept. Most of the script is still intact, although now in the form of a subroutine. > > > This program reminded me that unfortunately I'll be out of town during > > the next meeting... > > Sorry to hear that. Hope you can make it out soon! > > j > Looking forward to it! :) -------------- next part -------------- A non-text attachment was scrubbed... Name: shots.tar.gz Type: application/x-gzip Size: 42991 bytes Desc: not available Url : http://mail.pm.org/pipermail/omaha-pm/attachments/20060502/202f81fe/attachment-0001.gz From jay at jays.net Tue May 2 17:57:53 2006 From: jay at jays.net (Jay Hannah) Date: Tue, 02 May 2006 19:57:53 -0500 Subject: [Omaha.pm] next meeting In-Reply-To: <9ac12b1c0605021426l184af3f4j7e33495aaa48e4de@mail.gmail.com> References: <9ac12b1c0604301541k57e28e34l9905b5ab7a7bf53c@mail.gmail.com> <4457345F.1040005@jays.net> <9ac12b1c0605021426l184af3f4j7e33495aaa48e4de@mail.gmail.com> Message-ID: <44580011.7080707@jays.net> Dave M wrote: >> I don't run X-Windows anywhere. Can you post a screen shot? (Or >> an OS X Widget? -grin-) > > See attached. Slick. Maybe you could map the whole ITinOmaha.org database? Talk them into providing an XML dump like their FAQs says. :) http://omaha.pm.org/kwiki/index.cgi?OmahaUserGroups >> I've been meaning to rewrite the Date::Calc stuff in that script into >> Class::Date, but haven't gotten around to it. > > I took some liberties with what was there so it would come out in a > format that Gtk2::Calendar would accept. Most of the script is still > intact, although now in the form of a subroutine. New and improved: http://omaha.pm.org/nextmtg_pl.txt :) j From dave.nerd at gmail.com Tue May 2 18:08:47 2006 From: dave.nerd at gmail.com (Dave M) Date: Tue, 2 May 2006 20:08:47 -0500 Subject: [Omaha.pm] next meeting In-Reply-To: <44580011.7080707@jays.net> References: <9ac12b1c0604301541k57e28e34l9905b5ab7a7bf53c@mail.gmail.com> <4457345F.1040005@jays.net> <9ac12b1c0605021426l184af3f4j7e33495aaa48e4de@mail.gmail.com> <44580011.7080707@jays.net> Message-ID: <9ac12b1c0605021808x2cc4414btd396c0b04b8d60e@mail.gmail.com> On 5/2/06, Jay Hannah wrote: > Dave M wrote: > >> I don't run X-Windows anywhere. Can you post a screen shot? (Or > >> an OS X Widget? -grin-) > > > > See attached. > > Slick. Maybe you could map the whole ITinOmaha.org database? Talk them into providing an XML dump like their FAQs says. :) > > http://omaha.pm.org/kwiki/index.cgi?OmahaUserGroups hmmm. I wonder how hard that would be? That would be a great learning experience for me as well... and a nice break from the usual things I work on. Guess I'll ask them about the XML dump first (http://itinomaha.org/index.php/faqs/#22). > > >> I've been meaning to rewrite the Date::Calc stuff in that script into > >> Class::Date, but haven't gotten around to it. > > > > I took some liberties with what was there so it would come out in a > > format that Gtk2::Calendar would accept. Most of the script is still > > intact, although now in the form of a subroutine. > > New and improved: > > http://omaha.pm.org/nextmtg_pl.txt Nice. I'll work that into version 0.02. :) > > :) > > j > > > _______________________________________________ > Omaha-pm mailing list > Omaha-pm at pm.org > http://mail.pm.org/mailman/listinfo/omaha-pm > From jay at jays.net Wed May 3 14:55:14 2006 From: jay at jays.net (Jay Hannah) Date: Wed, 03 May 2006 16:55:14 -0500 Subject: [Omaha.pm] [Fwd: Re: [pm_groups] Calculate next meeting date] Message-ID: <445926C2.9070008@jays.net> -laugh- !! j -------- Original Message -------- Subject: Re: [pm_groups] Calculate next meeting date Date: Tue, 2 May 2006 20:28:50 -0600 From: Marcelo E. Magall?n To: pm_groups at pm.org References: <445802EC.5030102 at jays.net> On 5/2/06, Jay Hannah wrote: > This is a pretty slick combination of Date::Calc and Class::Date, IMHO: Cute... > Anyone have a tighter version? :) Are you seriously asking for golf? Fooooooore! --------------------------------- 8< --------------------------------- #!/usr/bin/perl -l use strict; # just for the fun of ... use warnings; # ... making golf funnier use POSIX qw/mktime/; my $target_wday = shift; # 0 is Sunday my $target_index = shift; # 1 is the first, 2 the second, ... my ($d, $m, $y, $first, $day) = (localtime)[3..5]; for (0 .. 1) { $first = (localtime mktime(0, 0, 0, 0, $m, $y))[6]; $day = 7*($target_index-1)+1+(6-$first+$target_wday)%7; $day < $d ? $m++ : last; } print scalar localtime mktime(0, 0, 0, $day, $m, $y); --------------------------------- >8 --------------------------------- Not really golf, but it's going that way... Marcelo -- Request pm.org Technical Support via support at pm.org pm_groups mailing list pm_groups at pm.org http://mail.pm.org/mailman/listinfo/pm_groups From jay at jays.net Wed May 3 14:59:48 2006 From: jay at jays.net (Jay Hannah) Date: Wed, 03 May 2006 16:59:48 -0500 Subject: [Omaha.pm] [pm_groups] Calculate next meeting date Message-ID: <445927D4.3060307@jays.net> :) j -------- Original Message -------- From: Flavio S. Glock To: Jay Hannah CC: pm_groups at pm.org Jay Hannah wrote: > This is a pretty slick combination of Date::Calc and Class::Date, IMHO: > > http://omaha.pm.org/nextmtg_pl.txt > > (In action: http://omaha.pm.org) > > Anyone have a tighter version? :) ---- #!/usr/bin/perl # # Our meetings are held the 2nd Tuesday of every month. Figure out when # the next meeting is. use DateTime; use DateTime::Event::ICal; my $set = DateTime::Event::ICal->recur( freq => 'monthly', byday => '2tu', ); my $dt = DateTime->today; my $dt_next = $set->next( $dt ); print $dt_next; ---- - Flavio S. Glock From jay at jays.net Wed May 3 15:00:29 2006 From: jay at jays.net (Jay Hannah) Date: Wed, 03 May 2006 17:00:29 -0500 Subject: [Omaha.pm] [pm_groups] Calculate next meeting date Message-ID: <445927FD.7020302@jays.net> :) j -------- Original Message -------- Subject: Re: [pm_groups] Calculate next meeting date Date: Wed, 03 May 2006 16:37:35 +0200 From: Harald Joerg To: pm_groups at pm.org References: <445802EC.5030102 at jays.net> Jay Hannah writes: > This is a pretty slick combination of Date::Calc and Class::Date, IMHO: > > http://omaha.pm.org/nextmtg_pl.txt > > (In action: http://omaha.pm.org) > > Anyone have a tighter version? :) At Munich.pm, we're meeting at the third wednesday in odd months. We had an internal perlgolf competition about that, and this has been the winner (the task was to output the *two* next meetings in ISO format): ($/,$%,$.,$-)=(gmtime($^T+=86400))[3..6]while($/-18)/4|$%%2|$--3||++$"&printf 1900+$.."-%02d-$/\n",++$% On the last meeting it has been shortened by some bytes in a collaborative effort, but I seem to have lost the results. -- Cheers, haj (Munich.pm) -- Request pm.org Technical Support via support at pm.org pm_groups mailing list pm_groups at pm.org http://mail.pm.org/mailman/listinfo/pm_groups From jay at jays.net Wed May 3 15:01:23 2006 From: jay at jays.net (Jay Hannah) Date: Wed, 03 May 2006 17:01:23 -0500 Subject: [Omaha.pm] [Fwd: Re: [pm_groups] Calculate next meeting date] Message-ID: <44592833.6020702@jays.net> Ya, someone explain this one to me!! j -------- Original Message -------- Subject: Re: [pm_groups] Calculate next meeting date From: Jerome Quelin To: Jay Hannah CC: pm_groups at pm.org On 06/05/02 20:10 -0500, Jay Hannah wrote: > This is a pretty slick combination of Date::Calc and Class::Date, IMHO: > http://omaha.pm.org/nextmtg_pl.txt not sure it's what you want to hear, but lyon.pm's monthly meeting, held every last thursday, is computed as: $ LC_ALL=C cal | perl -aple '$x=$F[4]||$x}{$_=$x' regards, jerome -- jquelin at gmail.com From jay at jays.net Wed May 3 15:10:03 2006 From: jay at jays.net (Jay Hannah) Date: Wed, 03 May 2006 17:10:03 -0500 Subject: [Omaha.pm] [Fwd: O'Reilly UG Program News: DSUG Discount Changes] Message-ID: <44592A3B.3070805@jays.net> Discount code "DSUG" gives you 30%-35% off on oreilly.com. (O'Reilly has contributed many books to our book library for free, hence the plug.) j -------- Original Message -------- Subject: O'Reilly UG Program News: DSUG Discount Changes Date: Wed, 03 May 2006 12:16:34 -0700 From: Marsee Henon To: jay at jays.net Hello, Can you please let your members know about the increase in our user group discount? You can post this to your mailing list, web site, or in your newsletter and please make sure you mention this at your next meeting. Get 30% off a single book or 35% off two or more books from O'Reilly, No Starch, Paraglyph, PC Publishing, Pragmatic Bookshelf, SitePoint, or Syngress books you purchase directly from O'Reilly. Just use code DSUG when ordering online or by phone 800-998-9938. Free ground shipping on orders $29.95 or more in the US. Other benefits you receive when you buy directly from O'Reilly include: *100% Satisfaction Guarantee* If, for any reason, you're not completely satisfied with your purchase, return it to us and get your money back. A return shipping label is included with every direct purchase, and directions are posted online in case you've misplaced it: . *Safari Enabled* Whenever possible, our books are "Safari Enabled." This means you can access your book for free online for 45 days through the O'Reilly Safari Bookshelf. How do you know if your book is Safari Enabled? Turn your book over and look for the "Safari Enabled" logo on the bottom right of the page. If it's there, flip through the last couple pages of your book until you find directions for accessing your book online. *Booktech* Have a question about your book? O'Reilly is the only publisher that offers tech support for books. Send an email to and we'll help you out. Be specific: Include the book title and page number. It's also a good idea to include the ISBN so we know what edition you have. *Reader Reviews* Our reader reviews are read by most people at O'Reilly, including Tim O'Reilly, all our editors, as well as sales, marketing, and PR. So if you have praise, a gripe, or ideas for improvement, writing a reader review on oreilly.com is a sure way for your voice to be heard. Just go to your book's catalog page on oreilly.com and click the "Write a Review" button. *Book Registration* Register your book online and we'll notify you when the book has been updated or a new edition is available. You can also win books and other prizes. Haven't registered your books? Just go to . *Newsletters* Our newsletters keep you updated on the latest articles, books, news, and events. A complete list of newsletters and lists can be found at . We're working on a slew of additional benefits to serve you even better so stay tuned. As always, thanks for your help spreading the word. Marsee Henon ================================================================ O'Reilly 1005 Gravenstein Highway North Sebastopol, CA 95472 http://ug.oreilly.com/ http://ug.oreilly.com/creativemedia/ ================================================================ From jhannah at omnihotels.com Fri May 5 11:54:26 2006 From: jhannah at omnihotels.com (Jay Hannah) Date: Fri, 5 May 2006 13:54:26 -0500 Subject: [Omaha.pm] Next Meeting: Tue, 09 May 2006 @ 7pm! Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B04432C71@exchange2k3.omnihotels.net> http://omaha.pm.org/ Meetings are held here: Reboot the User (RTU) 13416 A Street Omaha, NE 68144 (402) 933-6449 Lost? Jay's mobile phone: 402-578-3976 Meetings are sponsored by Paragon IT Professionals. Thanks Chad Hendren! Free food is good! j From jhannah at omnihotels.com Tue May 9 07:36:46 2006 From: jhannah at omnihotels.com (Jay Hannah) Date: Tue, 9 May 2006 09:36:46 -0500 Subject: [Omaha.pm] FW: reflection examples needed Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B04432CA2@exchange2k3.omnihotels.net> Wow. Anyone Perl + .NET gurus feeling saucy enough to tackle that one? Grin, j -----Original Message----- From: Bergners, Andrei Sent: Tuesday, May 09, 2006 6:44 AM To: perl.net at listserv.ActiveState.com Subject: reflection examples needed Hi, Does anyone have any examples of Perl code which can load .NET assemblies and perform some reflection on them (eg., to query manifest information). As a first project in PerlNet I want to do strong name verification on assemblies that we build. thanks andrei From ryan at cfwebtools.com Tue May 9 08:21:46 2006 From: ryan at cfwebtools.com (Ryan Stille) Date: Tue, 09 May 2006 10:21:46 -0500 Subject: [Omaha.pm] meeting topic? Message-ID: <4460B38A.4090005@cfwebtools.com> What is the meeting topic tonight? Sorry if it was already posted and I missed it, I went through my inbox but didn't find anything. -Ryan From jhannah at omnihotels.com Wed May 10 11:34:31 2006 From: jhannah at omnihotels.com (Jay Hannah) Date: Wed, 10 May 2006 13:34:31 -0500 Subject: [Omaha.pm] Devel::Timer Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B04432CC7@exchange2k3.omnihotels.net> Ooo... I need one of these today. New toy! http://search.cpan.org/~jmoore/Devel-Timer-0.01/Timer.pm I love how every time I have a "wouldn't it be great if" idea someone has written it already and put it in CPAN. j From mat at phpconsulting.com Wed May 10 12:55:23 2006 From: mat at phpconsulting.com (Mat Caughron) Date: Wed, 10 May 2006 14:55:23 -0500 Subject: [Omaha.pm] Devel::Timer useful for MySQL performance tuning In-Reply-To: <29AB736ABCE5C745ABF9C93B02F2C27B04432CC7@exchange2k3.omnihotels.net> References: <29AB736ABCE5C745ABF9C93B02F2C27B04432CC7@exchange2k3.omnihotels.net> Message-ID: <20060510145044.N14767@.cucpbafhygvat> Jay et al: The MySQL TIMESTAMP doesn't really go beyond seconds (there are some hacks for milliseconds but that also isn't likely to be good enough) which makes performance tuning with native SQL difficult at best. So the next best thing would be to break complex queries into pieces and let your application handle high-res time resolution for each beginning and ending each piece. ( http://dev.mysql.com/doc/refman/5.0/en/time.html ) Thanks for pointing this one out! Mat Caughron On Wed, 10 May 2006, Jay Hannah wrote: > Ooo... I need one of these today. New toy! > > http://search.cpan.org/~jmoore/Devel-Timer-0.01/Timer.pm > > I love how every time I have a "wouldn't it be great if" idea someone > has written it already and put it in CPAN. > > j > > _______________________________________________ > Omaha-pm mailing list > Omaha-pm at pm.org > http://mail.pm.org/mailman/listinfo/omaha-pm > From jhannah at omnihotels.com Wed May 10 13:11:00 2006 From: jhannah at omnihotels.com (Jay Hannah) Date: Wed, 10 May 2006 15:11:00 -0500 Subject: [Omaha.pm] OSCON 2006 Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B04432CC9@exchange2k3.omnihotels.net> http://conferences.oreillynet.com/pub/w/46/sessions.html Wow. Sweet. I'm going! Yay! j From joshua.mcadams at gmail.com Wed May 10 13:25:48 2006 From: joshua.mcadams at gmail.com (Joshua McAdams) Date: Wed, 10 May 2006 16:25:48 -0400 Subject: [Omaha.pm] OSCON 2006 In-Reply-To: <29AB736ABCE5C745ABF9C93B02F2C27B04432CC9@exchange2k3.omnihotels.net> References: <29AB736ABCE5C745ABF9C93B02F2C27B04432CC9@exchange2k3.omnihotels.net> Message-ID: <49d805d70605101325p17457af7v97f0e5ad8bd2b4fe@mail.gmail.com> > http://conferences.oreillynet.com/pub/w/46/sessions.html > > Wow. Sweet. I'm going! Yay! More importantly, are you going here: http://yapcchicago.org/the-schedule/full-schedule ... Sorry, I just had to do it :) From andy at petdance.com Wed May 10 13:55:48 2006 From: andy at petdance.com (Andy Lester) Date: Wed, 10 May 2006 15:55:48 -0500 Subject: [Omaha.pm] OSCON 2006 In-Reply-To: <29AB736ABCE5C745ABF9C93B02F2C27B04432CC9@exchange2k3.omnihotels.net> References: <29AB736ABCE5C745ABF9C93B02F2C27B04432CC9@exchange2k3.omnihotels.net> Message-ID: <78A12887-F1B5-4526-A3B2-79C4A82D688E@petdance.com> On May 10, 2006, at 3:11 PM, Jay Hannah wrote: > http://conferences.oreillynet.com/pub/w/46/sessions.html > > Wow. Sweet. I'm going! Yay! Is there something on that page we should be seeing? Are you speaking? xoa -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20060510/3d578e9a/attachment.html From jay at jays.net Thu May 11 05:42:52 2006 From: jay at jays.net (Jay Hannah) Date: Thu, 11 May 2006 07:42:52 -0500 Subject: [Omaha.pm] OSCON 2006 In-Reply-To: <78A12887-F1B5-4526-A3B2-79C4A82D688E@petdance.com> References: <29AB736ABCE5C745ABF9C93B02F2C27B04432CC9@exchange2k3.omnihotels.net> <78A12887-F1B5-4526-A3B2-79C4A82D688E@petdance.com> Message-ID: <4463314C.8070208@jays.net> Andy Lester wrote: >> http://conferences.oreillynet.com/pub/w/46/sessions.html >> http://yapcchicago.org/the-schedule/full-schedule > > Is there something on that page we should be seeing? Are you speaking? No, I was just grunting and drooling over all the cool sessions. YAPC looks great too! j From jhannah at omnihotels.com Thu May 11 09:25:22 2006 From: jhannah at omnihotels.com (Jay Hannah) Date: Thu, 11 May 2006 11:25:22 -0500 Subject: [Omaha.pm] [patch] Devel::Timer Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B04432CDA@exchange2k3.omnihotels.net> Hi Jason -- I just discovered Devel::Timer. I love it! Thanks for putting it on CPAN! I'm trying to use it for timing some critical junctures in some of my enormous programs. The problem I was having is that my combinations of marks are hit dozens or hundreds of times as the program interates. That makes the report() output pages and pages long, and not very useful. So I added a couple new report() features. :) Here's a sample program for you to see what my patch does: --- $ cat j.pl #!/usr/bin/perl use Devel::Timer; my $t = Devel::Timer->new(); for (1..3) { $t->mark("something begin"); sleep $_; $t->mark("something end"); } sleep 1; $t->mark("END"); print "\$t->report;\n\n"; $t->report; print "\n\n"; print "\$t->report(collapse => 1);\n\n"; $t->report(collapse => 1); print "\n\n"; print "\$t->report(collapse => 1, sort_by => 'count');\n\n"; $t->report(collapse => 1, sort_by => 'count'); --- Simple enough. The standard report() looks like this: $t->report; Devel::Timer Report -- Total time: 7.0028 secs Interval Time Percent ---------------------------------------------- 05 -> 06 3.0006 42.85% something begin -> something end 03 -> 04 2.0007 28.57% something begin -> something end 06 -> 07 1.0009 14.29% something end -> END 01 -> 02 1.0004 14.29% something begin -> something end 00 -> 01 0.0000 0.00% INIT -> something begin 04 -> 05 0.0000 0.00% something end -> something begin 02 -> 03 0.0000 0.00% something end -> something begin Which is great for small or non-iterative programs, but if there's hundreds of loops of "something begin -> something end" the report gets very painful very quickly. :) So I wrote a collapse feature that people can activate if they want to: $t->report(collapse => 1); Devel::Timer Report -- Total time: 7.0028 secs Count Time Percent ---------------------------------------------- 3 6.0018 85.71% something begin -> something end 1 1.0009 14.29% something end -> END 2 0.0001 0.00% something end -> something begin 1 0.0000 0.00% INIT -> something begin The stats for all combinations of labels are added together. I also added a sort_by feature. By default the report is sorted by total time spent (like the default report()), but you can sort by count instead if you want: $t->report(collapse => 1, sort_by => 'count'); Devel::Timer Report -- Total time: 7.0028 secs Count Time Percent ---------------------------------------------- 3 6.0018 85.71% something begin -> something end 2 0.0001 0.00% something end -> something begin 1 0.0000 0.00% INIT -> something begin 1 1.0009 14.29% something end -> END Pretty neat huh? Awfully handy for me anyway. :) I didn't write any POD yet because I thought you might want to change the interface. My patch is below. Thoughts? Thanks again, j $ diff -ruN Timer_orig.pm Timer.pm --- Timer_orig.pm 2006-05-10 15:43:03.000000000 -0500 +++ Timer.pm 2006-05-11 11:10:36.000000000 -0500 @@ -76,7 +76,7 @@ sub report { - my $self = shift; + my ($self, %args) = @_; ## calculate total time (start time vs last time) @@ -84,9 +84,31 @@ $self->print("\n"); $self->print(ref($self) . " Report -- Total time: " . sprintf("%.4f", $total_time) . " secs"); + + if ($args{collapse}) + { + $self->calculate_collapsed; + + $self->print("Count Time Percent"); + $self->print("----------------------------------------------"); + + my $c = $self->{collapsed}; + my $sort_by = $args{sort_by} || "time"; + my @labels = sort { $c->{$b}->{$sort_by} <=> $c->{$a}->{$sort_by} } keys %$c; + foreach (@labels) + { + my $count = $c->{$_}->{count}; + my $time = $c->{$_}->{time}; + my $msg = sprintf("%8s %.4f %5.2f%% %s", + ($count, $time, (($time/$total_time)*100), $_)); + $self->print($msg); + } + return 1; + } + $self->print("Interval Time Percent"); $self->print("----------------------------------------------"); - + ## sort interval structure based on value @{$self->{intervals}} = sort { $b->{value} <=> $a->{value} } @{$self->{intervals}}; @@ -111,6 +133,23 @@ } } + +sub calculate_collapsed +{ + my ($self) = @_; + + my %collapsed; + foreach my $i (0 .. $self->{count} - 2) + { + my $label = $self->{label}->{$i} . ' -> ' . $self->{label}->{$i + 1}; + my $time = Time::HiRes::tv_interval($self->{times}->[$i], $self->{times}->[$i + 1]); + $collapsed{$label}{time} += $time; + $collapsed{$label}{count}++; + } + $self->{collapsed} = \%collapsed; +} + + ## output methods ## note: if you want to send output to somewhere other than stderr, ## you can override the print() method below. The initialize() From jay at jays.net Fri May 12 05:43:04 2006 From: jay at jays.net (Jay Hannah) Date: Fri, 12 May 2006 07:43:04 -0500 Subject: [Omaha.pm] Unicode Extract In-Reply-To: <5ad2dbbf0604141838mfaea182p884480d4451e6d0c@mail.gmail.com> References: <5ad2dbbf0604141838mfaea182p884480d4451e6d0c@mail.gmail.com> Message-ID: <446482D8.5070101@jays.net> Jon Lonowski wrote: > Is there a method for extracting the unicde value from a one-character string?? > > $int = extuni(substr($char,0,1)); > > substr() to ensure that only one character is passed through. Hey Jon -- Did you get that figured out? Sorry for the resounding silence to your post. I haven't worked with unicode and apparently no one else on this list has either. :) j From jay at jays.net Fri May 12 05:51:17 2006 From: jay at jays.net (Jay Hannah) Date: Fri, 12 May 2006 07:51:17 -0500 Subject: [Omaha.pm] Fwd: Calculate next meeting date Message-ID: <446484C5.8010405@jays.net> :) j -------- Original Message -------- Subject: Re: [pm_groups] Calculate next meeting date Date: Wed, 03 May 2006 13:51:16 +1200 From: Grant McLean (Wellington.PM) On Tue, 2006-05-02 at 20:10 -0500, Jay Hannah wrote: > This is a pretty slick combination of Date::Calc and Class::Date, IMHO: > > http://omaha.pm.org/nextmtg_pl.txt > > (In action: http://omaha.pm.org) > > Anyone have a tighter version? :) How about: use Date::Manip; my $next_month = UnixDate(DateCalc(ParseDate("1st"), "+ 1 month"), "%b %Y"); print ParseDate("2nd Tuesday of $next_month") One part of the Date::Manip POD seemed to suggest that ParseDate() would directly understand a string like "2nd Tuesday of next month", but I couldn't get that to work. Regards Grant From dan at linder.org Sat May 13 22:37:29 2006 From: dan at linder.org (Daniel Linder) Date: Sun, 14 May 2006 00:37:29 -0500 (CDT) Subject: [Omaha.pm] Perl regexp problem... Message-ID: <55007.68.13.86.85.1147585049.squirrel@mail.linder.org> In a program (which supposedly uses Perl for the back-end), it has a filter field that I can define using Perl regexp expressions. For example, this line: ^var1=(?i)(.*)(5705)(.*) will find all lines that begin with "var1=", followed byt any characters, then 5705, then any other characters.? This filter works fine. What I want to do is write a filter that finds the opposite lines; i.e all lines that begin with "var1=" but do not have 5705 in their value.? I tried ^var1=(?i)(.*)(^5705)(.*) but that didn't work... Any ideas?? Dan - - - - "Wait for that wisest of all counselors, time." -- Pericles "I do not fear computers, I fear the lack of them." -- Isaac Asimov "Soon we will be able to harness the rotational energy from Orwell's grave to solve all world energy problems." -- /. user GigsVT (208848) GPG fingerprint:6FFD DB94 7B96 0FD8 EADF 2EE0 B2B0 CC47 4FDE 9B68 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20060514/bd65abe6/attachment.html From andy at petdance.com Sat May 13 23:14:51 2006 From: andy at petdance.com (Andy Lester) Date: Sun, 14 May 2006 01:14:51 -0500 Subject: [Omaha.pm] Perl regexp problem... In-Reply-To: <55007.68.13.86.85.1147585049.squirrel@mail.linder.org> References: <55007.68.13.86.85.1147585049.squirrel@mail.linder.org> Message-ID: <20060514061451.GB7603@petdance.com> On Sun, May 14, 2006 at 12:37:29AM -0500, Daniel Linder (dan at linder.org) wrote: > For example, this line: > > ^var1=(?i)(.*)(5705)(.*) > > will find all lines that begin with "var1=", followed byt any > characters, then 5705, then any other characters.? This filter works > fine. Actually, that breaks down to ^var1= beginning of the line, and then "var1=" (?i) an optional "i" (.*) any string (5705) the string "5705" (.*) any other string The (.*) at the end is useless because it will always match in this case, and at the end of the line, you don't care. > What I want to do is write a filter that finds the opposite lines; i.e all > lines that begin with "var1=" but do not have 5705 in their > value.? I tried > > ^var1=(?i)(.*)(^5705)(.*) > > but that didn't work... That's because the ^ is only negation in a character set, as when you say [^aeiou] to mean "any character except the vowels". Probably the simplest way to do this is to have two regexes. if ( $line =~ /^var1=/ && $line !~ /5705/ ) { This says "If it starts with var1=, and it doesn't match 5705 anywhere", then $line matches. xoa -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From dave.nerd at gmail.com Sun May 14 08:44:45 2006 From: dave.nerd at gmail.com (Dave M) Date: Sun, 14 May 2006 10:44:45 -0500 Subject: [Omaha.pm] benchmark and md5sum Message-ID: <9ac12b1c0605140844p5eca79fbjb0b84a07b5dac7c7@mail.gmail.com> I often use the same md5 subroutine in all my scripts for various reasons. Recently I saw another way to read it in, and it appears to be faster: #!/usr/bin/perl use strict; use warnings; use Benchmark qw/cmpthese/; use Digest::MD5 qw/md5_hex/; $|++; my $dir = '/some/dir'; my @files = glob "$dir/*"; cmpthese( 10, { my_way => sub { foreach my $file (@files) { next if -d $file; open( FH, "<", $file ) or die "blah: $!\n"; my $slurp = do { local $/; }; my $md5sum = Digest::MD5::md5_hex($slurp); # print "md5sum for $file = $md5sum\n"; close(FH); } }, new_way => sub { foreach my $file (@files) { next if -d $file; open( FH, "<", $file ) or die "blah: $!\n"; binmode(FH); my $md5sum = Digest::MD5->new->addfile(*FH)->hexdigest; # print "md5sum for $file = $md5sum\n"; close(FH); } } } ); Which results in this: s/iter my_way other_way my_way 2.04 -- -45% new_way 1.12 82% -- So, besides the fact that I suffer from code-reuse, am I reading this right? I'm not a benchmark guru, but I understand that the results are displayed from slowest to fastest... Dave M From andy at petdance.com Sun May 14 11:57:06 2006 From: andy at petdance.com (Andy Lester) Date: Sun, 14 May 2006 13:57:06 -0500 Subject: [Omaha.pm] benchmark and md5sum In-Reply-To: <9ac12b1c0605140844p5eca79fbjb0b84a07b5dac7c7@mail.gmail.com> References: <9ac12b1c0605140844p5eca79fbjb0b84a07b5dac7c7@mail.gmail.com> Message-ID: On May 14, 2006, at 10:44 AM, Dave M wrote: > I often use the same md5 subroutine in all my scripts for various > reasons. Recently I saw another way to read it in, and it appears to > be faster: The #1 rule of benchmarking is to pull out as much irrelevant stuff as you can. For instance, the check for -d $file should be done outside of the benchmarked functions. It's the same in both functions, and skew your results. What if that check for the directory turns out to be 90% of the runtime in both cases? Other than that, I don't see anything else to pull out, though. You might want to try this: my $slurp = do { local $/; }; my $md5sum = Digest::MD5::md5_hex($slurp); as local $/; my $md5sum = Digest::MD5::md5_hex(); This removes the assignment of a local variable which you're then going to copy. xoa -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20060514/9f2b25fe/attachment.html From dan at linder.org Tue May 16 09:28:09 2006 From: dan at linder.org (Daniel Linder) Date: Tue, 16 May 2006 11:28:09 -0500 (CDT) Subject: [Omaha.pm] Perl regexp problem... In-Reply-To: <20060514061451.GB7603@petdance.com> References: <55007.68.13.86.85.1147585049.squirrel@mail.linder.org> <20060514061451.GB7603@petdance.com> Message-ID: <38931.63.230.40.25.1147796889.squirrel@mail.linder.org> Andy, Thanks for the input.? The original problem came from a co-worker of mine who is limited by the third-party program that? only allows the simple regular expression in a text box, so the loop (which was my first though, too) won't work. If I come up with anything that works I'll be sure to tell everyone. Dan On Sun, May 14, 2006 01:14, Andy Lester wrote: > On Sun, May 14, 2006 at 12:37:29AM -0500, Daniel Linder (dan at linder.org) > wrote: >> For example, this line: >> >> ^var1=(?i)(.*)(5705)(.*) >> >> will find all lines that begin with "var1=", followed byt any >> characters, then 5705, then any other characters. This filter works >> fine. > > Actually, that breaks down to > > ^var1= beginning of the line, and then "var1=" > (?i) an optional "i" > (.*) any string > (5705) the string "5705" > (.*) any other string > > The (.*) at the end is useless because it will always match in this > case, and at the end of the line, you don't care. > > >> What I want to do is write a filter that finds the opposite lines; i.e >> all >> lines that begin with "var1=" but do not have 5705 in their >> value. I tried >> >> ^var1=(?i)(.*)(^5705)(.*) >> >> but that didn't work... > > That's because the ^ is only negation in a character set, as when you > say [^aeiou] to mean "any character except the vowels". > > Probably the simplest way to do this is to have two regexes. > > if ( $line =~ /^var1=/ && $line !~ /5705/ ) { > > This says "If it starts with var1=, and it doesn't match 5705 anywhere", > then $line matches. > > xoa > -- > Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance > - - - - "Wait for that wisest of all counselors, time." -- Pericles "I do not fear computers, I fear the lack of them." -- Isaac Asimov "Soon we will be able to harness the rotational energy from Orwell's grave to solve all world energy problems." -- /. user GigsVT (208848) GPG fingerprint:6FFD DB94 7B96 0FD8 EADF 2EE0 B2B0 CC47 4FDE 9B68 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20060516/d4ab0d86/attachment.html From jay at jays.net Thu May 18 05:56:00 2006 From: jay at jays.net (Jay Hannah) Date: Thu, 18 May 2006 07:56:00 -0500 Subject: [Omaha.pm] [Fwd: User Groups: Apress Spring Newsletter Finally Here!] Message-ID: <446C6EE0.9090702@jays.net> Snipped for Perl content. j 3. Special Offers and Promotions A. eBooks: 1. Did you know you can try FREE eBooks from Apress? Download one here: http://www.apress.com/free/index.html. 2. Are you a Perl user? From May 16 - 31, 2006, you can purchase a limited edition Perl eBook bundle. You get five eBooks for 50 bucks--but hurry, because this deal only lasts for 15 days! http://www.apress.com/promo/perlbundle.html 3. Purchase a select title during the first printing (about six months from publication) and you'll be eligible to receive a free (that's right, FREE) companion eBook! All of our eBooks come in fully searchable PDF form and are sure to be your constant companions for quick code and topic searches. View the list of eligible books here: http://www.apress.com/misc/promo.html. From dan at linder.org Thu May 18 08:19:41 2006 From: dan at linder.org (Daniel Linder) Date: Thu, 18 May 2006 10:19:41 -0500 (CDT) Subject: [Omaha.pm] Detecting interactive console vs. in a script. Message-ID: <59188.63.230.40.25.1147965581.squirrel@mail.linder.org> Has anyone seen a good way to determine if a Perl script is running on an interactive console vs. within a shell or Perl script?? I have a code snippet that I want to print more text to a console for the user to view, but if it is within a script I don't want to clutter its output. On the Solaris system I'm running, I tried the "tty" command, but both return "/dev/pts/8" when called from the command line and within a script.? The closest thing I can come to is the shell variable $_: "-l" for interactive, and "./" if run from a script. Any other ideas? Dan - - - - "Wait for that wisest of all counselors, time." -- Pericles "I do not fear computers, I fear the lack of them." -- Isaac Asimov "Soon we will be able to harness the rotational energy from Orwell's grave to solve all world energy problems." -- /. user GigsVT (208848) GPG fingerprint:6FFD DB94 7B96 0FD8 EADF 2EE0 B2B0 CC47 4FDE 9B68 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20060518/b1ef0f25/attachment.html From andy at petdance.com Thu May 18 08:48:54 2006 From: andy at petdance.com (Andy Lester) Date: Thu, 18 May 2006 10:48:54 -0500 Subject: [Omaha.pm] Detecting interactive console vs. in a script. In-Reply-To: <59188.63.230.40.25.1147965581.squirrel@mail.linder.org> References: <59188.63.230.40.25.1147965581.squirrel@mail.linder.org> Message-ID: On May 18, 2006, at 10:19 AM, Daniel Linder wrote: > Has anyone seen a good way to determine if a Perl script is running > on an interactive console vs. within a shell or Perl script? I > have a code snippet that I want to print more text to a console for > the user to view, but if it is within a script I don't want to > clutter its output. This is covered in detail in the FAQ. $ perldoc -q interactive Found in /System/Library/Perl/5.8.6/pods/perlfaq8.pod How do I find out if I?m running interactively or not? -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From dan at linder.org Thu May 18 14:24:54 2006 From: dan at linder.org (Daniel Linder) Date: Thu, 18 May 2006 16:24:54 -0500 (CDT) Subject: [Omaha.pm] Detecting interactive console vs. in a script. In-Reply-To: References: <59188.63.230.40.25.1147965581.squirrel@mail.linder.org> Message-ID: <57931.63.230.40.25.1147987494.squirrel@mail.linder.org> Thanks -- don't know how my Googl'ing missed that... Guess I won't have to re-invent the wheel. :) Dan On Thu, May 18, 2006 10:48, Andy Lester wrote: > > On May 18, 2006, at 10:19 AM, Daniel Linder wrote: > >> Has anyone seen a good way to determine if a Perl script is running >> on an interactive console vs. within a shell or Perl script? I >> have a code snippet that I want to print more text to a console for >> the user to view, but if it is within a script I don't want to >> clutter its output. > > This is covered in detail in the FAQ. > > $ perldoc -q interactive > > Found in /System/Library/Perl/5.8.6/pods/perlfaq8.pod > How do I find out if I’m running interactively or not? > > > -- > Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance > > > > - - - - "Wait for that wisest of all counselors, time." -- Pericles "I do not fear computers, I fear the lack of them." -- Isaac Asimov "Soon we will be able to harness the rotational energy from Orwell's grave to solve all world energy problems." -- /. user GigsVT (208848) GPG fingerprint:6FFD DB94 7B96 0FD8 EADF 2EE0 B2B0 CC47 4FDE 9B68 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20060518/4819d75a/attachment.html From jhannah at omnihotels.com Fri May 19 08:31:28 2006 From: jhannah at omnihotels.com (Jay Hannah) Date: Fri, 19 May 2006 10:31:28 -0500 Subject: [Omaha.pm] rename, link Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B04432D42@exchange2k3.omnihotels.net> Huh. "perldoc perlfunc": rename OLDNAME,NEWNAME Changes the name of a file; an existing file NEW- NAME will be clobbered. Returns true for success, false otherwise. Behavior of this function varies wildly depending on your system implementation. For example, it will usually not work across file system bound- aries, even though the system mv command sometimes compensates for this. Other restrictions include whether it works on directories, open files, or pre-existing files. Check perlport and either the rename(2) manpage or equivalent system documenta- tion for details. So I wonder if its better to just system() out to "mv" on Linux if I don't care about portability? @sysargs = ('mv', "$outbound/$file", "/datamining/intrasight/CRS/archive"); system (@sysargs); vs rename("$outbound/$file", "/datamining/intrasight/CRS/archive/$file"); ...? And then link OLDFILE,NEWFILE Creates a new filename linked to the old filename. Returns true for success, false otherwise. Is that the same thing as making a system() call to "cp" on Linux? symlink() is for symbolic links, link() is the same thing as "cp"? Or would I be cooler if I just used some File::* class off CPAN nowadays? -grin- j From andy at petdance.com Fri May 19 08:41:53 2006 From: andy at petdance.com (Andy Lester) Date: Fri, 19 May 2006 10:41:53 -0500 Subject: [Omaha.pm] rename, link In-Reply-To: <29AB736ABCE5C745ABF9C93B02F2C27B04432D42@exchange2k3.omnihotels.net> References: <29AB736ABCE5C745ABF9C93B02F2C27B04432D42@exchange2k3.omnihotels.net> Message-ID: > > So I wonder if its better to just system() out to "mv" on Linux if I > don't care about portability? > > @sysargs = ('mv', "$outbound/$file", > "/datamining/intrasight/CRS/archive"); > system (@sysargs); Yes. > > Is that the same thing as making a system() call to "cp" on Linux? > symlink() is for symbolic links, link() is the same thing as "cp"? no, link() is for hard links. > Or would I be cooler if I just used some File::* class off CPAN > nowadays? -grin- File::Copy has been core since 5.002. xoa -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From dave.nerd at gmail.com Fri May 19 10:03:53 2006 From: dave.nerd at gmail.com (Dave M) Date: Fri, 19 May 2006 12:03:53 -0500 Subject: [Omaha.pm] rename, link In-Reply-To: References: <29AB736ABCE5C745ABF9C93B02F2C27B04432D42@exchange2k3.omnihotels.net> Message-ID: <9ac12b1c0605191003n18dcae20h72c6fe2b18560ff6@mail.gmail.com> On 5/19/06, Andy Lester wrote: > > > > So I wonder if its better to just system() out to "mv" on Linux if I > > don't care about portability? > > > > @sysargs = ('mv', "$outbound/$file", > > "/datamining/intrasight/CRS/archive"); > > system (@sysargs); > > Yes. > Andy, Can you explain why it's better than File::Copy's mv? Just curious, that's all. I'm using mv in one of my programs, although for the life of me I can't remember why I decided to use it instead of 'system'. Thanks, Dave From dave.nerd at gmail.com Fri May 19 10:03:53 2006 From: dave.nerd at gmail.com (Dave M) Date: Fri, 19 May 2006 12:03:53 -0500 Subject: [Omaha.pm] rename, link In-Reply-To: References: <29AB736ABCE5C745ABF9C93B02F2C27B04432D42@exchange2k3.omnihotels.net> Message-ID: <9ac12b1c0605191003n18dcae20h72c6fe2b18560ff6@mail.gmail.com> On 5/19/06, Andy Lester wrote: > > > > So I wonder if its better to just system() out to "mv" on Linux if I > > don't care about portability? > > > > @sysargs = ('mv', "$outbound/$file", > > "/datamining/intrasight/CRS/archive"); > > system (@sysargs); > > Yes. > Andy, Can you explain why it's better than File::Copy's mv? Just curious, that's all. I'm using mv in one of my programs, although for the life of me I can't remember why I decided to use it instead of 'system'. Thanks, Dave From andy at petdance.com Fri May 19 10:58:02 2006 From: andy at petdance.com (Andy Lester) Date: Fri, 19 May 2006 12:58:02 -0500 Subject: [Omaha.pm] rename, link In-Reply-To: <9ac12b1c0605191003n18dcae20h72c6fe2b18560ff6@mail.gmail.com> References: <29AB736ABCE5C745ABF9C93B02F2C27B04432D42@exchange2k3.omnihotels.net> <9ac12b1c0605191003n18dcae20h72c6fe2b18560ff6@mail.gmail.com> Message-ID: <320CE675-EAAF-43D9-9E0D-C3C0E1099A3D@petdance.com> > Can you explain why it's better than File::Copy's mv? Just curious, > that's all. I'm using mv in one of my programs, although for the life > of me I can't remember why I decided to use it instead of 'system'. I'm sorry, I misread that. I saw "possible" not "better". -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From jhannah at omnihotels.com Mon May 22 14:02:28 2006 From: jhannah at omnihotels.com (Jay Hannah) Date: Mon, 22 May 2006 16:02:28 -0500 Subject: [Omaha.pm] for loop quickie Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B04432D87@exchange2k3.omnihotels.net> before: for ($j = 0; $j < @row; $j++) { $row[$j] =~ s/[^ -~]//g; $row[$j] =~ s/\|/:/g; } after: for (@row) { s/[^ -~]//g; s/\|/:/g; } j From andy at petdance.com Mon May 22 14:14:24 2006 From: andy at petdance.com (Andy Lester) Date: Mon, 22 May 2006 16:14:24 -0500 Subject: [Omaha.pm] for loop quickie In-Reply-To: <29AB736ABCE5C745ABF9C93B02F2C27B04432D87@exchange2k3.omnihotels.net> References: <29AB736ABCE5C745ABF9C93B02F2C27B04432D87@exchange2k3.omnihotels.net> Message-ID: <095DB7DC-2F40-4E9E-8C69-DCA42BE57141@petdance.com> > > after: > > for (@row) { > s/[^ -~]//g; > s/\|/:/g; > } Beautiful. Getting out of the C mindset of keeping a loop index is one of the big steps into Perl mastery. Note that in this example, there's an implicit $_ being used as the loop variable. You can also make it explicit: for my $entry (@row) { $entry =~ s/...../; } In this case, although it looks like $entry is a temporary variable, and that changes to $entry will get thrown away, that's not the case. $entry is an alias to the iterated variable. xoa -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From kiranbina at gmail.com Mon May 22 19:22:52 2006 From: kiranbina at gmail.com (Dr. Dhundy R. Bastola) Date: Mon, 22 May 2006 21:22:52 -0500 Subject: [Omaha.pm] for loop quickie In-Reply-To: <095DB7DC-2F40-4E9E-8C69-DCA42BE57141@petdance.com> Message-ID: <4472720c.3921b9f6.355c.fffffd1f@mx.gmail.com> I really appreciate when Andy breaks it up and makes people like us feel welcome. I wanted to let you know that you are helping people like me learn well by doing so. Thanks Kiran -----Original Message----- From: omaha-pm-bounces+kiranbina=gmail.com at pm.org [mailto:omaha-pm-bounces+kiranbina=gmail.com at pm.org] On Behalf Of Andy Lester Sent: Monday, May 22, 2006 4:14 PM To: Perl Mongers of Omaha, Nebraska USA Subject: Re: [Omaha.pm] for loop quickie > > after: > > for (@row) { > s/[^ -~]//g; > s/\|/:/g; > } Beautiful. Getting out of the C mindset of keeping a loop index is one of the big steps into Perl mastery. Note that in this example, there's an implicit $_ being used as the loop variable. You can also make it explicit: for my $entry (@row) { $entry =~ s/...../; } In this case, although it looks like $entry is a temporary variable, and that changes to $entry will get thrown away, that's not the case. $entry is an alias to the iterated variable. xoa -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance _______________________________________________ Omaha-pm mailing list Omaha-pm at pm.org http://mail.pm.org/mailman/listinfo/omaha-pm From dan at linder.org Mon May 22 20:47:58 2006 From: dan at linder.org (Daniel Linder) Date: Mon, 22 May 2006 22:47:58 -0500 (CDT) Subject: [Omaha.pm] for loop quickie In-Reply-To: <29AB736ABCE5C745ABF9C93B02F2C27B04432D87@exchange2k3.omnihotels.net> References: <29AB736ABCE5C745ABF9C93B02F2C27B04432D87@exchange2k3.omnihotels.net> Message-ID: <1949.68.13.86.85.1148356078.squirrel@mail.linder.org> On Mon, May 22, 2006 16:02, Jay Hannah wrote: > before: > for ($j = 0; $j < @row; $j++) { > $row[$j] =~ s/[^ -~]//g; > $row[$j] =~ s/\|/:/g; > } > > after: > for (@row) { > s/[^ -~]//g; > s/\|/:/g; > } Ok, Jay -- which one is faster?? I am pretty sure it's the second one, but I'm interested in how much. (Thought I'd ask since you're always benchmarking ...) Dan - - - - "Wait for that wisest of all counselors, time." -- Pericles "I do not fear computers, I fear the lack of them." -- Isaac Asimov "Soon we will be able to harness the rotational energy from Orwell's grave to solve all world energy problems." -- /. user GigsVT (208848) GPG fingerprint:6FFD DB94 7B96 0FD8 EADF 2EE0 B2B0 CC47 4FDE 9B68 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20060522/1177e506/attachment.html From jay at jays.net Tue May 23 03:14:17 2006 From: jay at jays.net (Jay Hannah) Date: Tue, 23 May 2006 05:14:17 -0500 Subject: [Omaha.pm] for loop quickie In-Reply-To: <1949.68.13.86.85.1148356078.squirrel@mail.linder.org> References: <29AB736ABCE5C745ABF9C93B02F2C27B04432D87@exchange2k3.omnihotels.net> <1949.68.13.86.85.1148356078.squirrel@mail.linder.org> Message-ID: <4472E079.6090208@jays.net> Daniel Linder wrote: > Ok, Jay -- which one is faster? I am pretty sure it's the second one, > but I'm interested in how much. > > (Thought I'd ask since you're always benchmarking ...) Looks like "after" is almost twice as efficient... Interesting how my wallclock secs bounced around. I guess my Mac was busy doing something else a couple times. :) j $ cat j.pl use Benchmark qw(:all); my @row = (a..z); timethese(100000, { 'Before' => sub { before() }, 'After' => sub { after() } }); sub before { for ($j = 0; $j < @row; $j++) { $row[$j] =~ s/[^ -~]//g; $row[$j] =~ s/\|/:/g; } } sub after { for (@row) { s/[^ -~]//g; s/\|/:/g; } } $ perl j.pl Benchmark: timing 100000 iterations of After, Before... After: 2 wallclock secs ( 1.42 usr + 0.01 sys = 1.43 CPU) @ 69930.07/s (n=100000) Before: 2 wallclock secs ( 2.53 usr + 0.00 sys = 2.53 CPU) @ 39525.69/s (n=100000) $ perl j.pl Benchmark: timing 100000 iterations of After, Before... After: 1 wallclock secs ( 1.43 usr + 0.01 sys = 1.44 CPU) @ 69444.44/s (n=100000) Before: 3 wallclock secs ( 2.51 usr + 0.00 sys = 2.51 CPU) @ 39840.64/s (n=100000) $ perl j.pl Benchmark: timing 100000 iterations of After, Before... After: 1 wallclock secs ( 1.42 usr + 0.01 sys = 1.43 CPU) @ 69930.07/s (n=100000) Before: 1 wallclock secs ( 2.51 usr + 0.00 sys = 2.51 CPU) @ 39840.64/s (n=100000) $ perl j.pl Benchmark: timing 100000 iterations of After, Before... After: 1 wallclock secs ( 1.43 usr + 0.01 sys = 1.44 CPU) @ 69444.44/s (n=100000) Before: 1 wallclock secs ( 2.52 usr + 0.00 sys = 2.52 CPU) @ 39682.54/s (n=100000) From jay at jays.net Tue May 23 05:22:43 2006 From: jay at jays.net (Jay Hannah) Date: Tue, 23 May 2006 07:22:43 -0500 Subject: [Omaha.pm] Devel::Timer, Jason Moore Message-ID: <4472FE93.3010201@jays.net> I recently submitted a patch to Devel::Timer to the author: http://mail.pm.org/pipermail/omaha-pm/2006-May/000989.html But his email address bounced. I Google'd the heck out of him, but can't seem find him anywhere. http://search.cpan.org/~jmoore/ Anyone have a way to contact Jason? If not, I'm volunteering to take over maintenance of Devel::Timer. I've been using CPAN for years, but haven't been an author, so if the powers that be are hep to letting me take over maintenance I'll read all the FAQs and dive in. Let me know. Thanks, j Omaha.pm Only posting to NNTP once, then waiting at least 24 hours. :) From andy at petdance.com Tue May 23 14:51:44 2006 From: andy at petdance.com (Andy Lester) Date: Tue, 23 May 2006 16:51:44 -0500 Subject: [Omaha.pm] for loop quickie In-Reply-To: <4472720c.3921b9f6.355c.fffffd1f@mx.gmail.com> References: <4472720c.3921b9f6.355c.fffffd1f@mx.gmail.com> Message-ID: On May 22, 2006, at 9:22 PM, Dr. Dhundy R. Bastola wrote: > I really appreciate when Andy breaks it up and makes people like us > feel > welcome. I wanted to let you know that you are helping people like > me learn > well by doing so. Thanks I'm really glad I could help. One of the things that makes it easy for me to add my $0.02 is that Jay is such a great evangelist himself. It's not "What's the best way to do X", which can get tedious to deal with, but rather "Here's a way I found to do X". Some day we really need to figure out when I should come out to give a talk to you guys. Andy -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From jay at jays.net Tue May 23 17:58:01 2006 From: jay at jays.net (Jay Hannah) Date: Tue, 23 May 2006 19:58:01 -0500 Subject: [Omaha.pm] for loop quickie In-Reply-To: References: <4472720c.3921b9f6.355c.fffffd1f@mx.gmail.com> Message-ID: <4473AF99.4060404@jays.net> Andy Lester wrote: > I'm really glad I could help. One of the things that makes it easy > for me to add my $0.02 is that Jay is such a great evangelist > himself. It's not "What's the best way to do X", which can get > tedious to deal with, but rather "Here's a way I found to do X". -laugh- I'm glad my little tidbits help spark useful threads. Its just the stuff I run into while plunking through my 9 to 5. All: feel free to quiz and/or correct me whenever you want more verbose explanations or I'm obviously drunk and doing something silly. :) > Some day we really need to figure out when I should come out to give > a talk to you guys. You're certainly welcome any time! Our last meeting was great. Eclectic meandering, attendees from Lincoln and Sioux City! Too bad there was still only 6 of us total. :) Jeff Bisbee called me yesterday morning. He's back in town (off and on) for the week visiting his folks. He's still doing all kinds of cool Perl stuff at SportsLine. See SouthFlorida Perl Mongers. Oh, and apparently Chad doesn't work at Paragon any more, so our food sponsorship might have dried up. Doh! Bart! I feel hungrier already. :) j From andy at petdance.com Tue May 23 18:17:16 2006 From: andy at petdance.com (Andy Lester) Date: Tue, 23 May 2006 20:17:16 -0500 Subject: [Omaha.pm] for loop quickie In-Reply-To: <4473AF99.4060404@jays.net> References: <4472720c.3921b9f6.355c.fffffd1f@mx.gmail.com> <4473AF99.4060404@jays.net> Message-ID: <6DE0DD7F-C6CB-4ADC-8619-6B4AD3D072E1@petdance.com> On May 23, 2006, at 7:58 PM, Jay Hannah wrote: > You're certainly welcome any time! Our last meeting was great. > Eclectic meandering, attendees from Lincoln and Sioux City! Too bad > there was still only 6 of us total. :) What would you like me to talk about? I can talk about anything. Perl testing, web scraping, how to get hired, project estimation, etc etc etc. Do you guys have a projector that I can show slides on? Andy -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20060523/7ff36563/attachment.html From robert.fulkerson at gmail.com Tue May 23 18:26:40 2006 From: robert.fulkerson at gmail.com (Robert A. Fulkerson) Date: Tue, 23 May 2006 20:26:40 -0500 Subject: [Omaha.pm] for loop quickie In-Reply-To: <6DE0DD7F-C6CB-4ADC-8619-6B4AD3D072E1@petdance.com> References: <4472720c.3921b9f6.355c.fffffd1f@mx.gmail.com> <4473AF99.4060404@jays.net> <6DE0DD7F-C6CB-4ADC-8619-6B4AD3D072E1@petdance.com> Message-ID: <6cb6eebc0605231826x7287d8bep53731d456d3aec6c@mail.gmail.com> I'll force my Perl students to come if you're in town. Or I'll give them extra credit, which would probably make them happier. :) Or we could combine a lecture night and a meeting night in one. I can't usually make it to Tuesday night meetings because that's when class is. But that would make it very easy to combine the two. :) I'd put a vote in for testing or how to get hired; testing for me and how to get hired for my students. :) -- b On 5/23/06, Andy Lester wrote: > > > On May 23, 2006, at 7:58 PM, Jay Hannah wrote: > > You're certainly welcome any time! Our last meeting was great. Eclectic > meandering, attendees from Lincoln and Sioux City! Too bad there was still > only 6 of us total. :) > > > What would you like me to talk about? I can talk about anything. Perl > testing, web scraping, how to get hired, project estimation, etc etc etc. > > Do you guys have a projector that I can show slides on? > > Andy > > -- > Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance > > > > > _______________________________________________ > Omaha-pm mailing list > Omaha-pm at pm.org > http://mail.pm.org/mailman/listinfo/omaha-pm > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20060523/cfcae688/attachment.html From andy at petdance.com Tue May 23 18:29:15 2006 From: andy at petdance.com (Andy Lester) Date: Tue, 23 May 2006 20:29:15 -0500 Subject: [Omaha.pm] Let's get Andy to come to Omaha In-Reply-To: <6cb6eebc0605231826x7287d8bep53731d456d3aec6c@mail.gmail.com> References: <4472720c.3921b9f6.355c.fffffd1f@mx.gmail.com> <4473AF99.4060404@jays.net> <6DE0DD7F-C6CB-4ADC-8619-6B4AD3D072E1@petdance.com> <6cb6eebc0605231826x7287d8bep53731d456d3aec6c@mail.gmail.com> Message-ID: On May 23, 2006, at 8:26 PM, Robert A. Fulkerson wrote: > I'd put a vote in for testing or how to get hired; testing for me > and how to get hired for my students. :) Yeah, I'd vote more for the how to get hired, especially 'cause I'm writing a book, and I'd love to hear their thoughts about the things I tell them.... -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From jhannah at omnihotels.com Wed May 24 08:35:12 2006 From: jhannah at omnihotels.com (Jay Hannah) Date: Wed, 24 May 2006 10:35:12 -0500 Subject: [Omaha.pm] Our automated test library now contains 13, 534 tests :) Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B04432DB0@exchange2k3.omnihotels.net> Bragging rights, baby. j $ prove -snip!- Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------ ------- MVC/Control/Inventory/t/Avail.t 1 256 51 1 1.96% 51 MVC/Control/Rates/t/Avail.t 255 65280 35 69 197.14% 1-35 MVC/Model/Intrasight/t/NCOA_US.t 255 65280 11 22 200.00% 1-11 MVC/Model/Rewards/File/AX/t/Outbo 1 256 4 1 25.00% 4 MVC/Model/Rewards/Record/AX/t/Out 1 256 14 1 7.14% 14 MVC/Model/Rewards/Record/AX/t/Out 1 256 8 1 12.50% 8 MVC/Model/omares/Complex/Rates/t/ 1 256 4 1 25.00% 4 MVC/Model/omares/Complex/t/L_Rewa 255 65280 8 14 175.00% 2-8 MVC/Model/omares/Complex/t/Reserv 255 65280 28 52 185.71% 3-28 MVC/Model/omares/Simple/t/standar 255 65280 1407 28 1.99% 1394-1407 2 tests and 49 subtests skipped. Failed 10/207 test scripts, 95.17% okay. 98/13534 subtests failed, 99.28% okay. From andy at petdance.com Wed May 24 08:37:42 2006 From: andy at petdance.com (Andy Lester) Date: Wed, 24 May 2006 10:37:42 -0500 Subject: [Omaha.pm] Our automated test library now contains 13, 534 tests :) In-Reply-To: <29AB736ABCE5C745ABF9C93B02F2C27B04432DB0@exchange2k3.omnihotels.net> References: <29AB736ABCE5C745ABF9C93B02F2C27B04432DB0@exchange2k3.omnihotels.net> Message-ID: <6DA61CF8-D215-4A7F-A504-53FE8985719C@petdance.com> On May 24, 2006, at 10:35 AM, Jay Hannah wrote: > > Bragging rights, baby. To me, the number of tests isn't nearly as interesting as trends over time. Have you tracked that? -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From rob.townley at gmail.com Wed May 24 13:59:34 2006 From: rob.townley at gmail.com (Rob Townley) Date: Wed, 24 May 2006 15:59:34 -0500 Subject: [Omaha.pm] for loop quickie In-Reply-To: <29AB736ABCE5C745ABF9C93B02F2C27B04432D87@exchange2k3.omnihotels.net> References: <29AB736ABCE5C745ABF9C93B02F2C27B04432D87@exchange2k3.omnihotels.net> Message-ID: <7e84ed60605241359x1af5782y75297d5818b5e312@mail.gmail.com> On 5/22/06, Jay Hannah wrote: > > before: > > for ($j = 0; $j < @row; $j++) { > $row[$j] =~ s/[^ -~]//g; > $row[$j] =~ s/\|/:/g; > } > > after: > > for (@row) { > s/[^ -~]//g; > s/\|/:/g; > } > > j If i had a bug however, oftentimes i would have to take the shorter version and make it longer temporarily. Can't the re be written in one line? From andy at petdance.com Wed May 24 14:03:21 2006 From: andy at petdance.com (Andy Lester) Date: Wed, 24 May 2006 16:03:21 -0500 Subject: [Omaha.pm] for loop quickie In-Reply-To: <7e84ed60605241359x1af5782y75297d5818b5e312@mail.gmail.com> References: <29AB736ABCE5C745ABF9C93B02F2C27B04432D87@exchange2k3.omnihotels.net> <7e84ed60605241359x1af5782y75297d5818b5e312@mail.gmail.com> Message-ID: <865B41FA-7CF2-4E3B-A7B1-F999C4E2C292@petdance.com> On May 24, 2006, at 3:59 PM, Rob Townley wrote: > If i had a bug however, oftentimes i would have to take the > shorter version and make it longer temporarily. Can't the re be > written in one line? Nope, they're doing two entirely different things. -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20060524/9d6d0cc2/attachment.html From robert.fulkerson at gmail.com Wed May 24 14:47:17 2006 From: robert.fulkerson at gmail.com (Robert A. Fulkerson) Date: Wed, 24 May 2006 16:47:17 -0500 Subject: [Omaha.pm] Let's get Andy to come to Omaha In-Reply-To: References: <4472720c.3921b9f6.355c.fffffd1f@mx.gmail.com> <4473AF99.4060404@jays.net> <6DE0DD7F-C6CB-4ADC-8619-6B4AD3D072E1@petdance.com> <6cb6eebc0605231826x7287d8bep53731d456d3aec6c@mail.gmail.com> Message-ID: <6cb6eebc0605241447v3f6e6b5cr79382b2fa7ebd5d4@mail.gmail.com> > > Yeah, I'd vote more for the how to get hired, especially 'cause I'm > writing a book, and I'd love to hear their thoughts about the things > I tell them.... It's easy to convince my students how easy and cool Perl is in comparison to C or C++ for writing programs in their upper-level classes where the professor doesn't mind what language the solution is in. I've actually had semesters where students help steer the pace and content of the class because they want me to cover material that they know will help them solve some final projects in classes. :) Those are fun semesters. It's harder to convince them that there's money to be made if you're not writing PHP, Ruby on Rails or developing the latest-greatest AJAX/Web 2.0 where-should-we-have-lunch-today randomizer. Perhaps I'll go to the coffers and see if the university has any bring-a-cool-speaker-in cash laying around. :) -- b -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20060524/dce720aa/attachment.html From kiranbina at gmail.com Wed May 24 19:44:47 2006 From: kiranbina at gmail.com (Dr. Dhundy R. Bastola) Date: Wed, 24 May 2006 21:44:47 -0500 Subject: [Omaha.pm] Let's get Andy to come to Omaha In-Reply-To: <6cb6eebc0605241447v3f6e6b5cr79382b2fa7ebd5d4@mail.gmail.com> Message-ID: <44751a32.4606b988.3225.ffff8213@mx.gmail.com> >>Perhaps I'll go to the coffers and see if the university has any bring-a-cool-speaker-in cash laying around. :) I will try and look into that too. Kiran _____ From: omaha-pm-bounces+kiranbina=gmail.com at pm.org [mailto:omaha-pm-bounces+kiranbina=gmail.com at pm.org] On Behalf Of Robert A. Fulkerson Sent: Wednesday, May 24, 2006 4:47 PM To: Perl Mongers of Omaha, Nebraska USA Subject: Re: [Omaha.pm] Let's get Andy to come to Omaha Yeah, I'd vote more for the how to get hired, especially 'cause I'm writing a book, and I'd love to hear their thoughts about the things I tell them.... It's easy to convince my students how easy and cool Perl is in comparison to C or C++ for writing programs in their upper-level classes where the professor doesn't mind what language the solution is in. I've actually had semesters where students help steer the pace and content of the class because they want me to cover material that they know will help them solve some final projects in classes. :) Those are fun semesters. It's harder to convince them that there's money to be made if you're not writing PHP, Ruby on Rails or developing the latest-greatest AJAX/Web 2.0 where-should-we-have-lunch-today randomizer. Perhaps I'll go to the coffers and see if the university has any bring-a-cool-speaker-in cash laying around. :) -- b -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20060524/b51f0852/attachment.html From jay at jays.net Thu May 25 05:45:02 2006 From: jay at jays.net (Jay Hannah) Date: Thu, 25 May 2006 07:45:02 -0500 Subject: [Omaha.pm] Our automated test library now contains 13, 534 tests :) In-Reply-To: <6DA61CF8-D215-4A7F-A504-53FE8985719C@petdance.com> References: <29AB736ABCE5C745ABF9C93B02F2C27B04432DB0@exchange2k3.omnihotels.net> <6DA61CF8-D215-4A7F-A504-53FE8985719C@petdance.com> Message-ID: <4475A6CE.2030700@jays.net> Andy Lester wrote: > To me, the number of tests isn't nearly as interesting as trends over > time. Have you tracked that? No. OSCON 2003 was my first intro to building test suites, so I know the number was 0 before that. :) The trend is all in CVS, but the count wouldn't be trivial to pull and our QA process isn't nearly refined enough to track metrics like that. j From dthacker9 at cox.net Thu May 25 07:04:58 2006 From: dthacker9 at cox.net (dthacker9 at cox.net) Date: Thu, 25 May 2006 10:04:58 -0400 Subject: [Omaha.pm] Our automated test library now contains 13, 534 tests :) Message-ID: <28818737.1148565898459.JavaMail.root@centrmwml07.mgt.cox.net> ---- Jay Hannah wrote: > Andy Lester wrote: > > To me, the number of tests isn't nearly as interesting as trends over > > time. Have you tracked that? What kinds of trends? -types of tests? -errors found? DT From jhannah at omnihotels.com Fri May 26 11:07:46 2006 From: jhannah at omnihotels.com (Jay Hannah) Date: Fri, 26 May 2006 13:07:46 -0500 Subject: [Omaha.pm] lmao... if ($0 !~ /.t/) { Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B04432DCF@exchange2k3.omnihotels.net> Hit this line of code today while trying to fix a bug: next if ($rpc eq "ALL" and $filter_request); Commenting out that line of code fixes our bug! Yay! But then some of my tests for another set of business logic fail. Totally joking, Sean suggested this patch: if ($0 !~ /.t$/) { next if ($rpc eq "ALL" and $filter_request); } If you don't find that hilarious then either you're not versed in Perl automated testing, or you're far less of a geek than Sean and I... :) j From jay at jays.net Tue May 30 17:36:39 2006 From: jay at jays.net (Jay Hannah) Date: Tue, 30 May 2006 19:36:39 -0500 Subject: [Omaha.pm] FWD: "Build Tag Clouds in Perl and PHP" Message-ID: <447CE517.4000609@jays.net> Huh. I read the link and still don't know what a "tag cloud" is. :) Anyone more hep then me? j -------- Original Message -------- Subject: UG News--Good. Fast. Cheap. O'Reilly Launches PDF Guides Date: Tue, 30 May 2006 11:07:22 -0700 From: Marsee Henon To: jay at jays.net Hello, Can you share this news with your members? Let me know if you want a review copy. Thanks! Marsee Good. Fast. Cheap. O'Reilly Launches PDF Guides As part of O'Reilly Media's commitment to delivering vital technology information to people who need it, when they need it, O'Reilly is launching an ongoing series of PDF publications to address cutting edge technologies. O'Reilly's PDF guides are in-depth, immediate, timely, and authoritative. Readers can purchase and download the PDFs through the O'Reilly online store, with no restrictions on the ability to save, copy, or print them. The advantages to readers are numerous. O'Reilly authors can disseminate crucial information as the need arises, without having to wait for enough material to fill an entire book. Production time is reduced dramatically, giving IT professionals and others immediate access to the knowledge they want. Plus, readers can easily search the text, copy and paste handy bits of code into their applications, and take the PDF with them even when they're offline. But most importantly, readers won't have to compromise in their pursuit of timely information--these PDFs provide the high-quality content for which O'Reilly has come to be known. This month's PDF offerings are available now: "Build Tag Clouds in Perl and PHP" by Jim Bumgardner First popularized by the web sites Flickr, Technorati, and del.icio.us, these amorphous clumps of words now appear on a slew of web sites as visual evidence of their membership in the elite corps of "Web 2.0." This PDF analyzes what is and isn't a tag cloud, offers design tips for using them effectively, and then shows how to collect tags and display them in the tag cloud format. Scripts are provided in Perl and PHP. ISBN: 0-596-52794-2, 46 pages, $9.99 US, $12.99 CAN http://www.oreilly.com/catalog/tagclouds/ "Web Services on Rails" by Kevin Marshall In recent years, web services have become increasingly useful to smaller web site developers. Thanks to standards like SOAP and XML-RPC as well as frameworks such as Ruby on Rails, developers can easily create web service clients and servers with fewer errors. This guide looks at how Ruby on Rails makes building web service clients and servers simple and fun, with plenty of working examples and code details so you can see just how everything works. ISBN: 0-596-52796-9, 32 pages, $9.99 US, $12.99 CA http://www.oreilly.com/catalog/websor/ "Atlas UpdatePanel Control" by Bertrand Le Roy and Matt Gibbs The key to making ASP.NET applications more responsive to user input is the UpdatePanel control. In this tutorial, you'll learn from the experts: Bertrand Le Roy, UpdatePanel control's architect and developer, and Matt Gibbs, Atlas dev team manager. This PDF document contains all you need to get started implementing AJAX functionality in existing ASP.NET applications. ISBN: 0-596-52747-0, 56 pages, $9.99 US, $12.99 CA http://www.oreilly.com/catalog/atlasupc/ "Search Engine Optimization" by Harold Davis SEO--short for Search Engine Optimization--is the art, craft, and science of driving web traffic to web sites. Whether your web site depends on broad, general traffic, or high-quality, targeted traffic, this PDF has the tools and information you need to draw more traffic to your site, and build your bottom line. You?ll learn how to effectively use PageRank and Google itself--effective use of SEO means understanding how Google works: how to boost placement in Google search results, how not to offend Google, and how best to use paid Google programs. You?ll also learn how to best organize your web pages and web sites, apply SEO analysis tools, establish effective SEO best practices, and much more. ISBN: 0-596-52786-1, 41 pages, $9.99 US, $12.99 CA http://www.oreilly.com/catalog/seo/ Other PDFs from O'Reilly can be found in the O'Reilly Store at: http://pdfs.oreilly.com ================================================================ O'Reilly 1005 Gravenstein Highway North Sebastopol, CA 95472 http://ug.oreilly.com/ http://ug.oreilly.com/creativemedia/ ================================================================ From jay at jays.net Tue May 30 17:38:23 2006 From: jay at jays.net (Jay Hannah) Date: Tue, 30 May 2006 19:38:23 -0500 Subject: [Omaha.pm] [Fwd: Only 2 days left to buy the Perl eBook Bundle from Apress!] Message-ID: <447CE57F.5030206@jays.net> If I'm forwarding too much of this stuff just say so. I don't know if anyone is interested or not, so if its Perly I've been forwarding it. j -------- Original Message -------- Subject: Only 2 days left to buy the Perl eBook Bundle from Apress! Date: 30 May 2006 11:41:53 -0700 From: Apress Newsletters To: jay at jays.net *****Don't let this deal pass you by-only two days left! ***** It's that time of year...summer will soon be upon us in the Northern Hemisphere. With the inevitable arrival of insufferable heat, sticky humidity, and thundering storms, who wants to go outside? Instead, stay inside where it's cool, comfortable, and an ample power supply is just a few steps away. You can while away the days building towers of Coke cans or sorting through piles of old magazines, but we've come up with a better solution: brush up on those Perl skills! Through the end of May, we're offering a limited edition bundle of five Perl eBooks for only $50. That's right...$10 each! The titles included in the bundle are Beginning Perl Web Development: From Novice to Professional by Steve Suehring http://www.apress.com/book/bookDisplay.html?bID=10009 Pro Perl by Peter Wainwright http://www.apress.com/book/bookDisplay.html?bID=392 Pro Perl Parsing by Christopher Frenz http://www.apress.com/book/bookDisplay.html?bID=432 Perl 6 Now: The Core Ideas Illustrated with Perl 5 by Scott Walters http://www.apress.com/book/bookDisplay.html?bID=355 Regular Expression Recipes: A Problem-Solution Approach by Nathan Good http://www.apress.com/book/bookDisplay.html?bID=396 For more information, please visit http://www.apress.com/promo/perlbundle.html ************************************* All Apress titles are available through your favorite online and brick-and-mortar bookstores. Contact sales at apress.com with any questions. Please note that we do not send unsolicited newsletters. You received this because you signed up for our newsletter at a tradeshow or at http://www.apress.com, or you were on an opt-in list. To be removed from the Apress newsletter mailing list, please follow this link: http://www.apress.com/misc/optout2.html?e=jay%40jays.net&h=2b6318bd65c4a7b8149eeaab6f7d4d07&l=16 For all other requests, please do not reply to this e-mail. Instead, e-mail info at apress.com and we'll get back to you regarding your query. Apress - The Expert's Voice(TM) 2560 Ninth St, Suite 219 Berkeley, CA 94710 510-549-5930 **END** From andy at petdance.com Tue May 30 17:38:57 2006 From: andy at petdance.com (Andy Lester) Date: Tue, 30 May 2006 19:38:57 -0500 Subject: [Omaha.pm] FWD: "Build Tag Clouds in Perl and PHP" In-Reply-To: <447CE517.4000609@jays.net> References: <447CE517.4000609@jays.net> Message-ID: On May 30, 2006, at 7:36 PM, Jay Hannah wrote: > Huh. I read the link and still don't know what a "tag cloud" is. :) > > Anyone more hep then me? Look at http://del.icio.us/petdance and see the list of tags on the right. That's a tag cloud. xoa -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20060530/faab0878/attachment.html From jay at jays.net Tue May 30 17:54:48 2006 From: jay at jays.net (Jay Hannah) Date: Tue, 30 May 2006 19:54:48 -0500 Subject: [Omaha.pm] Fwd: potential pitfall with "return undef" Message-ID: <447CE958.2090001@jays.net> Oops! I "return undef;" ALL THE TIME... Ponder, j -------- Original Message -------- Subject: [Bioperl-l] For CVS developers - potential pitfall with "return undef" Date: Tue, 30 May 2006 18:18:45 +1000 From: Torsten Seemann Organization: Victorian Bioinformatics Consortium, Monash University To: bioperl-l at lists.open-bio.org FYI Bioperl developers: I just audited the bioperl-live CVS and found about 450 occurrences of "return undef". Page 199 of "Perl Best Practices" by Damian Conway, and this URL http://www.perl.com/lpt/a/2006/02/23/advanced_subroutines.html suggest: "Use return; instead of return undef; if you want to return nothing. If someone assigns the return value to an array, the latter creates an array of one value (undef), which evaluates to true. The former will correctly handle all contexts." So I'm guessing at least some of these 450 occurrences *could* result in bugs and should probably be changed. Your opinion may differ :-) -- Dr Torsten Seemann http://www.vicbioinformatics.com Victorian Bioinformatics Consortium, Monash University, Australia _______________________________________________ Bioperl-l mailing list Bioperl-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/bioperl-l