From jay at jays.net Wed Aug 2 08:27:27 2006 From: jay at jays.net (Jay Hannah) Date: Wed, 02 Aug 2006 10:27:27 -0500 Subject: [Omaha.pm] [pm_groups] Private vs. public In-Reply-To: References: <20060801184607.A3A204980F5@favaloro.2xdtech.com.ar> Message-ID: <44D0C45F.4080107@jays.net> JT Smith wrote: > I think that public archives are the only way to go. I can't tell you how many great > nuggets of information I've gleaned by searching the archives of public perl monger's > lists. I suppose if your list is purely social I could see not publishing the archives, > but if it contains technical discussions then you're stealing knowledge from the world > by keeping them private. Agreed. Preach it, brother! (Perhaps "denying knowledge from the world", not "stealing from the world". -grin-) > One other thing to note is that many people feel that the Perl world is dying. And I > think that a large part of that is because they don't see enough discussion of Perl out > there. In 1999 I brought Perl to the company I still work for. I was told it was a dead language. Funny how that FUD never changes. In 2006 we're using Perl more than ever, continuing to discard proprietary language programs. It works for us. I just got back from OSCON in Portland. I'm pleased to report Perl looks healthier than ever to me. :) > We need to be less private, not more. "Amen" he said, posting to pm_groups which has no public archive (ironic, eh?); but also cross-posting to the Omaha Perl Mongers whose archive is public. :) j Omaha.pm currently on another 2 night bender replacing old code w/ a far superior Perl replacement :) From jay at jays.net Wed Aug 2 19:47:29 2006 From: jay at jays.net (Jay Hannah) Date: Wed, 02 Aug 2006 21:47:29 -0500 Subject: [Omaha.pm] -lol- Another cool shirt Message-ID: <44D163C1.7020504@jays.net> http://www.cafepress.com/buy/perl/-/pv_design_details/pg_4/id_1192712/opt_/fpt_/c_/hlv_t j From jay at jays.net Thu Aug 3 06:10:51 2006 From: jay at jays.net (Jay Hannah) Date: Thu, 03 Aug 2006 08:10:51 -0500 Subject: [Omaha.pm] Last call for Perl Monger shirts! Message-ID: <44D1F5DB.7090807@jays.net> We're at 102 shirts so far. Only 7 local. :) http://omaha.pm.org/shirts.shtml Last call! j From jhannah at omnihotels.com Thu Aug 3 13:38:46 2006 From: jhannah at omnihotels.com (Jay Hannah) Date: Thu, 3 Aug 2006 15:38:46 -0500 Subject: [Omaha.pm] Classic CVS entry Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B05A37A1E@exchange2k3.omnihotels.net> 2 years ago I eliminated 3 function-specific programs book.pl pals.pl rpin.pl in favor of 1 generic program that could handle all 3 functions rq.pl I stumbled into my CVS entry for that day just now. It makes me laugh. See attachment. Grin, j -------------- next part -------------- A non-text attachment was scrubbed... Name: rq.png Type: image/png Size: 40745 bytes Desc: rq.png Url : http://mail.pm.org/pipermail/omaha-pm/attachments/20060803/a310e5bd/attachment-0001.png From durod at novia.net Fri Aug 4 06:44:11 2006 From: durod at novia.net (Paul Duran) Date: Fri, 04 Aug 2006 08:44:11 -0500 Subject: [Omaha.pm] [Kc] Using Perl In-Reply-To: <44CE9127.7050505@jays.net> References: <99dd19c90607270901o7d8bef91x499f2b73118492df@mail.gmail.com> <77b74a1e1210ec12a2f4808495feb6d4@mail> <99dd19c90607271508t22db7cd2o4f9314e318e977da@mail.gmail.com> <44C977FA.8040103@alliances.org> <1154181192.24818.6.camel@walkabout> <79A0B354-A745-4133-BD08-947E7D515463@goebel.ws> <44CE9127.7050505@jays.net> Message-ID: <44D34F2B.3050704@novia.net> Jay, Just a guess, didn't terminate the password statement correctly... BTW nice script though... Jay Hannah wrote: >Garrett Goebel wrote: > > >>Well, perhaps you'd like to submit a "best practices" version? >> >> > >Before: > > > >>bash-2.03# cat build_all_server_shutdown.sh >>#!/bin/bash >>USERNAME="username" >>PASSWORD="password" >> >>LOGFILE="all_server_shutdown.txt" \ >>COMMAND="psshutdown" \ >>CLOPTIONS="-s -t 1 -u ${USERNAME} -p ${PASSWORD}" \ >>/usr/bin/perl -ne 'BEGIN { $d=("-")x5; $r="REM"; $fn=$ENV >>{LOGFILE}; @cmd=($ENV{COMMAND}." ".$ENV{CLOPTIONS}." \\\\"," >> >>$fn"); $fl=<>; print "$r ${fl}erase $fn\n"; } next if /^(#)|($r)/; >>tr/a-z\r\n /A-Z/d; $_=(/^(SVR_)|(other)/i?"$r\n$r [$d$_$d]\n":join >>($_, at cmd)."\n"); print;' < $1 > $2 >> >> > >Huh. I can't even get that to run. The error I get: > > line 5: $1: ambiguous redirect > >Its basically generating a file to disk? Can you post a sample file? > >j > >_______________________________________________ >Omaha-pm mailing list >Omaha-pm at pm.org >http://mail.pm.org/mailman/listinfo/omaha-pm > > > > From dan at linder.org Fri Aug 4 06:16:54 2006 From: dan at linder.org (Daniel Linder) Date: Fri, 4 Aug 2006 08:16:54 -0500 (CDT) Subject: [Omaha.pm] Classic CVS entry In-Reply-To: <29AB736ABCE5C745ABF9C93B02F2C27B05A37A1E@exchange2k3.omnihotels.net> References: <29AB736ABCE5C745ABF9C93B02F2C27B05A37A1E@exchange2k3.omnihotels.net> Message-ID: <40513.70.171.164.226.1154697414.squirrel@mail.linder.org> On Thu, August 3, 2006 15:38, Jay Hannah wrote: > 2 years ago I eliminated 3 function-specific programs > book.pl > pals.pl > rpin.pl > in favor of 1 generic program that could handle all 3 functions > rq.pl > I stumbled into my CVS entry for that day just now. It makes me laugh. And it's this type of childish behavior that will keep OSS "second rate" to such big players such as Microsoft... These came out a few years ago: http://www.kuro5hin.org/story/2004/2/15/71552/7795 So much for 'professionalism' that is pounded into our heads in College. ;) 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 From durod at novia.net Fri Aug 4 07:22:29 2006 From: durod at novia.net (Paul Duran) Date: Fri, 04 Aug 2006 09:22:29 -0500 Subject: [Omaha.pm] Classic CVS entry In-Reply-To: <40513.70.171.164.226.1154697414.squirrel@mail.linder.org> References: <29AB736ABCE5C745ABF9C93B02F2C27B05A37A1E@exchange2k3.omnihotels.net> <40513.70.171.164.226.1154697414.squirrel@mail.linder.org> Message-ID: <44D35825.60404@novia.net> I disagree, If you have the guts to publicly post your work for the world to see and scrutinize --it makes you a better progammer. In my opinion open source programmers will always be a step ahead of all others (whoever that is) That's who I'll hire if I'm in that position. Paul Daniel Linder wrote: >On Thu, August 3, 2006 15:38, Jay Hannah wrote: > > >>2 years ago I eliminated 3 function-specific programs >> book.pl >> pals.pl >> rpin.pl >>in favor of 1 generic program that could handle all 3 functions >> rq.pl >>I stumbled into my CVS entry for that day just now. It makes me laugh. >> >> > > >And it's this type of childish behavior that will keep OSS "second rate" >to such big players such as Microsoft... > > >These came out a few years ago: > http://www.kuro5hin.org/story/2004/2/15/71552/7795 > >So much for 'professionalism' that is pounded into our heads in College. ;) > >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 > >_______________________________________________ >Omaha-pm mailing list >Omaha-pm at pm.org >http://mail.pm.org/mailman/listinfo/omaha-pm > > > > From jhannah at omnihotels.com Fri Aug 4 16:16:47 2006 From: jhannah at omnihotels.com (Jay Hannah) Date: Fri, 4 Aug 2006 18:16:47 -0500 Subject: [Omaha.pm] Test driven development: RED, GREEN, REFACTOR Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B05A37A37@exchange2k3.omnihotels.net> Hit a bug today. A specific message should have been logged as "WB V9", not "V9 V9". The code that threw that log entry is $return = sprintf( "%s %s %s [%s|%s%s%s%s] [%s|%s%s] %f", $req->get_gds, $req->get_sga, $msn, ... $req here is a Control::Multiplex::Payload::USW object. So, being the agile developer (and other buzzwordy crap here) that I am I added a test to USW.t that fails, demonstrating the bug: $ perl USW.t 1..71 ok 1 - new() ok 2 - get_payload() ok 3 - get_type() ... ok 67 - get_payload() ok 68 - get_type() ok 69 - get_segment() not ok 70 - get_gds() # Failed test 'get_gds()' # in USW.t at line 158. # got: 'V9' # expected: 'WB' ok 71 - get_sga() # Looks like you failed 1 test of 71. I then found the bug and patched it. And now ALL my tests pass! $ prove t/USW.t t/USW....ok All tests successful. Files=1, Tests=71, 1 wallclock secs ( 0.63 cusr + 0.06 csys = 0.69 CPU) Red/green/refactor, baby. I (re)learned that at OSCON last week. :) http://conferences.oreillynet.com/cs/os2006/view/e_sess/8699 j From jay at jays.net Sun Aug 6 09:24:42 2006 From: jay at jays.net (Jay Hannah) Date: Sun, 06 Aug 2006 11:24:42 -0500 Subject: [Omaha.pm] Classic CVS entry In-Reply-To: <40513.70.171.164.226.1154697414.squirrel@mail.linder.org> References: <29AB736ABCE5C745ABF9C93B02F2C27B05A37A1E@exchange2k3.omnihotels.net> <40513.70.171.164.226.1154697414.squirrel@mail.linder.org> Message-ID: <44D617CA.4080304@jays.net> Daniel Linder wrote: > These came out a few years ago: > http://www.kuro5hin.org/story/2004/2/15/71552/7795 :) I'd like to think people would say about the same if our code leaked. Like the author, I don't think it would matter much if it did. I don't see anything wrong with playful comments. Programming shouldn't be a joyless job. Nerds like nerd jokes. At least I do. > So much for 'professionalism' that is pounded into our heads in College. ;) What's "college"? ... oh, ya. Now I remember. IIRC only beer was pounded into my head there. :) j From joshua.mcadams at gmail.com Tue Aug 8 20:26:51 2006 From: joshua.mcadams at gmail.com (Joshua McAdams) Date: Tue, 8 Aug 2006 22:26:51 -0500 Subject: [Omaha.pm] Last call for Perl Monger shirts! In-Reply-To: <44D1F5DB.7090807@jays.net> References: <44D1F5DB.7090807@jays.net> Message-ID: <49d805d70608082026n65baa0j322f6921645b3682@mail.gmail.com> > We're at 102 shirts so far. Only 7 local. :) > > http://omaha.pm.org/shirts.shtml Okay, here is the Chicago.pm list... 33 in all: == Black == S - 0 M - 3 L - 3 XL - 8 XXL - 1 XXXL - 1 == Ash == S - 1 M - 3 L - 3 XL - 8 XXL - 1 XXXL - 1 You can ship them to: Performics Attn: Josh McAdams 180 N LaSalle St. Suite 1100 Chicago, IL 60601 As far as the bill, just let me know what I owe you for the shirts and shipping and I can mail you a check or paypal you or something... your preference. Thanks for taking the lead on this, Josh From joshua.mcadams at gmail.com Tue Aug 8 20:27:41 2006 From: joshua.mcadams at gmail.com (Joshua McAdams) Date: Tue, 8 Aug 2006 22:27:41 -0500 Subject: [Omaha.pm] Last call for Perl Monger shirts! In-Reply-To: <49d805d70608082026n65baa0j322f6921645b3682@mail.gmail.com> References: <44D1F5DB.7090807@jays.net> <49d805d70608082026n65baa0j322f6921645b3682@mail.gmail.com> Message-ID: <49d805d70608082027q62c58627j79aed4dc4bd63da6@mail.gmail.com> Oops, that went to everyone instead of just Jay :) Sorry for the posts! On 8/8/06, Joshua McAdams wrote: > > We're at 102 shirts so far. Only 7 local. :) > > > > http://omaha.pm.org/shirts.shtml > > Okay, here is the Chicago.pm list... 33 in all: > > == Black == > S - 0 > M - 3 > L - 3 > XL - 8 > XXL - 1 > XXXL - 1 > > == Ash == > S - 1 > M - 3 > L - 3 > XL - 8 > XXL - 1 > XXXL - 1 > > You can ship them to: > > Performics > Attn: Josh McAdams > 180 N LaSalle St. > Suite 1100 > Chicago, IL 60601 > > As far as the bill, just let me know what I owe you for the shirts and > shipping and I can mail you a check or paypal you or something... your > preference. > > Thanks for taking the lead on this, > Josh > From jhannah at omnihotels.com Tue Aug 15 15:51:29 2006 From: jhannah at omnihotels.com (Jay Hannah) Date: Tue, 15 Aug 2006 17:51:29 -0500 Subject: [Omaha.pm] am I drunk.... code reduction? Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B05A37AD7@exchange2k3.omnihotels.net> Am I drunk? Doesn't if ((not $row[0] =~ /RMCHG/) and (not $row[0] =~ /RMCHRG/) and (not $row[0] =~ /REUN/)) { if ($row[0] eq 'RMADJ') { # Do something... } } Reduce to if ($row[0] eq 'RMADJ') { # Do something... } ? j From jhannah at omnihotels.com Tue Aug 15 15:55:55 2006 From: jhannah at omnihotels.com (Jay Hannah) Date: Tue, 15 Aug 2006 17:55:55 -0500 Subject: [Omaha.pm] am I drunk.... code reduction? #2 Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B05A37AD8@exchange2k3.omnihotels.net> ?? I must be drunk? Doesn't if ($r[0] =~ /^COMP/) { $r[0] = $r[1]; if ((not $r[0] =~ /HCOMP/) and (not $r[0] =~ /GCOMP/) and (not $r[0] =~ /CCOMP/)) { $r[0] = "COMP"; } } reduce to if ($r[0] =~ /^COMP/) { $r[0] = "COMP"; } ?? j From dave.nerd at gmail.com Tue Aug 15 16:15:09 2006 From: dave.nerd at gmail.com (Dave M) Date: Tue, 15 Aug 2006 18:15:09 -0500 Subject: [Omaha.pm] am I drunk.... code reduction? In-Reply-To: <29AB736ABCE5C745ABF9C93B02F2C27B05A37AD7@exchange2k3.omnihotels.net> References: <29AB736ABCE5C745ABF9C93B02F2C27B05A37AD7@exchange2k3.omnihotels.net> Message-ID: <9ac12b1c0608151615l60390cdfkc78a376b7f8dbff8@mail.gmail.com> On 8/15/06, Jay Hannah wrote: > > Am I drunk? Doesn't > > if ((not $row[0] =~ /RMCHG/) and (not $row[0] =~ /RMCHRG/) and (not > $row[0] =~ /REUN/)) { > if ($row[0] eq 'RMADJ') { > # Do something... > } > } > > Reduce to > > if ($row[0] eq 'RMADJ') { > # Do something... > } > > ? I vote yes. :) From jhannah at omnihotels.com Tue Aug 15 16:18:43 2006 From: jhannah at omnihotels.com (Jay Hannah) Date: Tue, 15 Aug 2006 18:18:43 -0500 Subject: [Omaha.pm] am I drunk.... code reduction? #2 Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B05A37AD9@exchange2k3.omnihotels.net> > ?? I must be drunk? Doesn't > > if ($r[0] =~ /^COMP/) { > $r[0] = $r[1]; > if ((not $r[0] =~ /HCOMP/) and (not $r[0] =~ /GCOMP/) and (not $r[0] =~ /CCOMP/)) { > $r[0] = "COMP"; > } > } > > reduce to > > if ($r[0] =~ /^COMP/) { > $r[0] = "COMP"; > } > > ?? [Answering my own question...] No. If @r = ("COMPX", "HCOMP"); then the original code would leave $r[0] as "COMPX" but my reduction would change it to "COMP". Ok, I'm only half drunk... (the other example still stands AFAICT) (That is *not* the way I would have written this original, but my reduction was wrong.) Reduction stab 2: if ($r[0] =~ /^COMP/) { if ($r[1] =~ /[HGC]COMP/) { $r[0] = $r[1]; } else { $r[0] = "COMP"; } } Better, yes? No? j From jay at jays.net Tue Aug 15 16:21:28 2006 From: jay at jays.net (Jay Hannah) Date: Tue, 15 Aug 2006 18:21:28 -0500 Subject: [Omaha.pm] am I drunk.... code reduction? In-Reply-To: <9ac12b1c0608151615l60390cdfkc78a376b7f8dbff8@mail.gmail.com> References: <29AB736ABCE5C745ABF9C93B02F2C27B05A37AD7@exchange2k3.omnihotels.net> <9ac12b1c0608151615l60390cdfkc78a376b7f8dbff8@mail.gmail.com> Message-ID: <44E256F8.7060508@jays.net> Dave M wrote: > I vote yes. :) Yes I'm drunk, or yes the code can be reduced as stated? Laugh, j From durod at novia.net Tue Aug 15 19:26:14 2006 From: durod at novia.net (Paul Duran) Date: Tue, 15 Aug 2006 21:26:14 -0500 Subject: [Omaha.pm] am I drunk.... code reduction? In-Reply-To: <44E256F8.7060508@jays.net> References: <29AB736ABCE5C745ABF9C93B02F2C27B05A37AD7@exchange2k3.omnihotels.net> <9ac12b1c0608151615l60390cdfkc78a376b7f8dbff8@mail.gmail.com> <44E256F8.7060508@jays.net> Message-ID: <44E28246.4060100@novia.net> looks good, why not be drunk? and yes your code can be re-stated, "buurrrp" oooppps -p Jay Hannah wrote: >Dave M wrote: > > >>I vote yes. :) >> >> > >Yes I'm drunk, or yes the code can be reduced as stated? > >Laugh, > >j >_______________________________________________ >Omaha-pm mailing list >Omaha-pm at pm.org >http://mail.pm.org/mailman/listinfo/omaha-pm > > > > From jhannah at omnihotels.com Wed Aug 16 09:04:43 2006 From: jhannah at omnihotels.com (Jay Hannah) Date: Wed, 16 Aug 2006 11:04:43 -0500 Subject: [Omaha.pm] Corporate gibberish Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B05A37AE2@exchange2k3.omnihotels.net> LOL... Put your company name on the end of this URL: http://www.andrewdavidson.com/gibberish/?companyname=Put+Your+Company+Na me+Here j From mat at phpconsulting.com Wed Aug 16 10:48:36 2006 From: mat at phpconsulting.com (Mat Caughron) Date: Wed, 16 Aug 2006 12:48:36 -0500 Subject: [Omaha.pm] Corporate gibberish In-Reply-To: <29AB736ABCE5C745ABF9C93B02F2C27B05A37AE2@exchange2k3.omnihotels.net> References: <29AB736ABCE5C745ABF9C93B02F2C27B05A37AE2@exchange2k3.omnihotels.net> Message-ID: <20060816121908.J60235@qnejvacbegf.pbz> That was entertaining, Jay! Also interesting: It just so happens I worked for a company named %3Cb%3E Then I worked for a company named \\\\\\\ And then I worked for... :-) And thusly he opened the book of the OWASP commandments and turned to the chapter called A1 and read aloud: this speaketh of unvalidated input. Thou must Filter Thine GETs. And he returned again to the commandments of OWASP and again read aloud, this time from the chapter A4: thou shalt not enable cross site scripting. Returning a third time, he raised the book high and proclaimed chapter A7: improper error handling wilt be thine downfall. And truly, he enjoyedeth the readings, for they were teaching opportunities, open commandments and available for all to follow. Mat On Wed, 16 Aug 2006, Jay Hannah wrote: > LOL... Put your company name on the end of this URL: > > http://www.andrewdavidson.com/gibberish/?companyname=Put+Your+Company+Na > me+Here > > j > > _______________________________________________ > Omaha-pm mailing list > Omaha-pm at pm.org > http://mail.pm.org/mailman/listinfo/omaha-pm > From jhannah at omnihotels.com Wed Aug 16 11:37:03 2006 From: jhannah at omnihotels.com (Jay Hannah) Date: Wed, 16 Aug 2006 13:37:03 -0500 Subject: [Omaha.pm] /^\Q*****\E/ Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B05A37AF6@exchange2k3.omnihotels.net> Gotta love \Q and \E in regex's. :) # Set the cc_number to empty if it matches asterisks. The Reservation class will ignore it. # This is so people can change the expiration or name on card for modifications. # $cc_number = "" if ($cc_number =~ /^\Q*****\E/); j >From perldoc perlre: \Q quote (disable) pattern metacharacters till \E Today it is more common to use the quotemeta() function or the "\Q" metaquoting escape sequence to dis- able all metacharacters' special meanings like this: /$unquoted\Q$quoted\E$unquoted/ Beware that if you put literal backslashes (those not inside interpolated variables) between "\Q" and "\E", dou- ble-quotish backslash interpolation may lead to confusing results. If you need to use literal backslashes within "\Q...\E", consult "Gory details of parsing quoted con- structs" in perlop. From jhannah at omnihotels.com Wed Aug 16 13:21:19 2006 From: jhannah at omnihotels.com (Jay Hannah) Date: Wed, 16 Aug 2006 15:21:19 -0500 Subject: [Omaha.pm] another Redux / Re-ducks Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B05A37AF9@exchange2k3.omnihotels.net> Before my %cc = $GTD_Policy->cc_methods(lang_code=>$lang_code); my @s_cc = sort{$cc{$a} cmp $cc{$b}} keys %cc; foreach my $cc_type (sort @s_cc) { push @arr, { code=>$cc_type, desc=>$cc{$cc_type} }; } After my %cc = $GTD_Policy->cc_methods(lang_code=>$lang_code); foreach my $cc_type (sort keys %cc) { push @arr, { code=>$cc_type, desc=>$cc{$cc_type} }; } Looks like the first sort intended to sort the keys based on the values, but then that second sort was throwing all that hard work away... ? j From dave.nerd at gmail.com Wed Aug 16 13:46:46 2006 From: dave.nerd at gmail.com (Dave M) Date: Wed, 16 Aug 2006 15:46:46 -0500 Subject: [Omaha.pm] /^\Q*****\E/ In-Reply-To: <29AB736ABCE5C745ABF9C93B02F2C27B05A37AF6@exchange2k3.omnihotels.net> References: <29AB736ABCE5C745ABF9C93B02F2C27B05A37AF6@exchange2k3.omnihotels.net> Message-ID: <9ac12b1c0608161346m24b1eba0gb96ad69ae1114374@mail.gmail.com> On 8/16/06, Jay Hannah wrote: > > Gotta love \Q and \E in regex's. :) > > # Set the cc_number to empty if it matches asterisks. The Reservation > class will ignore it. > # This is so people can change the expiration or name on card for > modifications. > # > $cc_number = "" if ($cc_number =~ /^\Q*****\E/); > > j > > >From perldoc perlre: > > \Q quote (disable) pattern metacharacters till \E > > Today it is more common to use the quotemeta() > function or the "\Q" metaquoting escape sequence to dis- > able all metacharacters' special meanings like this: > > /$unquoted\Q$quoted\E$unquoted/ > > Beware that if you put literal backslashes (those not > inside interpolated variables) between "\Q" and "\E", dou- > ble-quotish backslash interpolation may lead to confusing > results. If you need to use literal backslashes within > "\Q...\E", consult "Gory details of parsing quoted con- > structs" in perlop. > > _______________________________________________ Neat stuff. I don't think I've ever used it though - although I have used quotemeta numerous times. From jhannah at omnihotels.com Thu Aug 17 10:42:21 2006 From: jhannah at omnihotels.com (Jay Hannah) Date: Thu, 17 Aug 2006 12:42:21 -0500 Subject: [Omaha.pm] a day in the life... Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B05A37B0F@exchange2k3.omnihotels.net> perldoc Model::omares::Complex::Rates::SeamlessSummary NAME Model::omares::Complex::Rates::SeamlessSummary - Uhh... does something METHODS -snip!- ... $day++; $dollar++; :) j From pbaker at omnihotels.com Thu Aug 17 11:05:01 2006 From: pbaker at omnihotels.com (Sean Baker) Date: Thu, 17 Aug 2006 13:05:01 -0500 Subject: [Omaha.pm] a day in the life... Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B06277AA9@exchange2k3.omnihotels.net> Laugh, CVS log for source/common/perl/MVC/Model/omares/Complex/Rates/SeamlessSummary.pm Revision 1.62 / (view) - annotate - [select for diffs] , Fri Dec 10 23:12:44 2004 UTC (20 months ago) by jhannah Branch: MAIN CVS Tags: Core_3_0_Britain, Core_2_5_Danang, Core_2_4_Allia Changes since 1.61: +36 -40 lines Diff to previous 1.61 ... Diff: Model::omares::crs::Rates::SeamlessSummary - Uhh... does something Sean :) -----Original Message----- From: omaha-pm-bounces+pbaker=omnihotels.com at pm.org [mailto:omaha-pm-bounces+pbaker=omnihotels.com at pm.org] On Behalf Of Jay Hannah Sent: Thursday, August 17, 2006 12:42 PM To: Perl Mongers of Omaha, Nebraska USA Subject: [Omaha.pm] a day in the life... perldoc Model::omares::Complex::Rates::SeamlessSummary NAME Model::omares::Complex::Rates::SeamlessSummary - Uhh... does something METHODS -snip!- ... $day++; $dollar++; :) j _______________________________________________ Omaha-pm mailing list Omaha-pm at pm.org http://mail.pm.org/mailman/listinfo/omaha-pm From jay at jays.net Thu Aug 17 17:31:47 2006 From: jay at jays.net (Jay Hannah) Date: Thu, 17 Aug 2006 19:31:47 -0500 Subject: [Omaha.pm] a day in the life... In-Reply-To: <29AB736ABCE5C745ABF9C93B02F2C27B06277AA9@exchange2k3.omnihotels.net> References: <29AB736ABCE5C745ABF9C93B02F2C27B06277AA9@exchange2k3.omnihotels.net> Message-ID: <44E50A73.6060605@jays.net> Sean Baker wrote: > Laugh, > > Revision 1.62 / (view) - annotate - [select for diffs] , Fri Dec 10 > 23:12:44 2004 UTC (20 months ago) by jhannah > > Diff: > Model::omares::crs::Rates::SeamlessSummary - Uhh... does something Guilty as charged. "Uhh..." sounds exactly like something I'd say. Probably adding POD for a method I was changing but the class had *no* POD at all yet so I had to throw the NAME, SYNOPSIS, METHODS at the top but I had no idea what the philosophy of the class as a whole was... I made it quite a bit better today, IMHO. I'm older and wiser now. Besides, "podchecker SeamlessSummary.pm" told me that "Uhh..." was A-OK. :) j From jay at jays.net Thu Aug 17 20:21:56 2006 From: jay at jays.net (Jay Hannah) Date: Thu, 17 Aug 2006 22:21:56 -0500 Subject: [Omaha.pm] Shirts: I'll take your money now. :) Message-ID: <44E53254.8010901@jays.net> Well, my little shirt experiment turned into a $2700 (+ shipping) shirt order. :) http://omaha.pm.org/shirts.shtml Below is the Omaha section. Trey and Dave have paid, if the others want to PayPal me plus a couple bucks shipping that would be great. Other options below and on the website. Thanks! j >From the website: ---------------------------- Jay Hannah Omni Hotels Reservation Center 11819 Miami St, 3rd Floor Omaha, NE 68164 Phone: 1-402-578-3976 ---------------------------- 1 2XL black $ 8.75 Jay Hannah 2 2XL ash $ 16.30 Jay Hannah 2 2XL ash $ 16.30 Trey Bianchini 1 2XL black $ 8.75 Dave M 1 XL ash $ 5.95 Herb Wolfe, Jr. 1 L black $ 6.65 Ryan Stille 1 M black $ 6.65 Ryan Stille 1 M black $ 6.65 Matthew Heller 1 2XL black $ 8.75 Richard Norton 1 2XL ash $ 8.15 Richard Norton ---------------------------- Subtotal $ 92.90 Shipping $ 13.00 PayPal fee $ 3.37 payment -$ 20.00 Trey Bianchini payment -$ 14.00 Dave M Total Due $ 75.27 USD Also from the website: Omaha Specific Info Omaha How To Pay: * PayPal me (Jay Hannah) now: jay(at)jays(dot)net. * Pay me in person. I work near 120th and Maple. Just give me a call: 578-3976. * Swing by Reboot The User and pay now or when you pick up the shirts. Omaha Shirt Pickup (once the order comes in) Reboot the User (RTU) Jay Swackhamer, proprietor 13416 A Street Omaha, NE 68144 (402) 933-6449 Store hours (from his website): Tuesday through Friday 6:00pm to 11:00pm Saturday 4:00pm to 9:00pm Sunday, Monday Closed. From jay at jays.net Mon Aug 21 05:36:15 2006 From: jay at jays.net (Jay Hannah) Date: Mon, 21 Aug 2006 07:36:15 -0500 Subject: [Omaha.pm] Uncyclopedia Message-ID: <94C5B822-C5CD-4D37-A1B6-7E733CF0BEA9@jays.net> http://uncyclopedia.org/wiki/Perl Laugh, j --- http://uncyclopedia.org/wiki/Java http://uncyclopedia.org/wiki/.NET http://uncyclopedia.org/wiki/Python http://uncyclopedia.org/wiki/Ruby http://uncyclopedia.org/wiki/C_Sharp http://uncyclopedia.org/wiki/Cisco http://uncyclopedia.org/wiki/Linux http://uncyclopedia.org/wiki/Windows From jhannah at omnihotels.com Mon Aug 21 11:48:45 2006 From: jhannah at omnihotels.com (Jay Hannah) Date: Mon, 21 Aug 2006 13:48:45 -0500 Subject: [Omaha.pm] 'Here' Documents don't do method calls Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B05A37B42@exchange2k3.omnihotels.net> Bug fix... Before my $strsql = <get_property(); my $strsql = < Before: sub prepend_pegheader { my ($str, $msgtype) = (@_); my $len = length($str) + 6; $len = "00000" . $len; # Just slap 5 zeroes onto the front and only $len =~ s/^\d+(\d{5})$/$1/; # take the last 5 characters. $str = "$msgtype$len$str"; return $str; } After: sub prepend_pegheader { my ($str, $msgtype) = (@_); my $len = sprintf("%05d", length($str) + 6); return "$msgtype$len$str"; } ? j From dan at linder.org Mon Aug 28 07:41:46 2006 From: dan at linder.org (Daniel Linder) Date: Mon, 28 Aug 2006 09:41:46 -0500 (CDT) Subject: [Omaha.pm] sprintf is your friend In-Reply-To: <29AB736ABCE5C745ABF9C93B02F2C27B05A37BC2@exchange2k3.omnihotels.net> References: <29AB736ABCE5C745ABF9C93B02F2C27B05A37BC2@exchange2k3.omnihotels.net> Message-ID: <56663.63.230.40.25.1156776106.squirrel@www.linder.org> On Fri, August 25, 2006 15:47, Jay Hannah wrote: > Before: > > sub prepend_pegheader > { > my ($str, $msgtype) = (@_); > my $len = length($str) + 6; > $len = "00000" . $len; # Just slap 5 zeroes onto the front and > only > $len =~ s/^\d+(\d{5})$/$1/; # take the last 5 characters. > $str = "$msgtype$len$str"; > return $str; > } I don't like this -- it seems to use a lot of extra steps to achieve the same result. I'd only use this over the other one if it was faster and that was a paramount issue in the program. The only place I can realistically see this breaking is if "len" is >99999 - thus only the last five digits of the real number would get captured. At least with "sprintf" it will expand the "%05d" to show all six digits if needed. Of course that might be the intent so that the sixth column is *always* the start of "str" nomatter what. dan at dglinder:~/tmp$ cat d.pl #!perl -w $number = 123; $line = sprintf ("1: %05d\n", $number); printf ("%s", $line); $number = 123123; $line = sprintf ("2: %05d\n", $number); printf ("%s", $line); dan at dglinder:~/tmp$ perl ./d.pl 1: 00123 2: 123123 > After: > sub prepend_pegheader > { > my ($str, $msgtype) = (@_); > my $len = sprintf("%05d", length($str) + 6); > return "$msgtype$len$str"; > } This is my pick, even if it is a slight bit slower in the end -- much more readable. If you do get six digits showing up where you only wanted five then I would recommend that you check why the length of "str" is so great, and either adjust the five digits to six or larger, or fix the input being placed into "str". 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 From jhannah at omnihotels.com Mon Aug 28 13:20:33 2006 From: jhannah at omnihotels.com (Jay Hannah) Date: Mon, 28 Aug 2006 15:20:33 -0500 Subject: [Omaha.pm] object -> object mappings Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B05A37BCF@exchange2k3.omnihotels.net> This made me laugh today. Code I wrote. For all these attibutes fill one object from another... my $hdr = $self->get_HDR; foreach (qw( cty hrs aad ars gmt sct sga loc sff utt sqn typ pri )) { my $method1 = "set_" . uc($_); my $method2 = "get_hdr_$_"; $hdr->$method1($pegasus_bout->$method2); } j From KThompson at heiskell.com Mon Aug 28 13:31:30 2006 From: KThompson at heiskell.com (Thompson, Kenn) Date: Mon, 28 Aug 2006 13:31:30 -0700 Subject: [Omaha.pm] object -> object mappings Message-ID: <16F8D15756891C4EA961565331A3B350056D3E2D@JDHEXC01.heiskell.com> Ok, color me newb, but what's wrong with that? -----Original Message----- For all these attibutes fill one object from another... my $hdr = $self->get_HDR; foreach (qw( cty hrs aad ars gmt sct sga loc sff utt sqn typ pri )) { my $method1 = "set_" . uc($_); my $method2 = "get_hdr_$_"; $hdr->$method1($pegasus_bout->$method2); } From pbaker at omnihotels.com Mon Aug 28 13:42:48 2006 From: pbaker at omnihotels.com (Sean Baker) Date: Mon, 28 Aug 2006 15:42:48 -0500 Subject: [Omaha.pm] object -> object mappings Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B063C729D@exchange2k3.omnihotels.net> Jay's trying to show off his mojo. Other than not knowing what all the three character attributes are, nothing.... Sean -----Original Message----- From: omaha-pm-bounces+pbaker=omnihotels.com at pm.org [mailto:omaha-pm-bounces+pbaker=omnihotels.com at pm.org] On Behalf Of Thompson, Kenn Sent: Monday, August 28, 2006 3:32 PM To: 'Perl Mongers of Omaha, Nebraska USA' Subject: Re: [Omaha.pm] object -> object mappings Ok, color me newb, but what's wrong with that? -----Original Message----- For all these attibutes fill one object from another... my $hdr = $self->get_HDR; foreach (qw( cty hrs aad ars gmt sct sga loc sff utt sqn typ pri )) { my $method1 = "set_" . uc($_); my $method2 = "get_hdr_$_"; $hdr->$method1($pegasus_bout->$method2); } _______________________________________________ Omaha-pm mailing list Omaha-pm at pm.org http://mail.pm.org/mailman/listinfo/omaha-pm From jay at jays.net Mon Aug 28 17:57:13 2006 From: jay at jays.net (Jay Hannah) Date: Mon, 28 Aug 2006 19:57:13 -0500 Subject: [Omaha.pm] object -> object mappings In-Reply-To: <16F8D15756891C4EA961565331A3B350056D3E2D@JDHEXC01.heiskell.com> References: <16F8D15756891C4EA961565331A3B350056D3E2D@JDHEXC01.heiskell.com> Message-ID: <44F390E9.8090804@jays.net> Thompson, Kenn wrote: > Ok, color me newb, but what's wrong with that? IMO, nothing. It just makes me laugh when I write Perl like that because (1) database tables with 100 columns drive me nutty, (2) I suspect that would have been a lot more code in other languages, so the fact that Perl does such an kooky job so well makes me giggle like a school girl. Shortly after I wrote that one I wrote a similar block that does the same thing to 40 columns from the same database table. Only 2 extra lines of Perl -- just a longer qw() block. :) j From jay at jays.net Mon Aug 28 18:11:18 2006 From: jay at jays.net (Jay Hannah) Date: Mon, 28 Aug 2006 20:11:18 -0500 Subject: [Omaha.pm] sprintf is your friend In-Reply-To: <56663.63.230.40.25.1156776106.squirrel@www.linder.org> References: <29AB736ABCE5C745ABF9C93B02F2C27B05A37BC2@exchange2k3.omnihotels.net> <56663.63.230.40.25.1156776106.squirrel@www.linder.org> Message-ID: <44F39436.1010809@jays.net> Daniel Linder wrote: > On Fri, August 25, 2006 15:47, Jay Hannah wrote: >> Before: >> >> sub prepend_pegheader >> { >> my ($str, $msgtype) = (@_); >> my $len = length($str) + 6; >> $len = "00000" . $len; # Just slap 5 zeroes onto the front and >> only >> $len =~ s/^\d+(\d{5})$/$1/; # take the last 5 characters. >> $str = "$msgtype$len$str"; >> return $str; >> } > > I don't like this -- it seems to use a lot of extra steps to achieve the > same result. I'd only use this over the other one if it was faster and > that was a paramount issue in the program. Indeed. Whenever I post "Before:" and "After:" code samples I'm asserting that the "After:" is a better way to do the same thing. It appears you and I agree in this case. :) > The only place I can realistically see this breaking is if "len" is >99999 > - thus only the last five digits of the real number would get captured. > At least with "sprintf" it will expand the "%05d" to show all six digits > if needed. Of course that might be the intent so that the sixth column is > *always* the start of "str" nomatter what. > > dan at dglinder:~/tmp$ cat d.pl > #!perl -w > > $number = 123; > $line = sprintf ("1: %05d\n", $number); > printf ("%s", $line); > > $number = 123123; > $line = sprintf ("2: %05d\n", $number); > printf ("%s", $line); > > dan at dglinder:~/tmp$ perl ./d.pl > 1: 00123 > 2: 123123 Ah, yes. Good point about numbers > 99999. In my particular context, such a thing is not supposed to be possible so I think my conversion was valid. >> After: >> sub prepend_pegheader >> { >> my ($str, $msgtype) = (@_); >> my $len = sprintf("%05d", length($str) + 6); >> return "$msgtype$len$str"; >> } > > This is my pick, even if it is a slight bit slower in the end -- much more > readable. If you do get six digits showing up where you only wanted five > then I would recommend that you check why the length of "str" is so great, > and either adjust the five digits to six or larger, or fix the input being > placed into "str". In my particular context the vendor specification does not allow for lengths > 99999. So I don't know what I "should do" if the length was longer. Dump core and page everyone, probably. :) After I posted that I was have tempted to Perl golf it down to sub prepend_pegheader { my ($str, $msgtype) = (@_); return sprintf("%s%05d%s", $msgtype, length($str) + 6, $str); } or sub prepend_pegheader { sprintf("%s%05d%s", $_[1], length($_[0]) + 6, $_[0]); } or no sub at all since it's one line now. :) But I'm not that evil. I like being able to read the code I wrote yesterday without excessive quantities of ellicit drugs. j From jhannah at omnihotels.com Tue Aug 29 08:54:28 2006 From: jhannah at omnihotels.com (Jay Hannah) Date: Tue, 29 Aug 2006 10:54:28 -0500 Subject: [Omaha.pm] regex'ing binary goo?? Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B05A37BDC@exchange2k3.omnihotels.net> $ cat j.pl my $stream = "A00010\x{1b}\x{be}\x{a}\x{81}D00318"; if ($stream =~ /^A00010.{4}/) { print "yes\n"; } else { print "no\n"; } $ perl j.pl no What?? That string doesn't start with A00010 followed by 4 somethings? j From andy at petdance.com Tue Aug 29 09:48:14 2006 From: andy at petdance.com (Andy Lester) Date: Tue, 29 Aug 2006 11:48:14 -0500 Subject: [Omaha.pm] regex'ing binary goo?? In-Reply-To: <29AB736ABCE5C745ABF9C93B02F2C27B05A37BDC@exchange2k3.omnihotels.net> References: <29AB736ABCE5C745ABF9C93B02F2C27B05A37BDC@exchange2k3.omnihotels.net> Message-ID: On Aug 29, 2006, at 10:54 AM, Jay Hannah wrote: > What?? That string doesn't start with A00010 followed by 4 > somethings? Note that . doesn't match everything. It doesn't match \n, for example. -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From andy at petdance.com Tue Aug 29 10:42:30 2006 From: andy at petdance.com (Andy Lester) Date: Tue, 29 Aug 2006 12:42:30 -0500 Subject: [Omaha.pm] Hackathon Chicago, Nov 10-12, 2006! Message-ID: The Chicago Perl Mongers and The Perl Foundation are proud to announce the Fall 2006 Chicago Hackathon, the weekend of November 10-12, 2006 in suburban Crystal Lake, IL. It will be a round-the- clock weekend of programming on Perl-related projects with your colleagues in the open source community. Dozens of programmers from the open source community in the midwest, as well as others from around the US, will be getting together to share ideas, work on code, and move their Perl-related projects forward. The participants set the agenda for what we'll be working on, but Perl 6 and Parrot are already on the roster of projects. Chip Salzenberg, pumpking for the Parrot project, will be on hand to help with Parrot and Perl 6. Andy Lester will also be driving some Parrot maintenance tasks, and other midwest programmers will be working on their own projects. There's sure to be something interesting for everyone! Participation in the hackathon costs nothing. The Perl Foundation is even providing hotel rooms at a special rate if you want to spend the night. Even if you're in the area for just an hour, stop by, grab a snack or some pizza and talk with other people interested in Perl. You might contribute more than you think just by talking with other programmers. To find out more, visit http://hackathon.info. If you'll be attending, please sign in on the Attendees wiki page, and/or email rsvp at hackathon.info. You can also send questions to Andy Lester at andy at hackathon.info (Google says it's only an 8 hour drive! Hope to see you here!) http://maps.google.com/maps? f=d&hl=en&sll=41.89445,-90.954885&sspn=4.521918,8.338623&saddr=Omaha, +NE&daddr=600+Tracy+Trl,+Crystal+Lake,+IL+60014+% 4042.228169,-88.298386&ie=UTF8&ll=41.738528,-92.120361&spn=4.532905,8.33 8623&om=1 xoxo, Andy -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From jhannah at omnihotels.com Tue Aug 29 11:03:01 2006 From: jhannah at omnihotels.com (Jay Hannah) Date: Tue, 29 Aug 2006 13:03:01 -0500 Subject: [Omaha.pm] regex'ing binary goo?? Message-ID: <29AB736ABCE5C745ABF9C93B02F2C27B05A37BE2@exchange2k3.omnihotels.net> Andy was right... Apparently '.' doesn't match a bunch of binary goo. Throw the /s switch on your regex though and it seems to do what I expected. I've used /s a million times, but never in the context of embedded random binary crap in my scalars... $ cat j.pl foreach ( "A00010\x{1b}\x{be}\x{a}\x{81}D00318", "A00010\x{a}\x{1c}\x{10}hD00318" ) { print (/^A00010.{4}/ ? "yes " : "no "); print (/^A00010.{4}/s ? "yes " : "no "); } print "\n"; $ perl j.pl no yes no yes /s is my friend. :) j From dan at linder.org Wed Aug 30 08:26:11 2006 From: dan at linder.org (Daniel Linder) Date: Wed, 30 Aug 2006 10:26:11 -0500 (CDT) Subject: [Omaha.pm] regex'ing binary goo?? In-Reply-To: <29AB736ABCE5C745ABF9C93B02F2C27B05A37BDC@exchange2k3.omnihotels.net> References: <29AB736ABCE5C745ABF9C93B02F2C27B05A37BDC@exchange2k3.omnihotels.net> Message-ID: <41286.70.171.164.226.1156951571.squirrel@www.linder.org> On Tue, August 29, 2006 10:54, Jay Hannah wrote: > $ cat j.pl > my $stream = "A00010\x{1b}\x{be}\x{a}\x{81}D00318"; > if ($stream =~ /^A00010.{4}/) { > print "yes\n"; > } else { > print "no\n"; > } > > $ perl j.pl > no > > > What?? That string doesn't start with A00010 followed by 4 somethings? I beleve that the "\x{a}" is kicking you -- isn't that the hex character "0xA" or "newline"? Thus, your "$stream" variable is actually two lines as far as the regexp is concerned. (If I mis-read the \x{a} and/or mis-understood regexp and multi-line matching, just ignore this...) 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 From jay at jays.net Wed Aug 30 19:33:56 2006 From: jay at jays.net (Jay Hannah) Date: Wed, 30 Aug 2006 21:33:56 -0500 Subject: [Omaha.pm] regex'ing binary goo?? In-Reply-To: <41286.70.171.164.226.1156951571.squirrel@www.linder.org> References: <29AB736ABCE5C745ABF9C93B02F2C27B05A37BDC@exchange2k3.omnihotels.net> <41286.70.171.164.226.1156951571.squirrel@www.linder.org> Message-ID: <44F64A94.5080001@jays.net> Daniel Linder wrote: > I beleve that the "\x{a}" is kicking you -- isn't that the hex character > "0xA" or "newline"? Thus, your "$stream" variable is actually two lines > as far as the regexp is concerned. Oh, really? Yup, that would definitely explain that then! AFAIK that binary junk is just random so I guess it would be my luck that randomness would hit /n. :) j