From jay at jays.net Wed Mar 2 11:04:38 2005 From: jay at jays.net (Jay Hannah) Date: Wed Mar 2 11:05:07 2005 Subject: [Omaha.pm] Re: [olug] [OT] Of parents and children In-Reply-To: <5aeb7d3f050224084849efd1b7@mail.gmail.com> References: <5aeb7d3f050224084849efd1b7@mail.gmail.com> Message-ID: (see OLUG thread for discussion to date) On Feb 24, 2005, at 10:48 AM, Kevin Lanik wrote: > Slightly off topic, but an interesting programming problem here. I'm > programming in objective-c (language doesn't matter much though) and I > basically have a tree. My problem is that I'd like to be able to take > a node and move it into one of it's children (or, since there is X > level of depth) or somewhere in it's own lineage. It's been decided to > preserve as much hierarchy as possible, so if a node moves to it's > subnode it retains its children. For example, node 1's parent is the > root node: it has children 2 and 3. 2 has children 4 and 5. I want to > move node 1 into node 4's list. The first of two scenarios now is that > node 2's parent becomes the root node and node 1's parent becomes > node 4, all other nodes stay the same. The other scenario makes node > 4's parent the root node and node 1's parent 4, with all other nodes > retaining thier parents. Does this make sense? The current solution is > that we don't allow a node to be dropped in one of its children (or > down the line) but would choosing one of these two be more appropriate > than the other? I know this isn't exactly the forum for the question, > but who doesn't enjoy a puzzler! When you get to actually implementing and persisting a solution I'd use OO Perl (I'm biased), or I'd jump into declaritive programming and try my hand at prolog (for the logic engine, at least): http://www.augustana.ca/~mohrj/courses/common/csc370/lecture_notes/ prolog2.html?presentation mmmmm... Prolog... AI... ggrggrllgggghh... (also see Perl/CPAN's AI::Prolog for the merger of both worlds. -grin-) j Omaha Perl Mongers: http://omaha.pm.org From jay at jays.net Wed Mar 2 20:27:18 2005 From: jay at jays.net (Jay Hannah) Date: Wed Mar 2 20:27:27 2005 Subject: [Omaha.pm] Programming languages poster Message-ID: <93ecad8869785bc502f73d76d7d59e62@jays.net> Sweet!! Gotta buy a couple books! http://www.oreilly.com/news/languageposter_0504.html j From jay at jays.net Wed Mar 2 21:59:30 2005 From: jay at jays.net (Jay Hannah) Date: Wed Mar 2 21:59:40 2005 Subject: [Omaha.pm] Facade Design Pattern Message-ID: http://perldesignpatterns.com/?FacadePattern http://www.theperlreview.com/Articles/v0i4/facade.pdf j From mosedev at gmail.com Wed Mar 9 13:19:16 2005 From: mosedev at gmail.com (Jon L. [MoseDev]) Date: Wed Mar 9 13:19:26 2005 Subject: [Omaha.pm] Win -> Unix Message-ID: <2f89dcd20503091319245a0a2d@mail.gmail.com> I guess I should start out by saying I'm blatantly new to Omaha-pm. Really, I'm not even sure if I'm doing this right. But... I'm currently saving for a new computer. And, I was hoping to get Unix installed on it rather then Windows. Unless, somehow, I can get both installed on it, where they'd run completely seperate from each other. So, I was wondering if anyone had any suggestions as to which variation of Unix I should look at getting. From cybersean3000 at yahoo.com Wed Mar 9 13:23:30 2005 From: cybersean3000 at yahoo.com (Sean Edwards) Date: Wed Mar 9 13:23:40 2005 Subject: [Omaha.pm] Win -> Unix In-Reply-To: 6667 Message-ID: <20050309212330.91022.qmail@web52601.mail.yahoo.com> Wrong list. This question is for the Omaha Linux User Group: http://www.olug.org. You can join the list at the website. The OLUG answer to the question will be SUSE 9 Professional, but you will get many different answers with many different reasons. -=Sean Edwards=- --- "Jon L. [MoseDev]" wrote: > I guess I should start out by saying I'm blatantly > new to Omaha-pm. > Really, I'm not even sure if I'm doing this right. > But... > > I'm currently saving for a new computer. > And, I was hoping to get Unix installed on it rather > then Windows. > Unless, somehow, I can get both installed on it, > where they'd run > completely seperate from each other. > So, I was wondering if anyone had any suggestions as > to which > variation of Unix I should look at getting. > _______________________________________________ > Omaha-pm mailing list > Omaha-pm@pm.org > http://mail.pm.org/mailman/listinfo/omaha-pm > __________________________________ Celebrate Yahoo!'s 10th Birthday! Yahoo! Netrospective: 100 Moments of the Web http://birthday.yahoo.com/netrospective/ From jay at jays.net Wed Mar 9 14:30:13 2005 From: jay at jays.net (Jay Hannah) Date: Wed Mar 9 14:30:24 2005 Subject: [Omaha.pm] Win -> Unix In-Reply-To: <20050309212330.91022.qmail@web52601.mail.yahoo.com> References: <20050309212330.91022.qmail@web52601.mail.yahoo.com> Message-ID: <1a17ae95f557e11eae49f9552436adb9@jays.net> --- "Jon L. [MoseDev]" wrote: > I guess I should start out by saying I'm blatantly new to Omaha-pm. > Really, I'm not even sure if I'm doing this right. But... > > I'm currently saving for a new computer. > And, I was hoping to get Unix installed on it rather then Windows. > Unless, somehow, I can get both installed on it, where they'd run > completely seperate from each other. > So, I was wondering if anyone had any suggestions as to which > variation of Unix I should look at getting. On Mar 9, 2005, at 3:23 PM, Sean Edwards wrote: > Wrong list. This question is for the Omaha Linux User > Group: http://www.olug.org. > > You can join the list at the website. Welcome to the Omaha Perl Mongers! "Dual boot" is a very popular thing to want to do. The OLUG guys are great and will be happy to help. Check out their semi-annual "Install Fest" offerings -- you just show up w/ a PC and they help you install Linux/Win combos from scratch. Then, when you've got your hardware settled, you can get busy ruling the world through Perl. -grin- j From mat at phpconsulting.com Wed Mar 9 15:35:08 2005 From: mat at phpconsulting.com (Mat Caughron) Date: Wed Mar 9 15:28:46 2005 Subject: [Omaha.pm] Win -> Unix -> Darwin! In-Reply-To: <1a17ae95f557e11eae49f9552436adb9@jays.net> References: <20050309212330.91022.qmail@web52601.mail.yahoo.com> <1a17ae95f557e11eae49f9552436adb9@jays.net> Message-ID: Jon, Jay, Sean et al: Of course, you could cave in and buy a Mac. If you're into development via shell, you'll have all of the standard unix goodness (and then some) in the terminal. XTools is a decent IDE that you can use with perl, comes standard. BBEdit CVS support is kinda nice too. Other than one well-discussed bug in DBI, I've had no issues whatsoever running perl code / CPAN modules on OSX for deployment on Linux-x86. Any others care to comment on usefulness of MacOSX as a platform for perl hacking? Mat Caughron, CISSP PHP Consulting www.phpconsulting.com On Wed, 9 Mar 2005, Jay Hannah wrote: > --- "Jon L. [MoseDev]" wrote: > > I guess I should start out by saying I'm blatantly new to Omaha-pm. > > Really, I'm not even sure if I'm doing this right. But... > > > > I'm currently saving for a new computer. > > And, I was hoping to get Unix installed on it rather then Windows. > > Unless, somehow, I can get both installed on it, where they'd run > > completely seperate from each other. > > So, I was wondering if anyone had any suggestions as to which > > variation of Unix I should look at getting. > > On Mar 9, 2005, at 3:23 PM, Sean Edwards wrote: > > Wrong list. This question is for the Omaha Linux User > > Group: http://www.olug.org. > > > > You can join the list at the website. > > Welcome to the Omaha Perl Mongers! > > "Dual boot" is a very popular thing to want to do. The OLUG guys are > great and will be happy to help. Check out their semi-annual "Install > Fest" offerings -- you just show up w/ a PC and they help you install > Linux/Win combos from scratch. > > Then, when you've got your hardware settled, you can get busy ruling > the world through Perl. -grin- > > j > > > _______________________________________________ > Omaha-pm mailing list > Omaha-pm@pm.org > http://mail.pm.org/mailman/listinfo/omaha-pm > From jay at jays.net Wed Mar 9 17:20:13 2005 From: jay at jays.net (Jay Hannah) Date: Wed Mar 9 17:20:25 2005 Subject: [Omaha.pm] Win -> Unix -> Darwin! In-Reply-To: References: <20050309212330.91022.qmail@web52601.mail.yahoo.com> <1a17ae95f557e11eae49f9552436adb9@jays.net> Message-ID: On Mar 9, 2005, at 5:35 PM, Mat Caughron wrote: > If you're into development via shell, you'll have all of the > standard unix goodness (and then some) in the terminal. > XTools is a decent IDE that you can use with perl, comes standard. I don't seem to have Xtools on my Powerbook... Are you talking about this?: http://www.tenon.com/products/xtools/ > BBEdit CVS support is kinda nice too. I'm never (yet) liked any GUI CVS tools. I'm a command line geek I guess. j From cybersean3000 at yahoo.com Wed Mar 9 20:25:47 2005 From: cybersean3000 at yahoo.com (Sean Edwards) Date: Wed Mar 9 20:25:58 2005 Subject: [Omaha.pm] Win -> Unix -> Darwin! In-Reply-To: 6667 Message-ID: <20050310042547.87873.qmail@web52610.mail.yahoo.com> Actually, work provides me with a PowerBook G4. -=Sean=- --- Mat Caughron wrote: > Jon, Jay, Sean et al: > > Of course, you could cave in and buy a Mac. > > If you're into development via shell, you'll have > all of the > standard unix goodness (and then some) in the > terminal. > XTools is a decent IDE that you can use with perl, > comes standard. > BBEdit CVS support is kinda nice too. > > Other than one well-discussed bug in DBI, I've had > no issues whatsoever > running perl code / CPAN modules on OSX for > deployment on Linux-x86. > > Any others care to comment on usefulness of MacOSX > as a platform for perl > hacking? > > > Mat Caughron, CISSP > PHP Consulting > www.phpconsulting.com > > > On Wed, 9 Mar 2005, Jay Hannah wrote: > > --- "Jon L. [MoseDev]" wrote: > > > I guess I should start out by saying I'm > blatantly new to Omaha-pm. > > > Really, I'm not even sure if I'm doing this > right. But... > > > > > > I'm currently saving for a new computer. > > > And, I was hoping to get Unix installed on it > rather then Windows. > > > Unless, somehow, I can get both installed on it, > where they'd run > > > completely seperate from each other. > > > So, I was wondering if anyone had any > suggestions as to which > > > variation of Unix I should look at getting. > > > > On Mar 9, 2005, at 3:23 PM, Sean Edwards wrote: > > > Wrong list. This question is for the Omaha > Linux User > > > Group: http://www.olug.org. > > > > > > You can join the list at the website. > > > > Welcome to the Omaha Perl Mongers! > > > > "Dual boot" is a very popular thing to want to do. > The OLUG guys are > > great and will be happy to help. Check out their > semi-annual "Install > > Fest" offerings -- you just show up w/ a PC and > they help you install > > Linux/Win combos from scratch. > > > > Then, when you've got your hardware settled, you > can get busy ruling > > the world through Perl. -grin- > > > > j > > > > > > _______________________________________________ > > Omaha-pm mailing list > > Omaha-pm@pm.org > > http://mail.pm.org/mailman/listinfo/omaha-pm > > > _______________________________________________ > Omaha-pm mailing list > Omaha-pm@pm.org > http://mail.pm.org/mailman/listinfo/omaha-pm > __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ From jhannah at omnihotels.com Mon Mar 14 16:15:13 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Mon Mar 14 16:15:22 2005 Subject: [Omaha.pm] LF -> CRLF Message-ID: <200503150015.j2F0FAcN014956@omares-email.omnihotels.com> So we've got a bunch of Unix files that Windows can't read correctly. perl -pi -e 's/(? Unix -> Darwin! In-Reply-To: References: <20050309212330.91022.qmail@web52601.mail.yahoo.com> <1a17ae95f557e11eae49f9552436adb9@jays.net> Message-ID: <20050315030741.GA29337@jbisbee.com> * Mat Caughron (mat@phpconsulting.com) wrote: > Any others care to comment on usefulness of MacOSX as a platform for perl > hacking? Go to any major perl conference and you'll notice that the majority of laptops are powerbooks and ibooks. I only use my linux box as a server now and ssh into it upstairs in the closet :) (I take that back, I use a vnc server to use DVD::Rip) :) -- Jeff Bisbee / omaha-pm@jbisbee.com / jbisbee.com From omaha-pm at jbisbee.com Mon Mar 14 19:07:41 2005 From: omaha-pm at jbisbee.com (Jeff Bisbee) Date: Mon Mar 14 19:08:09 2005 Subject: [Omaha.pm] Win -> Unix -> Darwin! In-Reply-To: References: <20050309212330.91022.qmail@web52601.mail.yahoo.com> <1a17ae95f557e11eae49f9552436adb9@jays.net> Message-ID: <20050315030741.GA29337@jbisbee.com> * Mat Caughron (mat@phpconsulting.com) wrote: > Any others care to comment on usefulness of MacOSX as a platform for perl > hacking? Go to any major perl conference and you'll notice that the majority of laptops are powerbooks and ibooks. I only use my linux box as a server now and ssh into it upstairs in the closet :) (I take that back, I use a vnc server to use DVD::Rip) :) -- Jeff Bisbee / omaha-pm@jbisbee.com / jbisbee.com From Jay at RebootTheUser.com Tue Mar 15 09:49:48 2005 From: Jay at RebootTheUser.com (Jay Swackhamer) Date: Tue Mar 15 09:49:59 2005 Subject: [Omaha.pm] Win -> Unix In-Reply-To: <1a17ae95f557e11eae49f9552436adb9@jays.net> References: <20050309212330.91022.qmail@web52601.mail.yahoo.com> <1a17ae95f557e11eae49f9552436adb9@jays.net> Message-ID: <16389.205.142.237.129.1110908988.squirrel@webmail.reboottheuser.com> Or if you cant wait until an installfest, stop by the store and I/someone could help get your machine setup as a dual-boot.(Gentoo=store preference for developers/and anyone else....) (or if you really want to be like the mac guys, we could even put on freebsd) > --- "Jon L. [MoseDev]" wrote: >> I guess I should start out by saying I'm blatantly new to Omaha-pm. >> Really, I'm not even sure if I'm doing this right. But... >> >> I'm currently saving for a new computer. >> And, I was hoping to get Unix installed on it rather then Windows. >> Unless, somehow, I can get both installed on it, where they'd run >> completely seperate from each other. >> So, I was wondering if anyone had any suggestions as to which >> variation of Unix I should look at getting. > > On Mar 9, 2005, at 3:23 PM, Sean Edwards wrote: >> Wrong list. This question is for the Omaha Linux User >> Group: http://www.olug.org. >> >> You can join the list at the website. > > Welcome to the Omaha Perl Mongers! > > "Dual boot" is a very popular thing to want to do. The OLUG guys are > great and will be happy to help. Check out their semi-annual "Install > Fest" offerings -- you just show up w/ a PC and they help you install > Linux/Win combos from scratch. > > Then, when you've got your hardware settled, you can get busy ruling > the world through Perl. -grin- > > j > > > _______________________________________________ > Omaha-pm mailing list > Omaha-pm@pm.org > http://mail.pm.org/mailman/listinfo/omaha-pm > -- Jay Swackhamer Reboot The User 15791 West Dodge Road Suite 135 Omaha, NE 68118 (402) 933-6449 (402) 933-6456 Fax http://www.RebootTheUser.com From jay at jays.net Wed Mar 16 07:37:58 2005 From: jay at jays.net (Jay Hannah) Date: Wed Mar 16 07:38:10 2005 Subject: [Omaha.pm] Job opening - Programmer / Analyst II Message-ID: Click from here: http://www.careerlink.org/emp/ohr/fm/ If you know anyone sharp who's looking, please send them our way! Thanks, j From jhannah at omnihotels.com Wed Mar 16 14:02:37 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Wed Mar 16 14:02:42 2005 Subject: [Omaha.pm] RE: CGI.pm -- strange argument results and $q->param. In-Reply-To: <200503041415.j24EFacN007363@omares-email.omnihotels.com> Message-ID: <200503162202.j2GM2XcN007433@omares-email.omnihotels.com> From: Sean Baker [mailto:pbaker@omnihotels.com] > Bummer. If I try to pass an empty $q->param as a %args into > the set_personname method, it screws things up. > > Look at the results below of nametitle and surnameprefix when > I leave "|| undef" off of nametitle and surnameprefix. > > $o_Contact->set_personname( > contactid => $pageid, > nameprefix => $q->param("personname__nameprefix__$pageid") || undef, > givenname => $q->param("personname__givenname__$pageid") || undef, > middlename => $q->param("personname__middlename__$pageid") || undef, > surname => $q->param("personname__surname__$pageid") || undef, > namesuffix => $q->param("personname__namesuffix__$pageid") || undef, > nametitle => $q->param("personname__nametitle__$pageid"), > surnameprefix => $q->param("personname__surnameprefix__$pageid"), > ); > > DB<5> x %args > 0 'givenname' > 1 'LYNN' > 2 'middlename' > 3 undef > 4 'contactid' > 5 564 > 6 'namesuffix' > 7 undef > 8 'nameprefix' > 9 'MRS' > 10 'nametitle' > 11 'surnameprefix' > 12 'surname' > 13 'BLAKE' Yup. The "problem" is that in array context $q->param('x') when 'x' isn't defined returns an empty array. If it returned undef, your code would work. An empty array messes up your hash like so: my %a = ( 1 => 'one', 2 => (), 3 => 'three' ); DB<1> x %a 0 'three' 1 undef 2 1 3 'one' 4 2 5 3 I exchanged emails with the author/maintainer a couple years ago. He said the behavior was documented. (Actually I just checked and I don't see where it's documented.) Anyhoo, this is where the weirdness lies: DB<1> x $q->param('x') empty array You can fix it the way you did DB<3> x $q->param('x') || undef 0 undef Or by forcing scalar context DB<2> x scalar($q->param('x')) 0 undef Or, as he suggested to me, by pulling each param into a scalar before you define your hash (doubling the # of lines in your code). Bummer, huh? CGI.pm is still pretty cool though. j P.S. You should '|| undef' those last 2 parms too! From pbaker at omnihotels.com Wed Mar 16 14:06:57 2005 From: pbaker at omnihotels.com (Sean Baker) Date: Wed Mar 16 14:07:02 2005 Subject: [Omaha.pm] RE: CGI.pm -- strange argument results and $q->param. In-Reply-To: <200503162202.j2GM2XcN007433@omares-email.omnihotels.com> Message-ID: <200503162206.j2GM6rcN020074@omares-email.omnihotels.com> I left the last two "|| undef,"'s off to explain behaviour... The real code has it. Sean -----Original Message----- From: Jay Hannah [mailto:jhannah@omnihotels.com] Sent: Wednesday, March 16, 2005 4:03 PM To: pbaker@omnihotels.com Cc: omaha-pm@pm.org Subject: RE: CGI.pm -- strange argument results and $q->param. From: Sean Baker [mailto:pbaker@omnihotels.com] > Bummer. If I try to pass an empty $q->param as a %args into > the set_personname method, it screws things up. > > Look at the results below of nametitle and surnameprefix when > I leave "|| undef" off of nametitle and surnameprefix. > > $o_Contact->set_personname( > contactid => $pageid, > nameprefix => $q->param("personname__nameprefix__$pageid") || undef, > givenname => $q->param("personname__givenname__$pageid") || undef, > middlename => $q->param("personname__middlename__$pageid") || undef, > surname => $q->param("personname__surname__$pageid") || undef, > namesuffix => $q->param("personname__namesuffix__$pageid") || undef, > nametitle => $q->param("personname__nametitle__$pageid"), > surnameprefix => $q->param("personname__surnameprefix__$pageid"), > ); > > DB<5> x %args > 0 'givenname' > 1 'LYNN' > 2 'middlename' > 3 undef > 4 'contactid' > 5 564 > 6 'namesuffix' > 7 undef > 8 'nameprefix' > 9 'MRS' > 10 'nametitle' > 11 'surnameprefix' > 12 'surname' > 13 'BLAKE' Yup. The "problem" is that in array context $q->param('x') when 'x' isn't defined returns an empty array. If it returned undef, your code would work. An empty array messes up your hash like so: my %a = ( 1 => 'one', 2 => (), 3 => 'three' ); DB<1> x %a 0 'three' 1 undef 2 1 3 'one' 4 2 5 3 I exchanged emails with the author/maintainer a couple years ago. He said the behavior was documented. (Actually I just checked and I don't see where it's documented.) Anyhoo, this is where the weirdness lies: DB<1> x $q->param('x') empty array You can fix it the way you did DB<3> x $q->param('x') || undef 0 undef Or by forcing scalar context DB<2> x scalar($q->param('x')) 0 undef Or, as he suggested to me, by pulling each param into a scalar before you define your hash (doubling the # of lines in your code). Bummer, huh? CGI.pm is still pretty cool though. j P.S. You should '|| undef' those last 2 parms too! From jay at jays.net Wed Mar 16 14:08:01 2005 From: jay at jays.net (Jay Hannah) Date: Wed Mar 16 14:08:09 2005 Subject: [Omaha.pm] Meeting tomorrow Message-ID: <0b7ab813c72810acdba4c0f179d9200c@jays.net> Yikes, has it been a month again already? Come join us for some more TBD Perl fun: http://omaha.pm.org/ Time for some serious Perl Golf? j From jhannah at omnihotels.com Wed Mar 16 14:13:34 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Wed Mar 16 14:13:41 2005 Subject: [Omaha.pm] RE: CGI.pm -- strange argument results and $q->param. In-Reply-To: <200503162206.j2GM6rcN020074@omares-email.omnihotels.com> Message-ID: <200503162213.j2GMDUcN001161@omares-email.omnihotels.com> > I left the last two "|| undef,"'s off to explain behaviour... > The real code has it. You are, as they say, the man. Time for the Omaha Perl Mongers to execute a hostile takeover of CGI.pm and fix that. -grin- j From jhannah at omnihotels.com Thu Mar 17 02:16:17 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Thu Mar 17 02:16:35 2005 Subject: [Omaha.pm] 4..1 is not 1..4 reversed Message-ID: <200503171016.j2HAGDcN025301@omares-email.omnihotels.com> Oh... I guess this is the new thing I learned today. This works: $ perl -e 'print join "", 1..4' 1234 And I thought this would work too: $ perl -e 'print join "", 4..1' Nope. 4..1 isn't a 4 integer series. I thought it was. I guess I'll switch to "reverse 1..4". I thought ".." worked on any ASCII series, forward or backward. I guess it only works forward. j From dan at linder.org Wed Mar 16 14:52:33 2005 From: dan at linder.org (Daniel Linder) Date: Thu Mar 17 07:25:30 2005 Subject: [Omaha.pm] Impossible perl one-liner? Message-ID: <31170.12.160.138.60.1111013553.squirrel@12.160.138.60> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ok, here's probably a simple one -- I just can't get my head around it. :) On Solaris, when I use "df -k" the sizes listed are in terms of KBytes. I'm trying to come up with a simple perl one-liner to do one of two things to make a quick scan of the list a bit easier to 'grok': 1: Add a comman "," between every third digit (1234567 -> 1,234,567) 2: Convert from KBytes to MBytes or GBytes by dividing by 1024 or 1024^2. For #1, I couldn't get a perl one-liner could do multiple 'inserts' of commas, especially when counting from the right-most digit and progressing left. I was trying this to achieve #2: # echo leading text 1234567 trailing text | perl -pe 's/([0-9]+)/$1\/1024/g' But that just returned: leading text 1234567/1024 trailing text I tried inserting the "eval" function, but couldn't get it to work... So, anyone else got an idea? Dan P.s. I might end up writing a small script that uses more perl bruit force but I thought a one-liner would be cleaner. :) - - - - - "I do not fear computer, I fear the lack of them." -- Isaac Asimov GPG fingerprint:9EE8 ABAE 10D3 0B55 C536 E17A 3620 4DCA A533 19BF -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFCOLixNiBNyqUzGb8RAtmlAJ0VFzTy+fj38kcWPBWOPU8wa+bZcwCeIlg8 2UIZc0C8cnca4/a5/te2IvU= =EWyj -----END PGP SIGNATURE----- From scott.l.miller at hp.com Thu Mar 17 08:55:47 2005 From: scott.l.miller at hp.com (Miller, Scott L (Omaha Networks)) Date: Thu Mar 17 08:56:00 2005 Subject: [Omaha.pm] 4..1 is not 1..4 reversed Message-ID: <1F7C0C8F4BD7C54A8BC55012FEF3DF6D0302E889@omaexc11.americas.cpqcorp.net> This was a very recent thread in PM entitled "the '..' operator and decreasing values" http://www.perlmonks.org/index.pl?node_id=436782 -Scott -----Original Message----- From: omaha-pm-bounces@pm.org [mailto:omaha-pm-bounces@pm.org]On Behalf Of Jay Hannah Sent: Thursday, March 17, 2005 4:16 AM To: omaha-pm@pm.org Subject: [Omaha.pm] 4..1 is not 1..4 reversed Oh... I guess this is the new thing I learned today. This works: $ perl -e 'print join "", 1..4' 1234 And I thought this would work too: $ perl -e 'print join "", 4..1' Nope. 4..1 isn't a 4 integer series. I thought it was. I guess I'll switch to "reverse 1..4". I thought ".." worked on any ASCII series, forward or backward. I guess it only works forward. j _______________________________________________ Omaha-pm mailing list Omaha-pm@pm.org http://mail.pm.org/mailman/listinfo/omaha-pm From jay at jays.net Thu Mar 17 15:12:55 2005 From: jay at jays.net (Jay Hannah) Date: Thu Mar 17 15:13:03 2005 Subject: [Omaha.pm] 4..1 is not 1..4 reversed In-Reply-To: <1F7C0C8F4BD7C54A8BC55012FEF3DF6D0302E889@omaexc11.americas.cpqcorp.net> References: <1F7C0C8F4BD7C54A8BC55012FEF3DF6D0302E889@omaexc11.americas.cpqcorp.net> Message-ID: <89b687f36f154d06f05b5542ef255f95@jays.net> On Mar 17, 2005, at 10:55 AM, Miller, Scott L (Omaha Networks) wrote: > This was a very recent thread in PM entitled "the '..' operator and > decreasing values" > > http://www.perlmonks.org/index.pl?node_id=436782 -laugh- The Internet: more than you ever wanted to know about any topic/phenom. Crazy 'puters. I especially enjoy those people that post w/o reading the thread first. j From jay at jays.net Thu Mar 17 16:18:07 2005 From: jay at jays.net (Jay Hannah) Date: Thu Mar 17 16:18:18 2005 Subject: [Omaha.pm] Impossible perl one-liner? In-Reply-To: <31170.12.160.138.60.1111013553.squirrel@12.160.138.60> References: <31170.12.160.138.60.1111013553.squirrel@12.160.138.60> Message-ID: <34efc56d03a1faf8c9380dc8fcd9b2f3@jays.net> On Mar 16, 2005, at 4:52 PM, Daniel Linder wrote: > On Solaris, when I use "df -k" the sizes listed are in terms of KBytes. > I'm trying to come up with a simple perl one-liner to do one of two > things > to make a quick scan of the list a bit easier to 'grok': > 1: Add a comman "," between every third digit (1234567 -> 1,234,567) > For #1, I couldn't get a perl one-liner could do multiple 'inserts' of > commas, especially when counting from the right-most digit and > progressing > left. I dunno in a one-liner. I wrote an 18-liner and then stumbled into many ideas better than mine: http://perlmonks.thepen.com/117697.html If you want "my way" (why would you? -laugh-): $ df -k Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/disk0s9 39066000 15462748 23347252 40% / devfs 93 93 0 100% /dev fdesc 1 1 0 100% /dev 512 512 0 100% /.vol automount -nsl [329] 0 0 0 100% /Network automount -fstab [332] 0 0 0 100% /automount/Servers automount -static [332] 0 0 0 100% /automount/static $ cat commas.pl #!/usr/bin/perl while (<>) { $line_orig = $_; $line = $_; my @ints = /(\d\d\d\d+)/g; my (%conv, $orig); foreach $orig (@ints) { my @i = reverse (split //, $orig); for ($offset = 3; $offset < @i; $offset += 3) { if ($i[$offset + 1] =~ /\d/) { splice @i, $offset, 0, ','; $offset++; } } my $new = join "", reverse @i; $line =~ s/$orig/$new/g; } print $line; } $ df -k | ./commas.pl Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/disk0s9 39,066,000 15,462,748 23,347,252 40% / devfs 93 93 0 100% /dev fdesc 1 1 0 100% /dev 512 512 0 100% /.vol automount -nsl [329] 0 0 0 100% /Network automount -fstab [332] 0 0 0 100% /automount/Servers automount -static [332] 0 0 0 100% /automount/static Things get pretty ugly when you jack w/ the column widths of some columns in some rows but not all columns for all rows. To make it pretty perhaps you should slurp it all up then kick it all out via Perl formats? (See perldoc perlform). > 2: Convert from KBytes to MBytes or GBytes by dividing by 1024 or > 1024^2. > I was trying this to achieve #2: > # echo leading text 1234567 trailing text | perl -pe > 's/([0-9]+)/$1\/1024/g' > But that just returned: > leading text 1234567/1024 trailing text > > I tried inserting the "eval" function, but couldn't get it to work... > > So, anyone else got an idea? If you look in "perldoc perlre" you'll find "(?{ code })", which theoretically lets you execute code inside a regex. I've never gotten it to work though. > P.s. I might end up writing a small script that uses more perl bruit > force > but I thought a one-liner would be cleaner. :) Ya. Easier to read/maintain that way. -grin- j From dan at linder.org Thu Mar 17 13:59:49 2005 From: dan at linder.org (Daniel Linder) Date: Fri Mar 18 06:32:45 2005 Subject: [Omaha.pm] Impossible perl one-liner? In-Reply-To: <34efc56d03a1faf8c9380dc8fcd9b2f3@jays.net> References: <31170.12.160.138.60.1111013553.squirrel@12.160.138.60> <34efc56d03a1faf8c9380dc8fcd9b2f3@jays.net> Message-ID: <34375.12.160.138.59.1111096789.squirrel@12.160.138.59> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > I dunno in a one-liner. I wrote an 18-liner and then stumbled into many > ideas better than mine: > http://perlmonks.thepen.com/117697.html Thanks for the link -- I searched PerlMonks, but couldn't find this entry. :( For my limited needs, this appears to work: # df -k | perl -pe 's/(?<=\d)(?=(?:\d\d\d)+\b)/,/g' Filesystem kbytes used avail capacity Mounted on /dev/dsk/c1t0d0s0 28,299,128 9,852,819 18,163,318 36% / And you're right -- the output is uglier now that the columns have no chance to line up. I might have to play with the "(?{ code })" you mentioned to see if I can get it to work. Thanks! Dan - - - - - "I do not fear computer, I fear the lack of them." -- Isaac Asimov GPG fingerprint:9EE8 ABAE 10D3 0B55 C536 E17A 3620 4DCA A533 19BF -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFCOf3VNiBNyqUzGb8RAsUxAJ9V9xzZgORtaVZ7ubln0s+Fgj1j3wCeNwIZ FYJHnSmSKVihNScEM+sWEOM= =oj4P -----END PGP SIGNATURE----- From scott.l.miller at hp.com Fri Mar 18 07:16:22 2005 From: scott.l.miller at hp.com (Miller, Scott L (Omaha Networks)) Date: Fri Mar 18 07:16:34 2005 Subject: [Omaha.pm] Impossible perl one-liner? Message-ID: <1F7C0C8F4BD7C54A8BC55012FEF3DF6D0302E891@omaexc11.americas.cpqcorp.net> If you really want a one liner, suggest this as a golf challenge on perl monks... -Scott -----Original Message----- From: omaha-pm-bounces@pm.org [mailto:omaha-pm-bounces@pm.org]On Behalf Of Jay Hannah Sent: Thursday, March 17, 2005 6:18 PM To: Perl Mongers of Omaha, Nebraska USA Subject: Re: [Omaha.pm] Impossible perl one-liner? On Mar 16, 2005, at 4:52 PM, Daniel Linder wrote: > On Solaris, when I use "df -k" the sizes listed are in terms of KBytes. > I'm trying to come up with a simple perl one-liner to do one of two > things > to make a quick scan of the list a bit easier to 'grok': > 1: Add a comman "," between every third digit (1234567 -> 1,234,567) > For #1, I couldn't get a perl one-liner could do multiple 'inserts' of > commas, especially when counting from the right-most digit and > progressing > left. I dunno in a one-liner. I wrote an 18-liner and then stumbled into many ideas better than mine: http://perlmonks.thepen.com/117697.html If you want "my way" (why would you? -laugh-): $ df -k Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/disk0s9 39066000 15462748 23347252 40% / devfs 93 93 0 100% /dev fdesc 1 1 0 100% /dev 512 512 0 100% /.vol automount -nsl [329] 0 0 0 100% /Network automount -fstab [332] 0 0 0 100% /automount/Servers automount -static [332] 0 0 0 100% /automount/static $ cat commas.pl #!/usr/bin/perl while (<>) { $line_orig = $_; $line = $_; my @ints = /(\d\d\d\d+)/g; my (%conv, $orig); foreach $orig (@ints) { my @i = reverse (split //, $orig); for ($offset = 3; $offset < @i; $offset += 3) { if ($i[$offset + 1] =~ /\d/) { splice @i, $offset, 0, ','; $offset++; } } my $new = join "", reverse @i; $line =~ s/$orig/$new/g; } print $line; } $ df -k | ./commas.pl Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/disk0s9 39,066,000 15,462,748 23,347,252 40% / devfs 93 93 0 100% /dev fdesc 1 1 0 100% /dev 512 512 0 100% /.vol automount -nsl [329] 0 0 0 100% /Network automount -fstab [332] 0 0 0 100% /automount/Servers automount -static [332] 0 0 0 100% /automount/static Things get pretty ugly when you jack w/ the column widths of some columns in some rows but not all columns for all rows. To make it pretty perhaps you should slurp it all up then kick it all out via Perl formats? (See perldoc perlform). > 2: Convert from KBytes to MBytes or GBytes by dividing by 1024 or > 1024^2. > I was trying this to achieve #2: > # echo leading text 1234567 trailing text | perl -pe > 's/([0-9]+)/$1\/1024/g' > But that just returned: > leading text 1234567/1024 trailing text > > I tried inserting the "eval" function, but couldn't get it to work... > > So, anyone else got an idea? If you look in "perldoc perlre" you'll find "(?{ code })", which theoretically lets you execute code inside a regex. I've never gotten it to work though. > P.s. I might end up writing a small script that uses more perl bruit > force > but I thought a one-liner would be cleaner. :) Ya. Easier to read/maintain that way. -grin- j _______________________________________________ Omaha-pm mailing list Omaha-pm@pm.org http://mail.pm.org/mailman/listinfo/omaha-pm From dan at linder.org Thu Mar 17 14:52:45 2005 From: dan at linder.org (Daniel Linder) Date: Fri Mar 18 07:25:39 2005 Subject: [Omaha.pm] Impossible perl one-liner? In-Reply-To: <1F7C0C8F4BD7C54A8BC55012FEF3DF6D0302E891@omaexc11.americas.cpqcorp.ne t> References: <1F7C0C8F4BD7C54A8BC55012FEF3DF6D0302E891@omaexc11.americas.cpqcorp.net> Message-ID: <43727.12.160.138.59.1111099965.squirrel@12.160.138.59> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > If you really want a one liner, suggest this as a golf challenge on perl > monks... Good idea, I might do this. :) The only bad thing about PerlGolf is that the one line 'solution' tends to be too cryptic to easily remember... :( I'm not complaining mind you -- I was hoping there was a simple regexp I had missed that would lend this to be an easily remembered perl script to commit to memory for the next time I'm on a foreign system and needed this conversion. Of course, chances are good that I should have some sort of Internet access - I'll just search the Omaha-PM archives. :) Dan - - - - - "I do not fear computer, I fear the lack of them." -- Isaac Asimov GPG fingerprint:9EE8 ABAE 10D3 0B55 C536 E17A 3620 4DCA A533 19BF -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFCOgo9NiBNyqUzGb8RAo0sAJ4kKqE+vAhQCr7zKC61dL1d3+WvfACfTbf1 yHMkWHfTW9i85H3x0toGHX0= =KgRa -----END PGP SIGNATURE----- From jhannah at omnihotels.com Fri Mar 18 10:02:21 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Fri Mar 18 10:02:29 2005 Subject: [Omaha.pm] FW: Perl Compiler source file Message-ID: <200503181802.j2II2FcN017351@omares-email.omnihotels.com> The post I was talking about @ the meeting last night. j -----Original Message----- From: Scott Walters [mailto:scott@illogics.org] Sent: Thursday, March 17, 2005 10:52 AM To: Sapna Jain Cc: perl-porters@perl.org Subject: Re: Perl Compiler source file Sapna, The "compiler" is written in Perl. It does no optimization, but there are comments about possibile optiizations in the files. The "compiled" code still uses the bytecode operation definitions - it just unrolls the inner loop, calling each bytecode operation function in turn in a long series. This still requires libperl.a. The output is C. Perl bytecode ops are very high-level - this makes it both harder and less rewarding to compile Perl source. Each bytecode does a lot of work, and an optimizing compiler can't comprehend the details of this work, nor can they gain benefit from rearranging the operations in most cases. If you're just interested in optimizing the bytecode, there is some room for unrolling loops and the like. Peephole optization could replace longer sequences with shorter ones. See the types.pm module on CPAN for an example use of the optimize: http://search.cpan.org/~abergman/types-0.05/lib/types.pm Then check out the modules it references - optimize, optimizer, B::Generate, and so on. B::Generate is key - running Perl can inspect and change it's own bytecode. In this way, optimization and compilation are similar. Another benefit of playing with Ponie rather than Perl 5 is the code base is much smaller and readability is being given priority. I hope this helps. -scott On 0, Sapna Jain wrote: > > Hello, > > I m working in optimizing compilers, So, i want to study the perl > compiler, how it compiles the program, and generate c code, and nay > opportunities to improve the compilation process. > > But i could not find the files of perl source code, that usually do the > compilation part. > > So, if you know about the source files, used for compilation please let me > know, also if you have any documentation related to it. > > Thanks, > > sapna > ----------------------------------------------------------------------------- > Only when you believe in your dreams... > you can make them come true ! > ------------------------------------------------------------------------------ > Sapna Jain > Mtech 1 CSE > IITB > ------------------------------------------------------------------------------ From glim at mycybernet.net Sat Mar 19 12:11:00 2005 From: glim at mycybernet.net (glim@mycybernet.net) Date: Sat Mar 19 12:38:51 2005 Subject: [Omaha.pm] Yet Another Perl Conference, North America, 2005 Registration now open Message-ID: ----------> Yet Another Perl Conference, North America, 2005 Registration now open. Conference dates: Monday - Wednesday 27 - 29 June 2005 Location: 89 Chestnut Street http://89chestnut.com/ University of Toronto Toronto, Ontario, Canada Info at: http://yapc.org/America Direct registration: http://donate.perlfoundation.org/index.pl?node=registrant%20info&conference_id=423 Full registration fee $85 (USD) Book now for great deals on accommodations and ensure a space for yourself. Speaking slots are still open. If you would like to present at YAPC::NA 2005, see: http://yapc.org/America/cfp-2005.shtml Details of this announcement: http://yapc.org/America/registration-announcement-2005.txt <---------- More Details ============ Registration for YAPC::NA (Yet Another Perl Conference, North America) 2005 in Toronto, Ontario, Canada is now open. The conference registration price is USD$85. This price includes admission to all aspects of the conference, respectable amounts of catering, several activities and a few conference goodies. The YAPC North America 2005 conference features... * Fantastic speakers + most are the core creators of the technology on which they present + many are professional IT authors, trainers and conference speakers * An excellent learning opportunity * A chance to meet Perl professionals from all over North America and the world + YAPC attendees tend to be very involved in Perl and so are another great way to learn more about what the language has to offer beyond just what the speakers have to say * Extra-curricular / after hours activities * A great location in downtown Toronto All this, and the price is more than an order of magnitude cheaper than what commercial conferences can offer. This is because YAPC is a 100% volunteer effort, both from its organizers and its speakers. Quality is *not* sacrificed to achieve this stunning level of affordability. YAPC provides the best value-for-dollar in IT conferences. And it's a ton of fun, too. The dates of the conference are Monday - Wednesday 27-29 June 2005. The location is 89 Chestnut Street in downtown Toronto, Ontario, Canada. (Note that a different date block was previously announced; we moved the conference date to accommodate venue availability.) http://89chestnut.com/ -- a facility within the University of Toronto If you are at all interested in attending the conference... Book now! Book now! Book now! We have room for about 400 attendees and we hope to sell out well in advance of the late June conference date. However, the critical matter is that of hotels. The YAPC::NA 2005 organizers have made group arrangements with several facilities around the city to provide _excellent_ quality accommodations in _very_ convenient locations at _terrific_ prices for the _full_ capacity of conference attendees (around 400 people). (Finding, booking and paying accommodations is the responsibility of the attendees, but we will provide you with a list of the hotels and university dorms to try first based on our group arrangement with them when you register for the conference. Also, see the web site at http://yapc.org/America/accommodations-2005.shtml. More details will be up shortly. The dorm option will be approx. C$55/night, the hotel options will be more like C$90/night, and for slightly different prices there will be options for putting more than 1 person in a room. Exact details and how to book will be emailed directly to people who have registered for the conference as soon as they become available.) *The catch is -- book now!!* The group reservations will expire in early May, at which point in time the group rates will mostly still apply, but the rooms will be given out on an "availability basis". Which means that someone else outside of the YAPC group can book the rooms as well. Make no mistake -- the rooms *will* be sold. Toronto is a very active conference city in the summer and there will be _no_ guarantee of vacancies either at the facilities we made arrangements with or anywhere else in the city if you leave it to within 6 weeks of the conference date. So, if you want to save yourself the likely-fruitless headache of scrambling around looking for accommodations at the last minute, Book now! Book now! Book now! Have any questions? Email na-help@yapc.org for more details. Additionally, we are still welcoming submissions for proposals via: http://yapc.org/America/cfp-2005.shtml The close of the call-for-papers is April 18, 2005 at 11:59 pm (Toronto time). If you have any questions regarding the call-for-papers or speaking at YAPC::NA 2005 please email na-author@yapc.org We would love to hear from potential sponsors. Please contact the organizers at na-sponsor@yapc.org to learn about the benefits of sponsorship. From jay at jays.net Mon Mar 21 14:51:47 2005 From: jay at jays.net (Jay Hannah) Date: Mon Mar 21 14:51:57 2005 Subject: [Omaha.pm] Omni::DB::test() Message-ID: <94774caee418c4f5e2e77412498ac735@jays.net> I got tired of writing a 10 line "does our Perl -> Informix environment work?" program from memory, so I centralized that 10 lines into Omni::DB. Now I can find out command line if DBD::Informix is peachy: $ perl -MOmni::DB -e 'Omni::DB::test' There are 57 rows in omni@prod_tcp:hotels. It's basically an ode to DBI's installed_versions() routine that is unbelievably handy: $ perl -MDBI -e 'DBI->installed_versions' Perl : 5.006001 (i686-linux) OS : linux (2.2.14-12) DBI : 1.40 DBD::Sybase : 1.02 DBD::Sponge : 11.10 DBD::Proxy : install_driver(Proxy) failed: Can't locate RPC/PlClient.pm in @INC DBD::ODBC : install_driver(ODBC) failed: ... DBD::Informix : 0.95 DBD::ExampleP : 11.12 DBD::ADO : 0.14 j From jay at jays.net Tue Mar 22 17:26:44 2005 From: jay at jays.net (Jay Hannah) Date: Tue Mar 22 17:26:55 2005 Subject: [Omaha.pm] IIS server log analysis Message-ID: <9e53349be852858290206232ea66cc5e@jays.net> From the Why Didn't I Post This Yesterday To Let Someone Else Do My Homework For Me Department ----------------- PROBLEM ----------------- Given a directory of .zip files: ex050220.zip ex050221.zip ex050222.zip ex050223.zip ex050224.zip ex050225.zip ex050226.zip Containing IIS server logs like this: # Fields: date time c-ip cs-username s-ip s-port cs-method cs-uri-stem cs-uri-query sc-status sc-bytes cs(User-Agent) cs(Cookie) cs(Referer) 2005-02-20 00:00:00 68.60.191.239 - 198.64.145.249 443 GET /images/header/tnd_sg_07-over.gif - 304 163 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1) ASPSESSIONIDSCSSSCRD=OAMAHBPAJHHBGEJEKBALFCOO https://ssl.omnihotels.com/Omni? prop=CHIDTN&pagedst=AvailReq&pagesrc=Hotels ... Report the total number of bytes per hour transferred from port 80 and port 443 like so: Year to hour Port 80 Port 443 ------------- --------- ----------- 2005-02-20-00 208867846 31587703 2005-02-20-01 193477261 25950887 2005-02-20-02 210614224 24952027 ... ----------------- SOLUTION ----------------- for (20 .. 26) { # Shooting for: ex050220.log $file = sprintf("ex0502%d", $_); `unzip $file.zip`; readfile("$file.log"); unlink("$file.log"); } sub readfile { my ($file) = @_; my %stats; open (IN, $file); while () { next if /^#/; my @l = split / /; $hour = $l[1]; $hour =~ s/:.*//; $stats{"$l[0]-$hour"}{$l[5]} += $l[10]; #$cnt++; #last if ($cnt == 500); } close IN; foreach (sort keys %stats) { print "$_ $stats{$_}{80} $stats{$_}{443}\n"; } } From Kent.Tegels at hdrinc.com Tue Mar 22 20:25:38 2005 From: Kent.Tegels at hdrinc.com (Tegels, Kent) Date: Tue Mar 22 20:26:08 2005 Subject: [Omaha.pm] IIS server log analysis Message-ID: <8046479841F5F84C9BD1F5CF4AD4379E01E73E46@OMA-G-L.intranet.hdr> http://sqljunkies.com/WebLog/ktegels/archive/2003/12/05/580.aspx ________________________________ From: omaha-pm-bounces@pm.org on behalf of Jay Hannah Sent: Tue 3/22/2005 7:26 PM To: Omaha Perl Mongers Subject: [Omaha.pm] IIS server log analysis From the Why Didn't I Post This Yesterday To Let Someone Else Do My Homework For Me Department ----------------- PROBLEM ----------------- Given a directory of .zip files: ex050220.zip ex050221.zip ex050222.zip ex050223.zip ex050224.zip ex050225.zip ex050226.zip Containing IIS server logs like this: # Fields: date time c-ip cs-username s-ip s-port cs-method cs-uri-stem cs-uri-query sc-status sc-bytes cs(User-Agent) cs(Cookie) cs(Referer) 2005-02-20 00:00:00 68.60.191.239 - 198.64.145.249 443 GET /images/header/tnd_sg_07-over.gif - 304 163 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1) ASPSESSIONIDSCSSSCRD=OAMAHBPAJHHBGEJEKBALFCOO https://ssl.omnihotels.com/Omni? prop=CHIDTN&pagedst=AvailReq&pagesrc=Hotels ... Report the total number of bytes per hour transferred from port 80 and port 443 like so: Year to hour Port 80 Port 443 ------------- --------- ----------- 2005-02-20-00 208867846 31587703 2005-02-20-01 193477261 25950887 2005-02-20-02 210614224 24952027 ... ----------------- SOLUTION ----------------- for (20 .. 26) { # Shooting for: ex050220.log $file = sprintf("ex0502%d", $_); `unzip $file.zip`; readfile("$file.log"); unlink("$file.log"); } sub readfile { my ($file) = @_; my %stats; open (IN, $file); while () { next if /^#/; my @l = split / /; $hour = $l[1]; $hour =~ s/:.*//; $stats{"$l[0]-$hour"}{$l[5]} += $l[10]; #$cnt++; #last if ($cnt == 500); } close IN; foreach (sort keys %stats) { print "$_ $stats{$_}{80} $stats{$_}{443}\n"; } } _______________________________________________ Omaha-pm mailing list Omaha-pm@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/20050322/c2575377/attachment.htm From jay at jays.net Wed Mar 23 12:17:34 2005 From: jay at jays.net (Jay Hannah) Date: Wed Mar 23 12:17:47 2005 Subject: [Omaha.pm] IIS server log analysis In-Reply-To: <8046479841F5F84C9BD1F5CF4AD4379E01E73E46@OMA-G-L.intranet.hdr> References: <8046479841F5F84C9BD1F5CF4AD4379E01E73E46@OMA-G-L.intranet.hdr> Message-ID: <675d8068c1ec86e6993df33d4d45a897@jays.net> On Mar 22, 2005, at 10:25 PM, Tegels, Kent wrote: > http://sqljunkies.com/WebLog/ktegels/archive/2003/12/05/580.aspx Why do you suppose your VB.NET code benchmarks faster than the Perl? j From Kent.Tegels at hdrinc.com Wed Mar 23 12:27:23 2005 From: Kent.Tegels at hdrinc.com (Tegels, Kent) Date: Wed Mar 23 12:27:34 2005 Subject: [Omaha.pm] IIS server log analysis Message-ID: <8046479841F5F84C9BD1F5CF4AD4379E02FABAF6@OMA-G-L.intranet.hdr> Compiled vs. Interpreted. -----Original Message----- From: omaha-pm-bounces@pm.org [mailto:omaha-pm-bounces@pm.org] On Behalf Of Jay Hannah Sent: Wednesday, March 23, 2005 2:18 PM To: Perl Mongers of Omaha, Nebraska USA Subject: Re: [Omaha.pm] IIS server log analysis On Mar 22, 2005, at 10:25 PM, Tegels, Kent wrote: > http://sqljunkies.com/WebLog/ktegels/archive/2003/12/05/580.aspx Why do you suppose your VB.NET code benchmarks faster than the Perl? j _______________________________________________ Omaha-pm mailing list Omaha-pm@pm.org http://mail.pm.org/mailman/listinfo/omaha-pm From stigliz at gmail.com Wed Mar 23 14:49:34 2005 From: stigliz at gmail.com (Amedeo Guffanti) Date: Wed Mar 23 14:49:43 2005 Subject: [Omaha.pm] Reseach on Open Source Developers Message-ID: Hi, I'm Amedeo Guffanti, a 22 years old Italian student at Bocconi university in Milan, I' m doing a research to write a work about Open Source Movement, in particular, about the developers. I try to collect the opinions of developers like you. My little poll is at this page : http://www.alberocavo.com/OSSprojects.asp It takes less then 4 minutes. I hope the Open Source Communities will give me a help for my research. I apologize for taking your time and for my English that I hope it's understandable ^^ Sincerly, Amedeo Guffanti From jay at jays.net Wed Mar 23 17:10:01 2005 From: jay at jays.net (Jay Hannah) Date: Wed Mar 23 17:10:16 2005 Subject: [Omaha.pm] IIS server log analysis In-Reply-To: <8046479841F5F84C9BD1F5CF4AD4379E02FABAF6@OMA-G-L.intranet.hdr> References: <8046479841F5F84C9BD1F5CF4AD4379E02FABAF6@OMA-G-L.intranet.hdr> Message-ID: <691a0af405952d3f063f6ebc2babd178@jays.net> > On Mar 22, 2005, at 10:25 PM, Tegels, Kent wrote: >> http://sqljunkies.com/WebLog/ktegels/archive/2003/12/05/580.aspx > > Why do you suppose your VB.NET code benchmarks faster than the Perl? > >> Compiled vs. Interpreted. I thought as a general rule the only inherent efficiency loss was @ compile time (perl script "startup")? So, once you've lost 1/2 second or whatever for perl to get going, you were on an even keel (generally) w/ compiled codebase? Yes/no? Of course there's always going to be differences in operation speeds (disk read, mem alloc, etc., etc.) for each language/OS combination, but that's true whether you're talking about 2 compiled languages competing; or a compiled vs. Perl? Yes/no? I would expect that any MS language would be more efficiently optimized for Windows O/S than any open source language, compiled or interpreted, could ever hope to be since MS hordes the source (low level APIs/hacks while talking to the filesystem manager, etc)? Obviously I'm no low-level language dude. Perl made me far too lazy early in my career for me to want to understand machine code. -grin- j From dan at linder.org Wed Mar 23 04:30:00 2005 From: dan at linder.org (Daniel Linder) Date: Wed Mar 23 21:02:46 2005 Subject: [Omaha.pm] IIS server log analysis In-Reply-To: <675d8068c1ec86e6993df33d4d45a897@jays.net> References: <8046479841F5F84C9BD1F5CF4AD4379E01E73E46@OMA-G-L.intranet.hdr> <675d8068c1ec86e6993df33d4d45a897@jays.net> Message-ID: <2187.68.13.86.89.1111581000.squirrel@68.13.86.89> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Mar 22, 2005, at 10:25 PM, Tegels, Kent wrote: > http://sqljunkies.com/WebLog/ktegels/archive/2003/12/05/580.aspx When I read the messages on this link and saw the resulting code, my first thought was "Gheesh, .Net is about 2-3 times more line count than Perl." I cut my teeth first on Assembly (~1980), then Pascal(~1981), back-tracked through Basic(~1983), went back to Pascal, got into C in college(1989), and finally picked up Perl(~1996). I have to say that I've really got spoiled by the language just knowing what I want to do with with the data and not having to explain to it that "X is an integer, Y is a floating point, and Z is a string of characters." :) Dan - - - - - "I do not fear computer, I fear the lack of them." -- Isaac Asimov GPG fingerprint:9EE8 ABAE 10D3 0B55 C536 E17A 3620 4DCA A533 19BF -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFCQWFINiBNyqUzGb8RAhHlAJ4zvf3GF08DWiACSAUP0dD1bFjbvgCfXK+9 Zkz5Xsw/3RUINd86RIrWkw4= =Q46A -----END PGP SIGNATURE----- From jay at jays.net Tue Mar 29 15:00:42 2005 From: jay at jays.net (Jay Hannah) Date: Tue Mar 29 15:00:53 2005 Subject: [Omaha.pm] Another one-liner - whack a database unload Message-ID: <07dc7a70172c853971913480aeed1c32@jays.net> PROBLEM Given a file, orphan.unl, that looks like this: >head -3 orphan.unl 11832|704402|PARKWE|L|GNRMSG||1004792774||DMC|2005-03-29 10:50:04.37500|0|0|PRO-PARKWEACT-1004792774TYP-FINO-1STA-ATOP-FLAG MESSAGEFLG-20050329000000TXT-REQ: RQ NSRM KING TA RATE:FDT-20050328101854FCL-LAJONEXDT-XCL-TOW-CIP-CBP-PLC-WCA-RTC-URG- NCLN-CLO-CPH-EDT-20050330000000DEP-| 11834|704402|PARKWE|L|GNRSPE||1004792774||DMC|2005-03-29 10:50:05.32800|0|0|PRO-PARKWEACT-1004792774ITN-1COD-S2FRD -20050329000000TOD-20050330000000AMT-0STA-C| 11840|704402|PARKWE|L|GNRSPE||1004792774||DMC|2005-03-29 10:50:07.29600|0|0|PRO-PARKWEACT-1004792774ITN-2COD-KINGFRD -20050329000000TOD-20050330000000AMT-0STA-C| Turn the leading digits into a single 0. SOLUTION >cat orphan.unl | perl -ne "s/^\d+/0/; print" > orphan_new.unl All done. Observe: >head -3 orphan_new.unl 0|704402|PARKWE|L|GNRMSG||1004792774||DMC|2005-03-29 10:50:04.37500|0|0|PRO-PARKWEACT-1004792774TYP-FINO-1STA-ATOP-FLAG MESSAGEFLG-20050329000000TXT-REQ: RQ NSRM KING TA RATE:FDT-20050328101854FCL-LAJONEXDT-XCL-TOW-CIP-CBP-PLC-WCA-RTC-URG- NCLN-CLO-CPH-EDT-20050330000000DEP-| 0|704402|PARKWE|L|GNRSPE||1004792774||DMC|2005-03-29 10:50:05.32800|0|0|PRO-PARKWEACT-1004792774ITN-1COD-S2FRD -20050329000000TOD-20050330000000AMT-0STA-C| 0|704402|PARKWE|L|GNRSPE||1004792774||DMC|2005-03-29 10:50:07.29600|0|0|PRO-PARKWEACT-1004792774ITN-2COD-KINGFRD -20050329000000TOD-20050330000000AMT-0STA-C| >wc -l orphan* 899 orphan.unl 899 orphan_new.unl Yay! What's the point? orphan.unl was a database unload, and we needed to set the serial/autonumber column (the first column) value to 0 on every row so the database would assign the ID automatically. j From jhannah at omnihotels.com Thu Mar 31 13:02:04 2005 From: jhannah at omnihotels.com (Jay Hannah) Date: Thu Mar 31 13:02:07 2005 Subject: [Omaha.pm] ?: vs || Message-ID: <200503312101.j2VL1uxm006969@omares-email.omnihotels.com> Two examples before: print_font('text_font', $print_double_miles ? $print_double_miles : 0); my $omni_status = $fg_stay_hashref->{'omni_status'} ? $fg_stay_hashref->{'omni_status'} : '010'; After (untested): print_font('text_font', $print_double_miles || 0); my $omni_status = $fg_stay_hashref->{'omni_status'} || '010';