From jonathan at leto.net Tue Nov 1 10:42:30 2011 From: jonathan at leto.net (Jonathan "Duke" Leto) Date: Tue, 1 Nov 2011 10:42:30 -0700 Subject: [Pdx-pm] Fwd: Google Code-in - urgent assistance required In-Reply-To: <201110302254.44110.enobacon@gmail.com> References: <201110302254.44110.enobacon@gmail.com> Message-ID: Howdy, Parrot Foundation is also ramping up for GCI, if you would like to help us come up with tasks, please add them here: https://github.com/parrot/parrot/wiki/Google-Code-In-Task-Ideas Duke On Sun, Oct 30, 2011 at 10:54 PM, The Dread Parrot wrote: > > > ---------- ?Forwarded Message: ?---------- > > Subject: Google Code-in - urgent assistance required > Date: Sunday 30 October 2011 18:16 > From: Paul Johnson > To: module-authors at perl.org > > [ See this post in glorious HTML at > http://blogs.perl.org/users/paul_johnson/2011/10/more-about-gci-2011.ht > ml ] > > The Google Code-in 2011 (GCI - http://wiki.enlightenedperl.org/gci2011) > will be starting shortly. ?This is the programme under which students > aged between 13 and 17 years are encouraged to get involved in open > source projects. ?The Perl Foundation would like Perl to be a part of > this programme, bringing both short and long-term benefits to Perl and > the students alike. > > Many of you will have seen my previous post > (http://blogs.perl.org/users/paul_johnson/2011/10/gci-2011.html) asking > the Perl community for help in creating tasks for students. ?A few of > you have subsequently added tasks to the ideas page > (http://wiki.enlightenedperl.org/gci2011/gci2011/ideas). ?For this we > are extremely grateful. ?Some of you may well be planning to add some > tasks. ?We'll also be very grateful for these tasks. > > It's almost time to submit our application. ?But for our application to > be successful we really need to add more tasks. ?So I'm renewing my > appeal for your help. > > We need help from all sorts of people. ?From developers, from > ?designers, from technical writers, from managers, from marketers, from > ?QA people and testers, from architects, from trainers, from user > ?interface specialists and from anyone who can speak more than one > ?language. ?And if you're reading this and don't fit into any of those > ?categories then you undoubtedly have other talents and we probably > ?need you even more. > > We need you to visit the ideas page > (http://wiki.enlightenedperl.org/gci2011/gci2011/ideas) and read about > the sort of tasks we need. ?Then create a login and add a task. ?If you > can't or don't want to create a login, please mail your task to me at > paul at pjcj.net > > Here are some suggestions for tasks: > > ?- Develop a new feature. > ?- Port to a new operating system. > ?- Fix a bug. ?(Go and check your RT queue.) > ?- Add tests for a feature. > ?- Add tests to improve coverage. ?(Take a look at cpancover > ? http://pjcj.sytes.net/cpancover/ ) > ?- Add to or improve documentation. > ?- Write a tutorial. > ?- Make a tutorial video. > ?- Make a promotional video. > ?- Add internationalisation (I18N) to a module. > ?- Translate documentation, tutorials or web sites. > ?- Investigate API changes. > ?- Research new ideas. algorithms or libraries. > ?- Compare and contrast modules. > > But feel free to let your imagination run wild. ?Any task that a young > student could perform that would be beneficial to the project is fair > game. > > In addition, if you really cannot think of a task to add, but you would > be willing to act as a mentor please add your name to the ideas page > (http://wiki.enlightenedperl.org/gci2011/gci2011/ideas) and note any > areas in which you would be willing to mentor. ?In particular we are in > need of mentors who would be able to assist with translation tasks, so > if you speak more than one language please add your name and note which > languages you speak. ?We also need mentors who would be happy to work > with students on bugs in modules where the author is unable to do so. > But we're very happy to accept all volunteers. ?So please either add a > task or sign up as a mentor. ?(Or both.) > > But this is getting very urgent. ?Our application needs to be on > ?Tuesday so please don't delay and sign up today! > > Thank you very much for your assistance. ?I trust that with your help > this year's GCI will be even more successful than last year's. > _______________________________________________ > Pdx-pm-list mailing list > Pdx-pm-list at pm.org > http://mail.pm.org/mailman/listinfo/pdx-pm-list > -- Jonathan "Duke" Leto Leto Labs LLC 209.691.DUKE // http://labs.leto.net NOTE: Personal email is only checked twice a day at 10am/2pm PST, please call/text for time-sensitive matters. From enobacon at gmail.com Thu Nov 3 02:25:11 2011 From: enobacon at gmail.com (Seven till Seven) Date: Thu, 3 Nov 2011 02:25:11 -0700 Subject: [Pdx-pm] DCI: A new way to OOP -- November meeting next week Message-ID: <201111030225.11982.enobacon@gmail.com> Thu. November 10th, 6:53pm at FreeGeek ? 1731 SE 10th Ave. DCI: A new way to OOP. speaker: Chad 'Exodist' Granum The DCI concept was created by Trygve Reenskaug, (inventor of MVC) and James Coplien. DCI Stands for Data, Context, Interactions. It was created to solve the problem of unpredictable emergent behavior in networks of interacting objects. This problem shows itself in complex OOP projects, most commonly in projects with deep polymorphism. This is a problem that Procedural/Imperative Programming does not have. DCI does not replace OOP, instead it augments it with lessons learned from looking back at Procedural Programming. It defines a way to encapsulate use cases into a single place. This provides an advantage to the programmer by reducing the number of interactions that need to be tracked. Another advantage is the reduction of side-effects between contexts. Another way to look at it is that a DCI implementation is much more maintainable as a project matures. Changes to requirements and additional features cause clean OOP project to degrade into spaghetti. DCI on the other hand maintains code clarity under changing requirements. You will Learn: * How to think in DCI * How the DCI cpan package helps you write DCI * That you may already write things in a form of DCI * How a DCI implementation compares to an OOP implementation (in a generic task) As usual, the meeting will be followed by social hour at the Lucky Lab. -- http://pdx.pm.org From kellert at ohsu.edu Fri Nov 4 15:34:26 2011 From: kellert at ohsu.edu (Tom Keller) Date: Fri, 4 Nov 2011 15:34:26 -0700 Subject: [Pdx-pm] common elements in two lists Message-ID: <481BC5A1-18DB-456B-B5B4-739A8F8739F0@ohsu.edu> Greetings, I have two very long lists of names. They have slightly different conventions for naming the same thing, so I devised a regex to compare the two lists. I need to extract the names common to both. (Acknowledgement: "Effective Perl Programming, 1st ed.") But it is taking an ungodly amount of time, since names1 contains 46227 names. names2 contains 5726 names. Here's the code: ######## my @names1 = get_names($file1); my @names2 = get_names($file2); #say join(", ", @names1); my @out = map { $_ =~ m/\w+[-_]*(\w*[-_]*\d+[a-z]*).*/ } @names2; my @index = grep { my $c = $_; if ( $c > $#names1 or # always false ( grep { $names1[$c] =~ m/$_/ } @out ) > 0) { 1; ## save } else { 0; ## skip } } 0 .. $#names1; my @common = map { $names1[$_] } @index; ######## Is there a faster/better way to do this? thanks, Tom MMI DNA Services Core Facility 503-494-2442 kellert at ohsu.edu Office: 6588 RJH (CROET/BasicScience) OHSU Shared Resources -------------- next part -------------- An HTML attachment was scrubbed... URL: From kris at bosland.com Fri Nov 4 15:39:28 2011 From: kris at bosland.com (Kris Bosland) Date: Fri, 4 Nov 2011 15:39:28 -0700 Subject: [Pdx-pm] common elements in two lists In-Reply-To: <481BC5A1-18DB-456B-B5B4-739A8F8739F0@ohsu.edu> References: <481BC5A1-18DB-456B-B5B4-739A8F8739F0@ohsu.edu> Message-ID: I would suggest smashing the strings into classes and then you only have to make comparisons within the classes. For example, you could find the Soundex(tm) code of each name. I don't know the details of your naming conventions so you would need to figure out the algorithm to get all the possible matches into one class - false positives are fine (a larger class but still small compared to your bigger set) but you don't want false negatives (putting things in different classes from each other). My $0.002 -Kris 2011/11/4 Tom Keller > Greetings, > I have two very long lists of names. They have slightly different > conventions for naming the same thing, so I devised a regex to compare the > two lists. I need to extract the names common to both. (Acknowledgement: > "Effective Perl Programming, 1st ed.") > But it is taking an ungodly amount of time, since > names1 contains 46227 names. > names2 contains 5726 names. > > Here's the code: > ######## > my @names1 = get_names($file1); > my @names2 = get_names($file2); > #say join(", ", @names1); > > my @out = map { $_ =~ m/\w+[-_]*(\w*[-_]*\d+[a-z]*).*/ } @names2; > my @index = grep { > my $c = $_; > if ( $c > $#names1 or # always false > ( grep { $names1[$c] =~ m/$_/ } @out ) > 0) { > 1; ## save > } else { > 0; ## skip > } > } 0 .. $#names1; > > my @common = map { $names1[$_] } @index; > ######## > > Is there a faster/better way to do this? > > thanks, > Tom > MMI DNA Services Core Facility > 503-494-2442 > kellert at ohsu.edu > Office: 6588 RJH (CROET/BasicScience) > > OHSU Shared Resources > > > > > > > > _______________________________________________ > Pdx-pm-list mailing list > Pdx-pm-list at pm.org > http://mail.pm.org/mailman/listinfo/pdx-pm-list > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joshua at keroes.com Fri Nov 4 15:41:12 2011 From: joshua at keroes.com (Joshua Keroes) Date: Fri, 4 Nov 2011 15:41:12 -0700 Subject: [Pdx-pm] common elements in two lists In-Reply-To: <481BC5A1-18DB-456B-B5B4-739A8F8739F0@ohsu.edu> References: <481BC5A1-18DB-456B-B5B4-739A8F8739F0@ohsu.edu> Message-ID: Well, grep is always going to check every single item in the list, so if you can avoid that, you'll can save time. Out of curiosity, have you tried out or benchmarked against something like List::Compare's get_intersection()? -Joshua 2011/11/4 Tom Keller > Greetings, > I have two very long lists of names. They have slightly different > conventions for naming the same thing, so I devised a regex to compare the > two lists. I need to extract the names common to both. (Acknowledgement: > "Effective Perl Programming, 1st ed.") > But it is taking an ungodly amount of time, since > names1 contains 46227 names. > names2 contains 5726 names. > > Here's the code: > ######## > my @names1 = get_names($file1); > my @names2 = get_names($file2); > #say join(", ", @names1); > > my @out = map { $_ =~ m/\w+[-_]*(\w*[-_]*\d+[a-z]*).*/ } @names2; > my @index = grep { > my $c = $_; > if ( $c > $#names1 or # always false > ( grep { $names1[$c] =~ m/$_/ } @out ) > 0) { > 1; ## save > } else { > 0; ## skip > } > } 0 .. $#names1; > > my @common = map { $names1[$_] } @index; > ######## > > Is there a faster/better way to do this? > > thanks, > Tom > MMI DNA Services Core Facility > 503-494-2442 > kellert at ohsu.edu > Office: 6588 RJH (CROET/BasicScience) > > OHSU Shared Resources > > > > > > > > _______________________________________________ > Pdx-pm-list mailing list > Pdx-pm-list at pm.org > http://mail.pm.org/mailman/listinfo/pdx-pm-list > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joshua at keroes.com Fri Nov 4 15:43:25 2011 From: joshua at keroes.com (Joshua Keroes) Date: Fri, 4 Nov 2011 15:43:25 -0700 Subject: [Pdx-pm] common elements in two lists In-Reply-To: References: <481BC5A1-18DB-456B-B5B4-739A8F8739F0@ohsu.edu> Message-ID: A few more libraries: http://search.cpan.org/~turugina/Set-Intersection-0.02/lib/Set/Intersection.pm http://search.cpan.org/~duncand/Set-Relation-0.12.7/lib/Set/Relation.pm -Joshua On Fri, Nov 4, 2011 at 3:41 PM, Joshua Keroes wrote: > Well, grep is always going to check every single item in the list, so if > you can avoid that, you'll can save time. > > Out of curiosity, have you tried out or benchmarked against something like > List::Compare's get_intersection()? > > -Joshua > > 2011/11/4 Tom Keller > >> Greetings, >> I have two very long lists of names. They have slightly different >> conventions for naming the same thing, so I devised a regex to compare the >> two lists. I need to extract the names common to both. (Acknowledgement: >> "Effective Perl Programming, 1st ed.") >> But it is taking an ungodly amount of time, since >> names1 contains 46227 names. >> names2 contains 5726 names. >> >> Here's the code: >> ######## >> my @names1 = get_names($file1); >> my @names2 = get_names($file2); >> #say join(", ", @names1); >> >> my @out = map { $_ =~ m/\w+[-_]*(\w*[-_]*\d+[a-z]*).*/ } @names2; >> my @index = grep { >> my $c = $_; >> if ( $c > $#names1 or # always false >> ( grep { $names1[$c] =~ m/$_/ } @out ) > 0) { >> 1; ## save >> } else { >> 0; ## skip >> } >> } 0 .. $#names1; >> >> my @common = map { $names1[$_] } @index; >> ######## >> >> Is there a faster/better way to do this? >> >> thanks, >> Tom >> MMI DNA Services Core Facility >> 503-494-2442 >> kellert at ohsu.edu >> Office: 6588 RJH (CROET/BasicScience) >> >> OHSU Shared Resources >> >> >> >> >> >> >> >> _______________________________________________ >> Pdx-pm-list mailing list >> Pdx-pm-list at pm.org >> http://mail.pm.org/mailman/listinfo/pdx-pm-list >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kellert at ohsu.edu Fri Nov 4 16:12:02 2011 From: kellert at ohsu.edu (Tom Keller) Date: Fri, 4 Nov 2011 16:12:02 -0700 Subject: [Pdx-pm] common elements in two lists In-Reply-To: References: <481BC5A1-18DB-456B-B5B4-739A8F8739F0@ohsu.edu> Message-ID: <01D6201F-C1C2-4FA5-8B2F-B0A841E97C01@ohsu.edu> Hi, Kris B had a really good idea for this problem, since the names identify items that do get repeated many times: names1 contains 46227 names. names2 contains 5726 names. class1 contains 7815 names. class2 contains 748 names. Much faster. Thanks! Tom MMI DNA Services Core Facility 503-494-2442 kellert at ohsu.edu Office: 6588 RJH (CROET/BasicScience) OHSU Shared Resources On Nov 4, 2011, at 3:39 PM, Kris Bosland wrote: I would suggest smashing the strings into classes and then you only have to make comparisons within the classes. For example, you could find the Soundex(tm) code of each name. I don't know the details of your naming conventions so you would need to figure out the algorithm to get all the possible matches into one class - false positives are fine (a larger class but still small compared to your bigger set) but you don't want false negatives (putting things in different classes from each other). My $0.002 -Kris 2011/11/4 Tom Keller > Greetings, I have two very long lists of names. They have slightly different conventions for naming the same thing, so I devised a regex to compare the two lists. I need to extract the names common to both. (Acknowledgement: "Effective Perl Programming, 1st ed.") But it is taking an ungodly amount of time, since names1 contains 46227 names. names2 contains 5726 names. Here's the code: ######## my @names1 = get_names($file1); my @names2 = get_names($file2); #say join(", ", @names1); my @out = map { $_ =~ m/\w+[-_]*(\w*[-_]*\d+[a-z]*).*/ } @names2; my @index = grep { my $c = $_; if ( $c > $#names1 or # always false ( grep { $names1[$c] =~ m/$_/ } @out ) > 0) { 1; ## save } else { 0; ## skip } } 0 .. $#names1; my @common = map { $names1[$_] } @index; ######## Is there a faster/better way to do this? thanks, Tom MMI DNA Services Core Facility 503-494-2442 kellert at ohsu.edu Office: 6588 RJH (CROET/BasicScience) OHSU Shared Resources _______________________________________________ Pdx-pm-list mailing list Pdx-pm-list at pm.org http://mail.pm.org/mailman/listinfo/pdx-pm-list -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.prew at gmail.com Fri Nov 4 16:33:09 2011 From: ben.prew at gmail.com (Ben Prew) Date: Fri, 4 Nov 2011 16:33:09 -0700 Subject: [Pdx-pm] common elements in two lists In-Reply-To: <01D6201F-C1C2-4FA5-8B2F-B0A841E97C01@ohsu.edu> References: <481BC5A1-18DB-456B-B5B4-739A8F8739F0@ohsu.edu> <01D6201F-C1C2-4FA5-8B2F-B0A841E97C01@ohsu.edu> Message-ID: Also, you're using 5.10+, right? If so, you can also use the ~~ operator: for my $name (@names2) { push @common, $name if ($name ~~ @out); } And, if you have that much overlap in names, use a hash: my %names1 = map { $_ => 1 } get_names($file1); my @names1 = keys %names1; my %names2 = map { $_ => 1 } get_names($file2); my @names2 = keys %names2; Finally, you'll probably want to quote any regular expression characters in the @out strings (the original code didn't, but it probably should) for my $name (@names2) { push @common, $name if ($name ~~ map { qr $_ } @out); } Note: all code should be assumed untested. 2011/11/4 Tom Keller : > Hi, > Kris B had a really good idea for this problem, since the names identify > items that do get repeated many times: > names1 contains 46227 names. > names2 contains 5726 names. > class1 contains 7815 names. > class2 contains 748 names. > Much faster. > Thanks! > Tom > MMI DNA Services Core Facility > 503-494-2442 > kellert at ohsu.edu > Office: 6588 RJH (CROET/BasicScience) > > OHSU Shared Resources > > > > > > > On Nov 4, 2011, at 3:39 PM, Kris Bosland wrote: > > I would suggest smashing the strings into classes and then you only have to > make comparisons within the classes. > For example, you could find the Soundex(tm) code of each name. > I don't know the details of your naming conventions so you would need to > figure out the algorithm to get all the possible matches into one class - > false positives are fine (a larger class but still small compared to your > bigger set) but you don't want false negatives (putting things in different > classes from each other). > My $0.002 > > -Kris > > 2011/11/4 Tom Keller >> >> Greetings, >> I have two very long lists of names. They have slightly different >> conventions for naming the same thing, so I devised a regex to compare the >> two lists. I need to extract the names common to both. (Acknowledgement: >> "Effective Perl Programming, 1st ed.") >> But it is taking an ungodly amount of time, since >> names1 contains 46227 names. >> names2 contains 5726 names. >> Here's the code: >> ######## >> my @names1 = get_names($file1); >> my @names2 = get_names($file2); >> #say join(", ", @names1); >> my @out = map { $_ =~ ?m/\w+[-_]*(\w*[-_]*\d+[a-z]*).*/ } @names2; >> my @index = grep { >> my $c = $_; >> if ( $c > $#names1 ?or # always false >> ( grep { $names1[$c] =~ m/$_/ } @out ) > 0) { >> 1; ?## save >> } else { >> 0; ?## skip >> } >> } 0 .. $#names1; >> my @common = map { $names1[$_] } @index; >> ######## >> Is there a faster/better way to do this? >> thanks, >> Tom >> MMI DNA Services Core Facility >> 503-494-2442 >> kellert at ohsu.edu >> Office: 6588 RJH (CROET/BasicScience) >> >> OHSU Shared Resources >> >> >> >> >> >> >> >> _______________________________________________ >> Pdx-pm-list mailing list >> Pdx-pm-list at pm.org >> http://mail.pm.org/mailman/listinfo/pdx-pm-list > > > > _______________________________________________ > Pdx-pm-list mailing list > Pdx-pm-list at pm.org > http://mail.pm.org/mailman/listinfo/pdx-pm-list > -- --Ben From schwern at pobox.com Fri Nov 4 18:17:58 2011 From: schwern at pobox.com (Michael G Schwern) Date: Fri, 04 Nov 2011 18:17:58 -0700 Subject: [Pdx-pm] common elements in two lists In-Reply-To: <481BC5A1-18DB-456B-B5B4-739A8F8739F0@ohsu.edu> References: <481BC5A1-18DB-456B-B5B4-739A8F8739F0@ohsu.edu> Message-ID: <4EB48EC6.7030103@pobox.com> On 2011.11.4 3:34 PM, Tom Keller wrote: > I have two very long lists of names. They have slightly different conventions > for naming the same thing, so I devised a regex to compare the two lists. I > need to extract the names common to both. (Acknowledgement: "Effective Perl > Programming, 1st ed.") > But it is taking an ungodly amount of time, since > names1 contains 46227 names. > names2 contains 5726 names. > > Here's the code: > ######## > my @names1 = get_names($file1); > my @names2 = get_names($file2); > #say join(", ", @names1); > > my @out = map { $_ =~ m/\w+[-_]*(\w*[-_]*\d+[a-z]*).*/ } @names2; > my @index = grep { > my $c = $_; > if ( $c > $#names1 or # always false > ( grep { $names1[$c] =~ m/$_/ } @out ) > 0) { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ That grep inside a grep makes it an O(N*M) algorithm (where N is the length of @names1 and M is @names2), so 46227 * 5726 == about 264 million iterations. First optimization would be to use first() from List::Util instead of grep. That will stop checking at its first match. However, it will on average only reduce the number of comparisons by half (so 130 million) and the cost of using first() instead of grep() might offset that. But it's cheap to find out. > 1; ## save > } else { > 0; ## skip > } > } 0 .. $#names1; > > my @common = map { $names1[$_] } @index; You'd be better off putting the normalized names into a hash and checking against that. my %names1 = map { _normalize($_) => 1 } get_names($file1); my %intersection; for my $name (@names2) { $intersection{$name}++ if $names1{ _normalize($name) }; } That requires N+M time, about 50 thousand, not N*M. OTOH it does use double the memory. -- 24. Must not tell any officer that I am smarter than they are, especially if it's true. -- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army http://skippyslist.com/list/ From tkil at scrye.com Fri Nov 4 20:22:45 2011 From: tkil at scrye.com (Anthony Foiani) Date: Fri, 04 Nov 2011 21:22:45 -0600 Subject: [Pdx-pm] common elements in two lists In-Reply-To: <481BC5A1-18DB-456B-B5B4-739A8F8739F0@ohsu.edu> (Tom Keller's message of "Fri, 4 Nov 2011 15:34:26 -0700") References: <481BC5A1-18DB-456B-B5B4-739A8F8739F0@ohsu.edu> Message-ID: Tom Keller writes: > They have slightly different conventions for naming the same thing If you could give examples (or even just explain what you mean by the above sentence), we can probably provide better help. * If the values are textually identical, then a hash is probably the best choice: my %in_names_1; @in_names_1{ @names1 } = ( 1 ) x @names1; my @common = grep { $in_names_1{$_} } @names2; * If each name can be filed into an unambiguous class, then consider using a hash-of-lists: my %names_in_class; foreach my $name ( @names1 ) { my $class = classify( $name ); push @{ $names_in_class{ $class } }, $name; } foreach my $name ( @names2 ) { my $class = classify( $name ); do_fancy_match( $name, $names_in_class{ $class } ); } (Where "do_fancy_match" does more work; since we've reduced the search space by filing names into classes, it might be ok to even do quadratic or worse within that particular function.) (Note that this is the algorithm needed for a SoundEx match, where the SoundEx is the category. Likewise, the "scrabble match" -- where the class is simply the sorted multiset of letters in the originial name -- is of this style as well.) Finally, if there's really no way to classify things, and every $name1 must be compared against every $name2, then just remember that 250M comparisons is really not that scary a number anymore. Not something you'd want to do to render a web page, but modern hardware ought to be able to hammer that out in a matter of minutes if not seconds. All you can do is make the comparison routine as efficient as possible, which might include preprocessing the two arrays. (Which is really just the pathologic case where every name has its own class; the role of the classes here is to allow for faster comparisons between words.) (A simple example here would be trying to match [sub-]domain names: "www.google.com" and "google.com" require at least a substring search, possibly two; but by preprocessing the data to reverse each name, then sorting the reversed names, you suddenly find that "moc.elgoog" and "moc.elgoog.www" are right next to each other.) HTH, t. From ben.hengst at gmail.com Fri Nov 4 20:41:59 2011 From: ben.hengst at gmail.com (benh) Date: Fri, 4 Nov 2011 20:41:59 -0700 Subject: [Pdx-pm] common elements in two lists In-Reply-To: References: <481BC5A1-18DB-456B-B5B4-739A8F8739F0@ohsu.edu> Message-ID: I'd have to do some benchmarking to get the numbers but it seems like you could just take the entries and key them with a count as a value then just take them based on the value being > 1. my %stash; foreach( get_names($file1) , map { $_ =~ m/\w+[-_]*(\w*[-_]*\d+[a-z]*).*/ } get_names($file2) ) { $stash{$_}++; } my @intersect = grep{$stash{$_} > 1} keys %stash; I'm not sure how much faster this would be rather then building two hashes and doing the comparison like this: my %file1 = map{ $_ => 1 } get_names($file1); my @intersect = grep{$file1{$_}} map { $_ =~ m/\w+[-_]*(\w*[-_]*\d+[a-z]*).*/ } get_names($file2); On Fri, Nov 4, 2011 at 20:22, Anthony Foiani wrote: > Tom Keller writes: > >> They have slightly different conventions for naming the same thing > > If you could give examples (or even just explain what you mean by the > above sentence), we can probably provide better help. > > * If the values are textually identical, then a hash is probably the > ?best choice: > > ? ?my %in_names_1; > ? ?@in_names_1{ @names1 } = ( 1 ) x @names1; > ? ?my @common = grep { $in_names_1{$_} } @names2; > > * If each name can be filed into an unambiguous class, then consider > ?using a hash-of-lists: > > ? ?my %names_in_class; > ? ?foreach my $name ( @names1 ) { > ? ? ? my $class = classify( $name ); > ? ? ? push @{ $names_in_class{ $class } }, $name; > ? ?} > ? ?foreach my $name ( @names2 ) { > ? ? ? my $class = classify( $name ); > ? ? ? do_fancy_match( $name, $names_in_class{ $class } ); > ? ?} > > ?(Where "do_fancy_match" does more work; since we've reduced the > ?search space by filing names into classes, it might be ok to even do > ?quadratic or worse within that particular function.) > > ?(Note that this is the algorithm needed for a SoundEx match, where > ?the SoundEx is the category. ?Likewise, the "scrabble match" -- > ?where the class is simply the sorted multiset of letters in the > ?originial name -- is of this style as well.) > > Finally, if there's really no way to classify things, and every $name1 > must be compared against every $name2, then just remember that 250M > comparisons is really not that scary a number anymore. ?Not something > you'd want to do to render a web page, but modern hardware ought to be > able to hammer that out in a matter of minutes if not seconds. > > All you can do is make the comparison routine as efficient as > possible, which might include preprocessing the two arrays. ?(Which is > really just the pathologic case where every name has its own class; > the role of the classes here is to allow for faster comparisons > between words.) > > (A simple example here would be trying to match [sub-]domain names: > "www.google.com" and "google.com" require at least a substring search, > possibly two; but by preprocessing the data to reverse each name, then > sorting the reversed names, you suddenly find that "moc.elgoog" and > "moc.elgoog.www" are right next to each other.) > > HTH, > t. > _______________________________________________ > Pdx-pm-list mailing list > Pdx-pm-list at pm.org > http://mail.pm.org/mailman/listinfo/pdx-pm-list > -- benh~ http://about.notbenh.info From enobacon at gmail.com Sat Nov 5 02:36:02 2011 From: enobacon at gmail.com (Eric Wilhelm) Date: Sat, 5 Nov 2011 02:36:02 -0700 Subject: [Pdx-pm] common elements in two lists In-Reply-To: <481BC5A1-18DB-456B-B5B4-739A8F8739F0@ohsu.edu> References: <481BC5A1-18DB-456B-B5B4-739A8F8739F0@ohsu.edu> Message-ID: <201111050236.02726.enobacon@gmail.com> # from Tom Keller # on Friday 04 November 2011 15:34: >my @out = map { $_ =~ ?m/\w+[-_]*(\w*[-_]*\d+[a-z]*).*/ } @names2; This regexp isn't anchored, so it might do surprising things sometimes. >( grep { $names1[$c] =~ m/$_/ } @out ) > 0) { This match isn't anchored either. Is that intentional, or does it even need to be regexp match vs just a literal? i.e. `eq` (or hash lookup as others have suggested.) If it is a literal rather than substring match, you should get a nice boost from the hash lookup. Otherwise you're stuck comparing N regexps to M strings . It depends on how the "slightly different conventions for naming the same thing" differ and if you can normalize both lists as Schwern suggested. Also note that '0 .. $#names1' is somewhat like the 'for(my $i = 0; $i++; $i < ...)' idiom in that you rarely really need to loop through indices and can typically just loop over values. my @common = grep {my $n = $_; first {$n =~ m/$_/} @out } @names; The exception would be if you really needed the @index list as a result. Also beware the memory limit if you go the hash route (and with your slurpy get_names() implementation. On very large lists, you may need them both sorted on disk to be able to page through. Or, iterate the filehandle of a big list with a small list in a hash if that does the trick. e.g. `for(<$fh1>) { chomp; print "$_\n" if $names2{$_}; }` --Eric -- The only thing that could save UNIX at this late date would be a new $30 shareware version that runs on an unexpanded Commodore 64. --Don Lancaster (1991) --------------------------------------------------- http://scratchcomputing.com --------------------------------------------------- From perl at aaroncrane.co.uk Sat Nov 5 06:07:11 2011 From: perl at aaroncrane.co.uk (Aaron Crane) Date: Sat, 5 Nov 2011 13:07:11 +0000 Subject: [Pdx-pm] common elements in two lists In-Reply-To: <4EB48EC6.7030103@pobox.com> References: <481BC5A1-18DB-456B-B5B4-739A8F8739F0@ohsu.edu> <4EB48EC6.7030103@pobox.com> Message-ID: Michael G Schwern wrote: > On 2011.11.4 3:34 PM, Tom Keller wrote: >> my @out = map { $_ =~ ?m/\w+[-_]*(\w*[-_]*\d+[a-z]*).*/ } @names2; >> my @index = grep { >> my $c = $_; >> if ( $c > $#names1 ?or # always false >> ( grep { $names1[$c] =~ m/$_/ } @out ) > 0) { > > That grep inside a grep makes it an O(N*M) algorithm (where N is the length of > @names1 and M is @names2), so 46227 * 5726 == about 264 million iterations. > > You'd be better off putting the normalized names into a hash and checking > against that. It sounds like normalising the names is probably the right thing in this situation. But if it weren't, there's another way to speed this up. The original code builds a list of fixed strings, and then selects the elements of @names1 that contain at least one of those fixed strings. It does that using grep inside grep; but another option would be to build a single regex to use in the outer grep: my @out = map { $_ =~ ?m/\w+[-_]*(\w*[-_]*\d+[a-z]*).*/ } @names2; my $regex = join '|', map { quotemeta } @out; $regex = qr/$regex/; my @common = grep { /$regex/ } @names1; Naively, that could be assumed to be O(N*M) in the same way as the double-grep solution ? and in Perl 5.8 and earlier, it is. (Though with a substantial reduction in the constant factors; it's probably considerably faster anyway.) However, starting from Perl 5.10, the regex engine uses an Aho-Corasick matcher for patterns (or subpatterns) consisting of fixed-string alternations: http://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_string_matching_algorithm The running time of the Aho-Corasick algorithm is linear in the length of the string being examined, independent of the number of alternatives, so it's an excellent choice for a situation like this if the number of fixed strings is arbitrarily large. For those using Perl 5.8, I have a CPAN module which implements a related algorithm: https://metacpan.org/module/Text::Match::FastAlternatives However, even under Perl 5.10 (and perhaps later; I should do some more timing tests), T::M::FA is faster than the internal regex engine. I assume that's partly because it needs to do less work, but in addition, the regex engine's running time seems to depend at least to some extent on the number of alternatives: http://aaroncrane.co.uk/2008/05/text_match_fastalternatives/ That said, the difference probably only matters if you have a gargantuan set of fixed strings, or if you're doing this sort of operation on millions of candidate strings (which was the situation I had when I wrote it). Also, that blog post is out of date; it says there's no Unicode support in TMFA, but recent versions do handle Unicode for the most part. And for that matter, I have an improved version of TMFA which is even faster still, and typically uses a quarter of the memory it used to. I really must get round to releasing that soon? -- Aaron Crane ** http://aaroncrane.co.uk/ From ben.hengst at gmail.com Mon Nov 7 11:10:56 2011 From: ben.hengst at gmail.com (benh) Date: Mon, 7 Nov 2011 11:10:56 -0800 Subject: [Pdx-pm] Fwd: UG News - Register Now: Mobile Design, Analyzing Social Networks, 5 Deadly Sins of SharePoint, Drupal for Designers and more In-Reply-To: <1320690179.1859.0.382424@post.oreilly.com> References: <1320690179.1859.0.382424@post.oreilly.com> Message-ID: ---------- Forwarded message ---------- From: Marsee Henon & Jon Johns Date: Mon, Nov 7, 2011 at 10:22 Subject: UG News - Register Now: Mobile Design, Analyzing Social Networks, 5 Deadly Sins of SharePoint, Drupal for Designers and more To: ben.hengst at gmail.com ** View in browser . *Forward this announcement to your user group or a friend* [image: O'Reilly Webcasts] Meet experts online. Join us for these free, live webcasts. Attendance is limited, so register now. We'll send you a reminder before the webcast. And please feel free to *forward this invitation*to others. [image: Steven Hoober] Applying Patterns to Mobile Design Presented by *Steven Hoober*, author of *Designing Mobile Interfaces* [image: Add to iCal] *Tuesday, Nov 8, 2011 at 10:00 PT* [image: Last Chance to Register] This webcast covers the intent of mobile patterns, and how to use them correctly in your design. Designed to be especially helpful for those migrating from other platforms, such as desktop web design. [image: Maksim Tsvetovat] Analyzing Social Networks on Twitter Presented by *Maksim Tsvetovat*, author of *Social Network Analysis for Startups* [image: Add to iCal] *Wednesday, Nov 9, 2011 at 10:00 PT* [image: Register now] This course will cover: harvesting data from Twitter via search and streaming APIs, decomposing Tweets into constituent parts, fast-and-frugal content analysis of tweets, deriving and analyzing social network data found in tweets, and analyzing friends and followers. [image: Dux Raymond Sy] 5 Deadly Sins of SharePoint in The Enterprise Presented by *Dux Raymond Sy*, author of *SharePoint 2010 for Project Management, Second Edition* [image: Add to iCal] *Monday, Nov 14, 2011 at 1:00PM PT* [image: Register now] Join Dux Raymond Sy, Managing Partner of Innovative-e, as he discusses five common pitfalls in your organization's implementation of SharePoint and how to avoid them. [image: Dani Nordin] Drupal for Designers Talking to Clients about Drupal Presented by *Dani Nordin*, author of *Planning and Managing Drupal Projects* [image: Add to iCal] *Tuesday, Nov 15, 2011 at 10:00 PT* [image: Register now] In this webcast, Dani Nordin, author of the Drupal for Designers series, will walk you through the process of working with clients through the Drupal design process. [image: Dan Kusnetzky] When is virtual machine software the wrong choice? Presented by *Dan Kusnetzky*, author of *Virtualization: A Manager's Guide* [image: Add to iCal] *Tuesday, Nov 15, 2011 at 1:00 PT* [image: Register now] This webcast will review the model of virtualization described in Virtualization: A Manager's Guide and discuss different virtualization solutions for different IT problems. To learn more about O'Reilly Webcasts, and watch on-demand videos of previous webcasts, visit: *oreilly.com/webcasts* [image: Spreading the knowledge of innovators - oreilly.com] You are receiving this email because you are a User Group contact with O'Reilly Media. Forward this announcement. If you would like to stop receiving these newsletters or announcements from O'Reilly, send an email to *usergroups at oreilly.com* . O'Reilly Media, Inc. 1005 Gravenstein Highway North, Sebastopol, CA 95472 (707) 827-7000 -- benh~ http://about.notbenh.info -------------- next part -------------- An HTML attachment was scrubbed... URL: From kellert at ohsu.edu Mon Nov 7 16:40:53 2011 From: kellert at ohsu.edu (Tom Keller) Date: Mon, 7 Nov 2011 16:40:53 -0800 Subject: [Pdx-pm] common elements in two lists In-Reply-To: References: <481BC5A1-18DB-456B-B5B4-739A8F8739F0@ohsu.edu> <4EB48EC6.7030103@pobox.com> Message-ID: <265F59DA-DBEE-442F-851B-AC57256BB4FB@ohsu.edu> Thanks All, Using Benchmark against Aaron Crane's suggestion ### my $t0 = Benchmark->new; ## capture the relevant signifier from each name in the longer list of unique names my @out = map { $_ =~ m/\w+[-_]*(\w*[-_]*\d+[a-z]*).*/ } @class1; say "out contains ", scalar @out, " strings with \@class1 as input"; my $regex = join '|', map { quotemeta } @out; $regex = qr/$regex/; my @common = grep { /$regex/ } @class2; my $t1 = Benchmark->new; my $td = timediff( $t1,$t0 ); say "the code took: ",timestr($td); say "common contains ", scalar @common, " names."; ### test.pl Output to ./data/affy_oa_common_classnames1_aaroncrane.txt names1 contains 46227 names. names2 contains 5726 names. class1 contains 7815 names. class2 contains 748 names. out contains 7806 strings with @class1 as input the code took: 0 wallclock secs ( 0.03 usr + 0.00 sys = 0.03 CPU) common contains 748 names. VS My original index method grep_names.pl Output to ./data/affy_oa_common1.txt names1 contains 46227 names. names2 contains 5726 names. class1 contains 7815 names. class2 contains 748 names. out contains 7806 strings with @class1 as input the code took: 19 wallclock secs (18.42 usr + 0.22 sys = 18.64 CPU) index contains 748 matches. The results are identical, but a fantastic speed-up. thanks again, Tom MMI DNA Services Core Facility 503-494-2442 kellert at ohsu.edu Office: 6588 RJH (CROET/BasicScience) OHSU Shared Resources On Nov 5, 2011, at 6:07 AM, Aaron Crane wrote: > Michael G Schwern wrote: >> On 2011.11.4 3:34 PM, Tom Keller wrote: >>> my @out = map { $_ =~ m/\w+[-_]*(\w*[-_]*\d+[a-z]*).*/ } @names2; >>> my @index = grep { >>> my $c = $_; >>> if ( $c > $#names1 or # always false >>> ( grep { $names1[$c] =~ m/$_/ } @out ) > 0) { >> >> That grep inside a grep makes it an O(N*M) algorithm (where N is the length of >> @names1 and M is @names2), so 46227 * 5726 == about 264 million iterations. >> >> You'd be better off putting the normalized names into a hash and checking >> against that. > > It sounds like normalising the names is probably the right thing in > this situation. But if it weren't, there's another way to speed this > up. The original code builds a list of fixed strings, and then > selects the elements of @names1 that contain at least one of those > fixed strings. It does that using grep inside grep; but another > option would be to build a single regex to use in the outer grep: > > my @out = map { $_ =~ m/\w+[-_]*(\w*[-_]*\d+[a-z]*).*/ } @names2; > my $regex = join '|', map { quotemeta } @out; > $regex = qr/$regex/; > my @common = grep { /$regex/ } @names1; > > Naively, that could be assumed to be O(N*M) in the same way as the > double-grep solution ? and in Perl 5.8 and earlier, it is. (Though > with a substantial reduction in the constant factors; it's probably > considerably faster anyway.) However, starting from Perl 5.10, the > regex engine uses an Aho-Corasick matcher for patterns (or > subpatterns) consisting of fixed-string alternations: > > http://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_string_matching_algorithm > > The running time of the Aho-Corasick algorithm is linear in the length > of the string being examined, independent of the number of > alternatives, so it's an excellent choice for a situation like this if > the number of fixed strings is arbitrarily large. > > For those using Perl 5.8, I have a CPAN module which implements a > related algorithm: > > https://metacpan.org/module/Text::Match::FastAlternatives > > However, even under Perl 5.10 (and perhaps later; I should do some > more timing tests), T::M::FA is faster than the internal regex engine. > I assume that's partly because it needs to do less work, but in > addition, the regex engine's running time seems to depend at least to > some extent on the number of alternatives: > > http://aaroncrane.co.uk/2008/05/text_match_fastalternatives/ > > That said, the difference probably only matters if you have a > gargantuan set of fixed strings, or if you're doing this sort of > operation on millions of candidate strings (which was the situation I > had when I wrote it). > > Also, that blog post is out of date; it says there's no Unicode > support in TMFA, but recent versions do handle Unicode for the most > part. And for that matter, I have an improved version of TMFA which > is even faster still, and typically uses a quarter of the memory it > used to. I really must get round to releasing that soon? > > -- > Aaron Crane ** http://aaroncrane.co.uk/ > _______________________________________________ > Pdx-pm-list mailing list > Pdx-pm-list at pm.org > http://mail.pm.org/mailman/listinfo/pdx-pm-list From enobacon at gmail.com Wed Nov 9 11:01:55 2011 From: enobacon at gmail.com (Seven till Seven) Date: Wed, 9 Nov 2011 12:01:55 -0700 Subject: [Pdx-pm] meeting tomorrow night -- DCI: A new way to OOP Message-ID: <201111091101.55498.enobacon@gmail.com> Thu. November 10th, 6:53pm at FreeGeek ? 1731 SE 10th Ave. DCI: A new way to OOP. speaker: Chad 'Exodist' Granum The DCI concept was created by Trygve Reenskaug, (inventor of MVC) and James Coplien. DCI Stands for Data, Context, Interactions. It was created to solve the problem of unpredictable emergent behavior in networks of interacting objects. This problem shows itself in complex OOP projects, most commonly in projects with deep polymorphism. This is a problem that Procedural/Imperative Programming does not have. DCI does not replace OOP, instead it augments it with lessons learned from looking back at Procedural Programming. It defines a way to encapsulate use cases into a single place. This provides an advantage to the programmer by reducing the number of interactions that need to be tracked. Another advantage is the reduction of side-effects between contexts. Another way to look at it is that a DCI implementation is much more maintainable as a project matures. Changes to requirements and additional features cause clean OOP project to degrade into spaghetti. DCI on the other hand maintains code clarity under changing requirements. You will Learn: * How to think in DCI * How the DCI cpan package helps you write DCI * That you may already write things in a form of DCI * How a DCI implementation compares to an OOP implementation (in a generic task) As usual, the meeting will be followed by social hour at the Lucky Lab. -- http://pdx.pm.org From enobacon at gmail.com Thu Nov 10 14:40:36 2011 From: enobacon at gmail.com (Seven till Seven) Date: Thu, 10 Nov 2011 15:40:36 -0700 Subject: [Pdx-pm] meeting tonight -- DCI: A new way to OOP Message-ID: <201111101440.36804.enobacon@gmail.com> Thu. November 10th, 6:53pm at FreeGeek ? 1731 SE 10th Ave. DCI: A new way to OOP. speaker: Chad 'Exodist' Granum The DCI concept was created by Trygve Reenskaug, (inventor of MVC) and James Coplien. DCI Stands for Data, Context, Interactions. It was created to solve the problem of unpredictable emergent behavior in networks of interacting objects. This problem shows itself in complex OOP projects, most commonly in projects with deep polymorphism. This is a problem that Procedural/Imperative Programming does not have. DCI does not replace OOP, instead it augments it with lessons learned from looking back at Procedural Programming. It defines a way to encapsulate use cases into a single place. This provides an advantage to the programmer by reducing the number of interactions that need to be tracked. Another advantage is the reduction of side-effects between contexts. Another way to look at it is that a DCI implementation is much more maintainable as a project matures. Changes to requirements and additional features cause clean OOP project to degrade into spaghetti. DCI on the other hand maintains code clarity under changing requirements. You will Learn: * How to think in DCI * How the DCI cpan package helps you write DCI * That you may already write things in a form of DCI * How a DCI implementation compares to an OOP implementation (in a generic task) As usual, the meeting will be followed by social hour at the Lucky Lab. -- http://pdx.pm.org From exodist7 at gmail.com Thu Nov 10 22:34:45 2011 From: exodist7 at gmail.com (Chad Granum) Date: Thu, 10 Nov 2011 22:34:45 -0800 Subject: [Pdx-pm] [Follow-Up] DCI: A new way to OOP Message-ID: Since there seemed to be interested I figured I would send this out: DCI IRC channel: $dci on irc.perl.org My Slides: exodist.github.com/DCI Github project: github.com/exodist/DCI On Thu, Nov 10, 2011 at 2:40 PM, Seven till Seven wrote: > > ?Thu. November 10th, 6:53pm at FreeGeek ? 1731 SE 10th Ave. > > DCI: A new way to OOP. > > ?speaker: Chad 'Exodist' Granum > > > The DCI concept was created by Trygve Reenskaug, (inventor of MVC) and > James Coplien. > > ?DCI Stands for Data, Context, Interactions. It was created to solve the > problem of unpredictable emergent behavior in networks of interacting > objects. This problem shows itself in complex OOP projects, most > commonly in projects with deep polymorphism. This is a problem that > Procedural/Imperative Programming does not have. > > ?DCI does not replace OOP, instead it augments it with lessons learned > from looking back at Procedural Programming. It defines a way to > encapsulate use cases into a single place. This provides an advantage > to the programmer by reducing the number of interactions that need to > be tracked. Another advantage is the reduction of side-effects between > contexts. > > ?Another way to look at it is that a DCI implementation is much more > maintainable as a project matures. Changes to requirements and > additional features cause clean OOP project to degrade into spaghetti. > DCI on the other hand maintains code clarity under changing > requirements. > > You will Learn: > > ?* How to think in DCI > ?* How the DCI cpan package helps you write DCI > ?* That you may already write things in a form of DCI > ?* How a DCI implementation compares to an OOP implementation (in a > generic task) > > ?As usual, the meeting will be followed by social hour at the Lucky Lab. > -- > > ? ? ? ?http://pdx.pm.org > _______________________________________________ > Pdx-pm-list mailing list > Pdx-pm-list at pm.org > http://mail.pm.org/mailman/listinfo/pdx-pm-list From enobacon at gmail.com Tue Nov 15 09:44:09 2011 From: enobacon at gmail.com (The Dread Parrot) Date: Tue, 15 Nov 2011 10:44:09 -0700 Subject: [Pdx-pm] Fwd: [pdx-groups] Programming Language Group Message-ID: <201111150944.10287.enobacon@gmail.com> ---------- Forwarded Message: ---------- Subject: [pdx-groups] Programming Language Group Date: Monday 14 November 2011 00:12 From: Matt Youell Hey all. I started a new group which I'm calling the "Zissou Society for Programming Language Exploration". :) Following the example of the Dataviz group it meets whenever there are presentations and people interested in seeing them. I'm lining up presentations now and expect the first meeting sometime in the new year, possibly in February. In addition, please consider this a Call for Presentations: Any programming language is fine, but the more unique, thought provoking, or brain-shaking, the better. Join us! http://groups.google.com/group/pdxlang -- http://pdx.pm.org From ben.hengst at gmail.com Thu Nov 17 18:23:16 2011 From: ben.hengst at gmail.com (benh) Date: Thu, 17 Nov 2011 18:23:16 -0800 Subject: [Pdx-pm] Fwd: UG News: HTML5 Tips 'n' Tales for Holiday Shopping - Save 50% on Ebooks & Videos and 40% on Print Books In-Reply-To: <1321520471.6731.0.109679@post.oreilly.com> References: <1321520471.6731.0.109679@post.oreilly.com> Message-ID: ---------- Forwarded message ---------- From: Marsee Henon & Jon Johns Date: Thu, Nov 17, 2011 at 01:01 Subject: UG News: HTML5 Tips 'n' Tales for Holiday Shopping - Save 50% on Ebooks & Videos and 40% on Print Books To: ben.hengst+oreilly at gmail.com ** View in Browser . *Forward this announcement to your user group or a friend* . [image: O'Reilly Books and Videos] Ten Weeks of Gift Ideas *| Week 2* HTML5 Programming Save 50% on ebooks and videos and 40% on print books with code HDHTML5 All orders over $29.95 qualify for FREE SHIPPING within the US. [image: Head First HTML5 Programming] *Head First HTML5 Programming * Ebook: $27.99 $13.99 Print: $49.99 $29.99 [image: Buy Now] [image: HTML5: The Missing Manual] *HTML5: The Missing Manual * Ebook: $31.99 $15.99 Print: $39.99 $23.99 [image: Buy Now] [image: Programming HTML5 Applications] *Programming HTML5 Applications * Ebook: $19.99 $9.99 Print: $24.99 $14.99 [image: Buy Now] [image: Creating HTML5 Animations with Flash and Wallaby] *Creating HTML5 Animations with Flash and Wallaby * Ebook: $12.99 $6.49 Print: $19.99 $11.99 [image: Buy Now] [image: Making Isometric Social Real-Time Games with HTML5, CSS3, and JavaScript] *Making Isometric Social Real-Time Games * Ebook: $15.99 $7.99 Print: $19.99 $11.99 [image: Buy Now] [image: The HTML5 Sessions: The Best of OSCON 2011] *The HTML5 Sessions: The Best of OSCON 2011 * Video: $99.99 $49.99 [image: Buy Now] [image: HTML5 Cookbook] *HTML5 Cookbook * Ebook: $27.99 $13.99 Print: $34.99 $20.99 [image: Buy Now] [image: HTML5 Media] *HTML5 Media * Ebook: $12.99 $6.49 Print: $19.99 $11.99 [image: Buy Now] [image: HTML5 Geolocation] *HTML5 Geolocation * Ebook: $12.99 $6.49 Print: $19.99 $11.99 [image: Buy Now] [image: HTML5 & CSS3 For The Real World] *HTML5 & CSS3 For The Real World * Print: $39.95 $23.97 [image: Buy Now] [image: HTML5 Canvas] *HTML5 Canvas * Ebook: $31.99 $15.99 Print: $39.99 $23.99 [image: Buy Now] [image: HTML5 Step by Step] *HTML5 Step by Step * Ebook: $23.99 $11.99 Print: $34.99 $20.99 [image: Buy Now] [image: HTML5 and CSS3] *HTML5 and CSS3 * Print: $33.00 $19.80 [image: Buy Now] [image: HTML5 Mobile Web Development] *HTML5 Mobile Web Development * Video: $139.00 $69.49 [image: Buy Now] [image: HTML5: Up and Running] *HTML5: Up and Running * Ebook: $23.99 $11.99 Print: $29.99 $17.99 [image: Buy Now] [image: Native Video in HTML5] *Native Video in HTML5 * Video: $24.99 $12.49 [image: Buy Now] [image: Offline Mobile Web Applications in HTML5] *Offline Mobile Web Applications in HTML5 * Video: $24.99 $12.49 [image: Buy Now] Keep your eye on our *10 Weeks of Gift Ideas*? more tips 'n' tales for holiday shopping. Next week brings our friend Vandad who makes things see and talk. Share this deal: [image: Forward to a friend] *This offer is good through January 19, 2012.* Suri is pretty perfect. But she's hard to shop for. Suri's secret ambition is to be a successful app creator. Her dream? To build the Giddy-App?, a phone and tablet interface for horse trainers. Using her own proprietary technology, Suri's Giddy-App will guide even the edgiest equine into a fast, smooth trot. For years, she's run a blog and built quite a following. Her next move is to build a full-fledged, interactive web app that runs on all mobile platforms as well. But there is one dark cloud in Suri's sunny world: she doesn't know how to move from "just the web" into the exciting and diverse world of app development. Which is where you can help. You know that with a little HMTL5 knowledge, combined with some JavaScript, Suri can be publishing mobile apps in no time without having to learn languages like Objective-C or Cocoa. With the holidays coming up, you could treat her to a copy of *Head First HTML5 Programming* from O'Reilly. Pretty perfect? Absolutely. [image: oreilly.com] You are receiving this email because you are a User Group contact with O'Reilly Media. Forward this announcement. If you would like to stop receiving these newsletters or announcements from O'Reilly, send an email to marsee at oreilly.com. O'Reilly Media, Inc. 1005 Gravenstein Highway North, Sebastopol, CA 95472 (707) 827-7000 -- benh~ http://about.notbenh.info -------------- next part -------------- An HTML attachment was scrubbed... URL: From outgoing at SolutionsCreative.com Sat Nov 19 11:10:26 2011 From: outgoing at SolutionsCreative.com (Richard Fobes) Date: Sat, 19 Nov 2011 11:10:26 -0800 Subject: [Pdx-pm] What I learned from Eric about CPAN errors Message-ID: <4EC7FF22.5070104@SolutionsCreative.com> Awhile back Eric Wilhelm helped me solve a couple of CPAN-related problems I encountered while trying to update my CPAN Language::Dashrep module. He suggested that others on this list might be interested in knowing what I learned -- either from the perspective of documentation improvements or from the perspective of others who might encounter the same difficulties. One problem turned out to be related to not knowing which choice to make when I used Jonathon Leto's module starter (at http://leto.net/modstarter.cgi). Here is Eric's useful advice: "I think you would be better off using Module::Build rather than Module::Install, since M::B is pure-perl and doesn't suffer the same bundling / compatibility problems as M::I. Ah... choices! The only drawbacks with Module::Build are to do with older (pre 5.10) perls (and their included CPAN.pm clients) not having support for Module::Build and/or the all-important configure_requires directive." "With Module::Install, you fix the builder problems, with Module::Build, we fix the builder problems, with ExtUtils::MakeMaker, nobody fixes the builder problems." The symptom of the other problem was the following error message: "ERROR: Missing required field 'dist_abstract' for metafile Could not get valid metadata. Error is: Invalid metadata structure. Errors: Missing mandatory field, 'abstract' (abstract) [Validation 1.4] ...." When I looked for an "abstract" in other CPAN modules I couldn't find one. Here is Eric's response: "I noticed that you currently have a very long description in place of the abstract in your version 1.10 on the CPAN. You want the abstract to be very short [...], then put your longer description under an "ABOUT" section." I learned that the "dist_abstract" -- or "abstract" -- comes from the portion of the NAME section that follows the hyphen. Thank you Eric for answering what I thought might be "stupid" questions! May others now benefit from your wise assistance. Richard Fobes Author of "The Creative Problem Solver's Toolbox" and "Ending The Hidden Unfairness In U.S. Elections" From michael at jamhome.us Wed Nov 23 05:51:48 2011 From: michael at jamhome.us (Michael Rasmussen) Date: Wed, 23 Nov 2011 05:51:48 -0800 Subject: [Pdx-pm] The person behind G+ Perlmonks account? Message-ID: <20111123135148.GA11679@jamhome.us> The person or a person behind the Perl Monks page on Google+ +1'd a post I made. This surprised me as the post was not very Perlish. Any clues as to who it is/was? -- Michael Rasmussen, Portland Oregon Other Adventures: http://www.jamhome.us/ or http://westy.saunter.us/ Fortune Cookie Fortune du jour: Advertising is the rattling of a stick inside a swill bucket. ~ George Orwell From jonathan at leto.net Wed Nov 30 19:58:32 2011 From: jonathan at leto.net (Jonathan "Duke" Leto) Date: Wed, 30 Nov 2011 19:58:32 -0800 Subject: [Pdx-pm] What I learned from Eric about CPAN errors In-Reply-To: <4EC7FF22.5070104@SolutionsCreative.com> References: <4EC7FF22.5070104@SolutionsCreative.com> Message-ID: Howdy, > One problem turned out to be related to not knowing which choice to make > when I used Jonathon Leto's module starter (at > http://leto.net/modstarter.cgi). ?Here is Eric's useful advice: Cool, people use my stuff! But also, bad me! modstarter.cgi is sorely out of date. It even gives you a .cvsignore file! I have been meaning to rewrite modstarter.cgi and I just haven't found the tuits. But, I recently had the fortitude to scrape lots of old legacy code from various moldering directories and put it on Github. Modstarter is a gem of not-so-Modern Perl: https://github.com/leto/legacy/blob/master/erebus/perl5lib/ModStarter.pm That's right, "use warnings" but not "use strict" ! Go ahead and laugh, but how much of *your* legacy code is on Github? In short, I also highly recommend using Module::Build :) Duke -- Jonathan "Duke" Leto Leto Labs LLC 209.691.DUKE // http://labs.leto.net NOTE: Personal email is only checked twice a day at 10am/2pm PST, please call/text for time-sensitive matters. From Art.Burke at educationnorthwest.org Wed Nov 30 09:14:39 2011 From: Art.Burke at educationnorthwest.org (Art Burke) Date: Wed, 30 Nov 2011 09:14:39 -0800 Subject: [Pdx-pm] What am I doing wrong? Message-ID: <2A85392715B78D4E87D89D4AD8199C0E0E6A77158F@W0803.EducationNorthWest.Local> I just installed ActivePerl and am trying it out. This runs fine: #!/usr/bin/perl use 5.006; use strict; use warnings; $a = 6; $b = 7; print (($a*$b), "\n"); The script below fails with a message that "Global symbol "$v1" requires explicit package name ...". Could someone tell me what I am doing wrong? #!/usr/bin/perl use 5.006; use strict; use warnings; $v1 = 6; $v2 = 7; print (($v1*$v2), "\n"); Thanks! Art _______________________________________ Arthur J. Burke Senior Methodology Advisor Education Northwest 101 SW Main St, Suite 500 Portland OR 97204-3213 Art.Burke at educationnorthwest.org Phone: 503-275-9592 http://educationnorthwest.org Need help finding evidence-based answers to questions about education practices, policies, or programs? Take advantage of our free reference desk service offered by our REL Northwest project. Contact Jennifer Klump at http://askarel.org/northwest for prompt, authoritative, and customized answers to your questions. -------------- next part -------------- An HTML attachment was scrubbed... URL: