From roberthpike at yahoo.com Wed Jun 10 10:29:42 2009 From: roberthpike at yahoo.com (Robert Pike) Date: Wed, 10 Jun 2009 10:29:42 -0700 (PDT) Subject: [kw-pm] Environment Variables Message-ID: <503905.53993.qm@web58701.mail.re1.yahoo.com> Simple question to answer for you I'm sure. How can I set up an environment variable on Windows 2003 so I can access it through the $ENV variable? Thanks. __________________________________________________________________ Make your browsing faster, safer, and easier with the new Internet Explorer? 8. Optimized for Yahoo! Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/ From john at perlwolf.com Wed Jun 10 13:54:28 2009 From: john at perlwolf.com (John Macdonald) Date: Wed, 10 Jun 2009 16:54:28 -0400 Subject: [kw-pm] Environment Variables In-Reply-To: <503905.53993.qm@web58701.mail.re1.yahoo.com> References: <503905.53993.qm@web58701.mail.re1.yahoo.com> Message-ID: <20090610205428.GB18104@perlwolf.com> On Wed, Jun 10, 2009 at 10:29:42AM -0700, Robert Pike wrote: > > Simple question to answer for you I'm sure. How can I set up an environment variable on Windows 2003 so I can access it through the $ENV variable? Thanks. If you're using cygwin, I believe it works just the same as on a Unix/Linux system: VAR=value program for setting VAR just for a single run; or: export VAR=value ... perl program ... perl program to set VAR for a series of runs. I'm sure it will also have a profile file in which you can place such settings so that they get re-created every time you start up your computer. There's probably some interaction you can do with the registry to do the same withuot using cygwin, but I've managed to avoid having to do serious work on a toy OS so I've never had to learn its oddities. (I've got enough oddities of my own to worry about already. :-) From roberthpike at yahoo.com Fri Jun 12 07:59:19 2009 From: roberthpike at yahoo.com (Robert Pike) Date: Fri, 12 Jun 2009 07:59:19 -0700 (PDT) Subject: [kw-pm] XML Parsing Message-ID: <573664.69942.qm@web58705.mail.re1.yahoo.com> Hi All, The small bit of script I have in place is used to merely go through an XML document and grab some information from it. One problem I'm having is determining if a tag had a particular atribute or not and what that attribute is set to. Currently I'm using XML::Simple. What do I need to be able to accomplish this? Without the need to install any additional modules would be preferable. Thanks again. Rob __________________________________________________________________ Get a sneak peak at messages with a handy reading pane with All new Yahoo! Mail: http://ca.promos.yahoo.com/newmail/overview2/ From daniel at coder.com Fri Jun 12 15:29:48 2009 From: daniel at coder.com (Daniel R. Allen) Date: Fri, 12 Jun 2009 18:29:48 -0400 (EDT) Subject: [kw-pm] June's Meeting: one day early (Wednesday the 17th) Message-ID: Embedded Systems and Microcontrollers and ... Perl? (maybe) We've got a presenter (Andrew); but Thursday isn't a good night for him. So we'll do this month's meeting a day early, Wedensday the 17th. Our presenter is experienced with a broad range of topics on microcontroller hardware, and we're trying to pin him down (so to speak). So come and don't be board; $anonymous will chip in for pizza. Hope IC you. And ?, and ? and ? too. -Daniel From daniel at coder.com Wed Jun 17 07:46:23 2009 From: daniel at coder.com (Daniel R. Allen) Date: Wed, 17 Jun 2009 10:46:23 -0400 (EDT) Subject: [kw-pm] Tonight's Meeting NOT about microcontrollers In-Reply-To: Message-ID: Sadly, Andrew can't present tonight, but he promises to have a presentation for us next month in the same time slot (Wednesday the 15th). Meaning if you were coming for the microcontroller stuff, he (and I, too) are sorry to disappoint. However, some folks are still meeting, in the usual place, at the usual hour. It will be a social event, with some as-of-yet undetermined programming content. 7pm in DC3323, University of Waterloo. http://kw.pm.org has the details. Pizza is on offer; before 5pm please add your name to http://kw.pm.org/wiki/index.cgi?PizzaList Note that the wiki's got an anti-spam feature now, you need to log in with any name you like, in order to see the edit button. Hope to see you tonight, -Daniel From abez at abez.ca Thu Jun 18 09:35:10 2009 From: abez at abez.ca (Abram Hindle) Date: Thu, 18 Jun 2009 12:35:10 -0400 Subject: [kw-pm] Last Wednesday's meeting Message-ID: <4A3A6CBE.5070405@abez.ca> On the topic of twitter I discussed tircd a tiny bit: http://github.com/abramhindle/tircd-plus-search/tree/master http://code.google.com/p/tircd/ We did a golf challenge from: http://kw.pm.org/wiki/index.cgi?GolfChallenge * Choose 1 uniformly randomly Write a perl script to select 1 element from a stream of unknown length uniformly randomly. The algorithm usually is read an element in, choose a number between 0 and 1, if it is less than 1/n then keep that new element, otherwise keep your old one. So first element is 1/1 to keep, second element is 1/2 to keep, third element is 1/3 to keep. Via induction you can work it out that this algorithm is uniformly random. ^^ I "proved" this on the board via hand waving. Here's my awk/bash version (bash seeds awk because gawk is bad at seeding itself) #!/bin/bash awk "BEGIN {srand($RANDOM + $RANDOM)} {c = (rand() < (1.0 / FNR))?\$0:c} END { print c }" $* Daniel wrote a tiny perl version (37 chars?) and max wrote a relatively small (87 chars?) python version. If Daniel or Max could share their code with the list that'd be great. abram -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 260 bytes Desc: OpenPGP digital signature URL: From max at alleged.net Thu Jun 18 09:41:01 2009 From: max at alleged.net (Max) Date: Thu, 18 Jun 2009 12:41:01 -0400 Subject: [kw-pm] Last Wednesday's meeting In-Reply-To: <4A3A6CBE.5070405@abez.ca> References: <4A3A6CBE.5070405@abez.ca> Message-ID: <4A3A6E1D.3000204@alleged.net> The reasonably minimalistic python version (87 bytes), with input in a file named 'x': import random as r n,s=0,'' for l in open('x'): n+=1 if r.random()<1.0/n:s=l print s Abram Hindle wrote: > On the topic of twitter I discussed tircd a tiny bit: > > http://github.com/abramhindle/tircd-plus-search/tree/master > http://code.google.com/p/tircd/ > > We did a golf challenge from: > http://kw.pm.org/wiki/index.cgi?GolfChallenge > > * Choose 1 uniformly randomly > > Write a perl script to select 1 element from a stream of unknown length > uniformly randomly. The algorithm usually is read an element in, choose > a number between 0 and 1, if it is less than 1/n then keep that new > element, otherwise keep your old one. So first element is 1/1 to keep, > second element is 1/2 to keep, third element is 1/3 to keep. Via > induction you can work it out that this algorithm is uniformly random. > > ^^ I "proved" this on the board via hand waving. > > > Here's my awk/bash version (bash seeds awk because gawk is bad at > seeding itself) > #!/bin/bash > awk "BEGIN {srand($RANDOM + $RANDOM)} {c = (rand() < (1.0 / FNR))?\$0:c} > END { print c }" $* > > Daniel wrote a tiny perl version (37 chars?) and max wrote a relatively > small (87 chars?) python version. > > If Daniel or Max could share their code with the list that'd be great. > > abram > > > ------------------------------------------------------------------------ > > _______________________________________________ > kw-pm mailing list > kw-pm at pm.org > http://mail.pm.org/mailman/listinfo/kw-pm From max at alleged.net Thu Jun 18 09:45:13 2009 From: max at alleged.net (Max) Date: Thu, 18 Jun 2009 12:45:13 -0400 Subject: [kw-pm] Last Wednesday's meeting In-Reply-To: <4A3A6E1D.3000204@alleged.net> References: <4A3A6CBE.5070405@abez.ca> <4A3A6E1D.3000204@alleged.net> Message-ID: <4A3A6F19.2030306@alleged.net> My indentation apparently got et; let's try again. import random as r n,s=0,'' for l in open('x'): n+=1 if r.random()<1.0/n:s=l print s Max wrote: > The reasonably minimalistic python version (87 bytes), with input in a > file named 'x': > import random as r > n,s=0,'' > for l in open('x'): > n+=1 > if r.random()<1.0/n:s=l > print s > From daniel at coder.com Thu Jun 18 09:52:06 2009 From: daniel at coder.com (Daniel R. Allen) Date: Thu, 18 Jun 2009 12:52:06 -0400 (EDT) Subject: [kw-pm] Last night's meeting In-Reply-To: <4A3A6CBE.5070405@abez.ca> Message-ID: $ cat alpha.html |perl -n -e'$s=$_ if(rand()<1/++$n);END{print $s}' Which, obviously, has an improvement, I don't know why I left that extra whitespace in there. For 35: $ cat alpha.html |perl -n -e'$s=$_ if(rand()<1/++$n);END{print$s}' Thanks Abram for the excellent challenge. There are nine other challenges on GolfChallenge in case we feel like doing this again. -Daniel On Thu, 18 Jun 2009, Abram Hindle wrote: > On the topic of twitter I discussed tircd a tiny bit: > > http://github.com/abramhindle/tircd-plus-search/tree/master > http://code.google.com/p/tircd/ > > We did a golf challenge from: > http://kw.pm.org/wiki/index.cgi?GolfChallenge > > * Choose 1 uniformly randomly > > Write a perl script to select 1 element from a stream of unknown length > uniformly randomly. The algorithm usually is read an element in, choose > a number between 0 and 1, if it is less than 1/n then keep that new > element, otherwise keep your old one. So first element is 1/1 to keep, > second element is 1/2 to keep, third element is 1/3 to keep. Via > induction you can work it out that this algorithm is uniformly random. > > ^^ I "proved" this on the board via hand waving. > > > Here's my awk/bash version (bash seeds awk because gawk is bad at > seeding itself) > #!/bin/bash > awk "BEGIN {srand($RANDOM + $RANDOM)} {c = (rand() < (1.0 / FNR))?\$0:c} > END { print c }" $* > > Daniel wrote a tiny perl version (37 chars?) and max wrote a relatively > small (87 chars?) python version. > > If Daniel or Max could share their code with the list that'd be great. > > abram > > From john at perlwolf.com Thu Jun 18 14:32:10 2009 From: john at perlwolf.com (John Macdonald) Date: Thu, 18 Jun 2009 17:32:10 -0400 Subject: [kw-pm] Last night's meeting In-Reply-To: References: <4A3A6CBE.5070405@abez.ca> Message-ID: <20090618213210.GA15266@perlwolf.com> The if statement modifier does not require parens around the condition, which saves one more char (only the close paren is saved, the open paren needs to be turned into a blank to separate "if" and "rand"): $ cat alpha.html |perl -n -e'$s=$_ if rand()<1/++$n;END{print$s}' Another shuffle save four more chars, by turning " if " into "?:1", removing the divide, and removing resultant unneeded blanks: $ cat alpha.html |perl -n -e'rand++$n<1?$s=$_:1;END{print$s}' So, it's down to 31 chars. An somewhat irrelevantly, the uncounted chars in front of the perl code can be reduced too, first with removal of extraneous blanks: $ cat alpha.html|perl -ne'rand++$n<1?$s=$_:1;END{print$s}' and even more with removal of the extraneous command: $ perl -ne'rand++$n<1?$s=$_:1;END{print$s}' $ cat alpha.html |perl -n -e'$s=$_ if(rand()<1/++$n);END{print $s}' > > Which, obviously, has an improvement, I don't know why I left that extra > whitespace in there. For 35: > > $ cat alpha.html |perl -n -e'$s=$_ if(rand()<1/++$n);END{print$s}' > > > Thanks Abram for the excellent challenge. There are nine other challenges > on GolfChallenge in case we feel like doing this again. > > -Daniel > > On Thu, 18 Jun 2009, Abram Hindle wrote: > > > On the topic of twitter I discussed tircd a tiny bit: > > > > http://github.com/abramhindle/tircd-plus-search/tree/master > > http://code.google.com/p/tircd/ > > > > We did a golf challenge from: > > http://kw.pm.org/wiki/index.cgi?GolfChallenge > > > > * Choose 1 uniformly randomly > > > > Write a perl script to select 1 element from a stream of unknown length > > uniformly randomly. The algorithm usually is read an element in, choose > > a number between 0 and 1, if it is less than 1/n then keep that new > > element, otherwise keep your old one. So first element is 1/1 to keep, > > second element is 1/2 to keep, third element is 1/3 to keep. Via > > induction you can work it out that this algorithm is uniformly random. > > > > ^^ I "proved" this on the board via hand waving. > > > > > > Here's my awk/bash version (bash seeds awk because gawk is bad at > > seeding itself) > > #!/bin/bash > > awk "BEGIN {srand($RANDOM + $RANDOM)} {c = (rand() < (1.0 / FNR))?\$0:c} > > END { print c }" $* > > > > Daniel wrote a tiny perl version (37 chars?) and max wrote a relatively > > small (87 chars?) python version. > > > > If Daniel or Max could share their code with the list that'd be great. > > > > abram > > > > > > _______________________________________________ > kw-pm mailing list > kw-pm at pm.org > http://mail.pm.org/mailman/listinfo/kw-pm From broadswd at gmail.com Fri Jun 19 05:50:58 2009 From: broadswd at gmail.com (Raymond) Date: Fri, 19 Jun 2009 08:50:58 -0400 Subject: [kw-pm] Last night's meeting In-Reply-To: <20090618213210.GA15266@perlwolf.com> References: <4A3A6CBE.5070405@abez.ca> <20090618213210.GA15266@perlwolf.com> Message-ID: (Replying to all this time, oops) >From the above: $ perl -ne'rand++$n<1?$s=$_:1;END{print$s}' (sfid-20090619_085617_898403_E3A69879) References: <4A3A6CBE.5070405@abez.ca> <20090618213210.GA15266@perlwolf.com> (sfid-20090619_085617_898403_E3A69879) Message-ID: <4A3BA0B8.1020708@abez.ca> So AWK's FNR is equal to perl's $. That's neat, thanks for that :) abram Raymond wrote: > (Replying to all this time, oops) > >>From the above: > > $ perl -ne'rand++$n<1?$s=$_:1;END{print$s}' > No need to increment a counter like $n, just use $. which gives the > line number 1 indexed. > > $ perl -ne'rand$.<1?$a=$_:1;END{print$a}' > Also replaced $s with $a so it runs safe under 'warnings'. ;) Two more > characters saved. > _______________________________________________ > kw-pm mailing list > kw-pm at pm.org > http://mail.pm.org/mailman/listinfo/kw-pm -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 260 bytes Desc: OpenPGP digital signature URL: From da at coder.com Fri Jun 19 07:55:25 2009 From: da at coder.com (Daniel R. Allen) Date: Fri, 19 Jun 2009 10:55:25 -0400 (EDT) Subject: [kw-pm] Last night's meeting In-Reply-To: Message-ID: ...We had considered the ?:1 operator, on the board, but didn't see where it got us. Clearly we didn't stare at it long enough. But turning rand()<1/++$n into rand++$n<1 into rand$.<1 is sheer genius on both of your parts. Nicely done, John and Raymond. 29 strokes == winner? -Daniel On Fri, 19 Jun 2009, Raymond wrote: > >From the above: > > $ perl -ne'rand++$n<1?$s=$_:1;END{print$s}' > No need to increment a counter like $n, just use $. which gives the > line number 1 indexed. > > $ perl -ne'rand$.<1?$a=$_:1;END{print$a}' > Also replaced $s with $a so it runs safe under 'warnings'. ;) Two more > characters saved. From john at perlwolf.com Fri Jun 19 07:56:48 2009 From: john at perlwolf.com (John Macdonald) Date: Fri, 19 Jun 2009 10:56:48 -0400 Subject: [kw-pm] Last night's meeting In-Reply-To: References: <4A3A6CBE.5070405@abez.ca> <20090618213210.GA15266@perlwolf.com> Message-ID: <20090619145648.GB15266@perlwolf.com> On Fri, Jun 19, 2009 at 08:50:58AM -0400, Raymond wrote: > (Replying to all this time, oops) > > >From the above: > > $ perl -ne'rand++$n<1?$s=$_:1;END{print$s}' > No need to increment a counter like $n, just use $. which gives the > line number 1 indexed. > > $ perl -ne'rand$.<1?$a=$_:1;END{print$a}' > Also replaced $s with $a so it runs safe under 'warnings'. ;) Two more > characters saved. Neat. And yet, 4 more chars can still be removed: $ perl -ne'rand$.<1?$a=$_:1}{print$a' ) { # -e arg goes here } The }{ in my new -e makes that end up as (blanks for readability inserted): while(<>) { rand $. < 1 ? $a = $_ : 1 } { print $a } Down to 25 chars. Unfortunately, while perl 5.10 provides "say" as an alternative to "print", that 2 char saving is overwhelmed by having to enable it with "use feature qw(say);" I'd consider it cheating to provide the "use feature qw(say)" using the -M switch, since if the contents of a -M switch doesn't get included in the char count you could just stick the whole program there. E.g.: $ perl -M'warnings;print"hi\n";' -pe '' References: <4A3A6CBE.5070405@abez.ca> <20090618213210.GA15266@perlwolf.com> <20090619145648.GB15266@perlwolf.com> Message-ID: Did anyone say anything about STDOUT? $ perl -ne'rand$.<1and$a=$_}{warn$a' On Fri, Jun 19, 2009 at 08:50:58AM -0400, Raymond wrote: >> (Replying to all this time, oops) >> >>> From the above: >> >> $ perl -ne'rand++$n<1?$s=$_:1;END{print$s}' > >> No need to increment a counter like $n, just use $. which gives the >> line number 1 indexed. >> >> $ perl -ne'rand$.<1?$a=$_:1;END{print$a}' > >> Also replaced $s with $a so it runs safe under 'warnings'. ;) Two more >> characters saved. > > Neat. And yet, 4 more chars can still be removed: > > $ perl -ne'rand$.<1?$a=$_:1}{print$a' > This is using trickery on the internal expansion of the -n > flag, to allow us to remove the END, its braces, and its > preceeding semi-colon. > > The -n provides a wrapper like: > > while(<>) { > # -e arg goes here > } > > The }{ in my new -e makes that end up as (blanks for readability > inserted): > > while(<>) { > rand $. < 1 > ? $a = $_ > : 1 > } > { > print $a > } > > Down to 25 chars. > > Unfortunately, while perl 5.10 provides "say" as an alternative > to "print", that 2 char saving is overwhelmed by having to > enable it with "use feature qw(say);" > > I'd consider it cheating to provide the "use feature qw(say)" > using the -M switch, since if the contents of a -M switch > doesn't get included in the char count you could just stick > the whole program there. E.g.: > > $ perl -M'warnings;print"hi\n";' -pe '' hi > > is a zero char script to print hi under such rules, and it could > do much more complicated things with those same 0 chars, using the > right "module" inclusion. > > A similar sort of cheat is available if you put the script into > a file, run it as "perl filename" and only count the number of > chars in the file as significant - a file containing "eval$0" > (6 chars - doesn't need the terminating newline) can be an > extemely complicated program, limited only by the maximum > length permitted for a filename on the supporting OS. > _______________________________________________ > kw-pm mailing list > kw-pm at pm.org > http://mail.pm.org/mailman/listinfo/kw-pm > From broadswd at gmail.com Fri Jun 19 08:10:45 2009 From: broadswd at gmail.com (Raymond) Date: Fri, 19 Jun 2009 11:10:45 -0400 Subject: [kw-pm] Last night's meeting In-Reply-To: References: <4A3A6CBE.5070405@abez.ca> <20090618213210.GA15266@perlwolf.com> <20090619145648.GB15266@perlwolf.com> Message-ID: I'll do you one stroke better and on STDOUT perl -pe'rand$.<1and$a=$_}{$_=$a' References: <4A3A6CBE.5070405@abez.ca> <20090618213210.GA15266@perlwolf.com> <20090619145648.GB15266@perlwolf.com> Message-ID: Bah! Just as I was reading perlrun to remember which switch did that. On Fri, 19 Jun 2009, Raymond wrote: > I'll do you one stroke better and on STDOUT > > perl -pe'rand$.<1and$a=$_}{$_=$a' From john at perlwolf.com Fri Jun 19 08:15:57 2009 From: john at perlwolf.com (John Macdonald) Date: Fri, 19 Jun 2009 11:15:57 -0400 Subject: [kw-pm] Last night's meeting In-Reply-To: References: Message-ID: <20090619151557.GC15266@perlwolf.com> On Fri, Jun 19, 2009 at 10:55:25AM -0400, Daniel R. Allen wrote: > ...We had considered the ?:1 operator, on the board, but didn't see where > it got us. Clearly we didn't stare at it long enough. > > But turning rand()<1/++$n into rand++$n<1 into rand$.<1 is sheer genius > on both of your parts. Nicely done, John and Raymond. > > 29 strokes == winner? In my previous message, I talked about "cheating" by providing executable code that is not part of the char count in various ways (-M switch, and the filename). But that trick I played on the -n switch made me realize that using -n is similarly a cheat because it provides code that is not counted. So what is the best non-cheating char count? $ perl -e '@a=<>;print at a[rand(@a)]' )]' References: <20090619151557.GC15266@perlwolf.com> Message-ID: That doesn't fit the description of the GOLF -- it's supposed to re-randomise the current random saved entry again and give it a chance based on the # of entries. This GOLF reads the entire file and then just grabs one of them. Justin On Fri, 19 Jun 2009, John Macdonald wrote: > On Fri, Jun 19, 2009 at 10:55:25AM -0400, Daniel R. Allen wrote: >> ...We had considered the ?:1 operator, on the board, but didn't see where >> it got us. Clearly we didn't stare at it long enough. >> >> But turning rand()<1/++$n into rand++$n<1 into rand$.<1 is sheer genius >> on both of your parts. Nicely done, John and Raymond. >> >> 29 strokes == winner? > > In my previous message, I talked about "cheating" by providing > executable code that is not part of the char count in various > ways (-M switch, and the filename). > > But that trick I played on the -n switch made me realize that > using -n is similarly a cheat because it provides code that is > not counted. > > So what is the best non-cheating char count? > > $ perl -e '@a=<>;print at a[rand(@a)]' > That's better than the "cheating" we've been doing using -n! > > And then, it can be golfed down a bit more to: > > $ perl -e 'print at a[rand(@a=<>)]' > > So, that's down to 18 chars, with no supporting cheats of any kind. > _______________________________________________ > kw-pm mailing list > kw-pm at pm.org > http://mail.pm.org/mailman/listinfo/kw-pm > From da at coder.com Fri Jun 19 08:24:50 2009 From: da at coder.com (Daniel R. Allen) Date: Fri, 19 Jun 2009 11:24:50 -0400 (EDT) Subject: [kw-pm] Last night's meeting In-Reply-To: <20090619151557.GC15266@perlwolf.com> Message-ID: On Fri, 19 Jun 2009, John Macdonald wrote: > So what is the best non-cheating char count? > > $ perl -e '@a=<>;print at a[rand(@a)]' > That's better than the "cheating" we've been doing using -n! > > And then, it can be golfed down a bit more to: > > $ perl -e 'print at a[rand(@a=<>)]' > > So, that's down to 18 chars, with no supporting cheats of any kind. > _______________________________________________ > kw-pm mailing list > kw-pm at pm.org > http://mail.pm.org/mailman/listinfo/kw-pm > From john at perlwolf.com Fri Jun 19 08:29:20 2009 From: john at perlwolf.com (John Macdonald) Date: Fri, 19 Jun 2009 11:29:20 -0400 Subject: [kw-pm] Last night's meeting In-Reply-To: <20090619151557.GC15266@perlwolf.com> References: <20090619151557.GC15266@perlwolf.com> Message-ID: <20090619152920.GD15266@perlwolf.com> On Fri, Jun 19, 2009 at 11:15:57AM -0400, John Macdonald wrote: > On Fri, Jun 19, 2009 at 10:55:25AM -0400, Daniel R. Allen wrote: > > ...We had considered the ?:1 operator, on the board, but didn't see where > > it got us. Clearly we didn't stare at it long enough. > > > > But turning rand()<1/++$n into rand++$n<1 into rand$.<1 is sheer genius > > on both of your parts. Nicely done, John and Raymond. > > > > 29 strokes == winner? > > In my previous message, I talked about "cheating" by providing > executable code that is not part of the char count in various > ways (-M switch, and the filename). > > But that trick I played on the -n switch made me realize that > using -n is similarly a cheat because it provides code that is > not counted. > > So what is the best non-cheating char count? > > $ perl -e '@a=<>;print at a[rand(@a)]' > That's better than the "cheating" we've been doing using -n! > > And then, it can be golfed down a bit more to: > > $ perl -e 'print at a[rand(@a=<>)]' > > So, that's down to 18 chars, with no supporting cheats of any kind. However, I haven't seen the original challenge - does it require that the program handle input that is too large to fit in memory? From max at alleged.net Fri Jun 19 08:33:06 2009 From: max at alleged.net (Max) Date: Fri, 19 Jun 2009 11:33:06 -0400 Subject: [kw-pm] Last night's meeting In-Reply-To: <20090619152920.GD15266@perlwolf.com> References: <20090619151557.GC15266@perlwolf.com> <20090619152920.GD15266@perlwolf.com> Message-ID: <4A3BAFB2.8020401@alleged.net> John Macdonald wrote: > However, I haven't seen the original challenge - does it require > that the program handle input that is too large to fit in memory? > It requires that the algorithm be online and not store the entire input in memory. In other words, it should use a constant amount of memory in the number of lines (O(1) where n = # of lines) From john at perlwolf.com Fri Jun 19 08:39:38 2009 From: john at perlwolf.com (John Macdonald) Date: Fri, 19 Jun 2009 11:39:38 -0400 Subject: [kw-pm] Last night's meeting In-Reply-To: <20090619152920.GD15266@perlwolf.com> References: <20090619151557.GC15266@perlwolf.com> <20090619152920.GD15266@perlwolf.com> Message-ID: <20090619153938.GE15266@perlwolf.com> On Fri, Jun 19, 2009 at 11:29:20AM -0400, John Macdonald wrote: > On Fri, Jun 19, 2009 at 11:15:57AM -0400, John Macdonald wrote: > > On Fri, Jun 19, 2009 at 10:55:25AM -0400, Daniel R. Allen wrote: > > > ...We had considered the ?:1 operator, on the board, but didn't see where > > > it got us. Clearly we didn't stare at it long enough. > > > > > > But turning rand()<1/++$n into rand++$n<1 into rand$.<1 is sheer genius > > > on both of your parts. Nicely done, John and Raymond. > > > > > > 29 strokes == winner? > > > > In my previous message, I talked about "cheating" by providing > > executable code that is not part of the char count in various > > ways (-M switch, and the filename). > > > > But that trick I played on the -n switch made me realize that > > using -n is similarly a cheat because it provides code that is > > not counted. > > > > So what is the best non-cheating char count? > > > > $ perl -e '@a=<>;print at a[rand(@a)]' > > > That's better than the "cheating" we've been doing using -n! > > > > And then, it can be golfed down a bit more to: > > > > $ perl -e 'print at a[rand(@a=<>)]' > > > > > So, that's down to 18 chars, with no supporting cheats of any kind. > > However, I haven't seen the original challenge - does it require > that the program handle input that is too large to fit in memory? While I was writing that, two people were pointing out that the handling it as a stream was part of the rules. The best "no outside assistance" for I can come up with so far is: $ perl -e 'rand$.<1?$a=$_:1for<>;print$a' ;warn$a' 2>&1 References: <20090619151557.GC15266@perlwolf.com> <20090619152920.GD15266@perlwolf.com> <20090619153938.GE15266@perlwolf.com> Message-ID: <20090619154354.GF15266@perlwolf.com> On Fri, Jun 19, 2009 at 11:39:38AM -0400, John Macdonald wrote: > (Note, this is an improvement if you add the extra code provided > by the -n or -p switch, even assuming that extraneous blanks > aren't counted.) That sentence was hard to understand. I'm talking about adding the size of the code provided internally by the -n or -p switch to the total character count measured for the solution. From john at perlwolf.com Fri Jun 19 08:49:30 2009 From: john at perlwolf.com (John Macdonald) Date: Fri, 19 Jun 2009 11:49:30 -0400 Subject: [kw-pm] Last night's meeting In-Reply-To: <20090619153938.GE15266@perlwolf.com> References: <20090619151557.GC15266@perlwolf.com> <20090619152920.GD15266@perlwolf.com> <20090619153938.GE15266@perlwolf.com> Message-ID: <20090619154930.GG15266@perlwolf.com> On Fri, Jun 19, 2009 at 11:39:38AM -0400, John Macdonald wrote: > On Fri, Jun 19, 2009 at 11:29:20AM -0400, John Macdonald wrote: > > $ perl -e 'rand$.<1?$a=$_:1for<>;print$a' > which is 29 chars. And to fill out my original argument against "cheating", if the size of command line switches other than -e is not counted in the rating system, then the solution: $ perl -M'-warnings;rand$.<1?$a=$_:1for<>;print$a' -e '' References: <20090619151557.GC15266@perlwolf.com> <20090619152920.GD15266@perlwolf.com> <20090619153938.GE15266@perlwolf.com> <20090619154930.GG15266@perlwolf.com> Message-ID: <4A3BB48F.7000601@alleged.net> John Macdonald wrote: > On Fri, Jun 19, 2009 at 11:39:38AM -0400, John Macdonald wrote: > >> On Fri, Jun 19, 2009 at 11:29:20AM -0400, John Macdonald wrote: >> >> $ perl -e 'rand$.<1?$a=$_:1for<>;print$a' > >> which is 29 chars. >> > > And to fill out my original argument against "cheating", if the > size of command line switches other than -e is not counted in > the rating system, then the solution: > > $ perl -M'-warnings;rand$.<1?$a=$_:1for<>;print$a' -e '' > is a solution with 0 chars. > I think the idea is that perl -e is free, anything else is counted. (n, p, -M, etc.) From john at perlwolf.com Fri Jun 19 09:01:18 2009 From: john at perlwolf.com (John Macdonald) Date: Fri, 19 Jun 2009 12:01:18 -0400 Subject: [kw-pm] Last night's meeting In-Reply-To: <4A3BB48F.7000601@alleged.net> References: <20090619151557.GC15266@perlwolf.com> <20090619152920.GD15266@perlwolf.com> <20090619153938.GE15266@perlwolf.com> <20090619154930.GG15266@perlwolf.com> <4A3BB48F.7000601@alleged.net> Message-ID: <20090619160118.GH15266@perlwolf.com> On Fri, Jun 19, 2009 at 11:53:51AM -0400, Max wrote: > John Macdonald wrote: >> On Fri, Jun 19, 2009 at 11:39:38AM -0400, John Macdonald wrote: >> >>> On Fri, Jun 19, 2009 at 11:29:20AM -0400, John Macdonald wrote: >>> >>> $ perl -e 'rand$.<1?$a=$_:1for<>;print$a' >> >>> which is 29 chars. >>> >> >> And to fill out my original argument against "cheating", if the >> size of command line switches other than -e is not counted in >> the rating system, then the solution: >> >> $ perl -M'-warnings;rand$.<1?$a=$_:1for<>;print$a' -e '' > >> is a solution with 0 chars. >> > > I think the idea is that perl -e is free, anything else is counted. (n, > p, -M, etc.) But does -p count as the 2 chars you type, or the 17 chars: while(<>){ ;print} that get wrapped around your -e code? From broadswd at gmail.com Fri Jun 19 09:04:07 2009 From: broadswd at gmail.com (Raymond) Date: Fri, 19 Jun 2009 12:04:07 -0400 Subject: [kw-pm] Last night's meeting In-Reply-To: <4A3BB48F.7000601@alleged.net> References: <20090619151557.GC15266@perlwolf.com> <20090619152920.GD15266@perlwolf.com> <20090619153938.GE15266@perlwolf.com> <20090619154930.GG15266@perlwolf.com> <4A3BB48F.7000601@alleged.net> Message-ID: 2009/6/19 Max : > John Macdonald wrote: >> >> On Fri, Jun 19, 2009 at 11:39:38AM -0400, John Macdonald wrote: >> >>> >>> On Fri, Jun 19, 2009 at 11:29:20AM -0400, John Macdonald wrote: >>> >>> $ perl -e 'rand$.<1?$a=$_:1for<>;print$a' >> >>> which is 29 chars. >>> >> >> And to fill out my original argument against "cheating", if the >> size of command line switches other than -e is not counted in >> the rating system, then the solution: >> >> $ perl -M'-warnings;rand$.<1?$a=$_:1for<>;print$a' -e '' > >> is a solution with 0 chars. >> > > I think the idea is that perl -e is free, anything else is counted. (n, p, > -M, etc.) Grrr... replying to list. I wish gmail had that option. Any of these are free. perl -e '' perl foo.pl foo.pl In the case of the last the shebang line (but NOT its arguments) is free. In general its also played no-modules except for any that are implicitly loaded by core perl commands. Extra symbols given by implicit loads aren't allowed without actually loading the module explicitly. All sourced files are considered in the count except IO as indicated in the challenge. That's the generally accepted rules in brief I think. From john at perlwolf.com Fri Jun 19 09:34:46 2009 From: john at perlwolf.com (John Macdonald) Date: Fri, 19 Jun 2009 12:34:46 -0400 Subject: [kw-pm] Last night's meeting In-Reply-To: References: <20090619151557.GC15266@perlwolf.com> <20090619152920.GD15266@perlwolf.com> <20090619153938.GE15266@perlwolf.com> <20090619154930.GG15266@perlwolf.com> <4A3BB48F.7000601@alleged.net> Message-ID: <20090619163446.GI15266@perlwolf.com> On Fri, Jun 19, 2009 at 12:04:07PM -0400, Raymond wrote: > 2009/6/19 Max : > > John Macdonald wrote: > >> > >> On Fri, Jun 19, 2009 at 11:39:38AM -0400, John Macdonald wrote: > >> > >>> > >>> On Fri, Jun 19, 2009 at 11:29:20AM -0400, John Macdonald wrote: > >>> > >>> $ perl -e 'rand$.<1?$a=$_:1for<>;print$a' >>> > >>> which is 29 chars. > >>> > >> > >> And to fill out my original argument against "cheating", if the > >> size of command line switches other than -e is not counted in > >> the rating system, then the solution: > >> > >> $ perl -M'-warnings;rand$.<1?$a=$_:1for<>;print$a' -e '' >> > >> is a solution with 0 chars. > >> > > > > I think the idea is that perl -e is free, anything else is counted. (n, p, > > -M, etc.) > Grrr... replying to list. I wish gmail had that option. > > Any of these are free. > > perl -e '' > perl foo.pl > foo.pl > > In the case of the last the shebang line (but NOT its arguments) is > free. In general its also played no-modules except for any that are > implicitly loaded by core perl commands. Extra symbols given by > implicit loads aren't allowed without actually loading the module > explicitly. All sourced files are considered in the count except IO as > indicated in the challenge. > > That's the generally accepted rules in brief I think. OK, the remaining "cheating" technique gives a count of 6 chars, as long as the only things counted are the contents of the script file and any useful command line args. $ FILE='rand$.<1?$a=$_:1while<>;print$a' $ print -n 'eval"$0"' >$FILE $ perl $FILE ;print$a Note: I just noticed that using 'for<>' had a bug - it reads all of the lines before processing the modified statement the first time, so $. is already incremented to the number of lines in the entire input and it does not give a fair selection (and can give no selection at all). That adds 2 chars to my "no assistance" count. From kw-pm at datademons.com Fri Jun 19 09:41:27 2009 From: kw-pm at datademons.com (Justin Wheeler) Date: Fri, 19 Jun 2009 12:41:27 -0400 (EDT) Subject: [kw-pm] Last night's meeting In-Reply-To: <20090619163446.GI15266@perlwolf.com> References: <20090619151557.GC15266@perlwolf.com> <20090619152920.GD15266@perlwolf.com> <20090619153938.GE15266@perlwolf.com> <20090619154930.GG15266@perlwolf.com> <4A3BB48F.7000601@alleged.net> <20090619163446.GI15266@perlwolf.com> Message-ID: That's still cheating. > OK, the remaining "cheating" technique gives a count of 6 chars, as > long as the only things counted are the contents of the script file > and any useful command line args. > > $ FILE='rand$.<1?$a=$_:1while<>;print$a' > $ print -n 'eval"$0"' >$FILE > $ perl $FILE $ wc -c $FILE > 6 rand$.<1?$a=$_:1while<>;print$a > > Note: I just noticed that using 'for<>' had a bug - it reads all of > the lines before processing the modified statement the first time, > so $. is already incremented to the number of lines in the entire > input and it does not give a fair selection (and can give no selection > at all). > > That adds 2 chars to my "no assistance" count. > _______________________________________________ > kw-pm mailing list > kw-pm at pm.org > http://mail.pm.org/mailman/listinfo/kw-pm > From abez at abez.ca Fri Jun 19 09:37:34 2009 From: abez at abez.ca (abez) Date: Fri, 19 Jun 2009 12:37:34 -0400 (EDT) Subject: [kw-pm] Last night's meeting In-Reply-To: <20090619152920.GD15266@perlwolf.com> (sfid-20090619_113505_908784_83FE4128) References: <20090619151557.GC15266@perlwolf.com> <20090619152920.GD15266@perlwolf.com> (sfid-20090619_113505_908784_83FE4128) Message-ID: On Fri, 19 Jun 2009, John Macdonald wrote: >> >> >> So, that's down to 18 chars, with no supporting cheats of any kind. > > However, I haven't seen the original challenge - does it require > that the program handle input that is too large to fit in memory? The purpose of the original challenge was for members to implement the randomized algorithm, that I presented, which allows for O(1) memory use, in terms of lines while ensuring the result was uniformly random (with some assumptions of course). This algorithm needs O(N) calls to rand but rand is pretty fast compared to I/O, thus this algorithm will work very well on huge inputs. Perhaps the golf should've been written more clearly but it was given a full presentation in the meeting :) abram From john at perlwolf.com Fri Jun 19 11:34:11 2009 From: john at perlwolf.com (John Macdonald) Date: Fri, 19 Jun 2009 14:34:11 -0400 Subject: [kw-pm] Last night's meeting In-Reply-To: References: <20090619151557.GC15266@perlwolf.com> <20090619152920.GD15266@perlwolf.com> Message-ID: <20090619183411.GJ15266@perlwolf.com> On Fri, Jun 19, 2009 at 12:37:34PM -0400, abez wrote: > On Fri, 19 Jun 2009, John Macdonald wrote: > >>> >>> >>> So, that's down to 18 chars, with no supporting cheats of any kind. >> >> However, I haven't seen the original challenge - does it require >> that the program handle input that is too large to fit in memory? > > The purpose of the original challenge was for members to implement the > randomized algorithm, that I presented, which allows for O(1) memory use, in > terms of lines while ensuring the result was uniformly random (with some > assumptions of course). > > This algorithm needs O(N) calls to rand but rand is pretty fast compared to > I/O, thus this algorithm will work very well on huge inputs. > > Perhaps the golf should've been written more clearly but it was given a full > presentation in the meeting :) No algorithm can be O(1). At best it can be O(n) on the number of lines. In fact, even if you were told the number of lines in the input you'd still have to read an amount that was not O(1) unless there were also sever constraints on the length of a line. Imagine that the input file is created by the following program that generates one 1000-char line and 999 1-char lines: my $big = int(rand(1000)); for my $line (0..999) { print 'x' x 999 if $line == $big; print "\n"; } If you knew that such a file was being searched, you could process it in O(log n) using a binary search to find one end of the non-blank line [O(log n)], deterine which line of the file that was [O(1) - take the pos in file of the "\n" that follows an "x" and subtract 999, that is the line number of the long line and all of the rest are short] pick a single random number [O(1)], and generating the required line based upon whether the result of the binary search is the same as the randomly chosen line number. But even for this much simpler case, you cannot get an O(1) algorithm. The actual case, which has an input of unknown number of lines, in which each line is of unknown length, has to be O(n) on the length of the input (which is worse than the number of lines; but we've been assuming that the input does not have any "lines" that are too large to fit into memory, or even close, so O(n) on the number of lines is a reasonable approximation. How would *any* O(1) algorithm be able to work if the input file it was given was not some html file, but was /dev/hda instead? And still be true for the size that might be available for /dev/hda 20 years from now. If /dev/hda is a disk drive that is 1 TB, it could contain a single line containing 1 TB of "text", or it could contain 10 billion lines of 100 characters each, or whatever - you basically need to read the entire input to know where lines start and their line number. I would take the O(1) requirement to be a measure on the amount of work done for each line read (which matches the cost of the readline operation at least). From max at alleged.net Fri Jun 19 11:41:02 2009 From: max at alleged.net (Max) Date: Fri, 19 Jun 2009 14:41:02 -0400 Subject: [kw-pm] Last night's meeting In-Reply-To: <20090619183411.GJ15266@perlwolf.com> References: <20090619151557.GC15266@perlwolf.com> <20090619152920.GD15266@perlwolf.com> <20090619183411.GJ15266@perlwolf.com> Message-ID: <4A3BDBBE.4080405@alleged.net> John Macdonald wrote: > O > No algorithm can be O(1). At best it can be O(n) on the number > of lines. > > We said O(1) *memory* use, on the number of lines. Yes, we're making the implicit assumption that lines are reasonable. The algorithm's complexity is indeed O(n), on the number of lines. Max From john at perlwolf.com Fri Jun 19 11:43:01 2009 From: john at perlwolf.com (John Macdonald) Date: Fri, 19 Jun 2009 14:43:01 -0400 Subject: [kw-pm] Last night's meeting In-Reply-To: <20090619183411.GJ15266@perlwolf.com> References: <20090619151557.GC15266@perlwolf.com> <20090619152920.GD15266@perlwolf.com> <20090619183411.GJ15266@perlwolf.com> Message-ID: <20090619184301.GK15266@perlwolf.com> I just re-read and realized the Abez was mixing memory size and execution in his discussion and I read them both being about execution time. For the results (except for my misguided read everything into an array) so far: memory use is O(l) where l is the length of the longest line in the input, which is actually O(1) if you assume a "reasonable" bound on the length of the longest line. execution is O(n) where n is the number of lines in the input (still assuming that line length bound, so that each readline is O(1)). On Fri, Jun 19, 2009 at 02:34:11PM -0400, John Macdonald wrote: > On Fri, Jun 19, 2009 at 12:37:34PM -0400, abez wrote: > > On Fri, 19 Jun 2009, John Macdonald wrote: > > > >>> > >>> > >>> So, that's down to 18 chars, with no supporting cheats of any kind. > >> > >> However, I haven't seen the original challenge - does it require > >> that the program handle input that is too large to fit in memory? > > > > The purpose of the original challenge was for members to implement the > > randomized algorithm, that I presented, which allows for O(1) memory use, in > > terms of lines while ensuring the result was uniformly random (with some > > assumptions of course). > > > > This algorithm needs O(N) calls to rand but rand is pretty fast compared to > > I/O, thus this algorithm will work very well on huge inputs. > > > > Perhaps the golf should've been written more clearly but it was given a full > > presentation in the meeting :) > > No algorithm can be O(1). At best it can be O(n) on the number > of lines. > > In fact, even if you were told the number of lines in the input > you'd still have to read an amount that was not O(1) unless > there were also sever constraints on the length of a line. > > Imagine that the input file is created by the following program > that generates one 1000-char line and 999 1-char lines: > > my $big = int(rand(1000)); > for my $line (0..999) { > print 'x' x 999 > if $line == $big; > print "\n"; > } > > If you knew that such a file was being searched, you could > process it in O(log n) using a binary search to find one end of > the non-blank line [O(log n)], deterine which line of the file > that was [O(1) - take the pos in file of the "\n" that follows > an "x" and subtract 999, that is the line number of the long > line and all of the rest are short] pick a single random number > [O(1)], and generating the required line based upon whether > the result of the binary search is the same as the randomly > chosen line number. But even for this much simpler case, > you cannot get an O(1) algorithm. > > The actual case, which has an input of unknown number of lines, > in which each line is of unknown length, has to be O(n) on the > length of the input (which is worse than the number of lines; > but we've been assuming that the input does not have any "lines" > that are too large to fit into memory, or even close, so O(n) > on the number of lines is a reasonable approximation. > > How would *any* O(1) algorithm be able to work if the input file > it was given was not some html file, but was /dev/hda instead? > And still be true for the size that might be available for > /dev/hda 20 years from now. If /dev/hda is a disk drive that is > 1 TB, it could contain a single line containing 1 TB of "text", > or it could contain 10 billion lines of 100 characters each, > or whatever - you basically need to read the entire input to > know where lines start and their line number. > > I would take the O(1) requirement to be a measure on the amount > of work done for each line read (which matches the cost of the > readline operation at least). > _______________________________________________ > kw-pm mailing list > kw-pm at pm.org > http://mail.pm.org/mailman/listinfo/kw-pm From dc0955 at gates.com Fri Jun 19 11:46:44 2009 From: dc0955 at gates.com (Carr, Dave) Date: Fri, 19 Jun 2009 12:46:44 -0600 Subject: [kw-pm] Last night's meeting In-Reply-To: <20090619184301.GK15266@perlwolf.com> References: <20090619151557.GC15266@perlwolf.com> <20090619152920.GD15266@perlwolf.com> <20090619183411.GJ15266@perlwolf.com>, <20090619184301.GK15266@perlwolf.com> Message-ID: <758F392F328BCC4F86003FACF7F7A8E337CD9899F5@MSNACCR01.ec.cf.com> HOLY COW!!! I TURN MY BACK FOR A MINUTE AND THE KW.PM MAILING LIST COMES BACK FROM THE DEAD! ________________________________________ From: kw-pm-bounces+dc0955=gates.com at pm.org [kw-pm-bounces+dc0955=gates.com at pm.org] On Behalf Of John Macdonald [john at perlwolf.com] Sent: Friday, June 19, 2009 12:43 PM To: abez Cc: K/W Perl Mongers Subject: Re: [kw-pm] Last night's meeting I just re-read and realized the Abez was mixing memory size and execution in his discussion and I read them both being about execution time. For the results (except for my misguided read everything into an array) so far: memory use is O(l) where l is the length of the longest line in the input, which is actually O(1) if you assume a "reasonable" bound on the length of the longest line. execution is O(n) where n is the number of lines in the input (still assuming that line length bound, so that each readline is O(1)). On Fri, Jun 19, 2009 at 02:34:11PM -0400, John Macdonald wrote: > On Fri, Jun 19, 2009 at 12:37:34PM -0400, abez wrote: > > On Fri, 19 Jun 2009, John Macdonald wrote: > > > >>> > >>> > >>> So, that's down to 18 chars, with no supporting cheats of any kind. > >> > >> However, I haven't seen the original challenge - does it require > >> that the program handle input that is too large to fit in memory? > > > > The purpose of the original challenge was for members to implement the > > randomized algorithm, that I presented, which allows for O(1) memory use, in > > terms of lines while ensuring the result was uniformly random (with some > > assumptions of course). > > > > This algorithm needs O(N) calls to rand but rand is pretty fast compared to > > I/O, thus this algorithm will work very well on huge inputs. > > > > Perhaps the golf should've been written more clearly but it was given a full > > presentation in the meeting :) > > No algorithm can be O(1). At best it can be O(n) on the number > of lines. > > In fact, even if you were told the number of lines in the input > you'd still have to read an amount that was not O(1) unless > there were also sever constraints on the length of a line. > > Imagine that the input file is created by the following program > that generates one 1000-char line and 999 1-char lines: > > my $big = int(rand(1000)); > for my $line (0..999) { > print 'x' x 999 > if $line == $big; > print "\n"; > } > > If you knew that such a file was being searched, you could > process it in O(log n) using a binary search to find one end of > the non-blank line [O(log n)], deterine which line of the file > that was [O(1) - take the pos in file of the "\n" that follows > an "x" and subtract 999, that is the line number of the long > line and all of the rest are short] pick a single random number > [O(1)], and generating the required line based upon whether > the result of the binary search is the same as the randomly > chosen line number. But even for this much simpler case, > you cannot get an O(1) algorithm. > > The actual case, which has an input of unknown number of lines, > in which each line is of unknown length, has to be O(n) on the > length of the input (which is worse than the number of lines; > but we've been assuming that the input does not have any "lines" > that are too large to fit into memory, or even close, so O(n) > on the number of lines is a reasonable approximation. > > How would *any* O(1) algorithm be able to work if the input file > it was given was not some html file, but was /dev/hda instead? > And still be true for the size that might be available for > /dev/hda 20 years from now. If /dev/hda is a disk drive that is > 1 TB, it could contain a single line containing 1 TB of "text", > or it could contain 10 billion lines of 100 characters each, > or whatever - you basically need to read the entire input to > know where lines start and their line number. > > I would take the O(1) requirement to be a measure on the amount > of work done for each line read (which matches the cost of the > readline operation at least). > _______________________________________________ > kw-pm mailing list > kw-pm at pm.org > http://mail.pm.org/mailman/listinfo/kw-pm _______________________________________________ kw-pm mailing list kw-pm at pm.org http://mail.pm.org/mailman/listinfo/kw-pm From fulko.hew at gmail.com Sat Jun 20 05:18:39 2009 From: fulko.hew at gmail.com (Fulko Hew) Date: Sat, 20 Jun 2009 08:18:39 -0400 Subject: [kw-pm] Fwd: [tpm] Damian Conway event, Monday 27 July 2009 In-Reply-To: <5bef4baf0906190835p7b850568m4b92ee33a307481f@mail.gmail.com> References: <5bef4baf0906190835p7b850568m4b92ee33a307481f@mail.gmail.com> Message-ID: <8204a4fe0906200518h44b7edc0m50ed88cc41bde165@mail.gmail.com> ---------- Forwarded message ---------- From: Richard Dice Date: Fri, Jun 19, 2009 at 11:35 AM Subject: [tpm] Damian Conway event, Monday 27 July 2009 To: Toronto Perl Mongers Hi everyone, Damian Conway, Perl hacker extraordinaire and friend and honorary TPM member, will be in Toronto in July. He has offered to present a talk the evening of Monday 27 July. (Probably we could consider this to be our July meeting topic?) Details on the talk and its location are to follow as I hash that stuff out. Just wanted to let people know so they could save the date. Cheers, - Richard _______________________________________________ toronto-pm mailing list toronto-pm at pm.org http://mail.pm.org/mailman/listinfo/toronto-pm -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel at coder.com Sun Jun 21 15:02:41 2009 From: daniel at coder.com (Daniel R. Allen) Date: Sun, 21 Jun 2009 18:02:41 -0400 (EDT) Subject: [kw-pm] Last Wednesday's meeting In-Reply-To: <4A3A6CBE.5070405@abez.ca> Message-ID: On Fri, 19 Jun 2009, Raymond wrote: > I'll do you one stroke better and on STDOUT > > perl -pe'rand$.<1and$a=$_}{$_=$a'1or$a=$_}{$_=$a' Hi everyone, This is a bit off-topic, but since you guys are doing so much microcontroller stuff, I thought you might be interested. Make:KW (the local Maker group) is having a meeting this Thursday, July 2nd, at the Huether Hotel, downstairs in The Cavern at 7:30 PM. It's a great opportunity to socialize with other people who like to make things. From the event listing[1]: "Feel free to bring your latest projects to show off while we enjoy fine dining, mingling, and of course an exceptional selection of drinks. For those who haven't been able to make it previously, nows your chance to get in on the awesome. Name tags will be provided ;)" Of course, bringing projects is optional :-) (My latest is sitting, not quite functional, on the dining room table) We're also working on an initiative[2] to create a Hackerspace here in Waterloo Region. If the idea of having a place to hang out and hack/build appeals to you, come on out on Thursday and ask us about it. Hope to see you on Thursday, then! Oh, and if your microcontroller talk in July becomes widely known about, some of us may show up too :-) Cheers, Eric [1]: http://makekw.org/events/20090702 [2]: http://makekw.org/hackerspace