From rspier at pobox.com Sun Dec 2 20:00:14 2001 From: rspier at pobox.com (Robert Spier) Date: Wed Aug 4 00:02:09 2004 Subject: LA.pm: The Santa Claus Golf Apocalypse Message-ID: <15370.56494.20939.730774@rls.cx> Anyone interested in playing along? We could have a mini la-pm competition, where the winner gets dinner, or a drink or something. -R * To: fwp@perl.org * Subject: The Santa Claus Golf Apocalypse * From: Andrew.Savige@ir.com * Date: Sun, 2 Dec 2001 19:40:37 +1100 * Delivered-To: mailing list fwp@perl.org * Mailing-List: contact fwp-help@perl.org; run by ezmlm As an early Christmas present, you are invited to play Santa Claus' newly constructed 5-hole golf course. The holes are likely too easy, but that will hopefully encourage more entries (feedback welcome). In fact, this whole golf game is a little experimental and hopefully we can improve its format based on the outcome of this game. Please post solutions only to me, Santa the Arbiter. But before posting, verify your entries with the below test program, tsanta.pl. I will verify that they are indeed ok and post a daily leaderboard. I am open to ideas re the winner's prize. In most fwp golf games, we all steal ideas; the idea here is to keep the source code secret, only the current leaderboard is known. The test program, tsanta.pl, should run on both Windows and Unix (forgive me, but I don't have a Unix machine available right now). To allow for cross-platform differences, please format your code with a leading #!/usr/bin/perl line if you want to use command-line switches. For example: #!/usr/bin/perl -n print This has golf score of 8 (5 for 'print', 3 for ' -n'). All 5 holes manipulate text files. You may assume that said text files are always properly newline-terminated and that they do not contain any binary zeros. Similarly, your programs must properly newline-terminate everything they write (they always write to stdout). When in doubt about the specification, use the test program, tsanta.pl; if your entries pass the test program, they are ok. You must name your programs as shown below and put them in the same directory as the test program. That done, run the test program: perl tsanta.pl to verify that your entries meet the specification. Hole 1. head.pl. Print first 10 lines of a text file. Hole 2. tail.pl. Print last 10 lines of a text file. Hole 3. rev.pl. Print a text file in reverse order. Hole 4. mid.pl. Print the middle line/s of a text file (one line if an odd number of lines; two lines if an even number). Hole 5. wc.pl. Print the number of lines in the file to stdout, zero-filled, right-justified, 10 chars wide. Merry Christmas to all participants. Santa Claus the Arbiter. test program, tsanta.pl ----------------------- # tsanta.pl. Santa Claus golf game test program. use strict; sub GolfScore { my $script = shift; open(FF, $script) or die "error: open '$script'"; my $golf = 0; while () { chomp; next unless length; s/^#!.*?perl// if $. == 1; $golf += length; } close(FF); return $golf; } sub PrintGolfScore { my @scr = @_; my $tot = 0; for my $s (@scr) { $tot += GolfScore($s) } print "You shot a round of $tot strokes.\n"; } sub BuildFile { my ($fname, $data) = @_; open(FF, '>'.$fname) or die "error: open '$fname'"; print FF $data; close(FF); } sub CheckOne { my ($scr, $label, $data, $exp) = @_; my $intmp = 'in.tmp'; BuildFile($intmp, $data); my $cmd = "perl $scr $intmp"; print "$label: running: '$cmd'..."; my $out = `$cmd`; my $rc = $? >> 8; print "done (rc=$rc).\n"; if ($out ne $exp) { warn "Expected:\n"; print STDERR $exp; warn "Got:\n"; print STDERR $out; die "Oops, you failed.\n"; } } # ----------------------------------------------------- my $file1 = <<'GROK'; 1st line GROK my $file2 = <<'GROK'; 1st line 2nd line GROK my $file3 = <<'GROK'; 1st line 2nd line 3rd line GROK my $file4 = <<'GROK'; 1st line 2nd line 3rd line 4th line GROK my $file12 = <<'GROK'; 1st line 2nd line 3rd line 4th line 5th line 6th line 7th line 8th line 9th line 10th line 11th line 12th line GROK my $file21 = <<'GROK'; 1st line 2nd line 3rd line 4th line 5th line 6th line 7th line 8th line 9th line 10th line 11th line 12th line GROK # ----------------------------------------------------- sub CheckHead { my ($scr) = @_; my @tt = ( [ 'file1', $file1, "1st line\n" ], [ 'file2', $file2, "1st line\n2nd line\n" ], [ 'file3', $file3, "1st line\n2nd line\n3rd line\n" ], [ 'file12', $file12, "1st line\n2nd line\n3rd line\n4th line\n5th line\n". "6th line\n7th line\n8th line\n9th line\n10th line\n" ], ); for my $r (@tt) { CheckOne($scr, $r->[0], $r->[1], $r->[2]) } } sub CheckTail { my ($scr) = @_; my @tt = ( [ 'file1', $file1, "1st line\n" ], [ 'file2', $file2, "1st line\n2nd line\n" ], [ 'file3', $file3, "1st line\n2nd line\n3rd line\n" ], [ 'file12', $file12, "3rd line\n4th line\n5th line\n6th line\n7th line\n". "8th line\n9th line\n10th line\n11th line\n12th line\n" ], [ 'file21', $file21, "12th line\n\n\n\n\n\n\n\n\n\n" ], ); for my $r (@tt) { CheckOne($scr, $r->[0], $r->[1], $r->[2]) } } sub CheckRev { my ($scr) = @_; my @tt = ( [ 'file1', $file1, "1st line\n" ], [ 'file2', $file2, "2nd line\n1st line\n" ], [ 'file3', $file3, "3rd line\n2nd line\n1st line\n" ], [ 'file21', $file21, "\n\n\n\n\n\n\n\n\n12th line\n11th line\n10th line\n". "9th line\n8th line\n7th line\n6th line\n5th line\n". "4th line\n3rd line\n2nd line\n1st line\n" ], ); for my $r (@tt) { CheckOne($scr, $r->[0], $r->[1], $r->[2]) } } sub CheckMid { my ($scr) = @_; my @tt = ( [ 'file1', $file1, "1st line\n" ], [ 'file2', $file2, "1st line\n2nd line\n" ], [ 'file3', $file3, "2nd line\n" ], [ 'file4', $file4, "2nd line\n3rd line\n" ], [ 'file12', $file12, "6th line\n7th line\n" ], [ 'file21', $file21, "11th line\n" ], ); for my $r (@tt) { CheckOne($scr, $r->[0], $r->[1], $r->[2]) } } sub CheckWc { my ($scr) = @_; my @tt = ( [ 'file1', $file1, "0000000001\n" ], [ 'file2', $file2, "0000000002\n" ], [ 'file3', $file3, "0000000003\n" ], [ 'file4', $file4, "0000000004\n" ], [ 'file12', $file12, "0000000012\n" ], [ 'file21', $file21, "0000000021\n" ], ); for my $r (@tt) { CheckOne($scr, $r->[0], $r->[1], $r->[2]) } } # ----------------------------------------------------- my $head = 'head.pl'; my $tail = 'tail.pl'; my $rev = 'rev.pl'; my $mid = 'mid.pl'; my $wc = 'wc.pl'; select(STDERR);$|=1;select(STDOUT);$|=1; # auto-flush -f $head or die "error: file '$head' not found.\n"; -f $tail or die "error: file '$tail' not found.\n"; -f $rev or die "error: file '$rev' not found.\n"; -f $mid or die "error: file '$mid' not found.\n"; -f $wc or die "error: file '$wc' not found.\n"; PrintGolfScore($head, $tail, $rev, $mid, $wc); CheckHead($head); CheckTail($tail); CheckRev($rev); CheckMid($mid); CheckWc($wc); PrintGolfScore($head, $tail, $rev, $mid, $wc); print "Hooray, you passed.\n"; -- From darkuncle at darkuncle.net Tue Dec 4 18:19:38 2001 From: darkuncle at darkuncle.net (Scott Francis) Date: Wed Aug 4 00:02:09 2004 Subject: LA.pm: LotR premiere update Message-ID: <20011204161938.H52728@darkuncle.net> Got the date wrong, it's the 19th, not the 13th. With that in mind, I just realized I am going home (missouri) on vacation and leaving the 19th!! I WON'T BE HERE FOR THE PREMIERE! AIEEEEE seriously considered pushing back my vacation ... half the fun of this movie is going to be seeing it with friends. however, if it's as good as expected, I'm sure most of us will see it several times ... *sigh* -- Scott Francis darkuncle@ [home:] d a r k u n c l e . n e t UNIX | IP networks | security | sysadmin | caffeine | BOFH | general geekery GPG public key 0xCB33CCA7 illum oportet crescere me autem minui -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 872 bytes Desc: not available Url : http://mail.pm.org/archives/losangeles-pm/attachments/20011204/18c2c8d6/attachment.bin From SKamkar at LucidX.com Tue Dec 4 19:02:05 2001 From: SKamkar at LucidX.com (Samy Kamkar) Date: Wed Aug 4 00:02:09 2004 Subject: LA.pm: January meeting (and LOTR) Message-ID: <3C0D720D.2050703@LucidX.com> Hi everyone...I'd like to schedule a meeting for January, either the 5th or the 12th. I'm thinking the latter would be better to not interfere with anyone's vacations. Also, we'll need a speaker(s) and a venue, is anyone interested in providing one or the other? :) Lord of the Rings -- is anyone still up for it? Scott will be out on the 19th (when are you coming back?) -- we can always just schedule it after he's back Any questions, comments? -- Samy Kamkar -- (877) 898-1424 -- cp5@LucidX.com LucidX.com / LA.pm.org / pdump.org / code.LucidX.com From ask at valueclick.com Tue Dec 4 19:07:19 2001 From: ask at valueclick.com (Ask Bjoern Hansen) Date: Wed Aug 4 00:02:09 2004 Subject: LA.pm: LotR premiere update In-Reply-To: <20011204161938.H52728@darkuncle.net> Message-ID: On Tue, 4 Dec 2001, Scott Francis wrote: > Got the date wrong, it's the 19th, not the 13th. > > With that in mind, I just realized I am going home (missouri) on vacation and > leaving the 19th!! I WON'T BE HERE FOR THE PREMIERE! AIEEEEE I'll be in Denmark by then (leaving the 14th). :) > however, if it's as good as expected, I'm sure most of us will see it several > times ... heh... you have different expectations than I. :) - ask -- ask bjoern hansen, http://ask.netcetera.dk/ !try; do(); more than a billion impressions per week, http://valueclick.com From darkuncle at darkuncle.net Wed Dec 5 01:25:49 2001 From: darkuncle at darkuncle.net (Scott Francis) Date: Wed Aug 4 00:02:09 2004 Subject: LA.pm: LotR premiere update In-Reply-To: References: <20011204161938.H52728@darkuncle.net> Message-ID: <20011204232549.B59170@darkuncle.net> On Tue, Dec 04, 2001 at 05:07:19PM -0800, ask@valueclick.com said: > I'll be in Denmark by then (leaving the 14th). :) going home? how cool! I hope you're coming back eventually ... > > however, if it's as good as expected, I'm sure most of us will see it > > several times ... > > heh... you have different expectations than I. :) what?! you don't think LotR will be an outstanding series of movies? heresy ... we'll see what you have to say after you've seen it. :) > - ask -- Scott Francis darkuncle@ [home:] d a r k u n c l e . n e t UNIX | IP networks | security | sysadmin | caffeine | BOFH | general geekery GPG public key 0xCB33CCA7 illum oportet crescere me autem minui -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 872 bytes Desc: not available Url : http://mail.pm.org/archives/losangeles-pm/attachments/20011204/97e70b27/attachment.bin From darkuncle at darkuncle.net Wed Dec 5 01:30:42 2001 From: darkuncle at darkuncle.net (Scott Francis) Date: Wed Aug 4 00:02:09 2004 Subject: LA.pm: January meeting (and LOTR) In-Reply-To: <3C0D720D.2050703@LucidX.com> References: <3C0D720D.2050703@LucidX.com> Message-ID: <20011204233042.C59170@darkuncle.net> On Tue, Dec 04, 2001 at 05:02:05PM -0800, SKamkar@LucidX.com said: > Hi everyone...I'd like to schedule a meeting for January, either the 5th > or the 12th. I'm thinking the latter would be better to not interfere > with anyone's vacations. > > Also, we'll need a speaker(s) and a venue, is anyone interested in > providing one or the other? :) > > Lord of the Rings -- is anyone still up for it? > Scott will be out on the 19th (when are you coming back?) -- we can > always just schedule it after he's back be back the 27th IIRC ... > Any questions, comments? -- Scott Francis darkuncle@ [home:] d a r k u n c l e . n e t UNIX | IP networks | security | sysadmin | caffeine | BOFH | general geekery GPG public key 0xCB33CCA7 illum oportet crescere me autem minui -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 872 bytes Desc: not available Url : http://mail.pm.org/archives/losangeles-pm/attachments/20011204/42006208/attachment.bin From ronnetron at hotmail.com Wed Dec 5 03:30:19 2001 From: ronnetron at hotmail.com (Ron Smith) Date: Wed Aug 4 00:02:09 2004 Subject: LA.pm: LotR premiere update Message-ID: Now... Now... Now...; Let's get together before everyone takes off. R. >From: Scott Francis >To: Ask Bjoern Hansen >CC: list@la.pm.org >Subject: Re: LA.pm: LotR premiere update >Date: Tue, 4 Dec 2001 23:25:49 -0800 > >On Tue, Dec 04, 2001 at 05:07:19PM -0800, ask@valueclick.com said: > > I'll be in Denmark by then (leaving the 14th). :) > >going home? how cool! I hope you're coming back eventually ... > > > > however, if it's as good as expected, I'm sure most of us will see it > > > several times ... > > > > heh... you have different expectations than I. :) > >what?! you don't think LotR will be an outstanding series of movies? heresy >... we'll see what you have to say after you've seen it. :) > > > - ask > >-- >Scott Francis darkuncle@ [home:] d a r k u n c l e . n e >t >UNIX | IP networks | security | sysadmin | caffeine | BOFH | general >geekery >GPG public key 0xCB33CCA7 illum oportet crescere me autem >minui ><< attach3 >> _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp From darkuncle at darkuncle.net Thu Dec 13 22:19:24 2001 From: darkuncle at darkuncle.net (Scott Francis) Date: Wed Aug 4 00:02:09 2004 Subject: LA.pm: LotR early showing! Message-ID: <20011213201924.G98435@darkuncle.net> The Vista theater in Hollywood on Sunset Blvd. is showing Fellowship of the Ring at 12:01 AM on Wednesday. As I have to be at LAX at 3 p.m. that same day, this is the show I'm going to catch so I can see it opening day. :) Is anybody else interested in seeing the very first show in Los Angeles? :) I'm sure there are a few other theaters with midnight showings, but this was the only one I found within about 15 miles of 91601 (North Hollywood/Studio City area). I'm going regardless, but it would be lots of fun to take a big group to a midnight show ... -- Scott Francis darkuncle@ [home:] d a r k u n c l e . n e t UNIX | IP networks | security | sysadmin | caffeine | BOFH | general geekery GPG public key 0xCB33CCA7 illum oportet crescere me autem minui -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 872 bytes Desc: not available Url : http://mail.pm.org/archives/losangeles-pm/attachments/20011213/20c73d9c/attachment.bin From rspier at pobox.com Fri Dec 14 01:44:54 2001 From: rspier at pobox.com (Robert Spier) Date: Wed Aug 4 00:02:09 2004 Subject: LA.pm: LotR early showing! In-Reply-To: <20011213201924.G98435@darkuncle.net> References: <20011213201924.G98435@darkuncle.net> Message-ID: <1008315895.5382.0.camel@bear> Burbank has a midnight showing too, and that should be within 15 miles. But - go where it's most convenient. I don't think a midnight showing is for me, I want to enjoy the film - not fade in and out :) http://movies.yahoo.com/showtimes/showtimes.html?z=91501&r=sim&m=&t=AMC%20Burbank%2014&a=&dt=5&s=tm&p=0 On Thu, 2001-12-13 at 20:19, Scott Francis wrote: > The Vista theater in Hollywood on Sunset Blvd. is showing Fellowship of the > Ring at 12:01 AM on Wednesday. As I have to be at LAX at 3 p.m. that same > day, this is the show I'm going to catch so I can see it opening day. :) > > Is anybody else interested in seeing the very first show in Los Angeles? :) > I'm sure there are a few other theaters with midnight showings, but this was > the only one I found within about 15 miles of 91601 (North Hollywood/Studio > City area). I'm going regardless, but it would be lots of fun to take a big > group to a midnight show ... > -- > Scott Francis darkuncle@ [home:] d a r k u n c l e . n e t > UNIX | IP networks | security | sysadmin | caffeine | BOFH | general geekery > GPG public key 0xCB33CCA7 illum oportet crescere me autem minui From rspier at pobox.com Fri Dec 14 15:24:47 2001 From: rspier at pobox.com (Robert Spier) Date: Wed Aug 4 00:02:09 2004 Subject: LA.pm: fwd: [gnat@oreilly.com: The Perl Foundation wants *you*] Message-ID: <15386.28191.438759.346192@rls.cx> This is a very worthwhile cause. perl-foundation is going to become the umbrella group for YAS and Perl Mongers. But anyway, visit the websites and learn more :) -R ----- Forwarded message from Nathan Torkington ----- Date: Thu, 13 Dec 2001 13:25:27 -0700 From: Nathan Torkington To: advocacy@perl.org Subject: The Perl Foundation wants *you* We (the YAS board and advisors) decided at TPC this year that corporate America needed a more respectable name to give money to. "Yet Another Society" just didn't make managers comfortable. So YAS has started The Perl Foundation, which (among other things) will collect and distribute money for the development grants that Damian Conway benefitted from last year. http://www.perl-foundation.org/ This also marks the start of the fundraising work for the 2002 grants. Yes, plural. We're expanding our horizons for 2002. We're going to fund Damian again (he's proven addictive :-) but we're also going to fund Dan Sugalski. Dan's the architect behind the Parrot runtime engine for perl6 (side-note: we have scalar support now! www.parrotcode.org) and a year of Dan's time will help Parrot kick 365 times more ass than it currently does. As a member of the Perl community, please do consider contributing. You can give as much as is comfortable. I know how tight money is in these hideous economic times, but I strongly urge you to make some room for Perl. Whether it's $10, $100, or more, every bit counts. If you work for a company that relies heavily on Perl, please talk to your managers about arranging a donation to the Perl development grant. They are tax deductible, and there's no lower (or upper!) limit on donations. Last year's grant featured a heart-warming number of individual contributors, but despite the amazing turnout and generosity, half of the final amount for Damian came from one UK company, Blackstar. It's no secret that we need turnout from both individuals and businesses, and we can't meet our 2002 goals without increasing the amount of support we get from companies. If you work for a company, you can help us get that support. So here's a challenge for you: I just donated $100, bringing the total up to $2,480. If it passes $5,000 by Friday night, I'll give another $100. There are hundreds of people on this list--if only half of you give $100, that'd put us well over the mark. If it passes $10,000 by Friday night, I'll donate the $100 *and* squeal like a little kid at Christmas :-) Enough with the public radio pledge-drive impersonation. I've enclosed the press release below. Have a nice day. Thanks, Nat HOLLAND, Michigan, December 11, 2001. /Perl-Foundation.org/ -- Yet Another Society, a non-profit, 501(c)(3) corporation for the advancement of collaborative efforts in computer and information sciences, today announced the formation of the Perl Foundation as an internal unit dedicated to the Perl programming language. The Foundation will consolidates responsibility and authority for the Perl Mongers users groups organization, perlmonks.org, perl.org, the Perl Development Grants, the international Yet Another Perl Conferences, and copyright issues regarding Parrot and Perl 6. The Perl Foundation is opening with a campaign to raise US$175,000 for two 2002 Perl Development Grants, to be awarded to Dan Sugalski and Dr. Damian Conway for the ongoing work in Perl, including development of Perl 6. The grants will each be a total of US$80,000: US$60,000 stipend, with US$20,000 for travel. US$15,000 is assigned for administrative overhead. The first Perl Development Grant was awarded to Dr. Conway by the Yet Another Society in 2001, when a individuals and corporate sponsors made it possible. Individual and small companies accounted for nearly half the US$75,000 award. The list of contributors, as well as the work produced under the grant, are at http://yetanother.org/damian .. BlackStar, Morgan Stanley, VA Linux, Manning Publications, O'Reilly and Associates, and Stonehenge Consulting also made major contributions. For more information on The Perl Foundation, Perl Development Grants, please visit http://perl-foundation.org. To find out more about the Yet Another Society, http://yetanother.org. ----- End forwarded message ----- From ask at valueclick.com Fri Dec 14 17:20:55 2001 From: ask at valueclick.com (Ask Bjoern Hansen) Date: Wed Aug 4 00:02:10 2004 Subject: LA.pm: fwd: [gnat@oreilly.com: The Perl Foundation wants *you*] In-Reply-To: <15386.28191.438759.346192@rls.cx> Message-ID: On Fri, 14 Dec 2001, Robert Spier wrote: > This is a very worthwhile cause. perl-foundation is going to become > the umbrella group for YAS and Perl Mongers. But anyway, visit the > websites and learn more :) Yup! I actually made a check for them yesterday. :) Remember it's tax deductible and all. (Not that I've lived here long enough to quite figure out how much and what and how and stuff, but that's what the accountant[1] is for I guess). - ask [1] I figured the tax rules in Denmark fairly well the trial and error way[2]; I'm trying to not go through that again here. ;-) [2] okay, it wasn't *that* bad, but I can really easily think of more fun things to deal with. -- ask bjoern hansen, http://ask.netcetera.dk/ !try; do(); From asudarikov at xceed.com Tue Dec 18 15:56:47 2001 From: asudarikov at xceed.com (Arkadiy Sudarikov) Date: Wed Aug 4 00:02:10 2004 Subject: LA.pm: Shell Message-ID: Hello, everybody. I need some help with Shell (Bourne shell). I need to combine output of a HERE document and output of a Perl script to be input to a command .. without creating a file... Basically, I would like to have a HERE document for an email header and Perl script creates the body of the email and all of this, together, is sent to sendmail or whatever... How can I do this? Right now I am using a file: FILE=file EMAIL_FILE=email_file cat - > $EMAIL_FILE << EMAIL From: XXX To: $EMAIL Subject: xxx EMAIL ./encode_base64.pl $FILE | cat - >> $EMAIL_FILE cat $EMAIL_FILE | sendmail -oi -t From SKamkar at LucidX.com Thu Dec 20 17:40:57 2001 From: SKamkar at LucidX.com (Samy Kamkar) Date: Wed Aug 4 00:02:10 2004 Subject: LA.pm: next meeting && movies Message-ID: <3C227709.2050602@LucidX.com> I'd like to get a meeting going again for either January or February and maybe we can try for a movie again (Royal Tennenbaums looks good :) Is anyone interested in speaking -- or are there any new and interesting topics anyone cares to learn about? Also, any recommendations for a venue or is anyone able to host the next meeting? (it would also be helpful to have a projector) -- Samy Kamkar -- (877) 898-1424 -- cp5@LucidX.com LucidX.com / LA.pm.org / pdump.org / code.LucidX.com