From tfreedman at iqep.com Wed May 2 07:36:27 2007 From: tfreedman at iqep.com (Tom Freedman) Date: Wed, 2 May 2007 10:36:27 -0400 Subject: [ABE.pm] may 2, beer, stuff! also, yapc! In-Reply-To: <20070426205251.GA10374@knight.manxome.org> References: <20070426205251.GA10374@knight.manxome.org> Message-ID: > -----Original Message----- > From: Ricardo SIGNES > Sent: Thursday, April 26, 2007 4:53 PM > To: abe-pm at pm.org > Subject: [ABE.pm] may 2, beer, stuff! also, yapc! > > So, first of all, May 2 is the first Wednesday of May. Beer and chow at > Macht's Gute? I'll be there ~18:30. Confidentiality Notice: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender immediately by reply e-mail and destroy all copies of the original message. From rjbs-perl-abe at lists.manxome.org Wed May 2 07:48:08 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Wed, 2 May 2007 10:48:08 -0400 Subject: [ABE.pm] may 2, beer, stuff! also, yapc! In-Reply-To: References: <20070426205251.GA10374@knight.manxome.org> Message-ID: <20070502144807.GA4294@zodiac.codesimply.com> * Tom Freedman [2007-05-02T10:36:27] > > So, first of all, May 2 is the first Wednesday of May. Beer and chow at > > Macht's Gute? > > I'll be there ~18:30. > > Confidentiality Notice: This e-mail message, including any attachments, is for > ... I won't tell a soul. -- rjbs From faber at linuxnj.com Wed May 2 19:05:30 2007 From: faber at linuxnj.com (Faber J. Fedor) Date: Wed, 2 May 2007 22:05:30 -0400 Subject: [ABE.pm] More on the HD-DVD key Message-ID: <20070503020530.GB31237@neptune.faber.nom> Steganpoetry! http://scriptorium.monastic.org/ -- Regards, Faber Fedor President Linux New Jersey, Inc. 908-320-0357 800-706-0701 http://www.linuxnj.com From rjbs-perl-abe at lists.manxome.org Thu May 3 06:14:19 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Thu, 3 May 2007 09:14:19 -0400 Subject: [ABE.pm] YAPC Schedule Message-ID: <20070503131419.GA8950@knight.manxome.org> http://conferences.mongueurs.net/yn2007/schedule -- rjbs From rjbs-perl-abe at lists.manxome.org Fri May 4 18:46:59 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Fri, 4 May 2007 21:46:59 -0400 Subject: [ABE.pm] befunge, brainfuck, ook Message-ID: <20070505014659.GA13276@knight.manxome.org> === Befunge === http://en.wikipedia.org/wiki/Befunge http://search.cpan.org/~jquelin/Language-Befunge-2.06/Befunge.pm Here's Hello World (you need to be using a monospace font!): > v v ,,,,,"Hello"< >48*, v v,,,,,,"World!"< >25*,@ === Brainfuck === http://www.muppetlabs.com/~breadbox/bf/ http://search.cpan.org/~dankogai/Language-BF-0.02/lib/Language/BF.pm Hello World: ++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<< +++++++++++++++.>.+++.------.--------.>+.>. === Ook! === http://www.dangermouse.net/esoteric/ook.html http://search.cpan.org/~jhi/Acme-Ook-0.11/lib/Acme/Ook.pm Here's for example how to print a file in reverse order: Ook. Ook. Ook! Ook? Ook. Ook? Ook. Ook! Ook? Ook! Ook? Ook. Ook! Ook! Ook! Ook? Ook. Ook. Ook! Ook. Ook? Ook. Ook! Ook! Ook? Ook! -- rjbs From fiedlert at gmail.com Mon May 7 12:06:13 2007 From: fiedlert at gmail.com (Ted Fiedler) Date: Mon, 7 May 2007 15:06:13 -0400 Subject: [ABE.pm] A question Message-ID: <814422ce0705071206n5f5defd6k1b9bb0b7d31eca7@mail.gmail.com> Perhaps a stupid one... I have a block of about 30 if statements such as my %HASH; for my $id(@transactions) { my $action; if ( $x ne "NULL" ) { # $x and x are always the same $HASH{$id}{'x'} = $x; $action ++; } if ( $y ne "NULL" ) { $HASH{$id}{'y'} = $y; $action++; } #### snipping about 28 other ifs #### if ($action) { # do something } } Id like to shorten the cluster of ifs with something like for my $id(@transactions) { my $action; for my $ref (@listofrefs) { $HASH{$id}{'ref'} = $ref if ( $ref ne "NULL" ) $action++; } if ( $action ) { # do something... } } I know ive done this or something like it before, I just cant find the code... Ted -- "You are never dedicated to something you have complete confidence in. No one is fanatically shouting that the sun is going to rise tomorrow. They know it's going to rise tomorrow. " -- Robert M Pirsig -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/abe-pm/attachments/20070507/9a72cc27/attachment.html From fiedlert at gmail.com Mon May 7 12:06:13 2007 From: fiedlert at gmail.com (Ted Fiedler) Date: Mon, 7 May 2007 15:06:13 -0400 Subject: [ABE.pm] A question Message-ID: <814422ce0705071206n5f5defd6k1b9bb0b7d31eca7@mail.gmail.com> Perhaps a stupid one... I have a block of about 30 if statements such as my %HASH; for my $id(@transactions) { my $action; if ( $x ne "NULL" ) { # $x and x are always the same $HASH{$id}{'x'} = $x; $action ++; } if ( $y ne "NULL" ) { $HASH{$id}{'y'} = $y; $action++; } #### snipping about 28 other ifs #### if ($action) { # do something } } Id like to shorten the cluster of ifs with something like for my $id(@transactions) { my $action; for my $ref (@listofrefs) { $HASH{$id}{'ref'} = $ref if ( $ref ne "NULL" ) $action++; } if ( $action ) { # do something... } } I know ive done this or something like it before, I just cant find the code... Ted -- "You are never dedicated to something you have complete confidence in. No one is fanatically shouting that the sun is going to rise tomorrow. They know it's going to rise tomorrow. " -- Robert M Pirsig -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/abe-pm/attachments/20070507/9a72cc27/attachment-0001.html From rjbs-perl-abe at lists.manxome.org Mon May 7 13:03:48 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Mon, 7 May 2007 16:03:48 -0400 Subject: [ABE.pm] A question In-Reply-To: <814422ce0705071206n5f5defd6k1b9bb0b7d31eca7@mail.gmail.com> References: <814422ce0705071206n5f5defd6k1b9bb0b7d31eca7@mail.gmail.com> Message-ID: <20070507200348.GA18861@knight.office.icgroup.com> * Ted Fiedler [2007-05-07T15:06:13] > for my $id(@transactions) > { > > my $action; > for my $ref (@listofrefs) > { > $HASH{$id}{'ref'} = $ref > if ( $ref ne "NULL" ) > $action++; > } > > if ( $action ) > { > # do something... > } > } There are two problems here, at least: 1. "ref" is really generic and I can't tell what it means in each case 2. you're using $ref and "ref" which scares me and makes me think that you want to use symbolic references, which suck This is my guess at the real problem: you want to fill in defaults into rows. my %default = ( color => 'red', flavor => 'cod', ); for my $id (@transactions) { my $actions_taken = 0; DEFAULT: for my $key (keys %default) { next DEFAULT if $default{ $key } eq 'NULL'; $HASH{ $id }{ $key } = $default{ $key }; $actions_taken++; } } ...or something like that. -- rjbs From faber at linuxnj.com Mon May 7 18:50:43 2007 From: faber at linuxnj.com (Faber J. Fedor) Date: Mon, 7 May 2007 21:50:43 -0400 Subject: [ABE.pm] A question In-Reply-To: <814422ce0705071206n5f5defd6k1b9bb0b7d31eca7@mail.gmail.com> References: <814422ce0705071206n5f5defd6k1b9bb0b7d31eca7@mail.gmail.com> Message-ID: <20070508015043.GB3782@neptune.faber.nom> On 07/05/07 15:06 -0400, Ted Fiedler wrote: > Perhaps a stupid one... Oh, please! I've posted FAR stupider questions. -- Regards, Faber Fedor President Linux New Jersey, Inc. 908-320-0357 800-706-0701 http://www.linuxnj.com From faber at linuxnj.com Mon May 7 19:02:04 2007 From: faber at linuxnj.com (Faber J. Fedor) Date: Mon, 7 May 2007 22:02:04 -0400 Subject: [ABE.pm] A question In-Reply-To: <20070507200348.GA18861@knight.office.icgroup.com> References: <814422ce0705071206n5f5defd6k1b9bb0b7d31eca7@mail.gmail.com> <20070507200348.GA18861@knight.office.icgroup.com> Message-ID: <20070508020204.GC3782@neptune.faber.nom> On 07/05/07 16:03 -0400, Ricardo SIGNES wrote: > This is my guess at the real problem: you want to fill in defaults into rows. > > my %default = ( > color => 'red', > flavor => 'cod', > ); > > for my $id (@transactions) { > my $actions_taken = 0; > > DEFAULT: for my $key (keys %default) { > next DEFAULT if $default{ $key } eq 'NULL'; > $HASH{ $id }{ $key } = $default{ $key }; > $actions_taken++; > } > } > > ...or something like that. What's the point of the DEFAULT label? You're breaking out of the same loop you're in. Now, > DEFAULT: for my $id (@transactions) { > my $actions_taken = 0; > > for my $key (keys %default) { > next DEFAULT if $default{ $key } eq 'NULL'; > $HASH{ $id }{ $key } = $default{ $key }; > $actions_taken++; > } > } I could understand! -- Regards, Faber Fedor President Linux New Jersey, Inc. 908-320-0357 800-706-0701 http://www.linuxnj.com From rjbs-perl-abe at lists.manxome.org Mon May 7 19:46:37 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Mon, 7 May 2007 22:46:37 -0400 Subject: [ABE.pm] A question In-Reply-To: <20070508020204.GC3782@neptune.faber.nom> References: <814422ce0705071206n5f5defd6k1b9bb0b7d31eca7@mail.gmail.com> <20070507200348.GA18861@knight.office.icgroup.com> <20070508020204.GC3782@neptune.faber.nom> Message-ID: <20070508024637.GA21553@knight.manxome.org> * "Faber J. Fedor" [2007-05-07T22:02:04] > On 07/05/07 16:03 -0400, Ricardo SIGNES wrote: > > for my $id (@transactions) { > > my $actions_taken = 0; > > > > DEFAULT: for my $key (keys %default) { > > next DEFAULT if $default{ $key } eq 'NULL'; > > $HASH{ $id }{ $key } = $default{ $key }; > > $actions_taken++; > > } > > } > > > > ...or something like that. > > What's the point of the DEFAULT label? You're breaking out of the same > loop you're in. Now, Because later, if you refactor, you will not have to look for what loops controls have become mismatched. -- rjbs From faber at linuxnj.com Tue May 8 17:36:55 2007 From: faber at linuxnj.com (Faber J. Fedor) Date: Tue, 8 May 2007 20:36:55 -0400 Subject: [ABE.pm] Looking for a development enviroment Message-ID: <20070509003655.GD6322@neptune.faber.nom> It looks like I'm getting back into development (yeah!) doing distributed webapps (YEAH!) for clients. I'm thinking I'll be doing a mix of technologies: Dojo (an AJAX library) and maybe PHP on the front end, the occasional CGI scripts in Perl on the backend, throw in MySQL and do it all (development and deployment) on Linux boxen of course. Oh! And how about some Ruby On Rails! Does anyone have suggestions for a good programming enviroment? Currently, it's just me and (text-based) vim. I'm looking for something to make me more productive; read as "debug faster and spend less time fiddling with pretty front ends and deploy faster". -- Regards, Faber Fedor President Linux New Jersey, Inc. 908-320-0357 800-706-0701 http://www.linuxnj.com From john-abe at apt202.net Tue May 8 19:22:25 2007 From: john-abe at apt202.net (John Cappiello) Date: Tue, 8 May 2007 22:22:25 -0400 Subject: [ABE.pm] Looking for a development enviroment In-Reply-To: <20070509003655.GD6322@neptune.faber.nom> References: <20070509003655.GD6322@neptune.faber.nom> Message-ID: <20070509022225.GK26656@apt202.net> On Tue, May 08, 2007 at 08:36:55PM -0400, Faber J. Fedor wrote: > Does anyone have suggestions for a good programming enviroment? > > Currently, it's just me and (text-based) vim. I'm looking for something > to make me more productive; read as "debug faster and spend less time > fiddling with pretty front ends and deploy faster". Vim, firefox, and firebug. -- jcap From rjbs-perl-abe at lists.manxome.org Tue May 8 19:24:56 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Tue, 8 May 2007 22:24:56 -0400 Subject: [ABE.pm] Looking for a development enviroment In-Reply-To: <20070509003655.GD6322@neptune.faber.nom> References: <20070509003655.GD6322@neptune.faber.nom> Message-ID: <20070509022456.GA26195@knight.manxome.org> * "Faber J. Fedor" [2007-05-08T20:36:55] > Currently, it's just me and (text-based) vim. I'm looking for something > to make me more productive; read as "debug faster and spend less time > fiddling with pretty front ends and deploy faster". My IDE is unix. I use screen, Vim, and other tools. I'm not sure what you really want from this mystery tool. What kind of things do you want it to do? -- rjbs From faber at linuxnj.com Tue May 8 19:30:01 2007 From: faber at linuxnj.com (Faber Fedor) Date: Tue, 8 May 2007 22:30:01 -0400 Subject: [ABE.pm] Looking for a development enviroment In-Reply-To: <20070509022225.GK26656@apt202.net> References: <20070509003655.GD6322@neptune.faber.nom> <20070509022225.GK26656@apt202.net> Message-ID: <300ccfa50705081930x182920a4id83ec27329e67397@mail.gmail.com> On 5/8/07, John Cappiello wrote: > On Tue, May 08, 2007 at 08:36:55PM -0400, Faber J. Fedor wrote: > > Does anyone have suggestions for a good programming enviroment? > Vim, firefox, and firebug. That's what I use now, along with the Web Developer, User Agent Switcher, Error Console, and DOM Inspector. It all just seems so cobbled together. Maybe I just need to see other techniques. I know how *I* use them. How do others use them? -- Faber From faber at linuxnj.com Tue May 8 19:37:40 2007 From: faber at linuxnj.com (Faber Fedor) Date: Tue, 8 May 2007 22:37:40 -0400 Subject: [ABE.pm] Looking for a development enviroment In-Reply-To: <20070509022456.GA26195@knight.manxome.org> References: <20070509003655.GD6322@neptune.faber.nom> <20070509022456.GA26195@knight.manxome.org> Message-ID: <300ccfa50705081937n3d728cdanfd0427bbb2aaf6dc@mail.gmail.com> On 5/8/07, Ricardo SIGNES wrote: > * "Faber J. Fedor" [2007-05-08T20:36:55] > > Currently, it's just me and (text-based) vim. I'm looking for something > > to make me more productive; read as "debug faster and spend less time > > fiddling with pretty front ends and deploy faster". > > My IDE is unix. I use screen, Vim, and other tools. I'm not sure what you > really want from this mystery tool. What kind of things do you want it to do? As I just replied to jcap, I'm looking for A Better Way, IOW different techniques. Here's an example of a better way to do a presentation: when we were meeting at the college in Bethlehem, you invited some guys from the Philly (?) PM group. They used OOo Impress to display their code. Well, so have I. What the Philly guys did was to gray out most of the screen and highlight the code they were talking about in white on black. Great technique! I can't live without screen and vim, but that's mostly sysadmin stuff. How do you guys use vim and screen for development (and what are "the other tools"?). -- faber From rjbs-perl-abe at lists.manxome.org Tue May 8 20:00:48 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Tue, 8 May 2007 23:00:48 -0400 Subject: [ABE.pm] Looking for a development enviroment In-Reply-To: <300ccfa50705081937n3d728cdanfd0427bbb2aaf6dc@mail.gmail.com> References: <20070509003655.GD6322@neptune.faber.nom> <20070509022456.GA26195@knight.manxome.org> <300ccfa50705081937n3d728cdanfd0427bbb2aaf6dc@mail.gmail.com> Message-ID: <20070509030048.GA26305@knight.manxome.org> * Faber Fedor [2007-05-08T22:37:40] > I can't live without screen and vim, but that's mostly sysadmin stuff. How > do you guys use vim and screen for development (and what are "the other > tools"?). I have one screen window for running vim, one for running the test suite, some more for the documentation... I use plugins to Vim to do error checking and set up the quickfix window (like perl_synwrite.vim). I'm not sure I use that much else while doing the actual coding. Most of the tools I use are for profiling and analysis. -- rjbs From faber at linuxnj.com Wed May 16 20:13:00 2007 From: faber at linuxnj.com (Faber J. Fedor) Date: Wed, 16 May 2007 23:13:00 -0400 Subject: [ABE.pm] Maybe I should use this development enviroment? In-Reply-To: <20070509003655.GD6322@neptune.faber.nom> References: <20070509003655.GD6322@neptune.faber.nom> Message-ID: <20070517031300.GA25219@neptune.faber.nom> http://uniquepeek.com/viewpage.php?page_id=799 -- Regards, Faber Fedor President Linux New Jersey, Inc. 908-320-0357 800-706-0701 http://www.linuxnj.com From rjbs-perl-abe at lists.manxome.org Thu May 17 04:48:00 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Thu, 17 May 2007 07:48:00 -0400 Subject: [ABE.pm] Maybe I should use this development enviroment? In-Reply-To: <20070517031300.GA25219@neptune.faber.nom> References: <20070509003655.GD6322@neptune.faber.nom> <20070517031300.GA25219@neptune.faber.nom> Message-ID: <20070517114800.GA3841@knight.manxome.org> * "Faber J. Fedor" [2007-05-16T23:13:00] > http://uniquepeek.com/viewpage.php?page_id=799 > When I first saw that, it really bugged me. First of all, who expects a voice command editor to be suitable for programming in a punctuation-heavy language? Secondly, the guy using it is being an idiot. He keeps trying the same non-working things over and over. If "capital Whatever" didn't work the first time, then when you get frustrated the next 15 times it doesn't work, you are the one who sucks, not the software. It's a shame, because I bet that an honest video evaluation of Vista's voice command could've been hilarious without being a straw man. -- rjbs From john-abe at apt202.net Thu May 17 06:43:46 2007 From: john-abe at apt202.net (John Cappiello) Date: Thu, 17 May 2007 09:43:46 -0400 Subject: [ABE.pm] Maybe I should use this development enviroment? In-Reply-To: <20070517114800.GA3841@knight.manxome.org> References: <20070509003655.GD6322@neptune.faber.nom> <20070517031300.GA25219@neptune.faber.nom> <20070517114800.GA3841@knight.manxome.org> Message-ID: <20070517134346.GF13111@apt202.net> On Thu, May 17, 2007 at 07:48:00AM -0400, Ricardo SIGNES wrote: > * "Faber J. Fedor" [2007-05-16T23:13:00] > > http://uniquepeek.com/viewpage.php?page_id=799 > > When I first saw that, it really bugged me. It's true, he was going on for weeks. But seriously, rjbs is right.o -- jcap From rjbs-perl-abe at lists.manxome.org Thu May 17 07:25:59 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Thu, 17 May 2007 10:25:59 -0400 Subject: [ABE.pm] work with rjbs! we're hiring Message-ID: <20070517142558.GA29473@zodiac.codesimply.com> http://jobs.perl.org/job/5802 -- rjbs From john-abe at apt202.net Thu May 17 11:38:31 2007 From: john-abe at apt202.net (John Cappiello) Date: Thu, 17 May 2007 14:38:31 -0400 Subject: [ABE.pm] work with rjbs! we're hiring In-Reply-To: <20070517142558.GA29473@zodiac.codesimply.com> References: <20070517142558.GA29473@zodiac.codesimply.com> Message-ID: <20070517183831.GG13111@apt202.net> On Thu, May 17, 2007 at 10:25:59AM -0400, Ricardo SIGNES wrote: > http://jobs.perl.org/job/5802 For what it's worth, this is a fun place to work and the other employees are all nice to work with. -- jcap From faber at linuxnj.com Thu May 17 18:06:51 2007 From: faber at linuxnj.com (Faber J. Fedor) Date: Thu, 17 May 2007 21:06:51 -0400 Subject: [ABE.pm] mail problems Message-ID: <20070518010651.GA27578@neptune.faber.nom> Here's a question for you email gurus in the audience: Alice logons to her AOL account from home in the morning and sends me an email. Later, at work, she logons to AOL, finds out that her email to me has been rejected by my server as spam. She thens forwards the email to me and it gets through. WTF? I can understand how it gets rejected the first time: X-Mailer: AOL 9.0 VR sub 100 X-Spam-Flag: NO X-Spam-Status: Yes, score=7.087 tag=0 tag2=5 kill=5 tests=[BAYES_50=0.001, HTML_IMAGE_ONLY_16=1.047, HTML_MESSAGE=3, MIME_QP_LONG_LINE=0.039, NO_REAL_NAME=3] X-Spam-Score: 7.087 X-Spam-Level: ******* X-Spam-Flag: YES but the same thing applies to the fowarded email, no? Unfortunately, I don't have the SpamAssassin headers of the email that gets through because it went through the local SA (which passed it) stripping out the headers from my remote SA. Any ideas? -- Regards, Faber Fedor President Linux New Jersey, Inc. 908-320-0357 800-706-0701 http://www.linuxnj.com From rjbs-perl-abe at lists.manxome.org Thu May 17 18:44:01 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Thu, 17 May 2007 21:44:01 -0400 Subject: [ABE.pm] mail problems In-Reply-To: <20070518010651.GA27578@neptune.faber.nom> References: <20070518010651.GA27578@neptune.faber.nom> Message-ID: <20070518014401.GA433@knight.manxome.org> * "Faber J. Fedor" [2007-05-17T21:06:51] > Alice logons to her AOL account from home in the morning and sends me an > email. Later, at work, she logons to AOL, finds out that her email to > me has been rejected by my server as spam. She thens forwards the email > to me and it gets through. WTF? I'd need to know more about the rejecting server's configuration. It's unusual for mail to be rejected based on SpamAssassin scores, as SA is usually used after acceptance to determine whether or not (and where) to deliver a message. To use it for rejection, you'd have to do "accept then send DSN" which is obnoxious. > HTML_IMAGE_ONLY_16=1.047, HTML_MESSAGE=3, MIME_QP_LONG_LINE=0.039, > NO_REAL_NAME=3] What's the HTML_IMAGE_ONLY rule? HTML with only image tags? Perhaps the forward contained text. -- rjbs From faber at linuxnj.com Thu May 17 19:59:35 2007 From: faber at linuxnj.com (Faber J. Fedor) Date: Thu, 17 May 2007 22:59:35 -0400 Subject: [ABE.pm] mail problems In-Reply-To: <20070518014401.GA433@knight.manxome.org> References: <20070518010651.GA27578@neptune.faber.nom> <20070518014401.GA433@knight.manxome.org> Message-ID: <20070518025935.GD27625@neptune.faber.nom> On 17/05/07 21:44 -0400, Ricardo SIGNES wrote: > * "Faber J. Fedor" [2007-05-17T21:06:51] > > Alice logons to her AOL account from home in the morning and sends me an > > email. Later, at work, she logons to AOL, finds out that her email to > > me has been rejected by my server as spam. She thens forwards the email > > to me and it gets through. WTF? > > I'd need to know more about the rejecting server's configuration. You want a login? :-) It's my mail server doing the rejecting. Postfix with AmaVisD using ClamAV and SA. > It's unusual > for mail to be rejected based on SpamAssassin scores, as SA is usually used > after acceptance to determine whether or not (and where) to deliver a message. > To use it for rejection, you'd have to do "accept then send DSN" which is > obnoxious. With Amavis, you do accept the email. Wanna see the maillog? Postfix decides whether or not to accept the email, passes it to AmaVisD which runs SA and ClamAV on it and, if accepted, passes it to another instance of Postfix which delivers the email to (in this case) procmail, otherwise it gets quarantined and bounced . My local box then POPs it down and runs it through a local version of SA. And #$%#$ spam STILL gets through! > > HTML_IMAGE_ONLY_16=1.047, HTML_MESSAGE=3, MIME_QP_LONG_LINE=0.039, > > NO_REAL_NAME=3] > > What's the HTML_IMAGE_ONLY rule? HTML with only image tags? HTML_IMAGE_ONLY_16 BODY: HTML: images with 1200-1600 bytes of words Applicable only to this message (she threw in two pieces of clip art) but the problem has been appearing since she started emailing me earlier this week. > Perhaps the forward contained text. Don't think so. mutt shows text in the forward and the body, but looking at the email with vi shows everything that is sent (?) as text is also sent as HTML. I'm turning off fetchmail tonight so the local SA doesn't overwrite the headers. We'll see what happens tomorrow. -- Regards, Faber Fedor President Linux New Jersey, Inc. 908-320-0357 800-706-0701 http://www.linuxnj.com From faber at linuxnj.com Fri May 18 14:08:41 2007 From: faber at linuxnj.com (Faber J. Fedor) Date: Fri, 18 May 2007 17:08:41 -0400 Subject: [ABE.pm] quick and dirty webapp? Message-ID: <20070518210841.GA29392@neptune.faber.nom> have multiple directories that contain various files (mostly PDFs). My client would like to access these files via the web browser. I was thinking of just directory listings, but he want's pull down menus; instead of going to the QA reports directory, he wants to click on the Intranet tab, select QA, then Reports, then the YYYYMMDD and see the PDF (_in_ his browser?). I imagine the webapp would have to read the dir and parse the dir/file names before showing the menus. Anyone know of a quick and dirty way to do this? Or a better way? Would RoR be a good choice? I'm under the impression that RoR is best for small database-backed sites. -- Regards, Faber Fedor President Linux New Jersey, Inc. 908-320-0357 800-706-0701 http://www.linuxnj.com From rjbs-perl-abe at lists.manxome.org Fri May 18 18:29:13 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Fri, 18 May 2007 21:29:13 -0400 Subject: [ABE.pm] quick and dirty webapp? In-Reply-To: <20070518210841.GA29392@neptune.faber.nom> References: <20070518210841.GA29392@neptune.faber.nom> Message-ID: <20070519012913.GB1933@knight.manxome.org> * "Faber J. Fedor" [2007-05-18T17:08:41] > have multiple directories that contain various files (mostly PDFs). My > client would like to access these files via the web browser. I was > thinking of just directory listings, but he want's pull down menus; > instead of going to the QA reports directory, he wants to click on the > Intranet tab, select QA, then Reports, then the YYYYMMDD and see the PDF > (_in_ his browser?). I imagine the webapp would have to read the dir and > parse the dir/file names before showing the menus. How do you know what file is what date? Let's say that the directories are random and the filenames are YYYY-MM-DD.PDF sub filename_to_date { my ($filename) = @_; (my $date = $filename) =~ s{.+[\\/]}{}; $date =~ s/-//i; $date =~ s/\.pdf//i; return $date; } my @files = File::Find::Rule->file->name(qr/\.pdf$/i)->in('root_dir'); my %date = map { $_ => filename_to_date($_) } @files; print "
"; ...and then something that redirects to the submitted file. > Anyone know of a quick and dirty way to do this? Or a better way? Would > RoR be a good choice? I'm under the impression that RoR is best for > small database-backed sites. RoR would be MASSIVE overkill. -- rjbs From rjbs-perl-abe at lists.manxome.org Mon May 21 15:27:03 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Mon, 21 May 2007 18:27:03 -0400 Subject: [ABE.pm] [fluhmann@gmail.com: [pm_groups] yapc-na early bird pricing ending] Message-ID: <20070521222703.GA3378@knight> Look people, the time for cheap registration is nearly at an end! Register now or you'll have to shell out FIFTEEN more dollars. I cannot stress how important that is: that's like two fewer pitchers you can buy. In fact, I am tempted to declare that anyone who doesn't register before the deadline owes the group two pitchers. (If you don't register at all, does that mean you owe a dozen? Don't find out!) ---------- Forwarded message ---------- From: Jeremy Fluhmann Date: May 21, 2007 10:47 AM Subject: yapc-na early bird pricing ending Early Bird pricing for YAPC::NA 2007 will be ending soon. Register before it's too late! Early Bird pricing ends midnight (CST) Tuesday, May 22nd. If you haven't registered yet, please do so by visiting http://conferences.mongueurs.net/yn2007/. If you already have a login, but haven't purchased your ticket yet, choose the 'Edit profile' from the left menu and follow the 'purchase your conference ticket' link. I apologize for the late notice. As someone mentioned, it's not much of an 'early' bird anymore ;-) Thanks, Jeremy ----- End forwarded message ----- -- rjbs From faber at linuxnj.com Mon May 21 16:06:47 2007 From: faber at linuxnj.com (Faber Fedor) Date: Mon, 21 May 2007 19:06:47 -0400 Subject: [ABE.pm] [fluhmann@gmail.com: [pm_groups] yapc-na early bird pricing ending] In-Reply-To: <20070521222703.GA3378@knight> References: <20070521222703.GA3378@knight> Message-ID: <300ccfa50705211606r5c53056bke344211b27db663e@mail.gmail.com> On 5/21/07, Ricardo SIGNES wrote: > I cannot stress how important that is: that's like two fewer pitchers you can > buy. In fact, I am tempted to declare that anyone who doesn't register before > the deadline owes the group two pitchers. (If you don't register at all, does > that mean you owe a dozen? Don't find out!) So Ted is buying the beer at teh next meeting? Where does one sign up/pay for the rooms and dining? I don't see it anywhere. -- Faber From faber at linuxnj.com Mon May 21 16:08:05 2007 From: faber at linuxnj.com (Faber Fedor) Date: Mon, 21 May 2007 19:08:05 -0400 Subject: [ABE.pm] [fluhmann@gmail.com: [pm_groups] yapc-na early bird pricing ending] In-Reply-To: <300ccfa50705211606r5c53056bke344211b27db663e@mail.gmail.com> References: <20070521222703.GA3378@knight> <300ccfa50705211606r5c53056bke344211b27db663e@mail.gmail.com> Message-ID: <300ccfa50705211608t18052159hc6b24ef838150345@mail.gmail.com> Never mind. I found it right after I sent the message (although I've been looking for the link for days!) On 5/21/07, Faber Fedor wrote: > On 5/21/07, Ricardo SIGNES wrote: > > > I cannot stress how important that is: that's like two fewer pitchers you can > > buy. In fact, I am tempted to declare that anyone who doesn't register before > > the deadline owes the group two pitchers. (If you don't register at all, does > > that mean you owe a dozen? Don't find out!) > > So Ted is buying the beer at teh next meeting? > > Where does one sign up/pay for the rooms and dining? I don't see it anywhere. > > -- > > Faber > From rjbs-perl-abe at lists.manxome.org Mon May 21 16:57:38 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Mon, 21 May 2007 19:57:38 -0400 Subject: [ABE.pm] [fluhmann@gmail.com: [pm_groups] yapc-na early bird pricing ending] In-Reply-To: <300ccfa50705211608t18052159hc6b24ef838150345@mail.gmail.com> References: <20070521222703.GA3378@knight> <300ccfa50705211606r5c53056bke344211b27db663e@mail.gmail.com> <300ccfa50705211608t18052159hc6b24ef838150345@mail.gmail.com> Message-ID: <20070521235738.GA3828@knight.manxome.org> * Faber Fedor [2007-05-21T19:08:05] > Never mind. I found it right after I sent the message (although I've > been looking for the link for days!) This year's YAPC::NA is being organized with ACT, "A Conference Toolkit," a reusable system for running YAPCs. That's great. Unfortunately, ACT is very young and is missing LOTS of features like, "providing useful information." -- rjbs From fiedlert at gmail.com Tue May 22 06:03:31 2007 From: fiedlert at gmail.com (Ted Fiedler) Date: Tue, 22 May 2007 09:03:31 -0400 Subject: [ABE.pm] [fluhmann@gmail.com: [pm_groups] yapc-na early bird pricing ending] In-Reply-To: <300ccfa50705211606r5c53056bke344211b27db663e@mail.gmail.com> References: <20070521222703.GA3378@knight> <300ccfa50705211606r5c53056bke344211b27db663e@mail.gmail.com> Message-ID: <814422ce0705220603p7984d37ak1f73191f2338f083@mail.gmail.com> > > > So Ted is buying the beer at teh next meeting? Yep pabst blue ribbon is on me ! :) Unfortunatley my employer will forbid me to go. I am at a vmware training this week and probably an informix training over the summer. This will take me over my allotted lifetime trainings with this company. I will however be funding my own trip to pittsburgh this year. Ted -- "You are never dedicated to something you have complete confidence in. No one is fanatically shouting that the sun is going to rise tomorrow. They know it's going to rise tomorrow. " -- Robert M Pirsig -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/abe-pm/attachments/20070522/27978afd/attachment.html From faber at linuxnj.com Tue May 22 06:11:42 2007 From: faber at linuxnj.com (Faber Fedor) Date: Tue, 22 May 2007 09:11:42 -0400 Subject: [ABE.pm] [fluhmann@gmail.com: [pm_groups] yapc-na early bird pricing ending] In-Reply-To: <814422ce0705220603p7984d37ak1f73191f2338f083@mail.gmail.com> References: <20070521222703.GA3378@knight> <300ccfa50705211606r5c53056bke344211b27db663e@mail.gmail.com> <814422ce0705220603p7984d37ak1f73191f2338f083@mail.gmail.com> Message-ID: <300ccfa50705220611s6c92163frbdcb42b9ab590afc@mail.gmail.com> On 5/22/07, Ted Fiedler wrote: > > > > So Ted is buying the beer at teh next meeting? > > Yep pabst blue ribbon is on me ! :) GAG! > Unfortunatley my employer will forbid me to go. I am at a vmware training > this week Bring your notes to the next meeting. > I will however be funding my own trip to pittsburgh this year. What's in P-burgh? -- Faber From rjbs-perl-abe at lists.manxome.org Tue May 22 06:41:27 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Tue, 22 May 2007 09:41:27 -0400 Subject: [ABE.pm] [fluhmann@gmail.com: [pm_groups] yapc-na early bird pricing ending] In-Reply-To: <814422ce0705220603p7984d37ak1f73191f2338f083@mail.gmail.com> References: <20070521222703.GA3378@knight> <300ccfa50705211606r5c53056bke344211b27db663e@mail.gmail.com> <814422ce0705220603p7984d37ak1f73191f2338f083@mail.gmail.com> Message-ID: <20070522134127.GA306@knight.office.icgroup.com> * Ted Fiedler [2007-05-22T09:03:31] > >So Ted is buying the beer at teh next meeting? > > Yep pabst blue ribbon is on me ! :) Any port in a storm. > Unfortunatley my employer will forbid me to go. I am at a vmware training > this week and probably an informix training over the summer. This will take > me over my allotted lifetime trainings with this company. I will however be > funding my own trip to pittsburgh this year. Woo! Hopefully I'll be going, too. -- rjbs From rjbs-perl-abe at lists.manxome.org Tue May 22 14:59:49 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Tue, 22 May 2007 17:59:49 -0400 Subject: [ABE.pm] perl 5.10 rules: state variables Message-ID: <20070522215949.GA761@knight> I thought I'd inject some more actual technical content into the list by sharing with you more information about perl 5.10 and how it is totally awesome. I'll try to send one email each day, until I get sick of it or run out of interesting things to say. Today's cool new feature: state variables State variables make it even easier to write closures, which are subroutines that have a way of remembering their state. (They have "en-closed" variables.) Closures allow subroutines to have their own private data that other code can't muck with. There are many advanced uses for these, and several simple benefits. One benefit is the encapsultion you can provide to your subroutines -- in other words, by keeping their data private, you can prevent code elsewhere from mucking with it. (This puts a limit on your ability to do crazy obnoxious things. Some people see that as a drag, but I see it as an act of kindness to your future self. For example, if you want your program to count out hits from unique IPs, you could write something like this: package IPCounter; use vars qw(%IP_HITS); sub hit_from { my ($ip) = @_; my $hits = $IP_HITS{ $ip } + 1; print "$hits from $ip\n"; } ...but now any old jerk can write $IPCounter::IP_HITS{'127.0.0.1'} = 0 whenever and wherever he wants. That jerk is likely to be you, and you'll really get annoyed when this causes havok down the line. You can already make a closure, like this: package IPCounter; { my %IP_HITS; sub hit_from { my ($ip) = @_; my $hits = $IP_HITS{ $ip } + 1; print "$hits from $ip\n"; } } This works, protecting %IP_HITS from outside interferences. Unfortunately, it looks weird to people who don't immediately realize that it's creating a closure. It also means you've got a sub being declared inside of a block and not aligned to the left. These are little weirdnesses, but all these little weird things add up to produce scary code. In Perl 5.10, you can write this: package IPCounter; sub hit_from { my ($ip) = @_; state %IP_HITS; my $hits = $IP_HITS{ $ip } + 1; print "$hits from $ip\n"; } %IP_HITS is only visible in the sub, but it keeps its value between calls to the sub. It's identical in function to the ugly code above, except it's not ugly. You can even have your state variables initialized, and the initialization will only happen once. sub drink_a_beer { state $limit = 10; $limit--; die "I think that's about enough.\n" unless $limit; } -- rjbs From fiedlert at gmail.com Tue May 22 16:19:36 2007 From: fiedlert at gmail.com (Ted Fiedler) Date: Tue, 22 May 2007 19:19:36 -0400 Subject: [ABE.pm] perl 5.10 rules: state variables In-Reply-To: <20070522215949.GA761@knight> References: <20070522215949.GA761@knight> Message-ID: <814422ce0705221619k2fa66b4hb80f34cb65f710ba@mail.gmail.com> When is 5.10 due to release? A cursory glance at perl.com showed nothing? -Ted -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/abe-pm/attachments/20070522/d2056c40/attachment.html From rjbs-perl-abe at lists.manxome.org Tue May 22 17:41:45 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Tue, 22 May 2007 20:41:45 -0400 Subject: [ABE.pm] perl 5.10 rules: state variables In-Reply-To: <814422ce0705221619k2fa66b4hb80f34cb65f710ba@mail.gmail.com> References: <20070522215949.GA761@knight> <814422ce0705221619k2fa66b4hb80f34cb65f710ba@mail.gmail.com> Message-ID: <20070523004145.GA1204@knight.manxome.org> * Ted Fiedler [2007-05-22T19:19:36] > When is 5.10 due to release? A cursory glance at perl.com showed nothing? It's inching toward 5.10.0rc1. I expect that by summer and 5.10.0 before fall... but there's no set date. I have 5.9.4 installed for playing with it. -- rjbs From rjbs-perl-abe at lists.manxome.org Fri May 25 07:25:10 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Fri, 25 May 2007 10:25:10 -0400 Subject: [ABE.pm] perl 5.10 rules! - field hashes Message-ID: <20070525142510.GA987@knight> It's not that one post per day was too ambitious. I've had time. I just keep forgetting! Here's another awesome little something from perl 5.10: field hashes. If you've been keeping up with the ever-changing fads of Perl object design, you will have heard of inside-out objects. If you haven't, here's a too-short primer: --- BEGIN PRIMER --- The most common way to make an object in Perl is to bless a hashref. That means you have a constructor that does something like this: sub new { my ($class, $host, $port) = @_; my $self = { host => $host, port => $port, created => time, }; return bless $self => $class; } Then you have methods to do things like see when an object was created: sub created { my ($self) = @_; return $self->{created}; } The problem is that anybody who feels like examining your objects can see that they're hashes, and they can do something asinine, like this: $object->{created} = 0; # make the object seem really old! Well, this might be useful now and then, in times of great need, but normally it's a terrible idea. After all, what if, in the future, the author of this class changes the way that created times are stored? You've just shot yourself in the foot. Many languages have "strong encapsulation" for objects -- you can only get at the objects via their public methods, not via their private instance data. Perl, not so much. The famous quote from Tom C. is, roughly, "Perl wants you to behave nicely because you're polite, not because it's got a shotgun." Inside out objects give Perl a shotgun. my %created; my %host; my %port; sub new { my ($class, $host, $port) = @_; my $self = {}; # or some other reference; it doesn't matter $created{ $self + 0 } = time; $host { $self + 0 } = $host; $port { $self + 0 } = $port; return $self; } sub created { my ($self) = @_; return $created{ $self + 0 }; } Now, because the data is in a lexical variable and not in the object, nobody outside the file that declares the class can get at an object's data. The object's internal data is outside the object, so we call the object "inside-out." The object's reference address (position in memory) is used as a key to the hash. Unfortunately, there are LOADS of problems with this: it doesn't work well under threads, it requires careful manual garbage collection, and there are other problems, as well. --- END PRIMER --- So, inside-out objects are a pain to use, but provide some real benefits (more, too, than just the one I sketched out). What's a Perl hacker to do? Well, hack perl itself, of course. Hash::Util::FieldHash lets you declare a special kind of hash, a fieldhash, which is built for taking care of the obnoxious problems above. If you try to use an object as a hash key in perl 5.8, you get the object's stringy form instead. So, if you do this: $sender{ $email } = 'rjbs' You will get an entry for something like: Email=HASH(0xDEADBEEF) If the object is overloaded to stringify to something else, you could be in for real problems. What if your Email object stringified to the sender? Now very time you tried to use the object as a hash key, you'd replace the previous entry for a distinct email from the same sender. With a fieldhash, objects (or any reference) used as keys work properly: the object's unique id is used instead. If the process threads, the entry is updated for the object's new id. (Objects get new ids in threads.) If the object is garbage collected, the hash entry goes away. I think that in a year or two after 5.10's release, we'll start seeing far more inside-out objects as a result of Hash::Util::FieldHash. For more on how inside-out objects can make life easier, see Perl Best Practices, Class::InsideOut, and Object::InsideOut. -- rjbs From faber at linuxnj.com Tue May 29 18:47:45 2007 From: faber at linuxnj.com (Faber J. Fedor) Date: Tue, 29 May 2007 21:47:45 -0400 Subject: [ABE.pm] Dinner favors Message-ID: <20070530014745.GA19532@neptune.faber.nom> Does anyone have O'Reilly's "Perl Hacks" by chromatic? Can I borrow it? Ted: were you the one raving about Negativland? IF so, do you have any CDs I can borrow to check them out? -- Regards, Faber Fedor President Linux New Jersey, Inc. 908-320-0357 800-706-0701 http://www.linuxnj.com From rjbs-perl-abe at lists.manxome.org Tue May 29 19:46:26 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Tue, 29 May 2007 22:46:26 -0400 Subject: [ABE.pm] perl 5.10 rules! - the // operator Message-ID: <20070530024626.GA11887@knight.manxome.org> Here's a little one, but a goodie: the // operator. I do this sort of thing all the time: # This routine takes a bunch of lines and indents all but the first, padding # the lines with $indent spaces on the left. sub hanging_indent { my ($paragraph, $indent) = @_; $indent ||= 2; my @lines = split /\n/, $paragraph; my $new_string = shift @lines; for my $line (@lines) { $new_string .= ' ' x $indent . "$_\n"; } return $new_string; } So, it's a contrived example, but you get the point. The problem here is the default $indent. If I call it like this: hanging_indent($string); It's swell, I get two-space indents, which are the default. If I call it like, this, though: hanging_indent($string, 0); ...I still get two-space indents! See, ||= means "assign unless the thing on the left is already true." Well, zero isn't true! This means I end up writing things like: $indent = 2 unless defined $indent; or $indent = defined $indent ? $indent : 2; Ugh! // to the rescue! // is just like ||, except instead of checking for truth, it checks for definedness. If the thing on the left is defined, it will short circuit there, even if it's defined as a false value like zero or the empty string. I can rewrite my routine, saying: $indent //= 2; ...and now I can pass a zero successfully! -- rjbs From rjbs-perl-abe at lists.manxome.org Wed May 30 02:29:52 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Wed, 30 May 2007 05:29:52 -0400 Subject: [ABE.pm] Dinner favors In-Reply-To: <20070530014745.GA19532@neptune.faber.nom> References: <20070530014745.GA19532@neptune.faber.nom> Message-ID: <20070530092952.GA32323@zodiac.codesimply.com> * "Faber J. Fedor" [2007-05-29T21:47:45] > Does anyone have O'Reilly's "Perl Hacks" by chromatic? Can I borrow it? Yup, I'll bring it. I have a hack in it! :) > Ted: were you the one raving about Negativland? IF so, do you have any > CDs I can borrow to check them out? I probably was, and I'll put their mp3s on a DVD for you. -- rjbs From rjbs-perl-abe at lists.manxome.org Wed May 30 02:30:53 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Wed, 30 May 2007 05:30:53 -0400 Subject: [ABE.pm] dinner, june 6 Message-ID: <20070530093053.GB32323@zodiac.codesimply.com> One week from today is the first Wednesday of the month. Mach's Gute? -- rjbs From fiedlert at gmail.com Wed May 30 04:32:56 2007 From: fiedlert at gmail.com (Ted Fiedler) Date: Wed, 30 May 2007 07:32:56 -0400 Subject: [ABE.pm] dinner, june 6 In-Reply-To: <20070530093053.GB32323@zodiac.codesimply.com> References: <20070530093053.GB32323@zodiac.codesimply.com> Message-ID: <814422ce0705300432h6f5ff0a8sb9839bb2754173e3@mail.gmail.com> Ill be there. On 5/30/07, Ricardo SIGNES wrote: > > > One week from today is the first Wednesday of the month. Mach's Gute? > > -- > rjbs > _______________________________________________ > ABE-pm mailing list > ABE-pm at pm.org > http://mail.pm.org/mailman/listinfo/abe-pm > -- "You are never dedicated to something you have complete confidence in. No one is fanatically shouting that the sun is going to rise tomorrow. They know it's going to rise tomorrow. " -- Robert M Pirsig -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/abe-pm/attachments/20070530/2b3c1e20/attachment.html From fiedlert at gmail.com Wed May 30 04:32:23 2007 From: fiedlert at gmail.com (Ted Fiedler) Date: Wed, 30 May 2007 07:32:23 -0400 Subject: [ABE.pm] Dinner favors In-Reply-To: <20070530014745.GA19532@neptune.faber.nom> References: <20070530014745.GA19532@neptune.faber.nom> Message-ID: <814422ce0705300432y1f037dech44079ca61643feeb@mail.gmail.com> On 5/29/07, Faber J. Fedor wrote: > > Does anyone have O'Reilly's "Perl Hacks" by chromatic? Can I borrow it? I subscribe to safari => http://safari.oreilly.com/ I get the 10 slot subscription. For reference it cant be beat, except by Google maybe :) Ted: were you the one raving about Negativland? IF so, do you have any > CDs I can borrow to check them out? > > Not I. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/abe-pm/attachments/20070530/b78d3ad5/attachment.html From rjbs-perl-abe at lists.manxome.org Wed May 30 05:25:02 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Wed, 30 May 2007 08:25:02 -0400 Subject: [ABE.pm] perl 5.10 rules! - assertions Message-ID: <20070530122502.GA12438@knight> What else is new in 5.10? Assertions! Assertions are defined in various ways by various people, but they're generally something like this: An assertion is a block of code written to ensure that everything is OK during the execution of a program during testing. When the code is put into production, assertions can be disabled to improve performance. I use assertions a lot, but mine usually work like this: sub change_email { my ($self, $address) = @_; RJBS::Assertions->assert_valid_addr($address); $self->{email} = $address; } The assert_valid_addr method, then, does something like: sub assert_valid_addr { my ($self, $address) = @_; unless (Email::Valid->address($address)) { Exception::BadValue->raise( domain => 'RFC822::Addr', value => $address, error => "fails validation: " . Email::Valid->details . " test", ) } } In other words, I use them as reusable validate-or-raise-exception code units. They always run, though, which can be expensive. (It can also be useful! I'm not advocating turning off all your validation!) With toggleable assertions, it's easy to turn off your assertions when they're expensive and generally more for diagnostics than for critical functions. Now, this example might look a little wordy, but keep in mind how useful this kind of framework can be for an "enterprise" application: sub change_email { my ($self, $address) = @_; { use assertions 1; # always run _assert_valid_addr($address); } $self->{email} = $address; } sub _assert_valid_addr : assertion { my ($address) = @_; { use assertions 'testing'; _assert_test_addr($address); } unless (Email::Valid->address($address)) { Exception::BadValue->raise( domain => 'RFC822::Addr', value => $address, error => "fails validation: " . Email::Valid->details . " test", ) } } sub _assert_test_addr : assertion { my ($address) = @_; Carp::confess "you must not set the address to a non-test address!" if $address !~ /\@example\.com/; } The assertion code (the subs marked ": assertion") is only run if the assertions indicated by their scope's "use assertion" are on. "1" is always on, so _assert_valid_addr is always called. _assert_test_addr is only called if the testing assertions are on. You turn assertions on by running perl with the -A switch, meaning that if our test files started with: #!perl -A=testing ...then we'd run those assertions. Otherwise, we wouldn't. The call would be optimized away when the program was compiled. That's the benefit of assertions over, say, "if ($ENV{TESTING})" -- they optimize away the whole call at compile time, rather than checking the environment variable over and over at run time. This works because you can change %ENV (for example) at run time, but you can't change which assertions are active. So, back to _assert_valid_addr -- why bother making it an assertion if we're going to always run it? Well, we're just setting ourselves up for future maintenance. If we later move some other validating code in front of this "change_email" we might only want to _assert_valid_addr when testing some bizarre bug, and we can then change "use assertions 1" to, say, "use assertions 'paranoid'" I'll be honest: there are a bunch of things I don't love about the new assertions interface. I think it's a little clumsy and, as you may have noticed, it forces you to use sub calls instead of method calls. Some of this may yet be changed or fixed by the final 5.10 release, and if it gets awesomer, I will let you all know. Still, optimize-away-able assertions will help remove obstacles to writing more error- and sanity-checking code, which means more maintainable code -- and that means a happy Ricardo. -- rjbs From fiedlert at gmail.com Wed May 30 05:31:14 2007 From: fiedlert at gmail.com (Ted Fiedler) Date: Wed, 30 May 2007 08:31:14 -0400 Subject: [ABE.pm] perl 5.10 rules! - assertions In-Reply-To: <20070530122502.GA12438@knight> References: <20070530122502.GA12438@knight> Message-ID: <814422ce0705300531y7b186699hfacdc6560f0af628@mail.gmail.com> Just an FYI - I'm getting a lot out of these synopses - Thanks! Ted. On 5/30/07, Ricardo SIGNES wrote: > > > What else is new in 5.10? Assertions! > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/abe-pm/attachments/20070530/928e7b80/attachment.html From rjbs-perl-abe at lists.manxome.org Wed May 30 05:56:44 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Wed, 30 May 2007 08:56:44 -0400 Subject: [ABE.pm] perl 5.10 rules! - assertions In-Reply-To: <814422ce0705300531y7b186699hfacdc6560f0af628@mail.gmail.com> References: <20070530122502.GA12438@knight> <814422ce0705300531y7b186699hfacdc6560f0af628@mail.gmail.com> Message-ID: <20070530125644.GA12778@knight.office.icgroup.com> * Ted Fiedler [2007-05-30T08:31:14] > Just an FYI - I'm getting a lot out of these synopses - Thanks! Excellent! Knowing that they're useful to someone is great motivation to continue. They're also useful to me: some of the new stuff I only know /about/, so writing about it forces me to go learn how it works. -- rjbs From faber at linuxnj.com Wed May 30 06:04:06 2007 From: faber at linuxnj.com (Faber Fedor) Date: Wed, 30 May 2007 09:04:06 -0400 Subject: [ABE.pm] dinner, june 6 In-Reply-To: <20070530093053.GB32323@zodiac.codesimply.com> References: <20070530093053.GB32323@zodiac.codesimply.com> Message-ID: <300ccfa50705300604m3cad7466gda40a4af46ea7bd3@mail.gmail.com> On 5/30/07, Ricardo SIGNES wrote: > > > One week from today is the first Wednesday of the month. Mach's Gute? Sehr gut! -- Faber -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/abe-pm/attachments/20070530/623bc038/attachment.html From faber at linuxnj.com Wed May 30 06:04:06 2007 From: faber at linuxnj.com (Faber Fedor) Date: Wed, 30 May 2007 09:04:06 -0400 Subject: [ABE.pm] dinner, june 6 In-Reply-To: <20070530093053.GB32323@zodiac.codesimply.com> References: <20070530093053.GB32323@zodiac.codesimply.com> Message-ID: <300ccfa50705300604m3cad7466gda40a4af46ea7bd3@mail.gmail.com> On 5/30/07, Ricardo SIGNES wrote: > > > One week from today is the first Wednesday of the month. Mach's Gute? Sehr gut! -- Faber -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/abe-pm/attachments/20070530/623bc038/attachment-0001.html From rhkramer at gmail.com Wed May 30 07:05:20 2007 From: rhkramer at gmail.com (Randy Kramer) Date: Wed, 30 May 2007 10:05:20 -0400 Subject: [ABE.pm] perl 5.10 rules! - assertions In-Reply-To: <814422ce0705300531y7b186699hfacdc6560f0af628@mail.gmail.com> References: <20070530122502.GA12438@knight> <814422ce0705300531y7b186699hfacdc6560f0af628@mail.gmail.com> Message-ID: <200705301005.20514.rhkramer@gmail.com> On Wednesday 30 May 2007 08:31 am, Ted Fiedler wrote: > Just an FYI - I'm getting a lot out of these synopses - Thanks! +1 (Even though I don't plan to learn/use Perl.) Randy Kramer From rjbs-perl-abe at lists.manxome.org Thu May 31 08:23:27 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Thu, 31 May 2007 11:23:27 -0400 Subject: [ABE.pm] perl 5.10 rules! - say what? Message-ID: <20070531152327.GA21434@knight.manxome.org> Here's another little one: say say is stolen from Perl 6. It's just like print, but it prints a newline when you're done. Seriously, that's it! print "Nice to meet you, ", $ENV{USER}, ".\n"; say "Nice to meet you, ", $ENV{USER}, "."; Those lines do the same thing. What's the big deal? Well, you save four keystrokes, for one, multiplied by every time you would've used print. Then there's this: print @lines, "\n"; say @lines; There you saved eight keystrokes! Is this a really small win? I don't know, I think it's a tiny improvement that you'll really grow to love. There's one thing to keep in mind: because "say" wasn't a keyword before 5.10, you'll want to let perl know that you want it to be one now. There are a few ways to do that: use feature 'say'; # turn on the "say" feature in this block or file use feature ':5.10'; # turn on all 5.10 features in this block or file perl -E 'say "Hello, world!"' # like perl -e, but with all features -- rjbs From faber at linuxnj.com Thu May 31 11:22:31 2007 From: faber at linuxnj.com (Faber J. Fedor) Date: Thu, 31 May 2007 14:22:31 -0400 Subject: [ABE.pm] Travel plans? Message-ID: <20070531182231.GA30829@neptune.faber.nom> How are you guys getting to the airport for YAPC? I don't want to leave my car at the airport for the whole trip, but every other option costs more than the round trip flight tickets. Ideas? -- Regards, Faber Fedor President Linux New Jersey, Inc. 908-320-0357 800-706-0701 http://www.linuxnj.com From john-abe at apt202.net Thu May 31 11:34:49 2007 From: john-abe at apt202.net (John Cappiello) Date: Thu, 31 May 2007 14:34:49 -0400 Subject: [ABE.pm] Travel plans? In-Reply-To: <20070531182231.GA30829@neptune.faber.nom> References: <20070531182231.GA30829@neptune.faber.nom> Message-ID: <20070531183449.GA30115@apt202.net> On Thu, May 31, 2007 at 02:22:31PM -0400, Faber J. Fedor wrote: > Ideas? You could come park at my place in East Falls (NW PHL) and we can take the train down together. Maybe $10 round trip on the train. 30mins each way. -- jcap From rjbs-perl-abe at lists.manxome.org Thu May 31 12:55:32 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Thu, 31 May 2007 15:55:32 -0400 Subject: [ABE.pm] Travel plans? In-Reply-To: <20070531182231.GA30829@neptune.faber.nom> References: <20070531182231.GA30829@neptune.faber.nom> Message-ID: <20070531195532.GA21963@knight.manxome.org> * "Faber J. Fedor" [2007-05-31T14:22:31] > I don't want to leave my car at the airport for the whole trip, but > every other option costs more than the round trip flight tickets. You're also welcome to come to Bethlehem and head from there. I'm not positive on my plan yet, but it's probably something like: * bus from ABE to PHL * brunch * train from PHL city to PHL airport -- rjbs From john-abe at apt202.net Thu May 31 14:02:21 2007 From: john-abe at apt202.net (John Cappiello) Date: Thu, 31 May 2007 17:02:21 -0400 Subject: [ABE.pm] Travel plans? In-Reply-To: <20070531195532.GA21963@knight.manxome.org> References: <20070531182231.GA30829@neptune.faber.nom> <20070531195532.GA21963@knight.manxome.org> Message-ID: <20070531210221.GB30115@apt202.net> On Thu, May 31, 2007 at 03:55:32PM -0400, Ricardo SIGNES wrote: > * brunch > * train from PHL city to PHL airport I will probably be involved in these festivities. -- jcap From rjbs-perl-abe at lists.manxome.org Thu May 31 14:47:40 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Thu, 31 May 2007 17:47:40 -0400 Subject: [ABE.pm] Travel plans? In-Reply-To: <20070531195532.GA21963@knight.manxome.org> References: <20070531182231.GA30829@neptune.faber.nom> <20070531195532.GA21963@knight.manxome.org> Message-ID: <20070531214740.GA22258@knight.manxome.org> * Ricardo SIGNES [2007-05-31T15:55:32] > You're also welcome to come to Bethlehem and head from there. I'm not > positive on my plan yet, but it's probably something like: > > * bus from ABE to PHL > * brunch > * train from PHL city to PHL airport My flight is at 12:25 pm out of PHL. This means I'll be taking the 8:50 bus from Bethlehem. If you want, you can drive to Bethlehem and park here for free -- I can get you a week-long pass, I think, with no problem. That will get me to Philly around 10:20, then I'll eat something. There's a 10:25 and 10:55 R1 out of that neighborhood, and they arrive at the airport around 10:50 and 11:20, respectively. Either is probably okay. -- rjbs From rjbs-perl-abe at lists.manxome.org Thu May 31 17:46:07 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Thu, 31 May 2007 20:46:07 -0400 Subject: [ABE.pm] perl 5.10 rules! - assertions In-Reply-To: <20070530122502.GA12438@knight> References: <20070530122502.GA12438@knight> Message-ID: <20070601004606.GA22807@knight.manxome.org> * Ricardo SIGNES [2007-05-30T08:25:02] > I'll be honest: there are a bunch of things I don't love about the new > assertions interface. I think it's a little clumsy and, as you may have > noticed, it forces you to use sub calls instead of method calls. Some of > this may yet be changed or fixed by the final 5.10 release, and if it gets > awesomer, I will let you all know. Some of my complaints aired: http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2007-06/msg00009.html -- rjbs From mct at toren.net Thu May 31 19:20:11 2007 From: mct at toren.net (Michael C. Toren) Date: Thu, 31 May 2007 22:20:11 -0400 Subject: [ABE.pm] perl 5.10 rules! - say what? In-Reply-To: <20070531152327.GA21434@knight.manxome.org> References: <20070531152327.GA21434@knight.manxome.org> Message-ID: <20070601022011.GE20151@netisland.net> On Thu, May 31, 2007 at 11:23:27AM -0400, Ricardo SIGNES wrote: > say is stolen from Perl 6. It's just like print, but it prints a newline when > you're done. Seriously, that's it! > > print "Nice to meet you, ", $ENV{USER}, ".\n"; > say "Nice to meet you, ", $ENV{USER}, "."; Hmm, somewhat of a shame it wasn't named "puts", to mirror the function of the same name in ruby, etc... -mct From waltman at pobox.com Thu May 31 19:49:03 2007 From: waltman at pobox.com (Walt Mankowski) Date: Thu, 31 May 2007 22:49:03 -0400 Subject: [ABE.pm] perl 5.10 rules! - say what? In-Reply-To: <20070531152327.GA21434@knight.manxome.org> References: <20070531152327.GA21434@knight.manxome.org> Message-ID: <20070601024903.GR29773@mawode.com> On Thu, May 31, 2007 at 11:23:27AM -0400, Ricardo SIGNES wrote: > > Here's another little one: say > > say is stolen from Perl 6. It's just like print, but it prints a newline when > you're done. Seriously, that's it! > > print "Nice to meet you, ", $ENV{USER}, ".\n"; > say "Nice to meet you, ", $ENV{USER}, "."; > > Those lines do the same thing. > > What's the big deal? Well, you save four keystrokes, for one, multiplied by > every time you would've used print. You could, of course, have saved *six* keystrokes by changing that first line to print "Nice to meet you, $ENV{USER}.\n"; and it's a lot clearer that you've got the space and period where you want them. I agree with Mike in wishing they'd called it "puts" like ruby and stdio.h do. "say" just seems a bit too cutesy. > Then there's this: > > print @lines, "\n"; > say @lines; > > There you saved eight keystrokes! > > Is this a really small win? I don't know, I think it's a tiny improvement that > you'll really grow to love. > > There's one thing to keep in mind: because "say" wasn't a keyword before 5.10, > you'll want to let perl know that you want it to be one now. There are a few > ways to do that: > > use feature 'say'; # turn on the "say" feature in this block or file > use feature ':5.10'; # turn on all 5.10 features in this block or file > > perl -E 'say "Hello, world!"' # like perl -e, but with all features There go all the keystrokes you just saved! :) Walt From waltman at pobox.com Thu May 31 19:51:14 2007 From: waltman at pobox.com (Walt Mankowski) Date: Thu, 31 May 2007 22:51:14 -0400 Subject: [ABE.pm] Travel plans? In-Reply-To: <20070531214740.GA22258@knight.manxome.org> References: <20070531182231.GA30829@neptune.faber.nom> <20070531195532.GA21963@knight.manxome.org> <20070531214740.GA22258@knight.manxome.org> Message-ID: <20070601025114.GS29773@mawode.com> On Thu, May 31, 2007 at 05:47:40PM -0400, Ricardo SIGNES wrote: > * Ricardo SIGNES [2007-05-31T15:55:32] > > You're also welcome to come to Bethlehem and head from there. I'm not > > positive on my plan yet, but it's probably something like: > > > > * bus from ABE to PHL > > * brunch > > * train from PHL city to PHL airport > > My flight is at 12:25 pm out of PHL. > > This means I'll be taking the 8:50 bus from Bethlehem. If you want, you can > drive to Bethlehem and park here for free -- I can get you a week-long pass, I > think, with no problem. > > That will get me to Philly around 10:20, then I'll eat something. > > There's a 10:25 and 10:55 R1 out of that neighborhood, and they arrive at the > airport around 10:50 and 11:20, respectively. Either is probably okay. But neither leaves you much time for brunch. :) I think I'm on the same flight you're taking. I haven't given much thought to which trains I'm taking yet. Walt From faber at linuxnj.com Thu May 31 20:33:40 2007 From: faber at linuxnj.com (Faber Fedor) Date: Thu, 31 May 2007 23:33:40 -0400 Subject: [ABE.pm] Travel plans? In-Reply-To: <20070531183449.GA30115@apt202.net> References: <20070531182231.GA30829@neptune.faber.nom> <20070531183449.GA30115@apt202.net> Message-ID: <300ccfa50705312033h381a2d9bo1a9fca6b4db8c46a@mail.gmail.com> What time/day are you guys leaving? I was thinking of heading down a few days early (Fri., Sat.) to hang out and see Houston. On 5/31/07, John Cappiello wrote: > > On Thu, May 31, 2007 at 02:22:31PM -0400, Faber J. Fedor wrote: > > Ideas? > > You could come park at my place in East Falls (NW PHL) and we can take > the train down together. Maybe $10 round trip on the train. 30mins > each way. > > -- > jcap > _______________________________________________ > ABE-pm mailing list > ABE-pm at pm.org > http://mail.pm.org/mailman/listinfo/abe-pm > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/abe-pm/attachments/20070531/fce0504c/attachment.html From john-abe at apt202.net Thu May 31 20:45:26 2007 From: john-abe at apt202.net (John Cappiello) Date: Thu, 31 May 2007 23:45:26 -0400 Subject: [ABE.pm] Travel plans? In-Reply-To: <300ccfa50705312033h381a2d9bo1a9fca6b4db8c46a@mail.gmail.com> References: <20070531182231.GA30829@neptune.faber.nom> <20070531183449.GA30115@apt202.net> <300ccfa50705312033h381a2d9bo1a9fca6b4db8c46a@mail.gmail.com> Message-ID: <20070601034526.GF30115@apt202.net> On Thu, May 31, 2007 at 11:33:40PM -0400, Faber Fedor wrote: > What time/day are you guys leaving? I was thinking of heading down a few > days early (Fri., Sat.) to hang out and see Houston. Heading down Sunday, coming back Thursday -- jcap From rjbs-perl-abe at lists.manxome.org Thu May 31 20:48:11 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Thu, 31 May 2007 23:48:11 -0400 Subject: [ABE.pm] Travel plans? In-Reply-To: <300ccfa50705312033h381a2d9bo1a9fca6b4db8c46a@mail.gmail.com> References: <20070531182231.GA30829@neptune.faber.nom> <20070531183449.GA30115@apt202.net> <300ccfa50705312033h381a2d9bo1a9fca6b4db8c46a@mail.gmail.com> Message-ID: <20070601034811.GA23018@knight.manxome.org> * Faber Fedor [2007-05-31T23:33:40] > What time/day are you guys leaving? I was thinking of heading down a few > days early (Fri., Sat.) to hang out and see Houston. http://conferences.mongueurs.net/yn2007/wiki?node=Departures%20by%20air -- rjbs From rjbs-perl-abe at lists.manxome.org Thu May 31 20:50:31 2007 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Thu, 31 May 2007 23:50:31 -0400 Subject: [ABE.pm] perl 5.10 rules! - say what? In-Reply-To: <20070601024903.GR29773@mawode.com> References: <20070531152327.GA21434@knight.manxome.org> <20070601024903.GR29773@mawode.com> Message-ID: <20070601035031.GB23018@knight.manxome.org> * Walt Mankowski [2007-05-31T22:49:03] > > print "Nice to meet you, ", $ENV{USER}, ".\n"; > > say "Nice to meet you, ", $ENV{USER}, "."; > > You could, of course, have saved *six* keystrokes by changing that > first line to > > print "Nice to meet you, $ENV{USER}.\n"; Yes, I just didn't feel like thinking of something noninterpolable like: print "Nice to meet you, ", $session->user, ".\n"; Mention @{[]} and you die. > I agree with Mike in wishing they'd called it "puts" like ruby and > stdio.h do. "say" just seems a bit too cutesy. I agree that "say" is annoying -- especially since it conflicts with Log::Speak, which we use extensively at work. "puts" would be a reasonable alternative, but my feelings on this matter are not strong. > > use feature ':5.10'; # turn on all 5.10 features in this block or file > > > > perl -E 'say "Hello, world!"' # like perl -e, but with all features > > There go all the keystrokes you just saved! :) ...unless I run all programs as one-liners with -E! Yeah, I am not a fan of use feature. -- rjbs