From gizmo at purdue.edu Fri Nov 12 11:20:43 2010 From: gizmo at purdue.edu (Joe Kline) Date: Fri, 12 Nov 2010 14:20:43 -0500 Subject: [Purdue-pm] Modern Perl: the book is out Message-ID: <4CDD938B.9000408@purdue.edu> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 http://www.modernperlbooks.com/mt/2010/11/the-book-is-out.html joe -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with Red Hat - http://enigmail.mozdev.org iD8DBQFM3ZOKb0mzA2gRTpkRAl5wAJ9nONArCjGKUFZEWd56MBvVSHFIvACfW0cM YwKdv4ZCEskE3Q8LMn2Ol1U= =lh1x -----END PGP SIGNATURE----- From jacoby at purdue.edu Fri Nov 12 11:32:29 2010 From: jacoby at purdue.edu (Dave jacoby) Date: Fri, 12 Nov 2010 14:32:29 -0500 Subject: [Purdue-pm] Modern Perl: the book is out In-Reply-To: <4CDD938B.9000408@purdue.edu> References: <4CDD938B.9000408@purdue.edu> Message-ID: <4CDD964D.8050003@purdue.edu> Have the PDF downloaded already. Like I need ANOTHER THING for my reading list. On 11/12/2010 02:20 PM, Joe Kline wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > http://www.modernperlbooks.com/mt/2010/11/the-book-is-out.html > > joe > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.5 (GNU/Linux) > Comment: Using GnuPG with Red Hat - http://enigmail.mozdev.org > > iD8DBQFM3ZOKb0mzA2gRTpkRAl5wAJ9nONArCjGKUFZEWd56MBvVSHFIvACfW0cM > YwKdv4ZCEskE3Q8LMn2Ol1U= > =lh1x > -----END PGP SIGNATURE----- > _______________________________________________ > Purdue-pm mailing list > Purdue-pm at pm.org > http://mail.pm.org/mailman/listinfo/purdue-pm -- Dave Jacoby Address: WSLR S049 Code Maker Mail: jacoby at purdue.edu Purdue University Phone: 765.49.67368 From mdw at purdue.edu Fri Nov 12 12:00:18 2010 From: mdw at purdue.edu (Mark Daniel Ward) Date: Fri, 12 Nov 2010 15:00:18 -0500 Subject: [Purdue-pm] Modern Perl: the book is out In-Reply-To: <4CDD964D.8050003@purdue.edu> References: <4CDD938B.9000408@purdue.edu> <4CDD964D.8050003@purdue.edu> Message-ID: <4CDD9CD2.9080408@purdue.edu> Dear Dave, Where do we get the link for the pdf download? I'm sure that this is an awesome book. Mark On 11/12/10 2:32 PM, Dave jacoby wrote: > Have the PDF downloaded already. Like I need ANOTHER THING for my > reading list. > > On 11/12/2010 02:20 PM, Joe Kline wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> http://www.modernperlbooks.com/mt/2010/11/the-book-is-out.html >> >> joe >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.5 (GNU/Linux) >> Comment: Using GnuPG with Red Hat - http://enigmail.mozdev.org >> >> iD8DBQFM3ZOKb0mzA2gRTpkRAl5wAJ9nONArCjGKUFZEWd56MBvVSHFIvACfW0cM >> YwKdv4ZCEskE3Q8LMn2Ol1U= >> =lh1x >> -----END PGP SIGNATURE----- >> _______________________________________________ >> Purdue-pm mailing list >> Purdue-pm at pm.org >> http://mail.pm.org/mailman/listinfo/purdue-pm > > From bradley.d.andersen at gmail.com Fri Nov 12 12:03:59 2010 From: bradley.d.andersen at gmail.com (Bradley Andersen) Date: Fri, 12 Nov 2010 15:03:59 -0500 Subject: [Purdue-pm] Modern Perl: the book is out In-Reply-To: <4CDD9CD2.9080408@purdue.edu> References: <4CDD938B.9000408@purdue.edu> <4CDD964D.8050003@purdue.edu> <4CDD9CD2.9080408@purdue.edu> Message-ID: http://www.onyxneon.com/books/modern_perl/modern_perl_a4.pdf -- You can't hold a man down without staying down with him. ? ? -- Booker T. Washington On Fri, Nov 12, 2010 at 3:00 PM, Mark Daniel Ward wrote: > Dear Dave, > ? ?Where do we get the link for the pdf download? ?I'm sure that this is an > awesome book. > Mark > > > On 11/12/10 2:32 PM, Dave jacoby wrote: >> >> Have the PDF downloaded already. Like I need ANOTHER THING for my reading >> list. >> >> On 11/12/2010 02:20 PM, Joe Kline wrote: >>> >>> -----BEGIN PGP SIGNED MESSAGE----- >>> Hash: SHA1 >>> >>> http://www.modernperlbooks.com/mt/2010/11/the-book-is-out.html >>> >>> joe >>> -----BEGIN PGP SIGNATURE----- >>> Version: GnuPG v1.4.5 (GNU/Linux) >>> Comment: Using GnuPG with Red Hat - http://enigmail.mozdev.org >>> >>> iD8DBQFM3ZOKb0mzA2gRTpkRAl5wAJ9nONArCjGKUFZEWd56MBvVSHFIvACfW0cM >>> YwKdv4ZCEskE3Q8LMn2Ol1U= >>> =lh1x >>> -----END PGP SIGNATURE----- >>> _______________________________________________ >>> Purdue-pm mailing list >>> Purdue-pm at pm.org >>> http://mail.pm.org/mailman/listinfo/purdue-pm >> >> > _______________________________________________ > Purdue-pm mailing list > Purdue-pm at pm.org > http://mail.pm.org/mailman/listinfo/purdue-pm > From mdw at purdue.edu Fri Nov 12 12:11:32 2010 From: mdw at purdue.edu (Mark Daniel Ward) Date: Fri, 12 Nov 2010 15:11:32 -0500 Subject: [Purdue-pm] Modern Perl: the book is out In-Reply-To: References: <4CDD938B.9000408@purdue.edu> <4CDD964D.8050003@purdue.edu> <4CDD9CD2.9080408@purdue.edu> Message-ID: <4CDD9F74.9010405@purdue.edu> Dear Bradley, Thank you very much. Have a nice weekend! Mark On 11/12/10 3:03 PM, Bradley Andersen wrote: > http://www.onyxneon.com/books/modern_perl/modern_perl_a4.pdf > -- > You can't hold a man down without staying down with him. > -- Booker T. Washington > > > > On Fri, Nov 12, 2010 at 3:00 PM, Mark Daniel Ward wrote: >> Dear Dave, >> Where do we get the link for the pdf download? I'm sure that this is an >> awesome book. >> Mark >> >> >> On 11/12/10 2:32 PM, Dave jacoby wrote: >>> Have the PDF downloaded already. Like I need ANOTHER THING for my reading >>> list. >>> >>> On 11/12/2010 02:20 PM, Joe Kline wrote: >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA1 >>>> >>>> http://www.modernperlbooks.com/mt/2010/11/the-book-is-out.html >>>> >>>> joe >>>> -----BEGIN PGP SIGNATURE----- >>>> Version: GnuPG v1.4.5 (GNU/Linux) >>>> Comment: Using GnuPG with Red Hat - http://enigmail.mozdev.org >>>> >>>> iD8DBQFM3ZOKb0mzA2gRTpkRAl5wAJ9nONArCjGKUFZEWd56MBvVSHFIvACfW0cM >>>> YwKdv4ZCEskE3Q8LMn2Ol1U= >>>> =lh1x >>>> -----END PGP SIGNATURE----- >>>> _______________________________________________ >>>> Purdue-pm mailing list >>>> Purdue-pm at pm.org >>>> http://mail.pm.org/mailman/listinfo/purdue-pm >>> >> _______________________________________________ >> Purdue-pm mailing list >> Purdue-pm at pm.org >> http://mail.pm.org/mailman/listinfo/purdue-pm >> From jacoby at purdue.edu Fri Nov 12 12:30:22 2010 From: jacoby at purdue.edu (Dave jacoby) Date: Fri, 12 Nov 2010 15:30:22 -0500 Subject: [Purdue-pm] Modern Perl: the book is out In-Reply-To: References: <4CDD938B.9000408@purdue.edu> <4CDD964D.8050003@purdue.edu> <4CDD9CD2.9080408@purdue.edu> Message-ID: <4CDDA3DE.2010704@purdue.edu> On 11/12/2010 03:03 PM, Bradley Andersen wrote: > http://www.onyxneon.com/books/modern_perl/modern_perl_a4.pdf I'll point out this bit from chromatic's blog (http://www.modernperlbooks.com/): These are free of cost and free of DRM, but not free of obligation. Your duty is to share the book with everyone who needs it. Give away the PDFs (and the ePub) far and wide. Write reviews. Cite it on the beginners mailing list. Seed it on BitTorrent. Host it on your own site. There's also a letter-sized format. -- Dave Jacoby Address: WSLR S049 Code Maker Mail: jacoby at purdue.edu Purdue University Phone: 765.49.67368 From gizmo at purdue.edu Fri Nov 12 12:50:44 2010 From: gizmo at purdue.edu (Joe Kline) Date: Fri, 12 Nov 2010 15:50:44 -0500 Subject: [Purdue-pm] Modern Perl: the book is out In-Reply-To: <4CDDA3DE.2010704@purdue.edu> References: <4CDD938B.9000408@purdue.edu> <4CDD964D.8050003@purdue.edu> <4CDD9CD2.9080408@purdue.edu> <4CDDA3DE.2010704@purdue.edu> Message-ID: <4CDDA8A4.5080602@purdue.edu> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Dave jacoby wrote: > On 11/12/2010 03:03 PM, Bradley Andersen wrote: >> http://www.onyxneon.com/books/modern_perl/modern_perl_a4.pdf > > I'll point out this bit from chromatic's blog > (http://www.modernperlbooks.com/): > > These are free of cost and free of DRM, but > not free of obligation. Your duty is to share > the book with everyone who needs it. Give away > the PDFs (and the ePub) far and wide. Write reviews. > Cite it on the beginners mailing list. Seed it > on BitTorrent. Host it on your own site. > > There's also a letter-sized format. > But notice the copyright: http://creativecommons.org/licenses/by-nc-nd/3.0/ Should affect what he intends but I'm not sure how familiar everyone is with the various Creative Commons copyright licenses. joe -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with Red Hat - http://enigmail.mozdev.org iD8DBQFM3aijb0mzA2gRTpkRArqAAJ9z5/tNOTEKISYxZmbmfZ0tuGmvEQCeNKo3 eQSy1osxW4QGFr9epNXfpAw= =beVX -----END PGP SIGNATURE----- From jacoby at purdue.edu Mon Nov 15 06:10:56 2010 From: jacoby at purdue.edu (Dave jacoby) Date: Mon, 15 Nov 2010 09:10:56 -0500 Subject: [Purdue-pm] Meeting Reminder Message-ID: <4CE13F70.5080308@purdue.edu> We meet again, tomorrow at 11:30am-1pm in Whistler 116. I don't know if we have anything planned, but we can usually come with ad-hoc discussions that are interesting. -- Dave Jacoby Address: WSLR S049 Code Maker Mail: jacoby at purdue.edu Purdue University Phone: 765.49.67368 From gizmo at purdue.edu Mon Nov 15 06:29:15 2010 From: gizmo at purdue.edu (Joe Kline) Date: Mon, 15 Nov 2010 09:29:15 -0500 Subject: [Purdue-pm] Meeting Reminder In-Reply-To: <4CE13F70.5080308@purdue.edu> References: <4CE13F70.5080308@purdue.edu> Message-ID: <4CE143BB.4080703@purdue.edu> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Dave jacoby wrote: > We meet again, tomorrow at 11:30am-1pm in Whistler 116. > > I don't know if we have anything planned, but we can usually come with > ad-hoc discussions that are interesting. > I'll be out tomorrow. I was thinking about showing off Lacuna Expanse and maybe Padre. I haven't had a chance to read _Modern Perl_ yet but maybe for next month. joe -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with Red Hat - http://enigmail.mozdev.org iD8DBQFM4UO3b0mzA2gRTpkRAjSDAJ9E+FDJT0I1TgBufBhMoauMLCKy6wCfYlpf Lokf7OU1CHL85YmuC2ol09I= =FLCM -----END PGP SIGNATURE----- From jacoby at purdue.edu Wed Nov 24 10:57:02 2010 From: jacoby at purdue.edu (Dave jacoby) Date: Wed, 24 Nov 2010 13:57:02 -0500 Subject: [Purdue-pm] Can do better with map somehow? Message-ID: <4CED5FFE.3030507@purdue.edu> So, I have a function that dumps a DB into a hashref. Assume the dump looks like a long version of this. $VAR1 = { 'a' => { 'foo' => 1 , 'bar' => 'Cheers' , } , 'b' => { 'foo' => 3 , 'bar' => 'Crow' , } , 'c' => { 'foo' => 1 , 'bar' => 'Neon Cactus' , } , ... } I would love to have that same hashref, except only containing only parts where 'foo' == 1. I can certainly loop it, but I'm learning more and more about map and it's finding its way into much more of my code. my $second ; %$second = map { $_ => $first->{$_} } keys %$first ; gets me a full copy, but I can't imagine a way to get grep to work for me and sort can just organize 'em. Is there a cool thing I'm missing? -- Dave Jacoby Address: WSLR S049 Code Maker Mail: jacoby at purdue.edu Purdue University Phone: 765.49.67368 From jacoby at purdue.edu Wed Nov 24 12:40:25 2010 From: jacoby at purdue.edu (Dave Jacoby) Date: Wed, 24 Nov 2010 15:40:25 -0500 Subject: [Purdue-pm] Can do better with map somehow? In-Reply-To: <4CED5FFE.3030507@purdue.edu> References: <4CED5FFE.3030507@purdue.edu> Message-ID: <4CED7839.8060804@purdue.edu> Rick really expanded my knowledge on this one, but it was offline, so anyone who might benefit from the response missed it. First, to clarify my terms. By "map", I meant, "using map {} @something rather than using for ( @something ) ". I've done that stuff for ten years, and I can do it, but it seems map is much more powerful and concise. My new solution: my $first = { 'a' => { 'foo' => 1, 'bar' => 'Cheers', }, 'b' => { 'foo' => 3, 'bar' => 'Crow', }, 'c' => { 'foo' => 1, 'bar' => 'Neon Cactus', } } ; my $second ; %$second = map { $_, $first->{ $_ } } grep { $first->{ $_ }->{ foo } == 1 } # <-- WOW! keys %$first ; say Dumper $second ; I never knew you could do grep like that. I know now. On 11/24/2010 01:57 PM, Dave jacoby wrote: > So, I have a function that dumps a DB into a hashref. Assume the dump > looks like a long version of this. > > $VAR1 = { > 'a' => { > 'foo' => 1 , > 'bar' => 'Cheers' , > } , > 'b' => { > 'foo' => 3 , > 'bar' => 'Crow' , > } , > 'c' => { > 'foo' => 1 , > 'bar' => 'Neon Cactus' , > } , > ... > } > > I would love to have that same hashref, except only containing only > parts where 'foo' == 1. I can certainly loop it, but I'm learning more > and more about map and it's finding its way into much more of my code. > > my $second ; %$second = map { $_ => $first->{$_} } keys %$first ; gets > me a full copy, but I can't imagine a way to get grep to work for me and > sort can just organize 'em. Is there a cool thing I'm missing? > -- Dave Jacoby Address: WSLR S049 Code Maker Mail: jacoby at purdue.edu Purdue University Phone: 765.49.67368 From mark at ecn.purdue.edu Sun Nov 28 12:36:57 2010 From: mark at ecn.purdue.edu (Mark Senn) Date: Sun, 28 Nov 2010 15:36:57 -0500 Subject: [Purdue-pm] Can do better with map somehow? In-Reply-To: <4CED7839.8060804@purdue.edu> References: <4CED5FFE.3030507@purdue.edu> <4CED7839.8060804@purdue.edu> Message-ID: <6523.1290976617@pier.ecn.purdue.edu> Dave Jacoby wrote: My new solution: my $first = { 'a' => { 'foo' => 1, 'bar' => 'Cheers', }, 'b' => { 'foo' => 3, 'bar' => 'Crow', }, 'c' => { 'foo' => 1, 'bar' => 'Neon Cactus', } } ; my $second ; %$second = map { $_, $first->{ $_ } } grep { $first->{ $_ }->{ foo } == 1 } # <-- WOW! keys %$first ; say Dumper $second ; I think (but don't know for sure) Perl 5 will do the grep and save all those results and then do the map. For this small example it probably won't matter much but if %$first was very large the above may run out of memory. I prefer this: my $third; map { ($first->{$_}->{foo} == 1) and $third->{$_} = $first->{$_} } keys %$first; say Dumper $third; -mark From jacoby at purdue.edu Mon Nov 29 06:34:45 2010 From: jacoby at purdue.edu (Dave Jacoby) Date: Mon, 29 Nov 2010 09:34:45 -0500 Subject: [Purdue-pm] Can do better with map somehow? In-Reply-To: <6523.1290976617@pier.ecn.purdue.edu> References: <4CED5FFE.3030507@purdue.edu> <4CED7839.8060804@purdue.edu> <6523.1290976617@pier.ecn.purdue.edu> Message-ID: <4CF3BA05.6000904@purdue.edu> There is something to that. I don't speak "map" as fluently as I should yet. On 11/28/2010 03:36 PM, Mark Senn wrote: > Dave Jacoby wrote: > My new solution: > > my $first = { > 'a' => { 'foo' => 1, 'bar' => 'Cheers', }, > 'b' => { 'foo' => 3, 'bar' => 'Crow', }, > 'c' => { 'foo' => 1, 'bar' => 'Neon Cactus', } } ; > my $second ; > %$second = > map { $_, $first->{ $_ } } > grep { $first->{ $_ }->{ foo } == 1 } #<-- WOW! > keys %$first ; > say Dumper $second ; > > I think (but don't know for sure) Perl 5 will do the grep and > save all those results and then do the map. For this small > example it probably won't matter much but if %$first was very > large the above may run out of memory. > > I prefer this: > > my $third; > map { ($first->{$_}->{foo} == 1) and $third->{$_} = $first->{$_} } > keys %$first; > say Dumper $third; > > -mark -- Dave Jacoby Address: WSLR S049 Code Maker Mail: jacoby at purdue.edu Purdue University Phone: 765.49.67368