From rob.townley at gmail.com Tue May 1 08:59:51 2007 From: rob.townley at gmail.com (Rob Townley) Date: Tue, 1 May 2007 10:59:51 -0500 Subject: [Omaha.pm] database -> XML In-Reply-To: <20070430102245.riba1ebk9w4wc800@www.neillnet.com> References: <20070422224044.lmhzzqzyo0wgk0gk@www.neillnet.com> <7e84ed60704241901l2d385c1cg771a6cfbe333aadc@mail.gmail.com> <20070430102245.riba1ebk9w4wc800@www.neillnet.com> Message-ID: <7e84ed60705010859i7887f556sf58c650b1348d3ad@mail.gmail.com> On 4/30/07, George Neill wrote: > > Quoting Rob Townley : > > > Several years ago, elements were better. > > There's no good answer, I believe it depends what you are trying to > do. Elements are nice because they are extendible/readable ... but > lengthy at times. Take a look at the link Jay provided, the author > makes good sense. > > An example, > > > > 0 > > > lastname > 20 > > > city > 28 > > > zipcode > 5 > > > > > > I find overkill. But apparently the M$ tools ('code generators') > slurp the above xml without having to write a lick of code. I would > prefer something in the middle. > > > > > > 20 > > > > 28 > > > > 5 > > > > > > > Later, > George. > > _______________________________________________ > Omaha-pm mailing list > Omaha-pm at pm.org > http://mail.pm.org/mailman/listinfo/omaha-pm > Even though i argued for using XML in about everything, the verbosity of many of XML projects subconsciously drove me away from programming, in particular, the XML MS products would spew out. However, judicious use of namespaces would help some. i remember having trouble with some of the dtd's when using a namespace version of an xml doc, so i wasn't able to use namespaces back then as much as i would have liked. 0 lastname 20 city 28 zipcode 5 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20070501/0625a71e/attachment.html From jhannah at omnihotels.com Wed May 2 15:14:45 2007 From: jhannah at omnihotels.com (Jay Hannah) Date: Wed, 2 May 2007 17:14:45 -0500 Subject: [Omaha.pm] "grep" huge files w/ no linefeeds Message-ID: Problem: You have a 150MB file where "lines" of data are separated by the pipe character, but there are no newlines (or carriage returns) anywhere in the file. Find the "line" that contains the string 'MERGE-TO'. (grep will tell you that all 150MB of the file matches that string. Not very helpful.) Solution: Tell Perl that your line delimiter is '|' and to print if a line contains 'MERGE-TO'. $ perl -nle 'BEGIN {$/="|"} print if (/MERGE-TO/)' myfile.txt "AA","NMT","NO ""MERGE-TO"" ACCOUNT WAS FOUND","300" :) j From andy at petdance.com Wed May 2 15:26:17 2007 From: andy at petdance.com (Andy Lester) Date: Wed, 2 May 2007 17:26:17 -0500 Subject: [Omaha.pm] "grep" huge files w/ no linefeeds In-Reply-To: References: Message-ID: <693948BC-C49D-4A9D-9D08-E87ECBF1B78F@petdance.com> On May 2, 2007, at 5:14 PM, Jay Hannah wrote: > Tell Perl that your line delimiter is '|' and to print if a line > contains 'MERGE-TO'. > > $ perl -nle 'BEGIN {$/="|"} print if (/MERGE-TO/)' myfile.txt yay Perl! You can also specify $/ on the command line with the -0 (that's dash zero) flag. perl -0x7C -nle'print if /MERGE-TO/' myfile.txt See perldoc perlrun for more snazzy tricks. xoxo, Andy -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From georgen at neillnet.com Sat May 5 19:48:08 2007 From: georgen at neillnet.com (George Neill) Date: Sat, 05 May 2007 21:48:08 -0500 Subject: [Omaha.pm] database -> XML In-Reply-To: <7e84ed60705010859i7887f556sf58c650b1348d3ad@mail.gmail.com> References: <20070422224044.lmhzzqzyo0wgk0gk@www.neillnet.com> <7e84ed60704241901l2d385c1cg771a6cfbe333aadc@mail.gmail.com> <20070430102245.riba1ebk9w4wc800@www.neillnet.com> <7e84ed60705010859i7887f556sf58c650b1348d3ad@mail.gmail.com> Message-ID: <20070505214808.ehzbhhiuzuoggckk@www.neillnet.com> Quoting Rob Townley : > Even though i argued for using XML in about everything, the verbosity of > many of XML projects subconsciously drove me away from programming, in > particular, the XML MS products would spew out. However, judicious use of > namespaces would help some. i remember having trouble with some of the > dtd's when using a namespace version of an xml doc, so i wasn't able to > use namespaces back then as much as i would have liked. You are certainly right on the verbosity topic. XML certainly has it's place. I believe it is perfect for control/metadata/transactional data; outside of that ... I feel it brings too much overhead. Later, George. From jhannah at omnihotels.com Mon May 7 10:09:43 2007 From: jhannah at omnihotels.com (Jay Hannah) Date: Mon, 7 May 2007 12:09:43 -0500 Subject: [Omaha.pm] Convert date formats in text files Message-ID: Project: For all text files in a directory, change all instances of "YYYY-MM-DD HH:MM:SS" to "YYYYMMDD". Solution: perl -pi -e 's/(\d\d\d\d)-(\d\d)-(\d\d) \d\d:\d\d:\d\d/$1$2$3/g' *.txt j From jhannah at omnihotels.com Mon May 7 10:19:56 2007 From: jhannah at omnihotels.com (Jay Hannah) Date: Mon, 7 May 2007 12:19:56 -0500 Subject: [Omaha.pm] May meeting tomorrow, June meeting cancelled Message-ID: http://omaha.pm.org/ Tue, 08 May 2007 @ 7pm! I'll be in Australia in June. Yay! :) Topic suggestion welcome. Otherwise we'll just wing it, as usual. j From robert.fulkerson at gmail.com Mon May 7 10:53:55 2007 From: robert.fulkerson at gmail.com (Robert Fulkerson) Date: Mon, 7 May 2007 12:53:55 -0500 Subject: [Omaha.pm] May meeting tomorrow, June meeting cancelled In-Reply-To: References: Message-ID: <6cb6eebc0705071053j37d9fefalc1ce4508777401ef@mail.gmail.com> Y'know, maybe I should just move my Perl class from Tuesday nights so I could make it to the meetings. Orrrrrrrr, I could just have class meet at the meetings and cut down on what I have to teach. :) -- b On 5/7/07, Jay Hannah wrote: > > > http://omaha.pm.org/ > Tue, 08 May 2007 @ 7pm! > > I'll be in Australia in June. Yay! :) > > Topic suggestion welcome. Otherwise we'll just wing it, as usual. > > j > > _______________________________________________ > 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/20070507/163f71b8/attachment.html From kiranbina at gmail.com Mon May 7 12:56:11 2007 From: kiranbina at gmail.com (kiran bina) Date: Mon, 7 May 2007 14:56:11 -0500 Subject: [Omaha.pm] May meeting tomorrow, June meeting cancelled In-Reply-To: <6cb6eebc0705071053j37d9fefalc1ce4508777401ef@mail.gmail.com> References: <6cb6eebc0705071053j37d9fefalc1ce4508777401ef@mail.gmail.com> Message-ID: <531681ec0705071256x3d0d4b18pe3ab3e273db29149@mail.gmail.com> Later would be a good idea bob :-) On 5/7/07, Robert Fulkerson wrote: > > Y'know, maybe I should just move my Perl class from Tuesday nights so I > could make it to the meetings. Orrrrrrrr, I could just have class meet at > the meetings and cut down on what I have to teach. :) > > -- b > > On 5/7/07, Jay Hannah wrote: > > > > > > http://omaha.pm.org/ > > Tue, 08 May 2007 @ 7pm! > > > > I'll be in Australia in June. Yay! :) > > > > Topic suggestion welcome. Otherwise we'll just wing it, as usual. > > > > j > > > > _______________________________________________ > > Omaha-pm mailing list > > Omaha-pm at pm.org > > http://mail.pm.org/mailman/listinfo/omaha-pm > > > > > _______________________________________________ > Omaha-pm mailing list > Omaha-pm at pm.org > http://mail.pm.org/mailman/listinfo/omaha-pm > -- Dhundy R. Bastola Assistant Professor Department of Pediatrics University of Nebraska Medical Center Omaha NE 68198 Always reply to: dbastola at unmc.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20070507/d7ddc3e2/attachment.html From jay at jays.net Mon May 7 21:33:36 2007 From: jay at jays.net (Jay Hannah) Date: Mon, 7 May 2007 23:33:36 -0500 Subject: [Omaha.pm] May meeting tomorrow, June meeting cancelled In-Reply-To: <6cb6eebc0705071053j37d9fefalc1ce4508777401ef@mail.gmail.com> References: <6cb6eebc0705071053j37d9fefalc1ce4508777401ef@mail.gmail.com> Message-ID: On May 7, 2007, at 12:53 PM, Robert Fulkerson wrote: > Y'know, maybe I should just move my Perl class from Tuesday nights so > I could make it to the meetings.? Time to move the meeting again, me thinks. Thursdays are bad for me. Mondays or Wednesdays? I'm thinking 2nd Wednesday of every month, starting in July. Thereby avoiding all the other stuff, as far as I can tell: http://itinomaha.org/ j From ryan at cfwebtools.com Tue May 8 06:14:19 2007 From: ryan at cfwebtools.com (Ryan Stille) Date: Tue, 08 May 2007 08:14:19 -0500 Subject: [Omaha.pm] May meeting tomorrow, June meeting cancelled In-Reply-To: References: <6cb6eebc0705071053j37d9fefalc1ce4508777401ef@mail.gmail.com> Message-ID: <464077AB.1010403@cfwebtools.com> 2nd Wed. sounds good to me. What do you think about meeting at an earlier time, too, like 6:00 or 6:30? -Ryan Jay Hannah wrote: > Time to move the meeting again, me thinks. Thursdays are bad for me. > > Mondays or Wednesdays? I'm thinking 2nd Wednesday of every month, > starting in July. Thereby avoiding all the other stuff, as far as I can > tell: > > http://itinomaha.org/ > > j > From jhannah at omnihotels.com Tue May 8 15:40:49 2007 From: jhannah at omnihotels.com (Jay Hannah) Date: Tue, 8 May 2007 17:40:49 -0500 Subject: [Omaha.pm] Job opening Message-ID: If you're interested or know someone drop Jimmy a line. j -----Original Message----- From: Jimmy M. Smith [mailto:jsmith at paragonitpros.com] Sent: Tuesday, May 08, 2007 8:04 AM We are currently searching for an entry to middle level Perl programmer with knowledge of VB.net and some web experience. This position would be great for someone out of college up to 2 years of experience. It is a 6 month contract to hire position. The company truly wanted to hire this person full time. They interview every candidate as if they are going to hire them right away. GREAT company with thousands of employees around the world. Thank you, Jimmy Smith Branch Sales Manager PARAGON IT Professionals 11606 Nicholas Street Omaha, NE 68154 (402) 504-4091 Ext. 305 (402) 504-4150 Fax www.paragonitpros.com "I.T. Phone Home." Bring your Information Technology career home to Nebraska! Visit http://www.paragonitpros.com/itphonehome.aspx From jay at jays.net Tue May 8 15:54:48 2007 From: jay at jays.net (Jay Hannah) Date: Tue, 8 May 2007 17:54:48 -0500 Subject: [Omaha.pm] May meeting tomorrow, June meeting cancelled In-Reply-To: <464077AB.1010403@cfwebtools.com> References: <6cb6eebc0705071053j37d9fefalc1ce4508777401ef@mail.gmail.com> <464077AB.1010403@cfwebtools.com> Message-ID: <7e60da5c046d192b9799a8c5d9511fa1@jays.net> On May 8, 2007, at 8:14 AM, Ryan Stille wrote: > 2nd Wed. sounds good to me. What do you think about meeting at an > earlier time, too, like 6:00 or 6:30? Sure. Starting in July: Every second Wednesday @ 6:30. Other bids? Going once... j From jhannah at omnihotels.com Thu May 10 14:54:09 2007 From: jhannah at omnihotels.com (Jay Hannah) Date: Thu, 10 May 2007 16:54:09 -0500 Subject: [Omaha.pm] code reduction Message-ID: Wow. I committed this on December 12, 2000: my $eot = chr(4); # Perl regex's can't see newlines, so cheat temporarily. $foliolines =~ s/\n/$eot/g; my @foliolines = split //, $foliolines; for ( my $k = 130; # Start at character 130... $k < length($foliolines); # Stop when done... $k += 272 # Each folio line is 272 characters long... ) { splice @foliolines, $k, 22, (split //, $apply_this_card_to_all); } $foliolines = join "", @foliolines; $foliolines =~ s/$eot/\n/g; Here's my new version: $foliolines =~ s/(.{130}).{22}(.*?\n)/$1$apply_this_card_to_all$2/gs; Laugh, j older and wiser? From andy at petdance.com Thu May 10 15:11:59 2007 From: andy at petdance.com (Andy Lester) Date: Thu, 10 May 2007 17:11:59 -0500 Subject: [Omaha.pm] code reduction In-Reply-To: References: Message-ID: On May 10, 2007, at 4:54 PM, Jay Hannah wrote: > my $eot = chr(4); # Perl regex's can't see newlines, so cheat > temporarily. Yes they can. Look at the /s and /m flags in perlre. -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From jhannah at omnihotels.com Thu May 10 15:51:35 2007 From: jhannah at omnihotels.com (Jay Hannah) Date: Thu, 10 May 2007 17:51:35 -0500 Subject: [Omaha.pm] code reduction Message-ID: I guess I should post this too. This is the little demo I wrote myself to prove it worked. :) j $ cat j.pl my $apply_this_card_to_all = "new"; my $before = < References: Message-ID: >$foliolines =~ s/(.{130}).{22}(.*?\n)/$1$apply_this_card_to_all$2/gs; >for ( > my $k = 130; # Start at character 130... > $k < length($foliolines); # Stop when done... > $k += 272 # Each folio line is 272 characters >long... >) { Do you really want to remove an understandable commented section of code with that? I'll be ringing you at 3 in the morning. Sean From jay at jays.net Sat May 12 07:26:35 2007 From: jay at jays.net (Jay Hannah) Date: Sat, 12 May 2007 09:26:35 -0500 Subject: [Omaha.pm] code reduction In-Reply-To: References: Message-ID: <38B90847-A0E1-432D-B80B-FB1E161319AE@jays.net> On May 10, 2007, at 5:11 PM, Andy Lester wrote: > On May 10, 2007, at 4:54 PM, Jay Hannah wrote: >> my $eot = chr(4); # Perl regex's can't see newlines, so cheat >> temporarily. > > Yes they can. Look at the /s and /m flags in perlre. Indeed. Hence my rewrite. I've learned a couple things since 2000. :) On May 11, 2007, at 8:02 AM, Sean Baker wrote: > Do you really want to remove an understandable commented section of > code > with that? I'll be ringing you at 3 in the morning. In this case it seems to me that my 1 line rewrite is more maintainable than the 12 line original. The comments helped me understand what I was doing in the 12 lines, but I think its easier to read what the 1 line version does. Yes? No? j From jay at jays.net Mon May 14 20:27:04 2007 From: jay at jays.net (Jay Hannah) Date: Mon, 14 May 2007 22:27:04 -0500 Subject: [Omaha.pm] Next Meeting: Wed, 11 Jul 2007 @ 6:30pm! In-Reply-To: <7e60da5c046d192b9799a8c5d9511fa1@jays.net> References: <6cb6eebc0705071053j37d9fefalc1ce4508777401ef@mail.gmail.com> <464077AB.1010403@cfwebtools.com> <7e60da5c046d192b9799a8c5d9511fa1@jays.net> Message-ID: On May 8, 2007, at 5:54 PM, Jay Hannah wrote: > On May 8, 2007, at 8:14 AM, Ryan Stille wrote: >> 2nd Wed. sounds good to me. What do you think about meeting at an >> earlier time, too, like 6:00 or 6:30? > > Sure. Starting in July: Every second Wednesday @ 6:30. > > Other bids? Going once... Sold! http://omaha.pm.org/ Next Meeting: Wed, 11 Jul 2007 @ 6:30pm! j From marsee at oreilly.com Mon May 14 14:36:16 2007 From: marsee at oreilly.com (Marsee Henon) Date: Mon, 14 May 2007 14:36:16 -0700 Subject: [Omaha.pm] Newsletter from O'Reilly UG Program, May 14 Message-ID: <4A6C05D2-DD45-49A2-A49D-3023D850BDEF@oreilly.com> Hopefully this forwards OK. I stripped 90% of this off, leaving only the header, Perl stuff, and footer. You can click the link to read the whole thing if you want. j If you cannot read the information below, click here. Hi there? As you might have noticed, this is our first HTML user group newsletter. I hope it's easier to read, although I think it's just as long. Remember you can request new releases for reviews or raffles by simply replying to this email with your list of titles. And please include the 10 digit ISBN to make your order arrive faster! I'm looking for user group videos or podcasts to blog about at http:// oreillyfyi.com. If you have one you want to share, send me a short description and the url so people can watch and listen. Do you have any other special events or news we should know about? Send them along any time. I'll fit them in as I can. Travel alert: If you are going to be in Orlando for Tech*Ed the beginning of June, make sure you let me know so we can try to meet up--if I already asked you, no need to tell me again. I'll be in and out of the O'Reilly booth and attending the INETA UG leader Summit on Saturday, June 2. I'll also be going to the San Francisco Bay Area Maker Faire 2007. I'm not sure where I'll be yet, but we we can try and say hi if your going too. Thanks for your help! ?Marsee Open Source Building a Data Warehouse with MySQL and Perl Most of us are at least somewhat familiar with the kind of relational database schemas that are created for e-commerce sites, among others. But there's another kind of database model out there: the data warehouse. Sam Tregar gives us the lowdown on this highly UNrelational database. Five Ways to Improve Your Perl Programming Inside every tangle of obfuscated Perl code is a clean, well- architected gem struggling to emerge from its cocoon. brian d foy has spent a lot of time thinking about this for his new book, "Mastering Perl," and has come up with a Top Five list of things that every Perl programmer should be thinking about when writing code. Until next time? Marsee Henon O'Reilly Media, Inc. 1005 Gravenstein Highway North, Sebastopol, CA 95472 http://ug.oreilly.com/ http://ug.oreilly.com/creativemedia/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20070514/707a0d20/attachment.html From jhannah at omnihotels.com Tue May 15 11:39:41 2007 From: jhannah at omnihotels.com (Jay Hannah) Date: Tue, 15 May 2007 13:39:41 -0500 Subject: [Omaha.pm] Jays back referencing substitution code...or the tangled ugliness of nested parens in reg expressions...or 'HEY YA'LL WATCH THIS!!!' In-Reply-To: References: Message-ID: -laugh- I'm not sure what real code you're accusing me of writing, but to figure out $1, $2, $3, simply count the left parens from left to right. The first left paren is $1, the second is $2, etc. j -----Original Message----- From: Trey Bianchini Sent: Tuesday, May 15, 2007 10:31 AM To: Sean Baker; Justin Esbenshade; Jay Hannah Subject: Jays back referencing substitution code...or the tangled ugliness of nested parens in reg expressions...or 'HEY YA'LL WATCH THIS!!!' echo "J,A,J,B,J,C" | perl -ne ' $_=~m/((J(,A,J),(B)),((J),C))/; print "one:$1\ntwo:$2\nthree:$3\nfour:$4\nfive:$5\nsix:$6\n" '; #one:J,A,J,B,J,C #two:J,A,J,B #three:,A,J #four:B #five:J,C #six:J It Seems that they are assigned to placeholder variables starting with the outermost parens and then going left to right, unesting them completely before moving to the next leftmost pair..... From jay at jays.net Thu May 17 12:43:23 2007 From: jay at jays.net (Jay Hannah) Date: Thu, 17 May 2007 14:43:23 -0500 (CDT) Subject: [Omaha.pm] Code reduction Message-ID: Confession: This isn't really Perl specific, just a general logic / cleanup excercise. j Before: next if ((not $row[20] =~ /^PENDING/) and (not $row[20] =~ /^ACTIVE/)); #get rid of all rows not pending # next if (not $row[20] =~ /^PENDING/); #get rid of all rows not pending next if ($row[19] =~ /^ON-CALL/); After: next unless ($row[20] =~ /^(PENDING|ACTIVE)$/; From jay at jays.net Thu May 17 12:58:31 2007 From: jay at jays.net (Jay Hannah) Date: Thu, 17 May 2007 14:58:31 -0500 (CDT) Subject: [Omaha.pm] Code reduction In-Reply-To: References: Message-ID: On Thu, 17 May 2007, Jay Hannah wrote: > Before: > > next if ((not $row[20] =~ /^PENDING/) and (not $row[20] =~ /^ACTIVE/)); #get rid of all rows not pending > # next if (not $row[20] =~ /^PENDING/); #get rid of all rows not pending > next if ($row[19] =~ /^ON-CALL/); > > After: > > next unless ($row[20] =~ /^(PENDING|ACTIVE)$/; Whoops! $row[20] and $row[19] are not the same thing. Doh! After(v2): next unless ($row[20] =~ /^(PENDING|ACTIVE)$/; next if ($row[19] =~ /^ON-CALL/); Somebody slap me! j From pbaker at omnihotels.com Thu May 17 12:04:08 2007 From: pbaker at omnihotels.com (Sean Baker) Date: Thu, 17 May 2007 14:04:08 -0500 Subject: [Omaha.pm] Code reduction In-Reply-To: References: Message-ID: That would work if it had a ")". And possibly this: next if ($row[20] !~ /^(PENDING|ACTIVE)$/); :) 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, May 17, 2007 2:43 PM To: omaha-pm at pm.org Subject: [Omaha.pm] Code reduction Confession: This isn't really Perl specific, just a general logic / cleanup excercise. j Before: next if ((not $row[20] =~ /^PENDING/) and (not $row[20] =~ /^ACTIVE/)); #get rid of all rows not pending # next if (not $row[20] =~ /^PENDING/); #get rid of all rows not pending next if ($row[19] =~ /^ON-CALL/); After: next unless ($row[20] =~ /^(PENDING|ACTIVE)$/; _______________________________________________ Omaha-pm mailing list Omaha-pm at pm.org http://mail.pm.org/mailman/listinfo/omaha-pm From jay at jays.net Thu May 17 13:49:24 2007 From: jay at jays.net (Jay Hannah) Date: Thu, 17 May 2007 15:49:24 -0500 (CDT) Subject: [Omaha.pm] Code reduction In-Reply-To: References: Message-ID: On Thu, 17 May 2007, Sean Baker wrote: > That would work if it had a ")". Doh again! Yup. :) > And possibly this: > > next if ($row[20] !~ /^(PENDING|ACTIVE)$/); > > :) I spent two hours one day banging my forhead because I typo'd !~ as !=. I can't trust myself with !~. :) I don't know what != // is *supposed* to do, but it doesn't syntax error: $ cat j.pl my $a = "egg"; if ($a !~ /plant/) { print "no match 1\n"; } if ($a != /plant/) { print "no match 2\n"; } $ perl j.pl no match 1 When my typos don't syntax error I'm in trouble because my brain doesn't see them when I stare at my code. j luvs punctuation wars and driving Pythonistas crazy with Perl "line noise" :) From pbaker at omnihotels.com Thu May 17 13:08:06 2007 From: pbaker at omnihotels.com (Sean Baker) Date: Thu, 17 May 2007 15:08:06 -0500 Subject: [Omaha.pm] Code reduction In-Reply-To: References: Message-ID: >I spent two hours one day banging my forhead because I typo'd !~ as !=. I >can't trust myself with !~. :) That's why Larry invented -w. To save you from using != //. pbaker at razorbill:~> perl t.pl no match 1 Use of uninitialized value in pattern match (m//) at t.pl line 7. Argument "egg" isn't numeric in numeric ne (!=) at t.pl line 7. Sean From jay at jays.net Thu May 17 14:20:05 2007 From: jay at jays.net (Jay Hannah) Date: Thu, 17 May 2007 16:20:05 -0500 (CDT) Subject: [Omaha.pm] Code reduction In-Reply-To: References: Message-ID: On Thu, 17 May 2007, Sean Baker wrote: > That's why Larry invented -w. To save you from using != //. > > pbaker at razorbill:~> perl t.pl > no match 1 > Use of uninitialized value in pattern match (m//) at t.pl line 7. > Argument "egg" isn't numeric in numeric ne (!=) at t.pl line 7. Hey, that would have been helpful! Confessional: I gave up on -w years ago when I disagreed with some of its "uninitialized" complaints in code I deemed clean. I guess the day I had that problem I should have given -w a stab at my code. :) j From reynacho at gmail.com Sun May 20 20:41:05 2007 From: reynacho at gmail.com (Jake Churchill) Date: Sun, 20 May 2007 22:41:05 -0500 Subject: [Omaha.pm] ColdFusion Job Opening Message-ID: <465114bf.4ed085e6.08d1.6a4a@mx.google.com> I work at CF Webtools (http://www.cfwebtools.com ) and we are currently looking for ColdFusion developers. There is a post on our website for an Intermediate to Advanced level developer. You can view that here: http://www.cfwebtools.com/index.cfm?objectid=EB52D74F-970E-628C-BAED1F6D0002 839C. I also know that my boss would be interested in picking up an entry level person. If you know anything about web development (php, perl, asp) you would definitely be considered for the position. If you are interested, contact me (reynacho at gmail.com) or Mark Kruger (mkruger at cfwebtools.com). Send a resume along if you can. FYI, about the entry level position, my boss mentioned that he'd even consider something part-time so if you are a student, this would be an AWESOME way to get some experience. Jake -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20070520/34fa12fb/attachment.html From jhannah at omnihotels.com Mon May 21 13:46:15 2007 From: jhannah at omnihotels.com (Jay Hannah) Date: Mon, 21 May 2007 15:46:15 -0500 Subject: [Omaha.pm] A .. Z Message-ID: -laugh- Here's a comment I wrote in 2001, commenting out someone else's code. j # my $letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; # What was that? Bad form, bad form! -grin- -jhannah 7/6/01 my $letters = join "", "A".."Z"; From jhannah at omnihotels.com Mon May 21 13:46:15 2007 From: jhannah at omnihotels.com (Jay Hannah) Date: Mon, 21 May 2007 15:46:15 -0500 Subject: [Omaha.pm] A .. Z Message-ID: -laugh- Here's a comment I wrote in 2001, commenting out someone else's code. j # my $letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; # What was that? Bad form, bad form! -grin- -jhannah 7/6/01 my $letters = join "", "A".."Z"; From jhannah at omnihotels.com Mon May 21 13:46:15 2007 From: jhannah at omnihotels.com (Jay Hannah) Date: Mon, 21 May 2007 15:46:15 -0500 Subject: [Omaha.pm] A .. Z Message-ID: -laugh- Here's a comment I wrote in 2001, commenting out someone else's code. j # my $letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; # What was that? Bad form, bad form! -grin- -jhannah 7/6/01 my $letters = join "", "A".."Z"; From jhannah at omnihotels.com Tue May 22 17:17:36 2007 From: jhannah at omnihotels.com (Jay Hannah) Date: Tue, 22 May 2007 19:17:36 -0500 Subject: [Omaha.pm] 'perl -d' |x hangs when quitting until 'export PERL_RL=1' Message-ID: I don't know why, but I just ran into another box where |x hangs when you try to leave it when pager is |less. ------------------ $ perl -d -e 1 Loading DB routines from perl5db.pl version 1.23 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): 1 auto(-1) DB<1> DB<1> o pager? pager = '|less' DB<2> |x $j ------------------ The less screen pops up, you hit 'q' to exit it, and then you're hung. Nothing but Control-\ does anything. export PERL_RL=1 and then everything works fine. I have no idea why. j From rob.townley at gmail.com Thu May 24 21:26:53 2007 From: rob.townley at gmail.com (Rob Townley) Date: Thu, 24 May 2007 23:26:53 -0500 Subject: [Omaha.pm] omaha.pm.org down Message-ID: <7e84ed60705242126w796624c0v4154fedba2f44250@mail.gmail.com> Jay, since it appears you wrote http://groups.pm.org/faq.html, i thought there may be a slight chance you could do something about omaha.pm.org being down. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20070524/bbb13822/attachment.html From jhannah at omnihotels.com Fri May 25 09:08:29 2007 From: jhannah at omnihotels.com (Jay Hannah) Date: Fri, 25 May 2007 11:08:29 -0500 Subject: [Omaha.pm] omaha.pm.org down In-Reply-To: <531681ec0705250903q17a0010ax77aefc92bf3e6eaf@mail.gmail.com> References: <7e84ed60705242126w796624c0v4154fedba2f44250@mail.gmail.com> <531681ec0705250903q17a0010ax77aefc92bf3e6eaf@mail.gmail.com> Message-ID: The server that hosts omaha.pm.org lost its power supply yesterday. The admin is a friend of mine and thinks he'll have it back up later today or tomorrow. :) Cheers, j sent from my work email since jays.net lives on the same server. My whole world flows through that box... -laugh- ---------- Forwarded message ---------- From: Rob Townley Date: May 24, 2007 10:26 PM Subject: [Omaha.pm] omaha.pm.org down To: "Perl Mongers of Omaha, Nebraska USA" < omaha-pm at pm.org > Jay, since it appears you wrote http://groups.pm.org/faq.html, i thought there may be a slight chance you could do something about omaha.pm.org being down. From jay at jays.net Sun May 27 19:17:54 2007 From: jay at jays.net (Jay Hannah) Date: Sun, 27 May 2007 21:17:54 -0500 Subject: [Omaha.pm] omaha.pm.org down In-Reply-To: References: <7e84ed60705242126w796624c0v4154fedba2f44250@mail.gmail.com> <531681ec0705250903q17a0010ax77aefc92bf3e6eaf@mail.gmail.com> Message-ID: <6400A687-CDC4-4C1E-800F-61EC62D3B730@jays.net> On May 25, 2007, at 11:08 AM, Jay Hannah wrote: > The server that hosts omaha.pm.org lost its power supply yesterday. > The > admin is a friend of mine and thinks he'll have it back up later today > or tomorrow. :) We're back: http://omaha.pm.org Thanks Josh!! j From jhannah at omnihotels.com Tue May 29 17:39:29 2007 From: jhannah at omnihotels.com (Jay Hannah) Date: Tue, 29 May 2007 19:39:29 -0500 Subject: [Omaha.pm] Count occurrences of the value of an attribute in XML Message-ID: Problem: Given data like this: $ head RevData.DALMAN.20070529.xml Count the number of each occurence of the attribute 'rt'. Solution: $ perl -lne '/rt="(\w+)"/; print $1' RevData.DALMAN.20070529.xml | uniq -c 2 585 DELUXE 422 SUITES j From jhannah at omnihotels.com Tue May 29 17:41:21 2007 From: jhannah at omnihotels.com (Jay Hannah) Date: Tue, 29 May 2007 19:41:21 -0500 Subject: [Omaha.pm] Count occurrences of the value of an attribute in XML Message-ID: Better yet, skip the lines that don't contain rt="" at all. $ perl -lne '/rt="(\w+)"/ && print $1' RevData.DALMAN.20070529.xml | uniq -c 117 DELUXE 84 SUITES j -----Original Message----- From: Jay Hannah Sent: Tuesday, May 29, 2007 7:39 PM To: 'omaha-pm at pm.org' Subject: Count occurrences of the value of an attribute in XML Problem: Given data like this: $ head RevData.DALMAN.20070529.xml Count the number of each occurence of the attribute 'rt'. Solution: $ perl -lne '/rt="(\w+)"/; print $1' RevData.DALMAN.20070529.xml | uniq -c 2 585 DELUXE 422 SUITES j From andy at petdance.com Tue May 29 19:03:06 2007 From: andy at petdance.com (Andy Lester) Date: Tue, 29 May 2007 21:03:06 -0500 Subject: [Omaha.pm] Count occurrences of the value of an attribute in XML In-Reply-To: References: Message-ID: <541E5D90-E5AA-4D52-AD93-8CA1751FAD2E@petdance.com> On May 29, 2007, at 7:39 PM, Jay Hannah wrote: > $ perl -lne '/rt="(\w+)"/; print $1' RevData.DALMAN.20070529.xml | > uniq I would put a \b in front of the rt so you don't match cart="foo". -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From andy at petdance.com Tue May 29 19:04:51 2007 From: andy at petdance.com (Andy Lester) Date: Tue, 29 May 2007 21:04:51 -0500 Subject: [Omaha.pm] Count occurrences of the value of an attribute in XML In-Reply-To: References: Message-ID: <85973A83-B7E2-4264-9D93-241FC932BBDC@petdance.com> On May 29, 2007, at 7:39 PM, Jay Hannah wrote: > $ perl -lne '/rt="(\w+)"/; print $1' RevData.DALMAN.20070529.xml | > uniq Actually, this is wrong. You cannot rely on the value of $1 if the m// did not match. Your "optimization" to /rt.../ && print $1 is necessary or else it is wrong. See http://perl101.org/regexes.html "Don't use capture variables without checking that the match succeeded." xoxo, Andy -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From jay at jays.net Tue May 29 21:56:36 2007 From: jay at jays.net (Jay Hannah) Date: Tue, 29 May 2007 23:56:36 -0500 Subject: [Omaha.pm] Count occurrences of the value of an attribute in XML In-Reply-To: <541E5D90-E5AA-4D52-AD93-8CA1751FAD2E@petdance.com> References: <541E5D90-E5AA-4D52-AD93-8CA1751FAD2E@petdance.com> Message-ID: <24C25244-3DB8-4D7A-8465-6DC983440D83@jays.net> On May 29, 2007, at 9:03 PM, Andy Lester wrote: > On May 29, 2007, at 7:39 PM, Jay Hannah wrote: >> $ perl -lne '/rt="(\w+)"/; print $1' RevData.DALMAN.20070529.xml | >> uniq > > I would put a \b in front of the rt so you don't match cart="foo". Ya. I like that. Thanks! On May 29, 2007, at 9:04 PM, Andy Lester wrote: > Actually, this is wrong. You cannot rely on the value of $1 if the > m// did not match. Your "optimization" to /rt.../ && print $1 is > necessary or else it is wrong. Yup. That's why I posted that correction 2 minutes after my first post. Thanks, j From cletus at bltd.com Thu May 31 17:12:15 2007 From: cletus at bltd.com (Clete Baker) Date: Thu, 31 May 2007 19:12:15 -0500 (CDT) Subject: [Omaha.pm] Introductory message ... and already I need help! Message-ID: <200706010012.l510CFSQ011974@oasis.novia.net> I just joined with the expectation that I might find someone here in the Omaha area who I could hire to develop a fairly complex app for tracking recordings of phrases, parsing and refining scripts, building a database, presenting a user interface of some sort, and constructing a delivery system which can pluck phrases from the database, concatenate them, name the resulting files, and send them out the door. Sounds daunting, and it doesn't help that as an IT guy tryin' to 'splain it I make one helluva recording engineer. But I think it can be modularized and built up over time. I'm inclined to specify perl for its flexibility with strings and its ability to play well with other utility apps the jobs require. The platform we're on is Mac OS X. I'm at the stage where I need the first module of this project right away. I thought I'd take a stab at coding it myself, but the last time I did any coding was 6 or 8 years ago, and I don't have the time to re-learn everything from the ground up. On top of which, I wasn't very good at it to begin with (I may have been bad, but I was sure slow!). The first module is fairly simple and straightforward (well... for anyone who doesn't have to grab the camel book again to write a "hello world" routine). I'm currently doing a lot of the work manually that I ultimately want to automate with the full application, but the first and most time-consuming chore I need the app to do for me is to parse a directory full of filenames, and from that, create a subdirectory hierarchy, move the files into their proper places within that hierarchy, and rename the files once they're there. Anyone out there able and willing to tackle a freelance job like this in the next week or so? If so, my contact info is below; I'd welcome a chat and an estimate. Meanwhile I'll bury my nose back in the books and hope I won't have to roll my own.... -- Clete Baker | cletus at bltd.com Studio B, Ltd. | ph 402-455-3000 Omaha, Nebraska | fx 402-455-8269