From grant at mclean.net.nz Sun Aug 1 18:22:17 2010 From: grant at mclean.net.nz (Grant McLean) Date: Mon, 02 Aug 2010 13:22:17 +1200 Subject: [Wellington-pm] Meeting Next Week Message-ID: <1280712137.835.24.camel@putnam.wgtn.cat-it.co.nz> Hi Mongers As I haven't been inundated with offers to speak at next week's meeting (despite Dan's excellent suggestion that he'd appreciate a talk on Dist::Zilla) I suggest that we declare the August meeting a social meeting and get together at a local pub (venue suggestions welcome). If you're looking for a night out this week, the second Ignite Wellington event is happening tomorrow evening: http://www.ignitewellington.co.nz/ Cheers Grant From pfCd?Y*_Qbdb6 at perform.shyuser.com Mon Aug 2 14:04:59 2010 From: pfCd?Y*_Qbdb6 at perform.shyuser.com (pfCd?Y*_Qbdb6 at perform.shyuser.com) Date: Mon, 02 Aug 2010 17:04:59 -0400 Subject: [Wellington-pm] ? shorten an Perl snippet Message-ID: Any monger got the short version of for Perl 50 day average when written as: { $product1 = ($split_line[10][5]+$split_line[11][5]+ $split_line[12][5]+$split_line[13][5]+$split_line[14][5]+$split_line[15][5]+$split_line[16][5]+ $split_line[17][5]+$split_line[18][5]+$split_line[19][5]+$split_line[20][5]+$split_line[21][5]+ $split_line[22][5]+$split_line[23][5]+$split_line[24][5]+$split_line[25][5]+$split_line[26][5]+ $split_line[27][5]+$split_line[28][5]+$split_line[29][5]+$split_line[30][5]+$split_line[31][5]+ $split_line[32][5]+$split_line[33][5]+$split_line[34][5]+$split_line[35][5]+$split_line[36][5]+ $split_line[37][5]+$split_line[38][5]+$split_line[39][5]+$split_line[40][5]+$split_line[41][5]+ $split_line[42][5]+$split_line[43][5]+$split_line[44][5]+$split_line[45][5]+$split_line[46][5]+ $split_line[47][5]+$split_line[48][5]+$split_line[49][5]+$split_line[50][5]+$split_line[51][5]+$split_line[52][5]+ $split_line[53][5]+$split_line[54][5]+$split_line[55][5]+$split_line[56][5]+$split_line[57][5]+$split_line[58][5]+ $split_line[59][5])/50; } From dan.horne at redbone.co.nz Mon Aug 2 14:34:56 2010 From: dan.horne at redbone.co.nz (Dan Horne) Date: Tue, 3 Aug 2010 09:34:56 +1200 Subject: [Wellington-pm] ? shorten an Perl snippet In-Reply-To: References: Message-ID: Without wanting to golf it, perhaps something like my $product = 0; for my $j (10 .. 59) { $product += $split_line[$j][5]; } $product = $product/50; You could divide by 50 inside the loop, but that might introduce too many rounding errors On 3 August 2010 09:04, wrote: > Any monger got the short version of for Perl 50 day average when written > as: > { > $product1 = > ($split_line[10][5]+$split_line[11][5]+ > > $split_line[12][5]+$split_line[13][5]+$split_line[14][5]+$split_line[15][5]+$split_line[16][5]+ > > $split_line[17][5]+$split_line[18][5]+$split_line[19][5]+$split_line[20][5]+$split_line[21][5]+ > > $split_line[22][5]+$split_line[23][5]+$split_line[24][5]+$split_line[25][5]+$split_line[26][5]+ > > $split_line[27][5]+$split_line[28][5]+$split_line[29][5]+$split_line[30][5]+$split_line[31][5]+ > > $split_line[32][5]+$split_line[33][5]+$split_line[34][5]+$split_line[35][5]+$split_line[36][5]+ > > $split_line[37][5]+$split_line[38][5]+$split_line[39][5]+$split_line[40][5]+$split_line[41][5]+ > > $split_line[42][5]+$split_line[43][5]+$split_line[44][5]+$split_line[45][5]+$split_line[46][5]+ > > $split_line[47][5]+$split_line[48][5]+$split_line[49][5]+$split_line[50][5]+$split_line[51][5]+$split_line[52][5]+ > > $split_line[53][5]+$split_line[54][5]+$split_line[55][5]+$split_line[56][5]+$split_line[57][5]+$split_line[58][5]+ > $split_line[59][5])/50; > } > > > > > > > _______________________________________________ > Wellington-pm mailing list > Wellington-pm at pm.org > http://mail.pm.org/mailman/listinfo/wellington-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: From grant at mclean.net.nz Mon Aug 2 14:52:48 2010 From: grant at mclean.net.nz (Grant McLean) Date: Tue, 03 Aug 2010 09:52:48 +1200 Subject: [Wellington-pm] ? shorten an Perl snippet In-Reply-To: References: Message-ID: <1280785968.18547.15.camel@putnam.wgtn.cat-it.co.nz> On Tue, 2010-08-03 at 09:34 +1200, Dan Horne wrote: > Without wanting to golf it, perhaps something like > > my $product = 0; > > for my $j (10 .. 59) { > $product += $split_line[$j][5]; > } > > $product = $product/50; > > You could divide by 50 inside the loop, but that might introduce too > many rounding errors That's certainly an improvement over the original code. I'd also be inclined to put the code in a subroutine with a name that made it clear what it was doing. Also the List::Util module (which has been included with Perl since 5.8) provides a few tools you could use, for example: use List::Util qw(sum); $product1 = average_50d(@split_line); sub average_50d { my $sum = sum map { $_->[5] } @_[10..59]; return $sum / 50; } For that quantity of data it would be more efficient to pass it by reference but I didn't want to clutter up the example. Cheers Grant From pfCd?Y*_Qbdb6 at perform.shyuser.com Mon Aug 2 15:27:34 2010 From: pfCd?Y*_Qbdb6 at perform.shyuser.com (pfCd?Y*_Qbdb6 at perform.shyuser.com) Date: Mon, 02 Aug 2010 18:27:34 -0400 Subject: [Wellington-pm] ? shorten an Perl snippet In-Reply-To: <1280785968.18547.15.camel@putnam.wgtn.cat-it.co.nz> References: <1280785968.18547.15.camel@putnam.wgtn.cat-it.co.nz> Message-ID: Hmmm. I'll try getting into that. That's enough for the moment. On 8/2/2010 5:52 PM, Grant McLean wrote: > On Tue, 2010-08-03 at 09:34 +1200, Dan Horne wrote: >> Without wanting to golf it, perhaps something like >> >> my $product = 0; >> >> for my $j (10 .. 59) { >> $product += $split_line[$j][5]; >> } >> >> $product = $product/50; >> >> You could divide by 50 inside the loop, but that might introduce too >> many rounding errors > > That's certainly an improvement over the original code. > > I'd also be inclined to put the code in a subroutine with a name that > made it clear what it was doing. Also the List::Util module (which has > been included with Perl since 5.8) provides a few tools you could use, > for example: > > use List::Util qw(sum); > > $product1 = average_50d(@split_line); > > sub average_50d { > my $sum = sum map { $_->[5] } @_[10..59]; > return $sum / 50; > } > > For that quantity of data it would be more efficient to pass it by > reference but I didn't want to clutter up the example. > > Cheers > Grant > > _______________________________________________ > Wellington-pm mailing list > Wellington-pm at pm.org > http://mail.pm.org/mailman/listinfo/wellington-pm > From daniel at rimspace.net Mon Aug 2 17:16:54 2010 From: daniel at rimspace.net (Daniel Pittman) Date: Tue, 03 Aug 2010 10:16:54 +1000 Subject: [Wellington-pm] ? shorten an Perl snippet In-Reply-To: (Dan Horne's message of "Tue, 3 Aug 2010 09:34:56 +1200") References: Message-ID: <878w4o5z49.fsf@rimspace.net> Dan Horne writes: > Without wanting to golf it, perhaps something like > > my $product = 0; > for my $j (10 .. 59) { > ??? $product += $split_line[$j][5]; > } > $product = $product/50; If split_line was a flat array, not a nested array, this would help: use List::Util qw{sum}; my $product = sum(@split_line[10..59]) / 50; It is roughly the same as the open-coded loop above, but IMO using the 'sum' function is a bit clearer for the reader. For nested arrays like this example, though, there isn't a neater way other, maybe, than open-coding the extraction with map and all. (That I can think of.) Daniel -- ? Daniel Pittman ? daniel at rimspace.net ? +61 401 155 707 ? made with 100 percent post-consumer electrons From pfCd?Y*_Qbdb6 at perform.shyuser.com Mon Aug 2 21:43:03 2010 From: pfCd?Y*_Qbdb6 at perform.shyuser.com (pfCd?Y*_Qbdb6 at perform.shyuser.com) Date: Tue, 03 Aug 2010 00:43:03 -0400 Subject: [Wellington-pm] ? shorten an Perl snippet In-Reply-To: References: <1280785968.18547.15.camel@putnam.wgtn.cat-it.co.nz> Message-ID: Grant's snippet squeezed & clutter happily nixed. On 8/2/2010 6:27 PM, pfCd?Y*_Qbdb6 at perform.shyuser.com wrote: > Hmmm. I'll try getting into that. > That's enough for the moment. > > > > On 8/2/2010 5:52 PM, Grant McLean wrote: >> On Tue, 2010-08-03 at 09:34 +1200, Dan Horne wrote: >>> Without wanting to golf it, perhaps something like >>> >>> my $product = 0; >>> >>> for my $j (10 .. 59) { >>> $product += $split_line[$j][5]; >>> } >>> >>> $product = $product/50; >>> >>> You could divide by 50 inside the loop, but that might >>> introduce too >>> many rounding errors >> >> That's certainly an improvement over the original code. >> >> I'd also be inclined to put the code in a subroutine with a >> name that >> made it clear what it was doing. Also the List::Util module >> (which has >> been included with Perl since 5.8) provides a few tools you >> could use, >> for example: >> >> use List::Util qw(sum); >> >> $product1 = average_50d(@split_line); >> >> sub average_50d { >> my $sum = sum map { $_->[5] } @_[10..59]; >> return $sum / 50; >> } >> >> For that quantity of data it would be more efficient to pass >> it by >> reference but I didn't want to clutter up the example. >> >> Cheers >> Grant >> >> _______________________________________________ >> Wellington-pm mailing list >> Wellington-pm at pm.org >> http://mail.pm.org/mailman/listinfo/wellington-pm >> > _______________________________________________ > Wellington-pm mailing list > Wellington-pm at pm.org > http://mail.pm.org/mailman/listinfo/wellington-pm > From pfCd?Y*_Qbdb6 at perform.shyuser.com Fri Aug 6 16:23:51 2010 From: pfCd?Y*_Qbdb6 at perform.shyuser.com (pfCd?Y*_Qbdb6 at perform.shyuser.com) Date: Fri, 06 Aug 2010 19:23:51 -0400 Subject: [Wellington-pm] Any Monger Wishing To bid Message-ID: Greetings, I am only a monger playing the market, wishing to develop a utility web site . . . Personal use - not public or commercial. How much time shall I budget for development? The reason for the site is the elimination of my many step early morning work schedule: download data, convert data files, crunch numbers, copy to spreadsheet. Care to bid: for details -- K. Pollock nz at perform.cotse.net From grant at mclean.net.nz Sun Aug 8 16:11:17 2010 From: grant at mclean.net.nz (Grant McLean) Date: Mon, 09 Aug 2010 11:11:17 +1200 Subject: [Wellington-pm] Social meet tomorrow Message-ID: <1281309077.13233.16.camel@putnam.wgtn.cat-it.co.nz> Hi Mongers The August meeting of Wellington Perl Mongers is tomorrow evening and is a social meeting: Venue: JJ Murphys - 119 Cuba Street Time: From 6:00pm There's a strong possibility of moving on for a meal after beer. Cheers Grant From grant at mclean.net.nz Sun Aug 8 20:31:48 2010 From: grant at mclean.net.nz (Grant McLean) Date: Mon, 09 Aug 2010 15:31:48 +1200 Subject: [Wellington-pm] Social meet tomorrow In-Reply-To: <1281309077.13233.16.camel@putnam.wgtn.cat-it.co.nz> References: <1281309077.13233.16.camel@putnam.wgtn.cat-it.co.nz> Message-ID: <1281324708.13233.21.camel@putnam.wgtn.cat-it.co.nz> If you're worried about missing out on your monthly dose of Perl talks, then check out this collection of YAPC::NA 2010 conference videos: http://www.presentingperl.org/yn2010/ Cheers Grant On Mon, 2010-08-09 at 11:11 +1200, Grant McLean wrote: > Hi Mongers > > The August meeting of Wellington Perl Mongers is tomorrow evening and is > a social meeting: > > Venue: JJ Murphys - 119 Cuba Street > Time: From 6:00pm > > There's a strong possibility of moving on for a meal after beer. > > Cheers > Grant > > _______________________________________________ > Wellington-pm mailing list > Wellington-pm at pm.org > http://mail.pm.org/mailman/listinfo/wellington-pm From grant at mclean.net.nz Mon Aug 9 22:35:04 2010 From: grant at mclean.net.nz (Grant McLean) Date: Tue, 10 Aug 2010 17:35:04 +1200 Subject: [Wellington-pm] Social meet tomorrow In-Reply-To: <1281309077.13233.16.camel@putnam.wgtn.cat-it.co.nz> References: <1281309077.13233.16.camel@putnam.wgtn.cat-it.co.nz> Message-ID: <1281418504.10569.0.camel@putnam.wgtn.cat-it.co.nz> This reminder is probably too late for anyone who has forgotten but ... It's happening tonight :-) Cheers Grant On Mon, 2010-08-09 at 11:11 +1200, Grant McLean wrote: > Hi Mongers > > The August meeting of Wellington Perl Mongers is tomorrow evening and is > a social meeting: > > Venue: JJ Murphys - 119 Cuba Street > Time: From 6:00pm > > There's a strong possibility of moving on for a meal after beer. > > Cheers > Grant > > _______________________________________________ > Wellington-pm mailing list > Wellington-pm at pm.org > http://mail.pm.org/mailman/listinfo/wellington-pm From grant at mclean.net.nz Wed Aug 11 01:25:00 2010 From: grant at mclean.net.nz (Grant McLean) Date: Wed, 11 Aug 2010 20:25:00 +1200 Subject: [Wellington-pm] [Fwd: Books and News from the O'Reilly User Group Program--Aug] Message-ID: <1281515100.6580.1.camel@localhost> -------- Forwarded Message -------- > From: Marsee Henon & Jon Johns > Subject: Books and News from the O'Reilly User Group Program--Aug > Date: Mon, 9 Aug 2010 08:00:33 -0700 > > View this information as HTML in your browser, click here: > http://post.oreilly.com/rd/9z1zdekcmmootomo1aidl2h7gogvgc9cb4lkhacbcco > > Hi there, > > We've released three books I hope everyone will check out: Cooking for > Geeks, Gamestorming, and Being Geek. We're looking for Slashdot, Amazon, > and oreilly.com reviews for each one. Let me know if you're interested. > > Starting August 31, O'Reilly is offering a free online course Processing > and Arduino in Tandem in partnership with creativeLIVE. Space is > limited, so register now. > http://post.oreilly.com/rd/9z1zieup92r2mop13cjg2n5ontmieqpio7mmupac6ro > > > O'Reilly webcasts happening soon on the following topics: > > -Programming Beyond Relational Features in SQL Server 2008, presented by > Leonard Lobel on Aug 17 @ 10am PT > http://post.oreilly.com/rd/9z1zve5tqhc8h6du39f6plfg2jtqmjvhpgp4thgjgvo > > -Best Practices for Upgrading and Migrating to SharePoint 2010, > presented by Joel Oleson and Dux Raymond Sy on Aug 20 @ 10am PT > http://post.oreilly.com/rd/9z1zflgb7d4kq8ukfa72vgqguhcl1sda371vg0ep7s0 > > -Asynchronous architectures with the CouchDB _changes feed, presented by > Jan Lehnardt on August 25 @ 10am PT > http://post.oreilly.com/rd/9z1zh87t20ad1a74n22slpda40pl1aa5jj0khv2kbjg > > -Self-Service Business Intelligence with Microsoft PowerPivot, presented > by Andrew J Brust Aug 26 @ 10am PT > http://post.oreilly.com/rd/9z1zk9nqpmv9t9rp3et4l146h4j4f2fo0rhsei9pi68 > > Check out our Webcast page for on-demand videos of past webcasts and > more upcoming live events. > http://post.oreilly.com/rd/9z1zp0290128nh91bjjamfqkdmu56q37ehj03tsdisg > > > Thanks, > > --Marsee Henon > > --------------------------------------------------------------------- > User Group Discounts > --------------------------------------------------------------------- > > Get 40% off books from O'Reilly, Microsoft Press, No Starch, Paraglyph, > PC Publishing, Pragmatic Bookshelf, Rocky Nook, SitePoint, or YoungJin > books and 50% off ebooks you purchase directly from O'Reilly. Just use > code DSUG when ordering online or by phone 800-998-9938. > http://post.oreilly.com/rd/9z1zl1a5eol0bvt8qnv5iuo5pib9a4tsfr2c9ckct60 > > Thinking about attending an O'Reilly Conference? Email > usergroups at oreilly.com for the user group discount code. You can see > what's coming up here: > http://post.oreilly.com/rd/9z1zg47a5ivalqupph4ros4pr0rd0vi2rlrbcpsuq6g. > > --------------------------------------------------------------------- > New Releases > --------------------------------------------------------------------- > Learning Rails: Live Edition > http://post.oreilly.com/rd/9z1za29hjk1j8imil4v8clle0qp4rjr1o4tfq2400r8 > > Cooking for Geeks > http://post.oreilly.com/rd/9z1z5fn4oq8lahnk1mjmh9ue3gjfe8s2t7u5sda9rho > > Being Geek > http://post.oreilly.com/rd/9z1zs02jcibe6hl5o7nu9qhsnk2i8ujqph1bbtmc3ig > > Getting the Most out of Google Apps for Business > http://post.oreilly.com/rd/9z1zh4h9g36lvppe1m219clert89tm74vagcigjdkg0 > > Test-Driven Database Development > http://post.oreilly.com/rd/9z1zb1vkdbu36b6aurl06llb4fmtt46bj88uei5ltgo > > Practical Python Programming: Callbacks > http://post.oreilly.com/rd/9z1z9ik2t2ap3dugohkprbvl7asnpkp794ho4mbdbs0 > > Automated Infrastructure is on the Menu with Chef > http://post.oreilly.com/rd/9z1zn5i2bnmh609tuf74qa91ad197ktemtktbdme1e8 > > Kindle: The Mini Missing Manual > http://post.oreilly.com/rd/9z1zokelilt42961l1el68acf0j3hpeen1fcm3nj1c0 > > Great R: Level 1 > http://post.oreilly.com/rd/9z1zf3mkjqusq61mnor467k2t380emaheh490cms350 > > Building a NoSQL Data Cloud > http://post.oreilly.com/rd/9z1z9ict1j4g70u7rqmndtf2cd19t2ct2o6isjthf9g > > Map Scripting 101 (No Starch) > http://post.oreilly.com/rd/9z1z5pbd7kuiajbt2tiki9oh7c5csb5q07l1dpofmd8 > > Observing and Optimizing your Application with DTrace > http://post.oreilly.com/rd/9z1z6i2eh2db6rvtq44qchjp551k3gpvlbrsjss774g > > Scalable Internet Architectures > http://post.oreilly.com/rd/9z1z2d21upg1s206qs9jjnujh9acfc2bo3aimea5t7o > > The Productive Programmer > http://post.oreilly.com/rd/9z1z34fdus769i2a1ae7t9krhigto630nc7f987dl2g > > Introduction to Django > http://post.oreilly.com/rd/9z1z5tkbo6knuba9crget13v1skdohlrlda2807qk8o > > Cooking with jQuery > http://post.oreilly.com/rd/9z1zrmk4pko4ublidov8lqif1i0mg1s0qrseon0pa1g > > Django Deployment Workshop > http://post.oreilly.com/rd/9z1zut6csh2k3ihsl9vtr30b5f1f8f166if9tok1u6o > > Hands-on Cassandra > http://post.oreilly.com/rd/9z1zj63rmtqra4ubc27nk9ro7sl6jq2gbgt2e6qb1ng > > Mobile Web High Performance > http://post.oreilly.com/rd/9z1zc7non54ra67ofu4n3rr8e0na6v1jfm6q1gmc7ig > > Windows Server 2008 Remote Desktop Services Resource Kit: > Rough Cuts Version (Microsoft Press) > http://post.oreilly.com/rd/9z1z68oi5lj9ilpkhsvg9h4qf6aaftgkl3gvs6uqv80 > > Microsoft Exchange Server 2010 Inside Out: > Rough Cuts Version (Microsoft Press) > http://post.oreilly.com/rd/9z1zkrb5mvchkoj1s8obdofe0o5po5hpjlphmhaqbj0 > > Microsoft PowerPivot for Excel 2010: > Rough Cuts Version (Microsoft Press) > http://post.oreilly.com/rd/9z1zb531o7sqldcns2krsvmbbtdberjmnddrirqhb3g > > > > > > Until next time-- > > Marsee Henon > > Forward this announcement - > http://post.oreilly.com/f2f/9z1zl724megq64bcde6f5f2mqha0o0engd9on27otao > > ================================================================ > O'Reilly > 1005 Gravenstein Highway North > Sebastopol, CA 95472 > 800-998-9938 > http://post.oreilly.com/rd/9z1zblptn1brud579ofgnu7ndrmeal0nh29qc0i8sn8 > Follow us on Twitter at: > http://post.oreilly.com/rd/9z1zrfj9p2j4em2fk4tnj70mnkouesmd2c7uaigm268 > > You are receiving this email because you are a User Group > contact with O'Reilly Media. If you would like to stop > receiving these newsletters or announcements from O'Reilly, > send an email to usergroups at oreilly.com > ================================================================ > > From douglas at paradise.net.nz Wed Aug 18 18:03:11 2010 From: douglas at paradise.net.nz (Douglas Bagnall) Date: Thu, 19 Aug 2010 13:03:11 +1200 Subject: [Wellington-pm] grabaseat screen-scraping Message-ID: <4C6C82CF.5020203@paradise.net.nz> Years ago, back in the level 2 days, somebody did a talk about finding cheap air tickets (to Tauranga, of all places, if my memory is correct (or perhaps Gisborne -- that sort of direction)), by capturing periodic screenshots of grabaseat.co.nz, which in those days was all Flash, and performing OCR or something. The script would email them when the price was good. Maybe it was Martyn. Perhaps he had relatives in Tauranga. Or in-laws. Anyway I was reminded of it today when I saw this URL: http://flightbookings.airnewzealand.co.nz/vgrabview/en_NZ/getSpecials.do?json=y [from http://pastebin.com/ucUWfAJ6, by the author known as 'ReziN' on freenode, in #nzpug] If whoever it was is still working on that project, I hope this is useful. Douglas From lenz at gschwendtner.eu Wed Aug 18 18:19:59 2010 From: lenz at gschwendtner.eu (Lenz Gschwendtner) Date: Thu, 19 Aug 2010 13:19:59 +1200 Subject: [Wellington-pm] grabaseat screen-scraping In-Reply-To: <4C6C82CF.5020203@paradise.net.nz> References: <4C6C82CF.5020203@paradise.net.nz> Message-ID: <48EEC14E-336C-4950-8163-73779A29BC47@gschwendtner.eu> On 19/08/2010, at 1:03 PM, Douglas Bagnall wrote: > Years ago, back in the level 2 days, somebody did a talk about finding > cheap air tickets (to Tauranga, of all places, if my memory is correct > (or perhaps Gisborne -- that sort of direction)), by capturing > periodic screenshots of grabaseat.co.nz, which in those days was all > Flash, and performing OCR or something. The script would email them > when the price was good. that project won for pure awesomeness though, honestly, the approach was very geeky and solved the problem nicely :-) i guess we decided back then that it was not an official perlmongers talk tough. > Maybe it was Martyn. Perhaps he had relatives in Tauranga. Or > in-laws. > > Anyway I was reminded of it today when I saw this URL: > > http://flightbookings.airnewzealand.co.nz/vgrabview/en_NZ/getSpecials.do?json=y they offer rss feeds, twitter, and a collection of other feeds in the meantime. > [from http://pastebin.com/ucUWfAJ6, by the author known as 'ReziN' on > freenode, in #nzpug] > > If whoever it was is still working on that project, I hope this is > useful. a script that would do the booking right away would be nice though :-) should actually be quite straight forward using a bit of WWW:Mechanizer goodness. From douglas at paradise.net.nz Wed Aug 18 20:25:44 2010 From: douglas at paradise.net.nz (Douglas Bagnall) Date: Thu, 19 Aug 2010 15:25:44 +1200 Subject: [Wellington-pm] grabaseat screen-scraping In-Reply-To: <48EEC14E-336C-4950-8163-73779A29BC47@gschwendtner.eu> References: <4C6C82CF.5020203@paradise.net.nz> <48EEC14E-336C-4950-8163-73779A29BC47@gschwendtner.eu> Message-ID: <4C6CA438.9000900@paradise.net.nz> On 19/08/10 13:19, Lenz Gschwendtner wrote: > that project won for pure awesomeness though, honestly, the approach > was very geeky and solved the problem nicely :-) Yes. It perhaps also had the advantage that you would find yourself in Tauranga less often than you might with an overly efficient solution. >> [from http://pastebin.com/ucUWfAJ6, by the author known as 'ReziN' on >> freenode, in #nzpug] That turns out to be a Sam Collinson. Douglas From pfCd?Y*_Qbdb6 at perform.shyuser.com Fri Aug 20 11:35:45 2010 From: pfCd?Y*_Qbdb6 at perform.shyuser.com (pfCd?Y*_Qbdb6 at perform.shyuser.com) Date: Fri, 20 Aug 2010 14:35:45 -0400 Subject: [Wellington-pm] At the buzzer Message-ID: Grant submitted the best solution for an abbreviated moving average. Any monger like to comment why these expressions produce the same result? use List::Util qw(sum); $product1 = average_5d(@split_line); sub average_5d { my $sum = sum map { $_->[7] } @_[1..5]; return $sum / 5; } #Next the expression was bumped a day [2..6] to produced a #comparison between $product1 and $product1A . use List::Util qw(sum); $product1A = average_5d(@split_line); sub average_5d { my $sum = sum map { $_->[7] } @_[2..6]; return $sum / 5; } From grant at mclean.net.nz Sun Aug 22 01:59:12 2010 From: grant at mclean.net.nz (Grant McLean) Date: Sun, 22 Aug 2010 20:59:12 +1200 Subject: [Wellington-pm] At the buzzer In-Reply-To: References: Message-ID: <1282467552.23011.13.camel@localhost> On Fri, 2010-08-20 at 14:35 -0400, pfCd?Y*_Qbdb6 at perform.shyuser.com wrote: > Any monger like to comment why these expressions produce the > same result? > > use List::Util qw(sum); > > $product1 = average_5d(@split_line); > > sub average_5d { > my $sum = sum map { $_->[7] } @_[1..5]; > return $sum / 5; > } > > #Next the expression was bumped a day [2..6] to produced a > #comparison between $product1 and $product1A . > > use List::Util qw(sum); > > $product1A = average_5d(@split_line); > > sub average_5d { > my $sum = sum map { $_->[7] } @_[2..6]; > return $sum / 5; > } Without knowing what numbers are in @split_line, it's not possible to say. When you say those two routines return the same result, you're not putting them in the same script are you? If you put those two code snippets in the same script then the 'average_5d' subroutine would get defined twice and the second definition would replace the first one. This happens during the compilation phase, before any of the lines are executed, so when this line ran: $product1 = average_5d(@split_line); it would be executing the second version of average_5d, not the first. The solution would be to give the second subroutine a different name. Of course if I've guessed wrong we'd really need to see the data. Cheers Grant From grant at mclean.net.nz Sun Aug 22 02:30:27 2010 From: grant at mclean.net.nz (Grant McLean) Date: Sun, 22 Aug 2010 21:30:27 +1200 Subject: [Wellington-pm] Next Meeting Sept 14th Message-ID: <1282469427.23011.26.camel@localhost> Hi Mongers The next meeting of Wellington Perl Mongers will be on Tuesday the 14th of September: 6:00pm Tuesday 14 September 2010 Level 4, Catalyst House 150 Willis Street Wellington I'm keen to sign up a speaker or two so email me if you'd like to book a slot. If anyone has tried packaging their CPAN modules using Distzilla then Dan has expressed an interest in hearing about it and I'm sure I'm not the only other one who'd be interested. Any other topic suggestions are welcome too. Cheers Grant From pfCd?Y*_Qbdb6 at perform.shyuser.com Tue Aug 24 12:12:56 2010 From: pfCd?Y*_Qbdb6 at perform.shyuser.com (pfCd?Y*_Qbdb6 at perform.shyuser.com) Date: Tue, 24 Aug 2010 15:12:56 -0400 Subject: [Wellington-pm] At the buzzer In-Reply-To: <1282467552.23011.13.camel@localhost> References: <1282467552.23011.13.camel@localhost> Message-ID: Must say that works many times better. On 8/22/2010 4:59 AM, Grant McLean wrote: > On Fri, 2010-08-20 at 14:35 -0400, pfCd?Y*_Qbdb6 at perform.shyuser.com > wrote: >> Any monger like to comment why these expressions produce the >> same result? >> >> use List::Util qw(sum); >> >> $product1 = average_5d(@split_line); >> >> sub average_5d { >> my $sum = sum map { $_->[7] } @_[1..5]; >> return $sum / 5; >> } >> >> #Next the expression was bumped a day [2..6] to produced a >> #comparison between $product1 and $product1A . >> >> use List::Util qw(sum); >> >> $product1A = average_5d(@split_line); >> >> sub average_5d { >> my $sum = sum map { $_->[7] } @_[2..6]; >> return $sum / 5; >> } > > Without knowing what numbers are in @split_line, it's not possible to > say. > > When you say those two routines return the same result, you're not > putting them in the same script are you? If you put those two code > snippets in the same script then the 'average_5d' subroutine would get > defined twice and the second definition would replace the first one. > This happens during the compilation phase, before any of the lines are > executed, so when this line ran: > > $product1 = average_5d(@split_line); > > it would be executing the second version of average_5d, not the first. > > The solution would be to give the second subroutine a different name. > > Of course if I've guessed wrong we'd really need to see the data. > > Cheers > Grant > > > _______________________________________________ > Wellington-pm mailing list > Wellington-pm at pm.org > http://mail.pm.org/mailman/listinfo/wellington-pm > From uriel at baboonsoftware.com Fri Aug 27 10:44:35 2010 From: uriel at baboonsoftware.com (Uriel Lizama) Date: Fri, 27 Aug 2010 12:44:35 -0500 Subject: [Wellington-pm] Tips about Wellington Message-ID: <4C77F983.3090404@baboonsoftware.com> Hello fellow Perl Mongers, I'm closing down to my trip to New Zealand, just a couple of months away from the big day, and I'm finalizing all the details, and I was hoping you could give me some tips in a couple of things: 1. I'll be renting a small flat to stay while I'm there with the family, but I would like to know which are the better areas of Wellington so I look for something in the right area. 2. How is public transportation in the city, would I need to consider renting a car to move around? Thank you, -- Uriel Lizama Perl Developer http://baboonsoftware.com/ Intelligent and Creative Programming From andrew at morphoss.com Fri Aug 27 16:56:30 2010 From: andrew at morphoss.com (Andrew McMillan) Date: Sat, 28 Aug 2010 11:56:30 +1200 Subject: [Wellington-pm] Tips about Wellington In-Reply-To: <4C77F983.3090404@baboonsoftware.com> References: <4C77F983.3090404@baboonsoftware.com> Message-ID: <1282953390.3487.5997.camel@happy.home.mcmillan.net.nz> On Fri, 2010-08-27 at 12:44 -0500, Uriel Lizama wrote: > Hello fellow Perl Mongers, > > I'm closing down to my trip to New Zealand, just a couple of months away > from the big day, and I'm finalizing all the details, and I was hoping > you could give me some tips in a couple of things: > > 1. I'll be renting a small flat to stay while I'm there with the family, > but I would like to know which are the better areas of Wellington so I > look for something in the right area. Hi Uriel, Anywhere will be safe, but for short-term furnished rental you may have more limited choices, and probably they will be mostly fairly close in. Check the location on a map, if you're in doubt about distance from CBD. The CBD is fairly flat, but everything gets steep pretty quickly outside that, so walking around is good in the centre, but further out you can use up a lot of energy and will want to hop on a bus. Further still and you will definitely want to have a car, to do anything at all. There is nowhere in the Wellington region where I would be concerned for my personal safety. I've lived here for thirty-three years and have never had any friend tell me they were pick-pocketed or mugged, or even hear of it happening to "a friend of a friend". > 2. How is public transportation in the city, would I need to consider > renting a car to move around? Public transport in Wellington is OK-ish, but if you want to get out and see the countryside at all you'll want a car, and New Zealand is much more about "countryside" than "big city sights". You're staying three months so I would look at buying a car second-hand and selling it cheaply at the end, which is likely to be a big saving. I think that much of the tourism you would want to do in the region (indeed: the whole country) you would want a car. My eldest son (now 12) and I thoroughly enjoyed ourselves in Mexico when I went there for DebConf6 at Oaxtepec, and afterwards in Oaxaca and Mexico City. Feel free to e-mail me if you have any specific questions about whether something might be suitable for how many people, etc. I might also be able to recommend some accommodation in Auckland, depending on timing. Regards, Andrew McMillan. -- ------------------------------------------------------------------------ andrew (AT) morphoss (DOT) com +64(272)DEBIAN You don't become a failure until you're satisfied with being one. ------------------------------------------------------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part URL: From pfCd?Y*_Qbdb6 at perform.shyuser.com Fri Aug 27 18:52:03 2010 From: pfCd?Y*_Qbdb6 at perform.shyuser.com (pfCd?Y*_Qbdb6 at perform.shyuser.com) Date: Fri, 27 Aug 2010 21:52:03 -0400 Subject: [Wellington-pm] Tips about Wellington In-Reply-To: <1282953390.3487.5997.camel@happy.home.mcmillan.net.nz> References: <4C77F983.3090404@baboonsoftware.com> <1282953390.3487.5997.camel@happy.home.mcmillan.net.nz> Message-ID: Hungry for wheels? Try Trade Me Motors for your pedal-to-the-metal toad hall runner or beach buggy. A new listing from internet traffic specialists Nielsen-Netratings puts online trading website Trade Me Motors -- the auction/retail shop within New Zealand's favourite eBay clone -- ten times ahead of its nearest competitor in terms of unique visitors. The niche website received over 255,000 unique visitors between 10-16 October, more than ten times next best autotrader.co.nz, with just over 22,000. > My eldest son (now 12) and I thoroughly enjoyed ourselves in Mexico when > I went there for DebConf6 at Oaxtepec, and afterwards in Oaxaca and > Mexico City. From grant at mclean.net.nz Tue Aug 31 15:39:19 2010 From: grant at mclean.net.nz (Grant McLean) Date: Wed, 01 Sep 2010 10:39:19 +1200 Subject: [Wellington-pm] Next Meeting Sept 14th Message-ID: <1283294359.4235.11.camel@putnam.wgtn.cat-it.co.nz> Hi Mongers The next meeting is still 2 weeks away, so that gives you plenty of time to prepare a talk - go on you know you want to :-) 6:00pm Tuesday 14 September 2010 Level 4, Catalyst House 150 Willis Street Wellington I'm going to do a talk on IOC (Inversion of Control) and Dependency Injection. That leaves at least one talk slot still to be filled. Email me if you'd like to book a slot. Cheers Grant _______________________________________________ Wellington-pm mailing list Wellington-pm at pm.org http://mail.pm.org/mailman/listinfo/wellington-pm From olly at survex.com Tue Aug 31 15:58:32 2010 From: olly at survex.com (Olly Betts) Date: Tue, 31 Aug 2010 23:58:32 +0100 Subject: [Wellington-pm] Next Meeting Sept 14th In-Reply-To: <1283294359.4235.11.camel@putnam.wgtn.cat-it.co.nz> References: <1283294359.4235.11.camel@putnam.wgtn.cat-it.co.nz> Message-ID: <20100831225832.GL16221@survex.com> On Wed, Sep 01, 2010 at 10:39:19AM +1200, Grant McLean wrote: > That leaves at least one talk slot still to be filled. Email me if > you'd like to book a slot. I can talk about "Modelling you data in Xapian". Cheers, Olly From grant at mclean.net.nz Tue Aug 31 16:03:30 2010 From: grant at mclean.net.nz (Grant McLean) Date: Wed, 01 Sep 2010 11:03:30 +1200 Subject: [Wellington-pm] Next Meeting Sept 14th In-Reply-To: <20100831225832.GL16221@survex.com> References: <1283294359.4235.11.camel@putnam.wgtn.cat-it.co.nz> <20100831225832.GL16221@survex.com> Message-ID: <1283295810.4235.12.camel@putnam.wgtn.cat-it.co.nz> On Tue, 2010-08-31 at 23:58 +0100, Olly Betts wrote: > On Wed, Sep 01, 2010 at 10:39:19AM +1200, Grant McLean wrote: > > That leaves at least one talk slot still to be filled. Email me if > > you'd like to book a slot. > > I can talk about "Modelling you data in Xapian". Awesome! Consider yourself booked :-) Cheers Grant