From daniel at coder.com Wed Jul 13 11:42:25 2005 From: daniel at coder.com (Daniel R. Allen) Date: Wed, 13 Jul 2005 14:42:25 -0400 (EDT) Subject: [kw-pm] revised plans for July meeting Message-ID: Lloyd has had to cancel the BBQ at his place. Plan B is that we do the pub/social in July, the following week (Thursday the 28th). If that date is worse for you than the 21st, let me know... Proposed location: The Plantation in uptown w'loo; IIRC we had a fairly good time there the last time, and it's better suited for a roundtable discussion than Huethers or a louder pub. Currently, we're hoping to do a BBQ for August, location TBA (we have a couple possibilities). -Daniel From daniel at coder.com Wed Jul 13 11:50:10 2005 From: daniel at coder.com (Daniel R. Allen) Date: Wed, 13 Jul 2005 14:50:10 -0400 (EDT) Subject: [kw-pm] revised plans for July meeting In-Reply-To: Message-ID: Of course, that shoud be "Symposium Cafe," they changed their name a while ago. -D On Wed, 13 Jul 2005, Daniel R. Allen wrote: > Lloyd has had to cancel the BBQ at his place. > > Plan B is that we do the pub/social in July, the following week (Thursday > the 28th). If that date is worse for you than the 21st, let me know... > > Proposed location: The Plantation in uptown w'loo; IIRC we had a fairly > good time there the last time, and it's better suited for a roundtable > discussion than Huethers or a louder pub. From daniel at coder.com Thu Jul 21 07:59:43 2005 From: daniel at coder.com (Daniel R. Allen) Date: Thu, 21 Jul 2005 10:59:43 -0400 (EDT) Subject: [kw-pm] Reminder: no meeting tonight Message-ID: Just a reminder, we're not meeting tonight, we're meeting for food and beers at Symposium Cafe in uptown Waterloo, next Thursday evening at 7ish. -Daniel From igorhamer at yahoo.com Fri Jul 22 12:42:14 2005 From: igorhamer at yahoo.com (Igor Hamer) Date: Fri, 22 Jul 2005 12:42:14 -0700 (PDT) Subject: [kw-pm] Part-time consulting job for Perl web development guru Message-ID: <20050722194214.73894.qmail@web32208.mail.mud.yahoo.com> Here at Contractor.com we have a need for a Perl consultant with lots of web development experience to help us launch and maintain a new website and various other web applications. Contractor.com/contractors.com is North America's largest building contractor directory with 1.1 million listings and 30,000 member companies. We are rapidly growing and are in need for some talented developers to help our IT infrastructure keep up with the growth of the company. This could be a telecommuting job but we will require the successful candidate to be on site once a week (weekend or evening OK). We are located at College and Yonge area in downtown Toronto. Our servers are running Red Hat Linux, MySQL InnoDB and Apache. Our apps are written in OO Perl using framework called Querry (to be available on CPAN in October). If interested send a summary of your qualifications or resume to igor at contractor.com Igor __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From eric at uc.org Tue Jul 26 08:02:12 2005 From: eric at uc.org (Eric - fishbot) Date: Tue, 26 Jul 2005 11:02:12 -0400 (EDT) Subject: [kw-pm] Free (as in beer) Advanced Perl Message-ID: For various reasons, I have ended up with three copies of Advanced Perl (from O'Reilly). These copies are in addition to the copy that is going into the kwpm library. Soo... quick contest, the winner gets a free copy. (You have to attend the /pub/social on Thursday (the 28th) to collect the prize. Feel free to send me a solution if you just like solving things, though.) I won one of the copies in a contest on Perlcast.com. The challenge was to come up with the most number of ways to Title Case all the words in a string, forcing all the rest to lowercase. One of my more obscure solutions was as follows: =code sub ucfirst_fsm { my @chars = unpack 'C*', shift; my $bound = 1; # initial boundary for ( @chars ) { $bound = 1, next if (( $_ == 0x20 ) || ( $_ == 0x09 )); if ( $bound ) { $_ &= 0xDF if (( $_ >= 0x61 ) && ( $_ <= 0x7A )); $bound = 0; next; } $_ |= 0x20 if (( $_ >= 0x41 ) && ( $_ <= 0x5A )); } return pack( 'C*', @chars ); } =cut As required, this translates "a stRing TO fOrMaT" to "A String To Format". However, this approach quickly breaks. The first person who sends me a testcase where this code fails, wins a copy of Advanced Perl, 2nd Edition. Incidentally, the book is pretty good. Looking forward to see everyone on Thursday, Eric From matt at sergeant.org Tue Jul 26 12:43:09 2005 From: matt at sergeant.org (Matt Sergeant) Date: Tue, 26 Jul 2005 15:43:09 -0400 Subject: [kw-pm] [CHALLENGE] Fastest timers Message-ID: <40120590e8e96159a1cc90bea3d68fcc@sergeant.org> I've been working on some code to add timers to Danga::Socket. The basic premise is you add a timer with a subroutine of this signature: AddTimer( $timeout_in_seconds, $coderef ); And then at some point in time we need to run all the timers that have "expired". It would be nice to be just as fast whether you're using a few timers, or thousands. Here's the current code, using a global array @Timers: sub AddTimer { my $class = shift; my ($secs, $coderef) = @_; my $timeout = time + $secs; # optimise tail insertion if (!@Timers || ($timeout >= $Timers[-1][0])) { push @Timers, [$timeout, $coderef]; return; } # Now where do we insert... for (my $i = 0; $i < @Timers; $i++) { if ($Timers[$i][0] > $timeout) { splice(@Timers, $i, 0, [$timeout, $coderef]); return; } } die "Shouldn't get here."; } And the code to run the timers is simple: my $now = time; # Run expired timers while (@Timers && $Timers[0][0] <= $now) { my $to_run = shift(@Timers); $to_run->[1]->($now); } It has been suggested that a binary search might be faster to do the inserts, which also leaves the code to run the timers nice and quick, but the challenge is to create a simple binary search without using recursion. Can you make it faster? Use Benchmark.pm to prove your methods. Remember though that the running of the expired timers needs to be fast too, so a hash insert of new timers followed by a linear scan to run the timers isn't going to cut it. Entries should be posted to the list for discussion. The winning entry gets either a copy of Advanced Perl Programming, or if the last one of those is already gone you can have any (used) book from my bookshelves (I'll post a photo of the bookshelves somewhere so you can pick). Matt. From matt at sergeant.org Tue Jul 26 14:18:36 2005 From: matt at sergeant.org (Matt Sergeant) Date: Tue, 26 Jul 2005 17:18:36 -0400 Subject: [kw-pm] [CHALLENGE] Fastest timers In-Reply-To: <40120590e8e96159a1cc90bea3d68fcc@sergeant.org> References: <40120590e8e96159a1cc90bea3d68fcc@sergeant.org> Message-ID: <1885fe6b7ddde138afb2f6bbe21a85b3@sergeant.org> OK, so I have a benchmark script here which will get people started. You'll need Heap::Simple, Heap::Simple::Perl and Heap::Simple::XS to get you started. This implements my original algorithm, mine plus a binary search to find the insert point, and a few other (slower) algorithms for you to play with. -------------- next part -------------- A non-text attachment was scrubbed... Name: timerbench.pl Type: application/text Size: 10558 bytes Desc: not available Url : http://mail.pm.org/pipermail/kw-pm/attachments/20050726/37c51375/timerbench.bin From daniel at coder.com Thu Jul 28 10:06:40 2005 From: daniel at coder.com (Daniel R. Allen) Date: Thu, 28 Jul 2005 13:06:40 -0400 (EDT) Subject: [kw-pm] tonight's beer meeting Message-ID: We're meeting at the Symposium Cafe in Uptown Waterloo. 7pm or thereabouts. Come for drinks or food (they have a long desert list). Location: http://tinyurl.com/dateq There is free parking in the lot on Regina Street (at the railroad tracks). Hope to see you there, Daniel From eric at uc.org Fri Jul 29 19:20:53 2005 From: eric at uc.org (Eric - fishbot) Date: Fri, 29 Jul 2005 22:20:53 -0400 (EDT) Subject: [kw-pm] Results - Free Adv. Perl Contest Message-ID: Congratulations to Elbie, for winning the copy of Advanced Perl Programming, Second Edition by Simon Cozens. Thanks to O'Reilly for mailing me an extra copy for no discernable reason. Elbie correctly stated that this solution fails for all input that is not 7-bit clean ASCII. Accented characters fail (not true for the perl capitalisation built-ins) and multi-byte characters fail very badly. Daniel pointed out the other error triggering conditions: the code mishandles alphabetics following punctuation and newlines. Daniel doesn't get a book, because he already has one. I'll buy him a beer instead. If anyone can find any other distinct bugs in the code, I will buy them two beers, since those are the only two I can think of. Great to see everyone last night. Have a great long weekend. fishbot :wq