From kbrannen at pwhome.com Mon Sep 8 18:06:23 2014 From: kbrannen at pwhome.com (kevin) Date: Mon, 08 Sep 2014 20:06:23 -0500 Subject: [DFW.pm] Need Perl Devlopers Message-ID: <540E528F.1070707@pwhome.com> Hi everyone, Since my director isn't in DFW-PM, I volunteered to post here cause we really need Perl developers, at least 3 or perhaps 4. It's basically LAMP development, working on CGI based apps. There's also some tool development. The job requires you to use Perl, SQL, HTML, and very basic bash scripting, so you should have those skills. Bonus points for Javascript, and mysql. The company is in Richardson and has been mostly good to work for. The thing I like most there is their flexibility on a number of issues (e.g. desktop choice and work hours). You can see all their jobs at http://www.hrsmart.com/about-us/careers/jobs, but the ones I'm referring are titled "Developer - LAMP Environment", third from the bottom at the present. The direct link is https://corporate.hua.hrsmart.com/hrsmart/ats/Posting/view/274. If you want to apply but have a few questions about the job first, feel free to email me directly and ask. I'll do my best to answer (off list). BTW, we also need Linux system administrators, if there are any on this list who are looking for a job. :) Kevin From dfwpm at internetalias.net Wed Sep 10 09:48:44 2014 From: dfwpm at internetalias.net (Tommy Butler) Date: Wed, 10 Sep 2014 11:48:44 -0500 Subject: [DFW.pm] YES! We're Meeting tonight! Special guest presenter bonus! In-Reply-To: References: Message-ID: <541080EC.3040901@internetalias.net> OK yes, I just did use more exclamation points in my subject line than a used car salesman, but every once in a while the caffeine gets to me. No, wait. Maybe it's the lack of caff... Nevermind! We are meeting tonight from 7 pm to 9 pm at the new Dallas Makerspace location where the meeting was held last month, and we have got ourselves a guest presenter! The DMS is at: 1825 Monetary Lane Suite 104 Carrollton, TX 75006 (214) 699-6537 Our celebrity guest is none other than our own fearless John Dexter. He's going to tell us all about Docker, and hopefully show us some cool examples of how we can use it to deploy our apps like the cool kids. This is a chance to walk away with working knowledge of a tool that will make your life /easier/. You should not miss this. As always, I'll send out google hangout invites to whomever sends me their google ID between now and the meeting. If you've ever sent your ID before, I'll probably have saved that and will send you an invite too. Online "seats" are limited though-- if we max out the hangout then you won't be able to connect. First come, first served. And in closing I'll just remind everyone that we remain committed to our schedule/routine, so as to be predictably present for anyone just walking in based on a web search or wall board posting. As stated above, it's always 7 to 9. By then we have often grown hungry after our long and intense pursuit of greater awesomeness. So it's only natural that after the meeting we'll probably go in search of worthy refreshment nearby, which when found will then be heartily imbibed with warm mirth of Perlish friendship. No that's a hot deal, err, meal. You're invited, so come and learn Perl with us. See you tonight Perl Mongers! -- Tommy Butler, John Fields -------------- next part -------------- An HTML attachment was scrubbed... URL: From asohn.unique at gmail.com Wed Sep 10 17:07:34 2014 From: asohn.unique at gmail.com (Andrew Sohn) Date: Wed, 10 Sep 2014 19:07:34 -0500 Subject: [DFW.pm] YES! We're Meeting tonight! Special guest presenter bonus! In-Reply-To: <541080EC.3040901@internetalias.net> References: <541080EC.3040901@internetalias.net> Message-ID: <234DF069-1835-4A9F-B41F-230CC176DD29@gmail.com> Sorry, I'm new to this. Location is advertised on the sure but the door is locked; is it by invite only on site and broadcast/remote only otherwise? > On Sep 10, 2014, at 11:48, Tommy Butler wrote: > > OK yes, I just did use more exclamation points in my subject line than a used car salesman, but every once in a while the caffeine gets to me. > > No, wait. Maybe it's the lack of caff... Nevermind! We are meeting tonight from 7 pm to 9 pm at the new Dallas Makerspace location where the meeting was held last month, and we have got ourselves a guest presenter! The DMS is at: > 1825 Monetary Lane > Suite 104 > Carrollton, TX 75006 > (214) 699-6537 > Our celebrity guest is none other than our own fearless John Dexter. He's going to tell us all about Docker, and hopefully show us some cool examples of how we can use it to deploy our apps like the cool kids. This is a chance to walk away with working knowledge of a tool that will make your life /easier/. You should not miss this. > > As always, I'll send out google hangout invites to whomever sends me their google ID between now and the meeting. If you've ever sent your ID before, I'll probably have saved that and will send you an invite too. Online "seats" are limited though-- if we max out the hangout then you won't be able to connect. First come, first served. > > And in closing I'll just remind everyone that we remain committed to our schedule/routine, so as to be predictably present for anyone just walking in based on a web search or wall board posting. As stated above, it's always 7 to 9. By then we have often grown hungry after our long and intense pursuit of greater awesomeness. So it's only natural that after the meeting we'll probably go in search of worthy refreshment nearby, which when found will then be heartily imbibed with warm mirth of Perlish friendship. > > No that's a hot deal, err, meal. You're invited, so come and learn Perl with us. > > See you tonight Perl Mongers! > > -- > Tommy Butler, John Fields > > > _______________________________________________ > Dfw-pm mailing list > Dfw-pm at pm.org > http://mail.pm.org/mailman/listinfo/dfw-pm -------------- next part -------------- An HTML attachment was scrubbed... URL: From wigthft at gmail.com Wed Sep 10 17:10:40 2014 From: wigthft at gmail.com (John Fields) Date: Wed, 10 Sep 2014 19:10:40 -0500 Subject: [DFW.pm] YES! We're Meeting tonight! Special guest presenter bonus! In-Reply-To: <234DF069-1835-4A9F-B41F-230CC176DD29@gmail.com> References: <541080EC.3040901@internetalias.net> <234DF069-1835-4A9F-B41F-230CC176DD29@gmail.com> Message-ID: call me! 469-688-7726... I'll come to the door, or we are in the "mixed use classroom" On Wed, Sep 10, 2014 at 7:07 PM, Andrew Sohn wrote: > Sorry, I'm new to this. Location is advertised on the sure but the door is > locked; is it by invite only on site and broadcast/remote only otherwise? > > On Sep 10, 2014, at 11:48, Tommy Butler wrote: > > OK yes, I just did use more exclamation points in my subject line than a > used car salesman, but every once in a while the caffeine gets to me. > > No, wait. Maybe it's the lack of caff... Nevermind! We are meeting > tonight from 7 pm to 9 pm at the new Dallas Makerspace location where the > meeting was held last month, and we have got ourselves a guest presenter! > The DMS is at: > > 1825 Monetary Lane > Suite 104 > Carrollton, TX 75006 > (214) 699-6537 > > Our celebrity guest is none other than our own fearless John Dexter. He's > going to tell us all about Docker, and hopefully show us some cool examples > of how we can use it to deploy our apps like the cool kids. This is a > chance to walk away with working knowledge of a tool that will make your > life /easier/. You should not miss this. > > As always, I'll send out google hangout invites to whomever sends me their > google ID between now and the meeting. If you've ever sent your ID before, > I'll probably have saved that and will send you an invite too. Online > "seats" are limited though-- if we max out the hangout then you won't be > able to connect. First come, first served. > > And in closing I'll just remind everyone that we remain committed to our > schedule/routine, so as to be predictably present for anyone just walking > in based on a web search or wall board posting. As stated above, it's > always 7 to 9. By then we have often grown hungry after our long and > intense pursuit of greater awesomeness. So it's only natural that after > the meeting we'll probably go in search of worthy refreshment nearby, which > when found will then be heartily imbibed with warm mirth of Perlish > friendship. > > No that's a hot deal, err, meal. You're invited, so come and learn Perl > with us. > > See you tonight Perl Mongers! > > -- > Tommy Butler, John Fields > > > _______________________________________________ > Dfw-pm mailing list > Dfw-pm at pm.org > http://mail.pm.org/mailman/listinfo/dfw-pm > > > _______________________________________________ > Dfw-pm mailing list > Dfw-pm at pm.org > http://mail.pm.org/mailman/listinfo/dfw-pm > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From john.dexter at psydefect.com Thu Sep 11 08:38:25 2014 From: john.dexter at psydefect.com (John Dexter) Date: Thu, 11 Sep 2014 10:38:25 -0500 Subject: [DFW.pm] YES! We're Meeting tonight! Special guest presenter bonus! In-Reply-To: <541080EC.3040901@internetalias.net> References: <541080EC.3040901@internetalias.net> Message-ID: I hope everyone that was able to join last night learned a little about Docker and application containerization. If you want to look at the presentation and the awful Mojolicious::Lite app I used for an example last night, it is on GitHub . If you want to learn more I would really encourage you to check out to the Docker website . The documentation is very good and there is an interactive tutorial you can go through as well. Creating an account for DockerHub also gives you the opportunity to join the "Docker Weekly" email newsletter which provides links to interesting articles on Docker. John Dexter On Wed, Sep 10, 2014 at 11:48 AM, Tommy Butler wrote: > OK yes, I just did use more exclamation points in my subject line than a > used car salesman, but every once in a while the caffeine gets to me. > > No, wait. Maybe it's the lack of caff... Nevermind! We are meeting > tonight from 7 pm to 9 pm at the new Dallas Makerspace location where the > meeting was held last month, and we have got ourselves a guest presenter! > The DMS is at: > > 1825 Monetary Lane > Suite 104 > Carrollton, TX 75006 > (214) 699-6537 > > Our celebrity guest is none other than our own fearless John Dexter. He's > going to tell us all about Docker, and hopefully show us some cool examples > of how we can use it to deploy our apps like the cool kids. This is a > chance to walk away with working knowledge of a tool that will make your > life /easier/. You should not miss this. > > As always, I'll send out google hangout invites to whomever sends me their > google ID between now and the meeting. If you've ever sent your ID before, > I'll probably have saved that and will send you an invite too. Online > "seats" are limited though-- if we max out the hangout then you won't be > able to connect. First come, first served. > > And in closing I'll just remind everyone that we remain committed to our > schedule/routine, so as to be predictably present for anyone just walking > in based on a web search or wall board posting. As stated above, it's > always 7 to 9. By then we have often grown hungry after our long and > intense pursuit of greater awesomeness. So it's only natural that after > the meeting we'll probably go in search of worthy refreshment nearby, which > when found will then be heartily imbibed with warm mirth of Perlish > friendship. > > No that's a hot deal, err, meal. You're invited, so come and learn Perl > with us. > > See you tonight Perl Mongers! > > -- > Tommy Butler, John Fields > > > > _______________________________________________ > Dfw-pm mailing list > Dfw-pm at pm.org > http://mail.pm.org/mailman/listinfo/dfw-pm > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bob.Vanderploeg at activenetwork.com Wed Sep 10 22:00:10 2014 From: Bob.Vanderploeg at activenetwork.com (Van Der Ploeg, Bob) Date: Thu, 11 Sep 2014 05:00:10 +0000 Subject: [DFW.pm] FizzBuzz Assignment Message-ID: <3DC191610C099A45BE04C3B3EC7EF4F26F480543@ASHMBX02.active.local> Here is my homework assignment. I know its wordy but it seems to work! :) #!/usr/bin/perl for($x=1;$x<=100;$x++){ if($x%3==0 && $x%5==0){print "FIZZBUZZ "} elsif ($x%3==0){print "fizz "} elsif($x%5==0){print "buzz "} else{print "$x ";} } http://www.facebook.com/robert.vanderploeg Deuteronomy 30:19 - Choose Life! Bob Van Der Ploeg, Professional Services Consultant Active Network | Faith Office: 214.271.9698 Mobile: 407-432-6665 bob.vanderploeg at activenetwork.com My ACTIVE is... Faith, Family, Swimming What's Your Active? http://www.FellowshipOne.com http://www.ActiveNetwork.com http://www.Active.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From nanis at cpan.org Thu Sep 11 09:28:25 2014 From: nanis at cpan.org (A. Sinan Unur) Date: Thu, 11 Sep 2014 12:28:25 -0400 Subject: [DFW.pm] FizzBuzz Assignment In-Reply-To: <3DC191610C099A45BE04C3B3EC7EF4F26F480543@ASHMBX02.active.local> References: <3DC191610C099A45BE04C3B3EC7EF4F26F480543@ASHMBX02.active.local> Message-ID: On Thu, Sep 11, 2014 at 1:00 AM, Van Der Ploeg, Bob wrote: > Here is my homework assignment. I know its wordy but it seems to work! J That reminds me: http://blog.nu42.com/2014/03/interpretive-fizzbuzz-experiment-brings.html -- Sinan From wigthft at gmail.com Thu Sep 11 09:42:30 2014 From: wigthft at gmail.com (John Fields) Date: Thu, 11 Sep 2014 11:42:30 -0500 Subject: [DFW.pm] Homework for the list, and for Oct 08 meeting In-Reply-To: References: Message-ID: Firstly, I want to thank John Dexter for his Docker presentation, showing how to encapsulate a Mojolicious Web server and application for easy deployment. He got what all presenters get, a free dinner and that warm afterglow from making the world a better place (with more Perl in it). :) I challenged the attendees last night to do the FizzBuzz program. We even had one programmer in attendance that had been asked to do it on a job interview the previous day! We were one day late for him, but hopefully not for you.. Http://rosettecode.org/wiki/FizzBuzz Don't cheat.. Yourself. Do it from scratch before looking at other's solutions. We will pick 2 more, with increasing difficulty with one per week. Also new member Andy Sohn will offer a short challenge and demonstrate answers live at the next Mongers. So send in your code, and be as creative as you can! TIMTOWTDI is a strength after all. :) Cheers, John and Tommy -------------- next part -------------- An HTML attachment was scrubbed... URL: From staurofilax77 at gmail.com Thu Sep 11 10:15:07 2014 From: staurofilax77 at gmail.com (Lisa Cloutier) Date: Thu, 11 Sep 2014 12:15:07 -0500 Subject: [DFW.pm] Homework for the list, and for Oct 08 meeting In-Reply-To: References: Message-ID: Solution below: my $x = 1; while ($x <= 100) { if (($x % 3 == 0) && ($x % 5 == 0)) { print "FizzBuzz\n"; } elsif ($x % 3 == 0) { print "Fizz\n"; } elsif ($x % 5 == 0) { print "Buzz\n"; } else { print "$x\n"; } $x++; } I minorly "cheated" in that I didn't know the sign in Perl for "mod" but had read Bob's email previously (before learning about the challenge) and realized what he was doing with the % sign. Had I been in an interview I probably would have used every special character in turn until I figured out the symbol for mod. So I guess I can "program my way out of a wet paper bag" as this website proclaimed about the FizzBuzz test. On Thu, Sep 11, 2014 at 11:42 AM, John Fields wrote: > Firstly, I want to thank John Dexter for his Docker presentation, showing > how to encapsulate a Mojolicious Web server and application for easy > deployment. He got what all presenters get, a free dinner and that warm > afterglow from making the world a better place (with more Perl in it). :) > > I challenged the attendees last night to do the FizzBuzz program. We even > had one programmer in attendance that had been asked to do it on a job > interview the previous day! We were one day late for him, but hopefully > not for you.. > > Http://rosettecode.org/wiki/FizzBuzz > > Don't cheat.. Yourself. Do it from scratch before looking at other's > solutions. We will pick 2 more, with increasing difficulty with one per > week. Also new member Andy Sohn will offer a short challenge and > demonstrate answers live at the next Mongers. > > So send in your code, and be as creative as you can! TIMTOWTDI is a > strength after all. :) > > Cheers, > John and Tommy > > _______________________________________________ > Dfw-pm mailing list > Dfw-pm at pm.org > http://mail.pm.org/mailman/listinfo/dfw-pm > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathan at mitsi.com Thu Sep 11 10:41:14 2014 From: nathan at mitsi.com (Nathan Dyck) Date: Thu, 11 Sep 2014 12:41:14 -0500 Subject: [DFW.pm] FizzBuzz Assignment In-Reply-To: <3DC191610C099A45BE04C3B3EC7EF4F26F480543@ASHMBX02.active.local> References: <3DC191610C099A45BE04C3B3EC7EF4F26F480543@ASHMBX02.active.local> Message-ID: <5411DEBA.8080700@mitsi.com> That looks like a C programmer wrote that! At least that's what my co-workers used to tell me regarding "for" loops. :-) So now I try to be more Perlish and write something like: foreach my $x (1..100) { #insert Bob's remaining code here } On 9/11/2014 12:00 AM, Van Der Ploeg, Bob wrote: > > Here is my homework assignment. I know its wordy but it seems to work! J > > #!/usr/bin/perl > > for($x=1;$x<=100;$x++){ > > if($x%3==0 && $x%5==0){print "FIZZBUZZ "} > > elsif ($x%3==0){print "fizz "} > > elsif($x%5==0){print "buzz "} > > else{print "$x ";} > > } > > http://www.facebook.com/robert.vanderploeg > Deuteronomy 30:19 - Choose Life! > > *Bob Van Der Ploeg, Professional Services Consultant* > Active Network | Faith > Office: 214.271.9698 > Mobile: 407-432-6665 > > bob.vanderploeg at activenetwork.com > > > *My ACTIVE is...* > Faith, Family, Swimming > > *What's Your Active?* > > http://www.FellowshipOne.com > http://www.ActiveNetwork.com > http://www.Active.com > > > > _______________________________________________ > Dfw-pm mailing list > Dfw-pm at pm.org > http://mail.pm.org/mailman/listinfo/dfw-pm -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.flach at webtooldeveloper.com Thu Sep 11 11:01:23 2014 From: robert.flach at webtooldeveloper.com (Robert Flach) Date: Thu, 11 Sep 2014 13:01:23 -0500 Subject: [DFW.pm] Homework for the list, and for Oct 08 meeting In-Reply-To: References: Message-ID: <5411E373.4070705@webtooldeveloper.com> Well, it sounds like it was a fun meeting. I'm sorry I missed it! I personally will occasionally use the FizzBuzz test when interviewing applicants though I usually use more complicated coding challenges. Maybe I could share one or more of those sometime as a "more advanced" challenge. In the meantime, scroll down for my solution and for the things I look for when evaluating a fizzbuzz... #!/usr/bin/perl use strict; use warnings; my $x = 0; while($x++ < 100) { my $val = ""; $val .= ( $x % 3 == 0 ) ? "fizz" : ""; $val .= ( $x % 5 == 0 ) ? "buzz" : ""; print STDOUT ( $val ? $val : "$x" ) . "\n"; } Things I look for in a fizz buzz: 1. (Dealbreaker) Is the code readable. (I have a pretty loose definition of readable and it definitely doesn't require comments, but if it's unintelligible it's a dealbreaker ) 2. (Dealbreaker) Will it produce correct output barring any minor syntax errors i.e. is the algorithm valid. 3. If doing a separate test for fizzbuzz have they optimized to a mod 15 check. 4. Can they (with prompting if needed) make the leap to realizing they can concat the two tests to produce the combined value without a separate test 5. If using real code: will it compile. 6. If using real code: will it compile without errors or warnings (e.g. for perl can I stick a use strict;use warnings; at the top of it. Things I never care about in a fizzbuzz: 1. Do they know the correct operator for modulus (as long as they know modulus is possible) 2. while vs for vs. foreach, variable initialization, ternary vs. if, perl vs c vs (insert your favorite language argument here) 3. correct formatting of output (e.g. I don't mind if they forget to newline it, nor do I give extra points for printf ) 4. error handling, supporting input arguments, etc. (this is an algorithm test, not a coding practices test and a coding practices test is unsuitable for the time available) Things somewhat unrelated to fizzbuzz but discernible in some way related to the fizzbuzz tests that I definitely care about/give extra credit for. 1. Do they confirm or clarify the requirements with me in some way e.g. "When you say instead prints fizz buzz or fizzbuzz do you mean that you don't want it to print those numbers at all and only print the alternate text, or would you like it to always print the numbers and print that in addition for those meeting the requirements?" It doesn't matter if their question is clearly answered in the requirements as written, restating the requirements as a question is a hugely valuable (and often undervalued) developer skill. 2. Similarly to number 1, do they ask questions about what I want in the solution (e.g. all those things in numbers 2-4 under things I never care about above) I don't care about those things (for the test; very different standard for "real" code), but many people do, and I DO care about your ability to realize that and your willingness to adjust your style accordingly. 3. I will always ask for some modification of the code afterwards. I care a lot about how they respond to that request, whether it is a request to make it do something different, to change the styling, to comment it, etc. 4. If using pseudo code does their pseudo code look like a human language construction or is it just code with invalid syntax. (Either way, once they are done I will almost always ask for something that would compile/interpret correctly in some language. Robert Flach *Web Tools* On 9/11/2014 12:15 PM, Lisa Cloutier wrote: > Solution below: > > > > > > > > > > > > > > > > > > > my $x = 1; > > while ($x <= 100) > { > if (($x % 3 == 0) && ($x % 5 == 0)) > { > print "FizzBuzz\n"; > } > elsif ($x % 3 == 0) > { > print "Fizz\n"; > } > elsif ($x % 5 == 0) > { > print "Buzz\n"; > } > else > { > print "$x\n"; > } > $x++; > } > > I minorly "cheated" in that I didn't know the sign in Perl for "mod" > but had read Bob's email previously (before learning about the > challenge) and realized what he was doing with the % sign. Had I > been in an interview I probably would have used every special > character in turn until I figured out the symbol for mod. > > So I guess I can "program my way out of a wet paper bag" as this > website proclaimed about the > FizzBuzz test. > > On Thu, Sep 11, 2014 at 11:42 AM, John Fields > wrote: > > Firstly, I want to thank John Dexter for his Docker presentation, > showing how to encapsulate a Mojolicious Web server and > application for easy deployment. He got what all presenters get, a > free dinner and that warm afterglow from making the world a better > place (with more Perl in it). :) > > I challenged the attendees last night to do the FizzBuzz program. > We even had one programmer in attendance that had been asked to do > it on a job interview the previous day! We were one day late for > him, but hopefully not for you.. > > Http://rosettecode.org/wiki/FizzBuzz > > Don't cheat.. Yourself. Do it from scratch before looking at > other's solutions. We will pick 2 more, with increasing > difficulty with one per week. Also new member Andy Sohn will > offer a short challenge and demonstrate answers live at the next > Mongers. > > So send in your code, and be as creative as you can! TIMTOWTDI is > a strength after all. :) > > Cheers, > John and Tommy > > > _______________________________________________ > Dfw-pm mailing list > Dfw-pm at pm.org > http://mail.pm.org/mailman/listinfo/dfw-pm > > > > > _______________________________________________ > Dfw-pm mailing list > Dfw-pm at pm.org > http://mail.pm.org/mailman/listinfo/dfw-pm -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmichaud at pobox.com Thu Sep 11 11:32:35 2014 From: pmichaud at pobox.com (Patrick R. Michaud) Date: Thu, 11 Sep 2014 13:32:35 -0500 Subject: [DFW.pm] Homework for the list, and for Oct 08 meeting In-Reply-To: References: Message-ID: <20140911183235.GA18564@pmichaud.com> Perl 6 solution #1, the straightforward one: for 1..100 { when $_ %% (3 & 5) { say "FizzBuzz" } when $_ %% 5 { say "Buzz" } when $_ %% 3 { say "Fizz" } say $_; } Some explanation: - The Perl 6 "%%" operator returns true if the left argument is evenly divisible by the right argument. - The "when" keyword is Perl 6's version of a "switch/case" statement; when the test is true, the block following it is executed and control skips to the end of the enclosing block. - The expression "$_ %% (3 & 5)" is true if $_ is evenly divisible by both 3 and 5. (The "&" operator in Perl 6 creates a junction of values, the numeric bitwise-and operator in Perl 6 is "+&".) Pm From homebase at internetalias.net Thu Sep 11 11:37:54 2014 From: homebase at internetalias.net (Tommy Butler) Date: Thu, 11 Sep 2014 13:37:54 -0500 Subject: [DFW.pm] Homework for the list, and for Oct 08 meeting In-Reply-To: <5411E373.4070705@webtooldeveloper.com> References: <5411E373.4070705@webtooldeveloper.com> Message-ID: "print STDOUT" ??????? You did that. On purpose? This raises so many questions :-P -- Tommy Butler On Sep 11, 2014, Robert Flach wrote: >Well, it sounds like it was a fun meeting. I'm sorry I missed it! I >personally will occasionally use the FizzBuzz test when interviewing >applicants though I usually use more complicated coding challenges. >Maybe I could share one or more of those sometime as a "more advanced" >challenge. In the meantime, scroll down for my solution and for the >things I look for when evaluating a fizzbuzz... > > > > > > > > > > > > > > > > > > > > > > > > > > > >#!/usr/bin/perl >use strict; >use warnings; >my $x = 0; >while($x++ < 100) >{ > my $val = ""; > $val .= ( $x % 3 == 0 ) ? "fizz" : ""; > $val .= ( $x % 5 == 0 ) ? "buzz" : ""; > print STDOUT ( $val ? $val : "$x" ) . "\n"; >} >Things I look for in a fizz buzz: >1. (Dealbreaker) Is the code readable. (I have a pretty loose >definition >of readable and it definitely doesn't require comments, but if it's >unintelligible it's a dealbreaker ) >2. (Dealbreaker) Will it produce correct output barring any minor >syntax >errors i.e. is the algorithm valid. >3. If doing a separate test for fizzbuzz have they optimized to a mod >15 >check. >4. Can they (with prompting if needed) make the leap to realizing they >can concat the two tests to produce the combined value without a >separate test >5. If using real code: will it compile. >6. If using real code: will it compile without errors or warnings (e.g. > >for perl can I stick a use strict;use warnings; at the top of it. > >Things I never care about in a fizzbuzz: >1. Do they know the correct operator for modulus (as long as they know >modulus is possible) >2. while vs for vs. foreach, variable initialization, ternary vs. if, >perl vs c vs (insert your favorite language argument here) >3. correct formatting of output (e.g. I don't mind if they forget to >newline it, nor do I give extra points for printf ) >4. error handling, supporting input arguments, etc. (this is an >algorithm test, not a coding practices test and a coding practices test > >is unsuitable for the time available) > >Things somewhat unrelated to fizzbuzz but discernible in some way >related to the fizzbuzz tests that I definitely care about/give extra >credit for. >1. Do they confirm or clarify the requirements with me in some way e.g. > >"When you say instead prints fizz buzz or fizzbuzz do you mean that you > >don't want it to print those numbers at all and only print the >alternate >text, or would you like it to always print the numbers and print that >in >addition for those meeting the requirements?" It doesn't matter if >their question is clearly answered in the requirements as written, >restating the requirements as a question is a hugely valuable (and >often >undervalued) developer skill. >2. Similarly to number 1, do they ask questions about what I want in >the >solution (e.g. all those things in numbers 2-4 under things I never >care >about above) I don't care about those things (for the test; very >different standard for "real" code), but many people do, and I DO care >about your ability to realize that and your willingness to adjust your >style accordingly. >3. I will always ask for some modification of the code afterwards. I >care a lot about how they respond to that request, whether it is a >request to make it do something different, to change the styling, to >comment it, etc. >4. If using pseudo code does their pseudo code look like a human >language construction or is it just code with invalid syntax. (Either >way, once they are done I will almost always ask for something that >would compile/interpret correctly in some language. > > > > >Robert Flach >*Web Tools* >On 9/11/2014 12:15 PM, Lisa Cloutier wrote: >> Solution below: >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> my $x = 1; >> >> while ($x <= 100) >> { >> if (($x % 3 == 0) && ($x % 5 == 0)) >> { >> print "FizzBuzz\n"; >> } >> elsif ($x % 3 == 0) >> { >> print "Fizz\n"; >> } >> elsif ($x % 5 == 0) >> { >> print "Buzz\n"; >> } >> else >> { >> print "$x\n"; >> } >> $x++; >> } >> >> I minorly "cheated" in that I didn't know the sign in Perl for "mod" >> but had read Bob's email previously (before learning about the >> challenge) and realized what he was doing with the % sign. Had I >> been in an interview I probably would have used every special >> character in turn until I figured out the symbol for mod. >> >> So I guess I can "program my way out of a wet paper bag" as this >> website proclaimed about the >> FizzBuzz test. >> >> On Thu, Sep 11, 2014 at 11:42 AM, John Fields > > wrote: >> >> Firstly, I want to thank John Dexter for his Docker >presentation, >> showing how to encapsulate a Mojolicious Web server and >> application for easy deployment. He got what all presenters get, >a >> free dinner and that warm afterglow from making the world a >better >> place (with more Perl in it). :) >> >> I challenged the attendees last night to do the FizzBuzz program. > >> We even had one programmer in attendance that had been asked to >do >> it on a job interview the previous day! We were one day late for >> him, but hopefully not for you.. >> >> Http://rosettecode.org/wiki/FizzBuzz >> >> Don't cheat.. Yourself. Do it from scratch before looking at >> other's solutions. We will pick 2 more, with increasing >> difficulty with one per week. Also new member Andy Sohn will >> offer a short challenge and demonstrate answers live at the next >> Mongers. >> >> So send in your code, and be as creative as you can! TIMTOWTDI >is >> a strength after all. :) >> >> Cheers, >> John and Tommy >> >> >> _______________________________________________ >> Dfw-pm mailing list >> Dfw-pm at pm.org >> http://mail.pm.org/mailman/listinfo/dfw-pm >> >> >> >> >> _______________________________________________ >> Dfw-pm mailing list >> Dfw-pm at pm.org >> http://mail.pm.org/mailman/listinfo/dfw-pm > > > >------------------------------------------------------------------------ > >_______________________________________________ >Dfw-pm mailing list >Dfw-pm at pm.org >http://mail.pm.org/mailman/listinfo/dfw-pm -- Sent with K-@ Mail - the evolution of emailing. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jacklupton at gmail.com Thu Sep 11 11:44:03 2014 From: jacklupton at gmail.com (Jack Lupton) Date: Thu, 11 Sep 2014 13:44:03 -0500 Subject: [DFW.pm] Homework for the list, and for Oct 08 meeting In-Reply-To: References: Message-ID: That link for rosetta code is misspelled. It should be http://rosettacode.org/wiki/FizzBuzz DFW.pm is great. I'm glad I joined though I live in Austin. :) On Thu, Sep 11, 2014 at 11:42 AM, John Fields wrote: > Firstly, I want to thank John Dexter for his Docker presentation, showing > how to encapsulate a Mojolicious Web server and application for easy > deployment. He got what all presenters get, a free dinner and that warm > afterglow from making the world a better place (with more Perl in it). :) > > I challenged the attendees last night to do the FizzBuzz program. We even > had one programmer in attendance that had been asked to do it on a job > interview the previous day! We were one day late for him, but hopefully > not for you.. > > Http://rosettecode.org/wiki/FizzBuzz > > Don't cheat.. Yourself. Do it from scratch before looking at other's > solutions. We will pick 2 more, with increasing difficulty with one per > week. Also new member Andy Sohn will offer a short challenge and > demonstrate answers live at the next Mongers. > > So send in your code, and be as creative as you can! TIMTOWTDI is a > strength after all. :) > > Cheers, > John and Tommy > > _______________________________________________ > Dfw-pm mailing list > Dfw-pm at pm.org > http://mail.pm.org/mailman/listinfo/dfw-pm > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From john.dexter at psydefect.com Thu Sep 11 11:54:37 2014 From: john.dexter at psydefect.com (John Dexter) Date: Thu, 11 Sep 2014 13:54:37 -0500 Subject: [DFW.pm] Homework for the list, and for Oct 08 meeting In-Reply-To: References: Message-ID: How's this for TIMTOWTDI? WWW::Mechanize::Treebuilder throws warnings for a depracted module, but it works on my machine... use v5.20; use WWW::Mechanize; use WWW::Mechanize::TreeBuilder; my $mech = WWW::Mechanize->new; WWW::Mechanize::TreeBuilder->meta->apply($mech); $mech->get( 'http://rosettacode.org/wiki/FizzBuzz' ); my @code_blocks = $mech->look_down('class', 'perl highlighted_source'); say $code_blocks[1]->as_text(); eval($code_blocks[1]->as_text()); John Dexter On Thu, Sep 11, 2014 at 1:44 PM, Jack Lupton wrote: > That link for rosetta code is misspelled. It should be > > http://rosettacode.org/wiki/FizzBuzz > > DFW.pm is great. I'm glad I joined though I live in Austin. :) > > On Thu, Sep 11, 2014 at 11:42 AM, John Fields wrote: > >> Firstly, I want to thank John Dexter for his Docker presentation, >> showing how to encapsulate a Mojolicious Web server and application for >> easy deployment. He got what all presenters get, a free dinner and that >> warm afterglow from making the world a better place (with more Perl in >> it). :) >> >> I challenged the attendees last night to do the FizzBuzz program. We >> even had one programmer in attendance that had been asked to do it on a job >> interview the previous day! We were one day late for him, but hopefully >> not for you.. >> >> Http://rosettecode.org/wiki/FizzBuzz >> >> Don't cheat.. Yourself. Do it from scratch before looking at other's >> solutions. We will pick 2 more, with increasing difficulty with one per >> week. Also new member Andy Sohn will offer a short challenge and >> demonstrate answers live at the next Mongers. >> >> So send in your code, and be as creative as you can! TIMTOWTDI is a >> strength after all. :) >> >> Cheers, >> John and Tommy >> >> _______________________________________________ >> Dfw-pm mailing list >> Dfw-pm at pm.org >> http://mail.pm.org/mailman/listinfo/dfw-pm >> >> > > _______________________________________________ > Dfw-pm mailing list > Dfw-pm at pm.org > http://mail.pm.org/mailman/listinfo/dfw-pm > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From homebase at internetalias.net Thu Sep 11 12:03:02 2014 From: homebase at internetalias.net (Tommy Butler) Date: Thu, 11 Sep 2014 14:03:02 -0500 Subject: [DFW.pm] Homework for the list, and for Oct 08 meeting In-Reply-To: References: Message-ID: <8009ce56-a4e0-47aa-b1b2-6278d63b86d1@internetalias.net> I too want to both thank and congratulate Mr Dexter. I'm so sorry I want there. I worked from Tuesday morning at 7 am to Wednesday night at 6 pm. Code binge. For the jobs that really, really have to get done on time. *sigh* I fell asleep sitting up in my chair at about 6:03 pm right after getting things ready to go to Perl Mongers. Have you ever woken up hours after having done that with the outlines of your keyboard mashed into your face, staring at the longest password in the universe typed into the login prompt? http://rosettacode.org/wiki/FizzBuzz Is all about the modulus operator. To do it another way might be creative but would almost certainly likely be less efficient. The only thing I can think of that world be faster is the cheat method I saw, where you hard code into your program the known fizzes and buzzes, spitting them out at the corresponding integer positions in the 1 to 100 loop. That aside, I'd say bonus points if you use the concatenation trick which gives your code an undetectably small speed of execution a boost at only 100 iterations. My .02 (with all you paid for it) --Tommy Butler On Sep 11, 2014, John Fields wrote: >Firstly, I want to thank John Dexter for his Docker presentation, >showing >how to encapsulate a Mojolicious Web server and application for easy >deployment. He got what all presenters get, a free dinner and that warm >afterglow from making the world a better place (with more Perl in it). >:) > >I challenged the attendees last night to do the FizzBuzz program. We >even >had one programmer in attendance that had been asked to do it on a job >interview the previous day! We were one day late for him, but >hopefully >not for you.. > >Http://rosettecode.org/wiki/FizzBuzz > >Don't cheat.. Yourself. Do it from scratch before looking at other's >solutions. We will pick 2 more, with increasing difficulty with one >per >week. Also new member Andy Sohn will offer a short challenge and >demonstrate answers live at the next Mongers. > >So send in your code, and be as creative as you can! TIMTOWTDI is a >strength after all. :) > >Cheers, >John and Tommy > > >------------------------------------------------------------------------ > >_______________________________________________ >Dfw-pm mailing list >Dfw-pm at pm.org >http://mail.pm.org/mailman/listinfo/dfw-pm -- Sent with K-@ Mail - the evolution of emailing. -------------- next part -------------- An HTML attachment was scrubbed... URL: From homebase at internetalias.net Thu Sep 11 12:08:27 2014 From: homebase at internetalias.net (Tommy Butler) Date: Thu, 11 Sep 2014 14:08:27 -0500 Subject: [DFW.pm] Homework for the list, and for Oct 08 meeting In-Reply-To: References: Message-ID: <3e6fbd5f-a0f4-4bbf-aa5f-b87d4fdf626d@internetalias.net> You just scraped something from the internet and you put it in an eval. http://goo.gl/Krnk46 You're my hero =) --Tommy Butler On Sep 11, 2014, John Dexter wrote: >How's this for TIMTOWTDI? WWW::Mechanize::Treebuilder throws warnings >for a >depracted module, but it works on my machine... > >use v5.20; >use WWW::Mechanize; >use WWW::Mechanize::TreeBuilder; > >my $mech = WWW::Mechanize->new; >WWW::Mechanize::TreeBuilder->meta->apply($mech); > >$mech->get( 'http://rosettacode.org/wiki/FizzBuzz' ); > >my @code_blocks = $mech->look_down('class', 'perl highlighted_source'); > >say $code_blocks[1]->as_text(); >eval($code_blocks[1]->as_text()); > > > >John Dexter > > >On Thu, Sep 11, 2014 at 1:44 PM, Jack Lupton >wrote: > >> That link for rosetta code is misspelled. It should be >> >> http://rosettacode.org/wiki/FizzBuzz >> >> DFW.pm is great. I'm glad I joined though I live in Austin. :) >> >> On Thu, Sep 11, 2014 at 11:42 AM, John Fields >wrote: >> >>> Firstly, I want to thank John Dexter for his Docker presentation, >>> showing how to encapsulate a Mojolicious Web server and application >for >>> easy deployment. He got what all presenters get, a free dinner and >that >>> warm afterglow from making the world a better place (with more Perl >in >>> it). :) >>> >>> I challenged the attendees last night to do the FizzBuzz program. >We >>> even had one programmer in attendance that had been asked to do it >on a job >>> interview the previous day! We were one day late for him, but >hopefully >>> not for you.. >>> >>> Http://rosettecode.org/wiki/FizzBuzz >>> >>> Don't cheat.. Yourself. Do it from scratch before looking at >other's >>> solutions. We will pick 2 more, with increasing difficulty with one >per >>> week. Also new member Andy Sohn will offer a short challenge and >>> demonstrate answers live at the next Mongers. >>> >>> So send in your code, and be as creative as you can! TIMTOWTDI is a >>> strength after all. :) >>> >>> Cheers, >>> John and Tommy >>> >>> _______________________________________________ >>> Dfw-pm mailing list >>> Dfw-pm at pm.org >>> http://mail.pm.org/mailman/listinfo/dfw-pm >>> >>> >> >> _______________________________________________ >> Dfw-pm mailing list >> Dfw-pm at pm.org >> http://mail.pm.org/mailman/listinfo/dfw-pm >> >> > > >------------------------------------------------------------------------ > >_______________________________________________ >Dfw-pm mailing list >Dfw-pm at pm.org >http://mail.pm.org/mailman/listinfo/dfw-pm -- Sent with K-@ Mail - the evolution of emailing. -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.flach at webtooldeveloper.com Thu Sep 11 12:31:50 2014 From: robert.flach at webtooldeveloper.com (Robert Flach) Date: Thu, 11 Sep 2014 14:31:50 -0500 Subject: [DFW.pm] Homework for the list, and for Oct 08 meeting In-Reply-To: References: <5411E373.4070705@webtooldeveloper.com> Message-ID: <5411F8A6.3020708@webtooldeveloper.com> Tommy, Run the code without the STDOUT, then run it with. It's a simple trick to avoid having perl interpret the ternary grouping parenthesis as print function delemiting parenthesis. TIMTOWDI: You could also wrap the entire thing in parenthesis, you could skip the ternary and do your printing in an if. You could move the ternary to an assignment statement to $val just before printing plain old $val (what I would probably normally do if I weren't being creative), etc. But the STDOUT is definitely required for the code as is ;-) Robert Flach *Web Tools* On 9/11/2014 1:37 PM, Tommy Butler wrote: > "print STDOUT" ??????? > > You did that. On purpose? > > This raises so many questions :-P > > -- Tommy Butler > > On Sep 11, 2014, Robert Flach wrote: > > Well, it sounds like it was a fun meeting. I'm sorry I missed > it! I personally will occasionally use the FizzBuzz test when > interviewing applicants though I usually use more complicated > coding challenges. Maybe I could share one or more of those > sometime as a "more advanced" challenge. In the meantime, scroll > down for my solution and for the things I look for when evaluating > a fizzbuzz... > > > > > > > > > > > > > > > > > > > > > > > > > > > > #!/usr/bin/perl > use strict; > use warnings; > my $x = 0; > while($x++ < 100) > { > my $val = ""; > $val .= ( $x % 3 == 0 ) ? "fizz" : ""; > $val .= ( $x % 5 == 0 ) ? "buzz" : ""; > print STDOUT ( $val ? $val : "$x" ) . "\n"; > } > Things I look for in a fizz buzz: > 1. (Dealbreaker) Is the code readable. (I have a pretty loose > definition of readable and it definitely doesn't require comments, > but if it's unintelligible it's a dealbreaker ) > 2. (Dealbreaker) Will it produce correct output barring any minor > syntax errors i.e. is the algorithm valid. > 3. If doing a separate test for fizzbuzz have they optimized to a > mod 15 check. > 4. Can they (with prompting if needed) make the leap to realizing > they can concat the two tests to produce the combined value > without a separate test > 5. If using real code: will it compile. > 6. If using real code: will it compile without errors or warnings > (e.g. for perl can I stick a use strict;use warnings; at the top > of it. > > Things I never care about in a fizzbuzz: > 1. Do they know the correct operator for modulus (as long as they > know modulus is possible) > 2. while vs for vs. foreach, variable initialization, ternary vs. > if, perl vs c vs (insert your favorite language argument here) > 3. correct formatting of output (e.g. I don't mind if they forget > to newline it, nor do I give extra points for printf ) > 4. error handling, supporting input arguments, etc. (this is an > algorithm test, not a coding practices test and a coding practices > test is unsuitable for the time available) > > Things somewhat unrelated to fizzbuzz but discernible in some way > related to the fizzbuzz tests that I definitely care about/give > extra credit for. > 1. Do they confirm or clarify the requirements with me in some way > e.g. "When you say instead prints fizz buzz or fizzbuzz do you > mean that you don't want it to print those numbers at all and only > print the alternate text, or would you like it to always print the > numbers and print that in addition for those meeting the > requirements?" It doesn't matter if their question is clearly > answered in the requirements as written, restating the > requirements as a question is a hugely valuable (and often > undervalued) developer skill. > 2. Similarly to number 1, do they ask questions about what I want > in the solution (e.g. all those things in numbers 2-4 under things > I never care about above) I don't care about those things (for the > test; very different standard for "real" code), but many people > do, and I DO care about your ability to realize that and your > willingness to adjust your style accordingly. > 3. I will always ask for some modification of the code > afterwards. I care a lot about how they respond to that request, > whether it is a request to make it do something different, to > change the styling, to comment it, etc. > 4. If using pseudo code does their pseudo code look like a human > language construction or is it just code with invalid syntax. > (Either way, once they are done I will almost always ask for > something that would compile/interpret correctly in some language. > > > > > Robert Flach > *Web Tools* > On 9/11/2014 12:15 PM, Lisa Cloutier wrote: >> Solution below: >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> my $x = 1; >> >> while ($x <= 100) >> { >> if (($x % 3 == 0) && ($x % 5 == 0)) >> { >> print "FizzBuzz\n"; >> } >> elsif ($x % 3 == 0) >> { >> print "Fizz\n"; >> } >> elsif ($x % 5 == 0) >> { >> print "Buzz\n"; >> } >> else >> { >> print "$x\n"; >> } >> $x++; >> } >> >> I minorly "cheated" in that I didn't know the sign in Perl for >> "mod" but had read Bob's email previously (before learning about >> the challenge) and realized what he was doing with the % sign. >> Had I been in an interview I probably would have used every >> special character in turn until I figured out the symbol for mod. >> >> So I guess I can "program my way out of a wet paper bag" as this >> website proclaimed about >> the FizzBuzz test. >> >> On Thu, Sep 11, 2014 at 11:42 AM, John Fields > > wrote: >> >> Firstly, I want to thank John Dexter for his Docker >> presentation, showing how to encapsulate a Mojolicious Web >> server and application for easy deployment. He got what all >> presenters get, a free dinner and that warm afterglow from >> making the world a better place (with more Perl in it). :) >> >> I challenged the attendees last night to do the FizzBuzz >> program. We even had one programmer in attendance that had >> been asked to do it on a job interview the previous day! We >> were one day late for him, but hopefully not for you.. >> >> Http://rosettecode.org/wiki/FizzBuzz >> >> Don't cheat.. Yourself. Do it from scratch before looking at >> other's solutions. We will pick 2 more, with increasing >> difficulty with one per week. Also new member Andy Sohn will >> offer a short challenge and demonstrate answers live at the >> next Mongers. >> >> So send in your code, and be as creative as you can! >> TIMTOWTDI is a strength after all. :) >> >> Cheers, >> John and Tommy >> >> >> _______________________________________________ >> Dfw-pm mailing list >> Dfw-pm at pm.org >> http://mail.pm.org/mailman/listinfo/dfw-pm >> >> >> >> >> _______________________________________________ >> Dfw-pm mailing list >> Dfw-pm at pm.org >> http://mail.pm.org/mailman/listinfo/dfw-pm > > ------------------------------------------------------------------------ > > Dfw-pm mailing list > Dfw-pm at pm.org > http://mail.pm.org/mailman/listinfo/dfw-pm > > > -- Sent with *K-@ Mail > * > - the evolution of emailing. > > > _______________________________________________ > Dfw-pm mailing list > Dfw-pm at pm.org > http://mail.pm.org/mailman/listinfo/dfw-pm -------------- next part -------------- An HTML attachment was scrubbed... URL: From homebase at internetalias.net Thu Sep 11 12:37:13 2014 From: homebase at internetalias.net (Tommy Butler) Date: Thu, 11 Sep 2014 14:37:13 -0500 Subject: [DFW.pm] Homework for the list, and for Oct 08 meeting In-Reply-To: <5411F8A6.3020708@webtooldeveloper.com> References: <5411E373.4070705@webtooldeveloper.com> <5411F8A6.3020708@webtooldeveloper.com> Message-ID: <1c71f5a7-7ca4-4e2f-a8b2-430666d52ab7@internetalias.net> You can put a unary plus sign operator on the parens to tell perl that the parens don't belong to the print command. Also comes in handy when using map in certain cases. print +( ... ) Cheers, --Tommy Butler On Sep 11, 2014, Robert Flach wrote: >Tommy, > Run the code without the STDOUT, then run it with. It's a simple >trick to avoid having perl interpret the ternary grouping parenthesis >as >print function delemiting parenthesis. TIMTOWDI: You could also wrap >the entire thing in parenthesis, you could skip the ternary and do your > >printing in an if. You could move the ternary to an assignment >statement to $val just before printing plain old $val (what I would >probably normally do if I weren't being creative), etc. But the STDOUT > >is definitely required for the code as is ;-) > >Robert Flach >*Web Tools* >On 9/11/2014 1:37 PM, Tommy Butler wrote: >> "print STDOUT" ??????? >> >> You did that. On purpose? >> >> This raises so many questions :-P >> >> -- Tommy Butler >> >> On Sep 11, 2014, Robert Flach >wrote: >> >> Well, it sounds like it was a fun meeting. I'm sorry I missed >> it! I personally will occasionally use the FizzBuzz test when >> interviewing applicants though I usually use more complicated >> coding challenges. Maybe I could share one or more of those >> sometime as a "more advanced" challenge. In the meantime, scroll >> down for my solution and for the things I look for when >evaluating >> a fizzbuzz... >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> #!/usr/bin/perl >> use strict; >> use warnings; >> my $x = 0; >> while($x++ < 100) >> { >> my $val = ""; >> $val .= ( $x % 3 == 0 ) ? "fizz" : ""; >> $val .= ( $x % 5 == 0 ) ? "buzz" : ""; >> print STDOUT ( $val ? $val : "$x" ) . "\n"; >> } >> Things I look for in a fizz buzz: >> 1. (Dealbreaker) Is the code readable. (I have a pretty loose >> definition of readable and it definitely doesn't require >comments, >> but if it's unintelligible it's a dealbreaker ) >> 2. (Dealbreaker) Will it produce correct output barring any minor >> syntax errors i.e. is the algorithm valid. >> 3. If doing a separate test for fizzbuzz have they optimized to a >> mod 15 check. >> 4. Can they (with prompting if needed) make the leap to realizing >> they can concat the two tests to produce the combined value >> without a separate test >> 5. If using real code: will it compile. >> 6. If using real code: will it compile without errors or warnings >> (e.g. for perl can I stick a use strict;use warnings; at the top >> of it. >> >> Things I never care about in a fizzbuzz: >> 1. Do they know the correct operator for modulus (as long as they >> know modulus is possible) >> 2. while vs for vs. foreach, variable initialization, ternary vs. >> if, perl vs c vs (insert your favorite language argument here) >> 3. correct formatting of output (e.g. I don't mind if they forget >> to newline it, nor do I give extra points for printf ) >> 4. error handling, supporting input arguments, etc. (this is an >> algorithm test, not a coding practices test and a coding >practices >> test is unsuitable for the time available) >> >> Things somewhat unrelated to fizzbuzz but discernible in some way >> related to the fizzbuzz tests that I definitely care about/give >> extra credit for. >> 1. Do they confirm or clarify the requirements with me in some >way >> e.g. "When you say instead prints fizz buzz or fizzbuzz do you >> mean that you don't want it to print those numbers at all and >only >> print the alternate text, or would you like it to always print >the >> numbers and print that in addition for those meeting the >> requirements?" It doesn't matter if their question is clearly >> answered in the requirements as written, restating the >> requirements as a question is a hugely valuable (and often >> undervalued) developer skill. >> 2. Similarly to number 1, do they ask questions about what I want >> in the solution (e.g. all those things in numbers 2-4 under >things >> I never care about above) I don't care about those things (for >the >> test; very different standard for "real" code), but many people >> do, and I DO care about your ability to realize that and your >> willingness to adjust your style accordingly. >> 3. I will always ask for some modification of the code >> afterwards. I care a lot about how they respond to that request, >> whether it is a request to make it do something different, to >> change the styling, to comment it, etc. >> 4. If using pseudo code does their pseudo code look like a human >> language construction or is it just code with invalid syntax. >> (Either way, once they are done I will almost always ask for >> something that would compile/interpret correctly in some >language. >> >> >> >> >> Robert Flach >> *Web Tools* >> On 9/11/2014 12:15 PM, Lisa Cloutier wrote: >>> Solution below: >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> my $x = 1; >>> >>> while ($x <= 100) >>> { >>> if (($x % 3 == 0) && ($x % 5 == 0)) >>> { >>> print "FizzBuzz\n"; >>> } >>> elsif ($x % 3 == 0) >>> { >>> print "Fizz\n"; >>> } >>> elsif ($x % 5 == 0) >>> { >>> print "Buzz\n"; >>> } >>> else >>> { >>> print "$x\n"; >>> } >>> $x++; >>> } >>> >>> I minorly "cheated" in that I didn't know the sign in Perl for >>> "mod" but had read Bob's email previously (before learning about >>> the challenge) and realized what he was doing with the % sign. >>> Had I been in an interview I probably would have used every >>> special character in turn until I figured out the symbol for >mod. >>> >>> So I guess I can "program my way out of a wet paper bag" as this >>> website proclaimed about >>> the FizzBuzz test. >>> >>> On Thu, Sep 11, 2014 at 11:42 AM, John Fields >> > wrote: >>> >>> Firstly, I want to thank John Dexter for his Docker >>> presentation, showing how to encapsulate a Mojolicious Web >>> server and application for easy deployment. He got what all >>> presenters get, a free dinner and that warm afterglow from >>> making the world a better place (with more Perl in it). :) >>> >>> I challenged the attendees last night to do the FizzBuzz >>> program. We even had one programmer in attendance that had >>> been asked to do it on a job interview the previous day! We >>> were one day late for him, but hopefully not for you.. >>> >>> Http://rosettecode.org/wiki/FizzBuzz >>> >>> Don't cheat.. Yourself. Do it from scratch before looking >at >>> other's solutions. We will pick 2 more, with increasing >>> difficulty with one per week. Also new member Andy Sohn >will >>> offer a short challenge and demonstrate answers live at the >>> next Mongers. >>> >>> So send in your code, and be as creative as you can! >>> TIMTOWTDI is a strength after all. :) >>> >>> Cheers, >>> John and Tommy >>> >>> >>> _______________________________________________ >>> Dfw-pm mailing list >>> Dfw-pm at pm.org >>> http://mail.pm.org/mailman/listinfo/dfw-pm >>> >>> >>> >>> >>> _______________________________________________ >>> Dfw-pm mailing list >>> Dfw-pm at pm.org >>> http://mail.pm.org/mailman/listinfo/dfw-pm >> >> >------------------------------------------------------------------------ >> >> Dfw-pm mailing list >> Dfw-pm at pm.org >> http://mail.pm.org/mailman/listinfo/dfw-pm >> >> >> -- Sent with *K-@ Mail >> >* > >> - the evolution of emailing. >> >> >> _______________________________________________ >> Dfw-pm mailing list >> Dfw-pm at pm.org >> http://mail.pm.org/mailman/listinfo/dfw-pm > > > >------------------------------------------------------------------------ > >_______________________________________________ >Dfw-pm mailing list >Dfw-pm at pm.org >http://mail.pm.org/mailman/listinfo/dfw-pm -- Sent with K-@ Mail - the evolution of emailing. -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.flach at webtooldeveloper.com Thu Sep 11 12:42:16 2014 From: robert.flach at webtooldeveloper.com (Robert Flach) Date: Thu, 11 Sep 2014 14:42:16 -0500 Subject: [DFW.pm] Homework for the list, and for Oct 08 meeting In-Reply-To: <1c71f5a7-7ca4-4e2f-a8b2-430666d52ab7@internetalias.net> References: <5411E373.4070705@webtooldeveloper.com> <5411F8A6.3020708@webtooldeveloper.com> <1c71f5a7-7ca4-4e2f-a8b2-430666d52ab7@internetalias.net> Message-ID: <5411FB18.6010500@webtooldeveloper.com> Yet another way to do it. Interesting. I would have assumed that the unary + would have caused a numeric contextual evaluation of the contents of the parens, causing the string prints to print zero instead, but it works a charm. Nice Robert Flach *Web Tools* On 9/11/2014 2:37 PM, Tommy Butler wrote: > You can put a unary plus sign operator on the parens to tell perl that > the parens don't belong to the print command. Also comes in handy > when using map in certain cases. > > print +( ... ) > > Cheers, > --Tommy Butler > > On Sep 11, 2014, Robert Flach wrote: > > Tommy, > Run the code without the STDOUT, then run it with. It's a > simple trick to avoid having perl interpret the ternary grouping > parenthesis as print function delemiting parenthesis. TIMTOWDI: > You could also wrap the entire thing in parenthesis, you could > skip the ternary and do your printing in an if. You could move > the ternary to an assignment statement to $val just before > printing plain old $val (what I would probably normally do if I > weren't being creative), etc. But the STDOUT is definitely > required for the code as is ;-) > > Robert Flach > *Web Tools* > On 9/11/2014 1:37 PM, Tommy Butler wrote: > "print STDOUT" ??????? > > You did that. On purpose? > > This raises so many questions :-P > > -- Tommy Butler > > On Sep 11, 2014, Robert Flach > wrote: > > Well, it sounds like it was a fun meeting. I'm sorry I missed > it! I personally will occasionally use the FizzBuzz test when > interviewing applicants though I usually use more complicated > coding challenges. Maybe I could share one or more of those > sometime as a "more advanced" challenge. In the meantime, > scroll down for my solution and for the things I look for when > evaluating a fizzbuzz... > > > > > > > > > > > > > > > > > > > > > > > > > > > > #!/usr/bin/perl > use strict; > use warnings; > my $x = 0; > while($x++ < 100) > { > my $val = ""; > $val .= ( $x % 3 == 0 ) ? "fizz" : ""; > $val .= ( $x % 5 == 0 ) ? "buzz" : ""; > print STDOUT ( $val ? $val : "$x" ) . "\n"; > } > Things I look for in a fizz buzz: > 1. (Dealbreaker) Is the code readable. (I have a pretty loose > definition of readable and it definitely doesn't require > comments, but if it's unintelligible it's a dealbreaker ) > 2. (Dealbreaker) Will it produce correct output barring any > minor syntax errors i.e. is the algorithm valid. > 3. If doing a separate test for fizzbuzz have they optimized > to a mod 15 check. > 4. Can they (with prompting if needed) make the leap to > realizing they can concat the two tests to produce the > combined value without a separate test > 5. If using real code: will it compile. > 6. If using real code: will it compile without errors or > warnings (e.g. for perl can I stick a use strict;use warnings; > at the top of it. > > Things I never care about in a fizzbuzz: > 1. Do they know the correct operator for modulus (as long as > they know modulus is possible) > 2. while vs for vs. foreach, variable initialization, ternary > vs. if, perl vs c vs (insert your favorite language argument here) > 3. correct formatting of output (e.g. I don't mind if they > forget to newline it, nor do I give extra points for printf ) > 4. error handling, supporting input arguments, etc. (this is > an algorithm test, not a coding practices test and a coding > practices test is unsuitable for the time available) > > Things somewhat unrelated to fizzbuzz but discernible in some > way related to the fizzbuzz tests that I definitely care > about/give extra credit for. > 1. Do they confirm or clarify the requirements with me in some > way e.g. "When you say instead prints fizz buzz or fizzbuzz do > you mean that you don't want it to print those numbers at all > and only print the alternate text, or would you like it to > always print the numbers and print that in addition for those > meeting the requirements?" It doesn't matter if their > question is clearly answered in the requirements as written, > restating the requirements as a question is a hugely valuable > (and often undervalued) developer skill. > 2. Similarly to number 1, do they ask questions about what I > want in the solution (e.g. all those things in numbers 2-4 > under things I never care about above) I don't care about > those things (for the test; very different standard for "real" > code), but many people do, and I DO care about your ability to > realize that and your willingness to adjust your style > accordingly. > 3. I will always ask for some modification of the code > afterwards. I care a lot about how they respond to that > request, whether it is a request to make it do something > different, to change the styling, to comment it, etc. > 4. If using pseudo code does their pseudo code look like a > human language construction or is it just code with invalid > syntax. (Either way, once they are done I will almost always > ask for something that would compile/interpret correctly in > some language. > > > > > Robert Flach > *Web Tools* > On 9/11/2014 12:15 PM, Lisa Cloutier wrote: >> Solution below: >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> my $x = 1; >> >> while ($x <= 100) >> { >> if (($x % 3 == 0) && ($x % 5 == 0)) >> { >> print "FizzBuzz\n"; >> } >> elsif ($x % 3 == 0) >> { >> print "Fizz\n"; >> } >> elsif ($x % 5 == 0) >> { >> print "Buzz\n"; >> } >> else >> { >> print "$x\n"; >> } >> $x++; >> } >> >> I minorly "cheated" in that I didn't know the sign in Perl >> for "mod" but had read Bob's email previously (before >> learning about the challenge) and realized what he was doing >> with the % sign. Had I been in an interview I probably >> would have used every special character in turn until I >> figured out the symbol for mod. >> >> So I guess I can "program my way out of a wet paper bag" as >> this website proclaimed >> about the FizzBuzz test. >> >> On Thu, Sep 11, 2014 at 11:42 AM, John Fields >> > wrote: >> >> Firstly, I want to thank John Dexter for his Docker >> presentation, showing how to encapsulate a Mojolicious >> Web server and application for easy deployment. He got >> what all presenters get, a free dinner and that warm >> afterglow from making the world a better place (with more >> Perl in it). :) >> >> I challenged the attendees last night to do the FizzBuzz >> program. We even had one programmer in attendance that >> had been asked to do it on a job interview the previous >> day! We were one day late for him, but hopefully not for >> you.. >> >> Http://rosettecode.org/wiki/FizzBuzz >> >> Don't cheat.. Yourself. Do it from scratch before >> looking at other's solutions. We will pick 2 more, with >> increasing difficulty with one per week. Also new member >> Andy Sohn will offer a short challenge and demonstrate >> answers live at the next Mongers. >> >> So send in your code, and be as creative as you can! >> TIMTOWTDI is a strength after all. :) >> >> Cheers, >> John and Tommy >> >> >> _______________________________________________ >> Dfw-pm mailing list >> Dfw-pm at pm.org >> http://mail.pm.org/mailman/listinfo/dfw-pm >> >> >> >> >> _______________________________________________ >> Dfw-pm mailing list >> Dfw-pm at pm.org >> http://mail.pm.org/mailman/listinfo/dfw-pm > > ------------------------------------------------------------------------ > > Dfw-pm mailing list > Dfw-pm at pm.org > http://mail.pm.org/mailman/listinfo/dfw-pm > > > -- Sent with *K-@ Mail > * > - the evolution of emailing. > > > _______________________________________________ > Dfw-pm mailing list > Dfw-pm at pm.org > http://mail.pm.org/mailman/listinfo/dfw-pm > > > ------------------------------------------------------------------------ > > Dfw-pm mailing list > Dfw-pm at pm.org > http://mail.pm.org/mailman/listinfo/dfw-pm > > > -- Sent with *K-@ Mail > * > - the evolution of emailing. > > > _______________________________________________ > Dfw-pm mailing list > Dfw-pm at pm.org > http://mail.pm.org/mailman/listinfo/dfw-pm -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmichaud at pobox.com Thu Sep 11 13:05:03 2014 From: pmichaud at pobox.com (Patrick R. Michaud) Date: Thu, 11 Sep 2014 15:05:03 -0500 Subject: [DFW.pm] Homework for the list, and for Oct 08 meeting In-Reply-To: <5411FB18.6010500@webtooldeveloper.com> References: <5411E373.4070705@webtooldeveloper.com> <5411F8A6.3020708@webtooldeveloper.com> <1c71f5a7-7ca4-4e2f-a8b2-430666d52ab7@internetalias.net> <5411FB18.6010500@webtooldeveloper.com> Message-ID: <20140911200503.GB18564@pmichaud.com> On Thu, Sep 11, 2014 at 02:42:16PM -0500, Robert Flach wrote: > Yet another way to do it. Interesting. I would have assumed that > the unary + would have caused a numeric contextual evaluation of the > contents of the parens, causing the string prints to print zero > instead, but it works a charm. Nice Coming from the Perl 6 world, it feels SO WRONG to me that a numeric context operator isn't producing a numeric result. It's one of those "OMG special case" exceptions that drive newbie Perl 5 programmers nuts, and definitely doesn't follow the principle of least astonishment. So yes, it works, but it's not something I'd encourage or want to see in code. :) FWIW, Perl 6 avoids this altogether by using whitespace to know when parens are part of the subroutine call syntax: print(2+3) * 7 # parens belong to "print" call print (2+3) * 7 # parens don't belong to the "print" call Pm From homebase at internetalias.net Thu Sep 11 13:29:38 2014 From: homebase at internetalias.net (Tommy Butler) Date: Thu, 11 Sep 2014 15:29:38 -0500 Subject: [DFW.pm] Homework for the list, and for Oct 08 meeting In-Reply-To: <20140911200503.GB18564@pmichaud.com> References: <5411E373.4070705@webtooldeveloper.com> <5411F8A6.3020708@webtooldeveloper.com> <1c71f5a7-7ca4-4e2f-a8b2-430666d52ab7@internetalias.net> <5411FB18.6010500@webtooldeveloper.com> <20140911200503.GB18564@pmichaud.com> Message-ID: <7fe4470b-cbb9-47dd-b41f-307f22535a98@internetalias.net> Any language that makes me use a plus sign for string concat... *ducks* --Tommy Butler On Sep 11, 2014, "Patrick R. Michaud" wrote: >On Thu, Sep 11, 2014 at 02:42:16PM -0500, Robert Flach wrote: >> Yet another way to do it. Interesting. I would have assumed that >> the unary + would have caused a numeric contextual evaluation of the >> contents of the parens, causing the string prints to print zero >> instead, but it works a charm. Nice > >Coming from the Perl 6 world, it feels SO WRONG to me that a >numeric context operator isn't producing a numeric result. It's >one of those "OMG special case" exceptions that drive newbie >Perl 5 programmers nuts, and definitely doesn't follow the >principle of least astonishment. > >So yes, it works, but it's not something I'd encourage or want to >see in code. :) > >FWIW, Perl 6 avoids this altogether by using whitespace to know >when parens are part of the subroutine call syntax: > > print(2+3) * 7 # parens belong to "print" call > print (2+3) * 7 # parens don't belong to the "print" call > >Pm >_______________________________________________ >Dfw-pm mailing list >Dfw-pm at pm.org >http://mail.pm.org/mailman/listinfo/dfw-pm -- Sent with K-@ Mail - the evolution of emailing. -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.flach at webtooldeveloper.com Thu Sep 11 13:41:04 2014 From: robert.flach at webtooldeveloper.com (Robert Flach) Date: Thu, 11 Sep 2014 15:41:04 -0500 Subject: [DFW.pm] Homework for the list, and for Oct 08 meeting In-Reply-To: <20140911200503.GB18564@pmichaud.com> References: <5411E373.4070705@webtooldeveloper.com> <5411F8A6.3020708@webtooldeveloper.com> <1c71f5a7-7ca4-4e2f-a8b2-430666d52ab7@internetalias.net> <5411FB18.6010500@webtooldeveloper.com> <20140911200503.GB18564@pmichaud.com> Message-ID: <541208E0.8020504@webtooldeveloper.com> Funny you should mention that. I agree completely, and the whitespace for defining call syntax makes a lot of sense to me. In fact, that was what I was expecting and I was quite surprised when Perl interpreted it as part of the print. Loved the %% operator by the way, seems like when I'm using modulus, that's the purpose 9 times out of 10 (on the other hand usurping bitwise & for anything else is a horrible abuse of long-time programmers trust; can't believe perl6 went there) Robert Flach *Web Tools* On 9/11/2014 3:05 PM, Patrick R. Michaud wrote: > On Thu, Sep 11, 2014 at 02:42:16PM -0500, Robert Flach wrote: >> Yet another way to do it. Interesting. I would have assumed that >> the unary + would have caused a numeric contextual evaluation of the >> contents of the parens, causing the string prints to print zero >> instead, but it works a charm. Nice > Coming from the Perl 6 world, it feels SO WRONG to me that a > numeric context operator isn't producing a numeric result. It's > one of those "OMG special case" exceptions that drive newbie > Perl 5 programmers nuts, and definitely doesn't follow the > principle of least astonishment. > > So yes, it works, but it's not something I'd encourage or want to > see in code. :) > > FWIW, Perl 6 avoids this altogether by using whitespace to know > when parens are part of the subroutine call syntax: > > print(2+3) * 7 # parens belong to "print" call > print (2+3) * 7 # parens don't belong to the "print" call > > Pm > _______________________________________________ > Dfw-pm mailing list > Dfw-pm at pm.org > http://mail.pm.org/mailman/listinfo/dfw-pm -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.flach at webtooldeveloper.com Thu Sep 11 13:50:20 2014 From: robert.flach at webtooldeveloper.com (Robert Flach) Date: Thu, 11 Sep 2014 15:50:20 -0500 Subject: [DFW.pm] Homework for the list, and for Oct 08 meeting In-Reply-To: <20140911183235.GA18564@pmichaud.com> References: <20140911183235.GA18564@pmichaud.com> Message-ID: <54120B0C.2040703@webtooldeveloper.com> So Patrick, If I want to see your solution running, what's the best recommended way to get a working perl6 environment these days? Robert Flach *Web Tools* On 9/11/2014 1:32 PM, Patrick R. Michaud wrote: > Perl 6 solution #1, the straightforward one: > > for 1..100 { > when $_ %% (3 & 5) { say "FizzBuzz" } > when $_ %% 5 { say "Buzz" } > when $_ %% 3 { say "Fizz" } > say $_; > } > > > Some explanation: > > - The Perl 6 "%%" operator returns true if the left argument is evenly > divisible by the right argument. > > - The "when" keyword is Perl 6's version of a "switch/case" statement; > when the test is true, the block following it is executed and control > skips to the end of the enclosing block. > > - The expression "$_ %% (3 & 5)" is true if $_ is evenly divisible > by both 3 and 5. (The "&" operator in Perl 6 creates a junction > of values, the numeric bitwise-and operator in Perl 6 is "+&".) > > Pm > _______________________________________________ > Dfw-pm mailing list > Dfw-pm at pm.org > http://mail.pm.org/mailman/listinfo/dfw-pm -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris at crspencer.com Thu Sep 11 14:12:16 2014 From: chris at crspencer.com (Christopher Spencer) Date: Thu, 11 Sep 2014 16:12:16 -0500 Subject: [DFW.pm] Fizzbuzz assignment Message-ID: map{if(!($_%3)){print"Fizz"}if(!($_%5)){print"Buzz"}if($_%3&&$_%5){print"$_"}print"\n"}(1..100) 97 characters. 1 line. -- Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmichaud at pobox.com Thu Sep 11 14:16:27 2014 From: pmichaud at pobox.com (Patrick R. Michaud) Date: Thu, 11 Sep 2014 16:16:27 -0500 Subject: [DFW.pm] Homework for the list, and for Oct 08 meeting In-Reply-To: <54120B0C.2040703@webtooldeveloper.com> References: <20140911183235.GA18564@pmichaud.com> <54120B0C.2040703@webtooldeveloper.com> Message-ID: <20140911211627.GA22438@pmichaud.com> On Thu, Sep 11, 2014 at 03:50:20PM -0500, Robert Flach wrote: > If I want to see your solution running, what's the best recommended > way to get a working perl6 environment these days? General answer: Navigate to perl6.org and click the "Download" link. More detailed answer/flowchart: 1. If you're running Windows, you probably want to get the latest .msi from http://rakudo.org/downloads/star . I recommend getting the "-moar" version instead of the "-parrot" version, but either should work fine. 2. If you're not running Windows, then you should decide if you want a distribution with pre-packaged Perl 6 modules ("Rakudo Star"), or just the compiler itself ("Rakudo"). If you want the pre-packaged modules, then download the .tar.gz file from http://rakudo.org/downloads/star, unpack, and build from there. If you're just interested in playing with the language, you can clone the compiler repository directly from Github and build from it. Building instructions for each are in the README file. There is a Debian package for rakudo, but it often runs many months out of date and none of the Rakudo developers have been able to be part of the Debian packaging team (long story there). For something evolving/developing as rapidly as Rakudo Perl 6, it's a bit painful to be six or so months out of date. Hope this helps. :) Pm From pmichaud at pobox.com Thu Sep 11 14:19:07 2014 From: pmichaud at pobox.com (Patrick R. Michaud) Date: Thu, 11 Sep 2014 16:19:07 -0500 Subject: [DFW.pm] Homework for the list, and for Oct 08 meeting In-Reply-To: <7fe4470b-cbb9-47dd-b41f-307f22535a98@internetalias.net> References: <5411E373.4070705@webtooldeveloper.com> <5411F8A6.3020708@webtooldeveloper.com> <1c71f5a7-7ca4-4e2f-a8b2-430666d52ab7@internetalias.net> <5411FB18.6010500@webtooldeveloper.com> <20140911200503.GB18564@pmichaud.com> <7fe4470b-cbb9-47dd-b41f-307f22535a98@internetalias.net> Message-ID: <20140911211907.GB22438@pmichaud.com> On Thu, Sep 11, 2014 at 03:29:38PM -0500, Tommy Butler wrote: > Any language that makes me use a plus sign for string concat... *ducks* Which language would that be? ;-) Perl 6 uses the tilde for concatenation, and as a string contextualizer: say "hello" ~ " world"; my $a = ~(3*5+7); # sets $a to string "22" Pm From robert.flach at webtooldeveloper.com Thu Sep 11 14:25:30 2014 From: robert.flach at webtooldeveloper.com (Robert Flach) Date: Thu, 11 Sep 2014 16:25:30 -0500 Subject: [DFW.pm] Homework for the list, and for Oct 08 meeting In-Reply-To: <20140911211907.GB22438@pmichaud.com> References: <5411E373.4070705@webtooldeveloper.com> <5411F8A6.3020708@webtooldeveloper.com> <1c71f5a7-7ca4-4e2f-a8b2-430666d52ab7@internetalias.net> <5411FB18.6010500@webtooldeveloper.com> <20140911200503.GB18564@pmichaud.com> <7fe4470b-cbb9-47dd-b41f-307f22535a98@internetalias.net> <20140911211907.GB22438@pmichaud.com> Message-ID: <5412134A.6070404@webtooldeveloper.com> I think he meant to say any language that doesn't let him use "." as the concatenation operator (a sentiment which I have some sympathy with), personally if I were in the perl6 world, I have a feeling I'd go with the join syntax over having to use ~ for string concat (e.g. say ["this"," that"," and the other"].join;) but I'm not sure... it is a lot more typing and feels less perlish (though so does not having dot for the concat operator :P. Robert Flach *Web Tools* On 9/11/2014 4:19 PM, Patrick R. Michaud wrote: > On Thu, Sep 11, 2014 at 03:29:38PM -0500, Tommy Butler wrote: >> Any language that makes me use a plus sign for string concat... *ducks* > Which language would that be? ;-) > > Perl 6 uses the tilde for concatenation, and as a string contextualizer: > > say "hello" ~ " world"; > > my $a = ~(3*5+7); # sets $a to string "22" > > Pm > _______________________________________________ > Dfw-pm mailing list > Dfw-pm at pm.org > http://mail.pm.org/mailman/listinfo/dfw-pm -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.eaglestone at gmail.com Thu Sep 11 14:30:43 2014 From: robert.eaglestone at gmail.com (Rob Eaglestone) Date: Thu, 11 Sep 2014 16:30:43 -0500 Subject: [DFW.pm] Fizzbuzz assignment In-Reply-To: References: Message-ID: Pounding one's head on the keyboard repeatedly again, I see. On Thu, Sep 11, 2014 at 4:12 PM, Christopher Spencer wrote: > > map{if(!($_%3)){print"Fizz"}if(!($_%5)){print"Buzz"}if($_%3&&$_%5){print"$_"}print"\n"}(1..100) > > 97 characters. 1 line. > > -- Chris > > _______________________________________________ > Dfw-pm mailing list > Dfw-pm at pm.org > http://mail.pm.org/mailman/listinfo/dfw-pm > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From asohn.unique at gmail.com Thu Sep 11 14:35:07 2014 From: asohn.unique at gmail.com (Andrew Sohn) Date: Thu, 11 Sep 2014 16:35:07 -0500 Subject: [DFW.pm] Fizzbuzz assignment In-Reply-To: References: Message-ID: Here's my Fizz Buzz golf attempt... :) print$_%3?'':Fizz,$_%5?'':Buzz,$_%3&&$_%5?$_:'',"\n"for 1..100 63 characters On Thu, Sep 11, 2014 at 4:30 PM, Rob Eaglestone wrote: > Pounding one's head on the keyboard repeatedly again, I see. > > On Thu, Sep 11, 2014 at 4:12 PM, Christopher Spencer > wrote: > >> >> map{if(!($_%3)){print"Fizz"}if(!($_%5)){print"Buzz"}if($_%3&&$_%5){print"$_"}print"\n"}(1..100) >> >> 97 characters. 1 line. >> >> -- Chris >> >> _______________________________________________ >> Dfw-pm mailing list >> Dfw-pm at pm.org >> http://mail.pm.org/mailman/listinfo/dfw-pm >> >> > > _______________________________________________ > Dfw-pm mailing list > Dfw-pm at pm.org > http://mail.pm.org/mailman/listinfo/dfw-pm > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmichaud at pobox.com Thu Sep 11 14:43:19 2014 From: pmichaud at pobox.com (Patrick R. Michaud) Date: Thu, 11 Sep 2014 16:43:19 -0500 Subject: [DFW.pm] Homework for the list, and for Oct 08 meeting In-Reply-To: <541208E0.8020504@webtooldeveloper.com> References: <5411E373.4070705@webtooldeveloper.com> <5411F8A6.3020708@webtooldeveloper.com> <1c71f5a7-7ca4-4e2f-a8b2-430666d52ab7@internetalias.net> <5411FB18.6010500@webtooldeveloper.com> <20140911200503.GB18564@pmichaud.com> <541208E0.8020504@webtooldeveloper.com> Message-ID: <20140911214319.GC22438@pmichaud.com> On Thu, Sep 11, 2014 at 03:41:04PM -0500, Robert Flach wrote: > (on the other hand usurping bitwise & for anything else is a > horrible abuse of long-time programmers trust; can't believe > perl6 went there) Oh, changing & (and |) makes perfect sense to me. Bitwise operations are no longer as commonly used as they once were, so huffmanization says we should give them longer forms and save the single-character operators for something more useful. Beyond that, there are in fact several meanings of "bitwise and" depending on how you look at the array of bits, so Perl 6 makes the different types of bitwise (and|or|xor) explicit: +& +| +^ numeric bitwise and, or, xor (e.g., signed) ~& ~| ~^ string buffer bitwise and, or, xor ?& ?| ?^ boolean and, or, xor (treats arguments as Bool) The above pattern makes even more sense when you consider the bit shifting operators... Perl 5's >> bit shift operator becomes +> numeric shift right (extends sign) ~> string buffer shift right (doesn't extend sign) This frees up the << and >> symbols for much more useful (and common) operations as well. And the consistent use of +/~/? to signify numeric/string/boolean pervades the entire language, thus reducing special cases and character sequences that have to be remembered. As far as changing & being an abuse of "long-time programmers' trust"; perhaps so. In Perl 6 we're focused more on making things better for generations of future programmers, even if it somewhat inconveniences the existing ones. Most long-time programmers coming to Perl 6 have been able to adapt from Perl 5's "&" bitwise and to Perl 6's "+&" without much fuss. And being able to write code like if $value == 2 | 3 | 7 | 11 | 12 { ... } if $spot ~~ Dog | Cat { ... } feels like a far more natural and useful purpose of "|" and "&" as operators, especially for newbie programmers. Pm From sriharsha at vedurumudi.com Thu Sep 11 15:09:47 2014 From: sriharsha at vedurumudi.com (Sriharsha Vedurumudi) Date: Thu, 11 Sep 2014 18:09:47 -0400 Subject: [DFW.pm] Fizzbuzz assignment In-Reply-To: References: Message-ID: <54121DAB.8000509@vedurumudi.com> Got a compile error when trying to run this. But this worked (81 chars though) map{print "".($_%15)?($_%3)?($_%5)?"$_\n":"Buzz\n":"Fizz\n":"FizzBuzz\n"}(1..100) -Sri On 09/11/2014 05:35 PM, Andrew Sohn wrote: > Here's my Fizz Buzz golf attempt... :) > > print$_%3?'':Fizz,$_%5?'':Buzz,$_%3&&$_%5?$_:'',"\n"for 1..100 > 63 characters > > On Thu, Sep 11, 2014 at 4:30 PM, Rob Eaglestone > > wrote: > > Pounding one's head on the keyboard repeatedly again, I see. > > On Thu, Sep 11, 2014 at 4:12 PM, Christopher Spencer > > wrote: > > map{if(!($_%3)){print"Fizz"}if(!($_%5)){print"Buzz"}if($_%3&&$_%5){print"$_"}print"\n"}(1..100) > > > 97 characters. 1 line. > > -- Chris > > _______________________________________________ > Dfw-pm mailing list > Dfw-pm at pm.org > http://mail.pm.org/mailman/listinfo/dfw-pm > > > > _______________________________________________ > Dfw-pm mailing list > Dfw-pm at pm.org > http://mail.pm.org/mailman/listinfo/dfw-pm > > > > > _______________________________________________ > Dfw-pm mailing list > Dfw-pm at pm.org > http://mail.pm.org/mailman/listinfo/dfw-pm -------------- next part -------------- An HTML attachment was scrubbed... URL: From homebase at internetalias.net Thu Sep 11 15:23:11 2014 From: homebase at internetalias.net (Tommy Butler) Date: Thu, 11 Sep 2014 17:23:11 -0500 Subject: [DFW.pm] Homework for the list, and for Oct 08 meeting In-Reply-To: <5412134A.6070404@webtooldeveloper.com> References: <5411E373.4070705@webtooldeveloper.com> <5411F8A6.3020708@webtooldeveloper.com> <1c71f5a7-7ca4-4e2f-a8b2-430666d52ab7@internetalias.net> <5411FB18.6010500@webtooldeveloper.com> <20140911200503.GB18564@pmichaud.com> <7fe4470b-cbb9-47dd-b41f-307f22535a98@internetalias.net> <20140911211907.GB22438@pmichaud.com> <5412134A.6070404@webtooldeveloper.com> Message-ID: Not necessarily, Robert. To me, it's like grinding my teeth with sandpaper when I have to use mathematical operators on strings. + = - Oh there are too many languages that do this to us, and then afterward some really stellar ones will follow up that poke in the eye with another. I'm talking about the ones that proudly don't support string interpolation. This makes the first problem worse. How? Let's see. As an example we'll play every browser's favorite game: "adding strings and variables"... greet( "Hello, there " + visitor.fname + ". My name is " + me.fname + " " + me.lname + "." ) Here's Bob Costas with some post game review: Hi there viewers. I'm not sure who won. I'm not sure anybody won. But the I'm feeling good about tonight's game. Not one semicolon. No sigils either! If you want to avoid unnecessary punctuation, this is the way! Back over to you, Tommy. Thanks Bob for that hard hitting review. I agree that this is the way we should be programming...like it's 1999. What a time to be alive. Yep. You've won me over now lang.name. ?/sarcasm? Using "incorrect" operators for a given datatype. That's what I dislike. And then forcing me to do it hundreds of times in a simple program because there's no interpolation support is what I strongly dislike. Patrick, I like tilde for string concat. Heck I love it. And if Perl didn't already wasted the underscore for numeric notation lipstick, I'd go for that too. Thanks for watching tonight's episode of "My Issues, Grab Some Tissues". This is your host, Tommy Butler signing off. Have a good night ladies and gentlemen. ...is this thing still on? I wonder if Patrick noticed my?french?sarcasm... On Sep 11, 2014, Robert Flach wrote: I think he meant to say any language that doesn't let him use "." as the concatenation operator (a sentiment which I have some sympathy with), personally if I were in the perl6 world, I have a feeling I'd go with the join syntax over having to use ~ for string concat (e.g. say ["this"," that"," and the other"].join;) but I'm not sure... it is a lot more typing and feels less perlish (though so does not having dot for the concat operator :P. Robert Flach Web Tools On 9/11/2014 4:19 PM, Patrick R. Michaud wrote: On Thu, Sep 11, 2014 at 03:29:38PM -0500, Tommy Butler wrote: Any language that makes me use a plus sign for string concat... *ducks* Which language would that be? ;-) Perl 6 uses the tilde for concatenation, and as a string contextualizer: say "hello" ~ " world"; my $a = ~(3*5+7); # sets $a to string "22" Pm _______________________________________________ Dfw-pm mailing list Dfw-pm at pm.org http://mail.pm.org/mailman/listinfo/dfw-pm _____________________________________________ Dfw-pm mailing list Dfw-pm at pm.org http://mail.pm.org/mailman/listinfo/dfw-pm -- Sent with K-@ Mail - the evolution of emailing. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kbrannen at pwhome.com Thu Sep 11 22:08:40 2014 From: kbrannen at pwhome.com (kevin) Date: Fri, 12 Sep 2014 00:08:40 -0500 Subject: [DFW.pm] Homework for the list, and for Oct 08 meeting In-Reply-To: <8009ce56-a4e0-47aa-b1b2-6278d63b86d1@internetalias.net> References: <8009ce56-a4e0-47aa-b1b2-6278d63b86d1@internetalias.net> Message-ID: <54127FD8.70708@pwhome.com> On 09/11/2014 02:03 PM, Tommy Butler wrote: ... > http://rosettacode.org/wiki/FizzBuzz > > Is all about the modulus operator. To do it another way might be > creative but would almost certainly likely be less efficient. The only > thing I can think of that world be faster is the cheat method I saw, > where you hard code into your program the known fizzes and buzzes, > spitting them out at the corresponding integer positions in the 1 to 100 > loop. ... You mean in the spirit of "Sieve of Eratosthenes" where you trade space of complexity? That's the only way I can think of to do it without the modulus operator. my @nums; for ($i=3 ; $i <= 100 ; $i += 3) { $nums[$i]++; } for ($i=5 ; $i <= 100 ; $i += 5) { $nums[$i] += 2; } my @strings = (0, "Fizz", "Buzz", "FizzBuzz"); print (($strings[$nums[$_]] || $_) . "\n") for (1 .. 100); I don't think I'd call that cheating, but inefficient I'll agree with. :) By cheating, I assume the method where you create an array with 100 hard-coded values? Yeah, I go with cheating there. :) Kevin From cspencer.mail at gmail.com Thu Sep 11 14:08:01 2014 From: cspencer.mail at gmail.com (Christopher Spencer) Date: Thu, 11 Sep 2014 16:08:01 -0500 Subject: [DFW.pm] Fizzbuzz Message-ID: map{if(!($_%3)){print"Fizz"}if(!($_%5)){print"Buzz"}if($_%3&&$_%5){print"$_"}print"\n"}(1..100) 96 characters. -- Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: From rurban at cpanel.net Fri Sep 12 10:55:08 2014 From: rurban at cpanel.net (Reini Urban) Date: Fri, 12 Sep 2014 12:55:08 -0500 Subject: [DFW.pm] Fizzbuzz assignment In-Reply-To: <54121DAB.8000509@vedurumudi.com> References: <54121DAB.8000509@vedurumudi.com> Message-ID: <5413337C.3010103@cpanel.net> On 09/11/2014 05:09 PM, Sriharsha Vedurumudi wrote: > Got a compile error when trying to run this. > But this worked (81 chars though) > > map{print > "".($_%15)?($_%3)?($_%5)?"$_\n":"Buzz\n":"Fizz\n":"FizzBuzz\n"}(1..100) do not use map when you can use for > On 09/11/2014 05:35 PM, Andrew Sohn wrote: >> Here's my Fizz Buzz golf attempt... :) >> >> print$_%3?'':Fizz,$_%5?'':Buzz,$_%3&&$_%5?$_:'',"\n"for 1..100 >> 63 characters well, for the golf cmdline you need "" p -e'print$_%3?"":Fizz,$_%5?"":Buzz,$_%3&&$_%5?$_:"","\n"for 1..100' -- Reini From dfwpm at internetalias.net Mon Sep 15 08:36:13 2014 From: dfwpm at internetalias.net (Tommy Butler) Date: Mon, 15 Sep 2014 10:36:13 -0500 Subject: [DFW.pm] message from meetup.com is bogus, please disregard Message-ID: <5417076D.8050201@internetalias.net> Hello friends. Important clarification here--- My humor is morbidly sarcastic and drier than a cup of sand; I believe I can be over-dramatic at times regarding my advocacy of Perl; I confess I write unreadable regular expressions; I'm aware I sometimes interrupt people when I get excited; I know these things, and I apologize profusely if I've ever offended anyone... But let me make clear that despite these shortcomings, /*neither John nor I have stepped down*/ as the organizers of the DFW Perl Mongers. I remain enthusiastically committed to DFW.pm in my current capacity. So what happened? Why this email? Meetup.com just sent out a bogus "shaming" email saying I stepped down as our group organizer, inviting someone else to come assume leadership and _pay_ meetup to do so. This happened because earler today I discontinued my meetup membership and ended my monthly payment of meetup dues, because they are expensive and offer me nothing. Please disregard their message. -- Tommy Butler -------------- next part -------------- An HTML attachment was scrubbed... URL: From vdpcorp at gmail.com Wed Sep 17 15:45:59 2014 From: vdpcorp at gmail.com (Bob VanDerPloeg) Date: Wed, 17 Sep 2014 17:45:59 -0500 Subject: [DFW.pm] Learn Perl with and Ministry Metrics Project Collaboration Message-ID: I really enjoyed last weeks DFWpm group and I am looking forward to getting to know others in the group and taking my Perl skills to the next level. I would like to propose an idea to anyone who is interested in learning Perl with me and at the same time moving an active project forward. I have a website that produces dashboards for churches called ministrymetrics.net. The demo site is "http://ffc.ministrymetrics.net". You can log in using " demo at demo.com" and password "demo". The bulk of the site is written in Perl with some css, jquery & javascript. If your interested in learning Perl and helping with this project please email me at vdpcorp at gmail.com and we can talk about next steps. I'll be glad to show you the current code. You know what I would REALLY like to do? Re-write this site in Perl 6!! Thanks Bob -------------- next part -------------- An HTML attachment was scrubbed... URL: From john.dexter at psydefect.com Wed Sep 24 14:19:34 2014 From: john.dexter at psydefect.com (John Dexter) Date: Wed, 24 Sep 2014 16:19:34 -0500 Subject: [DFW.pm] Homework for the list, and for Oct 08 meeting In-Reply-To: <54127FD8.70708@pwhome.com> References: <8009ce56-a4e0-47aa-b1b2-6278d63b86d1@internetalias.net> <54127FD8.70708@pwhome.com> Message-ID: Again with some TIMTOWTDI. I'm trying to learn some Perl6 so here is my FizzBuzz basketball attempt (definitely not golf anyway). It's a full CLI application; complete with usage screen and some tests. https://github.com/PsyDefect/App-FizzBuzz.git John Dexter On Fri, Sep 12, 2014 at 12:08 AM, kevin wrote: > On 09/11/2014 02:03 PM, Tommy Butler wrote: > ... > >> http://rosettacode.org/wiki/FizzBuzz >> >> Is all about the modulus operator. To do it another way might be >> creative but would almost certainly likely be less efficient. The only >> thing I can think of that world be faster is the cheat method I saw, >> where you hard code into your program the known fizzes and buzzes, >> spitting them out at the corresponding integer positions in the 1 to 100 >> loop. >> > ... > > You mean in the spirit of "Sieve of Eratosthenes" where you trade space of > complexity? That's the only way I can think of to do it without the modulus > operator. > > my @nums; > for ($i=3 ; $i <= 100 ; $i += 3) { $nums[$i]++; } > for ($i=5 ; $i <= 100 ; $i += 5) { $nums[$i] += 2; } > my @strings = (0, "Fizz", "Buzz", "FizzBuzz"); > print (($strings[$nums[$_]] || $_) . "\n") for (1 .. 100); > > I don't think I'd call that cheating, but inefficient I'll agree with. :) > > By cheating, I assume the method where you create an array with 100 > hard-coded values? Yeah, I go with cheating there. :) > > Kevin > _______________________________________________ > > Dfw-pm mailing list > Dfw-pm at pm.org > http://mail.pm.org/mailman/listinfo/dfw-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmichaud at pobox.com Wed Sep 24 14:48:13 2014 From: pmichaud at pobox.com (Patrick R. Michaud) Date: Wed, 24 Sep 2014 16:48:13 -0500 Subject: [DFW.pm] Homework for the list, and for Oct 08 meeting In-Reply-To: References: <8009ce56-a4e0-47aa-b1b2-6278d63b86d1@internetalias.net> <54127FD8.70708@pwhome.com> Message-ID: <20140924214813.GA26392@pmichaud.com> Note that MAIN can be a multisub. In other words, you can do: multi sub MAIN(Int :$end = 100, Int :$fizz = 3, Int :$buzz = 5) { ... } multi sub MAIN(Bool :$help) { say qq:to"END_USAGE"; ... END_USAGE } Perl 6 will select the MAIN() sub based on the options provided on the command line. Pm On Wed, Sep 24, 2014 at 04:19:34PM -0500, John Dexter wrote: > Again with some TIMTOWTDI. I'm trying to learn some Perl6 so here is my > FizzBuzz basketball attempt (definitely not golf anyway). > > It's a full CLI application; complete with usage screen and some tests. > https://github.com/PsyDefect/App-FizzBuzz.git > > > John Dexter > > On Fri, Sep 12, 2014 at 12:08 AM, kevin wrote: > > > On 09/11/2014 02:03 PM, Tommy Butler wrote: > > ... > > > >> http://rosettacode.org/wiki/FizzBuzz > >> > >> Is all about the modulus operator. To do it another way might be > >> creative but would almost certainly likely be less efficient. The only > >> thing I can think of that world be faster is the cheat method I saw, > >> where you hard code into your program the known fizzes and buzzes, > >> spitting them out at the corresponding integer positions in the 1 to 100 > >> loop. > >> > > ... > > > > You mean in the spirit of "Sieve of Eratosthenes" where you trade space of > > complexity? That's the only way I can think of to do it without the modulus > > operator. > > > > my @nums; > > for ($i=3 ; $i <= 100 ; $i += 3) { $nums[$i]++; } > > for ($i=5 ; $i <= 100 ; $i += 5) { $nums[$i] += 2; } > > my @strings = (0, "Fizz", "Buzz", "FizzBuzz"); > > print (($strings[$nums[$_]] || $_) . "\n") for (1 .. 100); > > > > I don't think I'd call that cheating, but inefficient I'll agree with. :) > > > > By cheating, I assume the method where you create an array with 100 > > hard-coded values? Yeah, I go with cheating there. :) > > > > Kevin > > _______________________________________________ > > > > Dfw-pm mailing list > > Dfw-pm at pm.org > > http://mail.pm.org/mailman/listinfo/dfw-pm > > > _______________________________________________ > Dfw-pm mailing list > Dfw-pm at pm.org > http://mail.pm.org/mailman/listinfo/dfw-pm From john.dexter at psydefect.com Wed Sep 24 15:34:12 2014 From: john.dexter at psydefect.com (John Dexter) Date: Wed, 24 Sep 2014 17:34:12 -0500 Subject: [DFW.pm] Homework for the list, and for Oct 08 meeting In-Reply-To: <20140924214813.GA26392@pmichaud.com> References: <8009ce56-a4e0-47aa-b1b2-6278d63b86d1@internetalias.net> <54127FD8.70708@pwhome.com> <20140924214813.GA26392@pmichaud.com> Message-ID: Thanks, Patrick. That's cool! I have seen some examples with multisubs for MAIN, but didn't think to use it in this case. John Dexter On Wed, Sep 24, 2014 at 4:48 PM, Patrick R. Michaud wrote: > > Note that MAIN can be a multisub. In other words, you can do: > > multi sub MAIN(Int :$end = 100, Int :$fizz = 3, Int :$buzz = 5) > { > ... > } > > multi sub MAIN(Bool :$help) > { > say qq:to"END_USAGE"; > ... > END_USAGE > } > > > Perl 6 will select the MAIN() sub based on the options provided on the > command line. > > Pm > > > On Wed, Sep 24, 2014 at 04:19:34PM -0500, John Dexter wrote: > > Again with some TIMTOWTDI. I'm trying to learn some Perl6 so here is my > > FizzBuzz basketball attempt (definitely not golf anyway). > > > > It's a full CLI application; complete with usage screen and some tests. > > https://github.com/PsyDefect/App-FizzBuzz.git > > > > > > John Dexter > > > > On Fri, Sep 12, 2014 at 12:08 AM, kevin wrote: > > > > > On 09/11/2014 02:03 PM, Tommy Butler wrote: > > > ... > > > > > >> http://rosettacode.org/wiki/FizzBuzz > > >> > > >> Is all about the modulus operator. To do it another way might be > > >> creative but would almost certainly likely be less efficient. The > only > > >> thing I can think of that world be faster is the cheat method I saw, > > >> where you hard code into your program the known fizzes and buzzes, > > >> spitting them out at the corresponding integer positions in the 1 to > 100 > > >> loop. > > >> > > > ... > > > > > > You mean in the spirit of "Sieve of Eratosthenes" where you trade > space of > > > complexity? That's the only way I can think of to do it without the > modulus > > > operator. > > > > > > my @nums; > > > for ($i=3 ; $i <= 100 ; $i += 3) { $nums[$i]++; } > > > for ($i=5 ; $i <= 100 ; $i += 5) { $nums[$i] += 2; } > > > my @strings = (0, "Fizz", "Buzz", "FizzBuzz"); > > > print (($strings[$nums[$_]] || $_) . "\n") for (1 .. 100); > > > > > > I don't think I'd call that cheating, but inefficient I'll agree with. > :) > > > > > > By cheating, I assume the method where you create an array with 100 > > > hard-coded values? Yeah, I go with cheating there. :) > > > > > > Kevin > > > _______________________________________________ > > > > > > Dfw-pm mailing list > > > Dfw-pm at pm.org > > > http://mail.pm.org/mailman/listinfo/dfw-pm > > > > > > _______________________________________________ > > Dfw-pm mailing list > > Dfw-pm at pm.org > > http://mail.pm.org/mailman/listinfo/dfw-pm > > _______________________________________________ > Dfw-pm mailing list > Dfw-pm at pm.org > http://mail.pm.org/mailman/listinfo/dfw-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vdpcorp at gmail.com Sat Sep 27 06:52:56 2014 From: vdpcorp at gmail.com (Bob VanDerPloeg) Date: Sat, 27 Sep 2014 08:52:56 -0500 Subject: [DFW.pm] Perl Projects Message-ID: Does anyone from the group interested in getting together today or tomorrow and collaborating on some Perl projects? I would love to see what your working on and learn more Perl. Thanks Bob vdpcorp at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dfwpm at internetalias.net Tue Sep 30 19:35:16 2014 From: dfwpm at internetalias.net (Tommy Butler) Date: Tue, 30 Sep 2014 21:35:16 -0500 Subject: [DFW.pm] new homework. fizz this buzz (advanced difficulty) Message-ID: <542B6864.5030908@internetalias.net> I'm calling this one advanced because it might be time intensive in Perl 6 (bait set). I'll publish an easier assignment in a couple days or so. This is a variation on an old riddle. Tackle one part or all parts of this problem in Perl or Perl 6. The only argument to your program is a single integer, representing the number of members in your traveling party. With a group of any random number of members, no less than 3, represented by exactly three /*types*/ of members, design the most efficient algorithm that gets each member safely from one side of a Bifr?st bridge to the other. The laws of probability apply in the distribution of types to members. You have to create the type-assignment mechanism that properly determines types based on these laws. The only violation of this principle is that there must be at least one member of each type present. Once you've determined your types, you start crossing your members over the bridge. This is a problem in and of itself. One member may cross at a time, because the way is dark, narrow, and only wide enough for 1 guide and 1 traveler to pass at a time. You are the guide, you hold Mj?lnir, and no one crosses without you. Traveling members can never get across unaided. Let (d) stand for duration. Traveling member type one (Fortran programmer) is slow and withered with age. It takes this member 3d time to cross the Bifr?st Type two (mouse) is faster than the others and can cross in 1d time Type three (cat) crosses in 2d and poses a danger to type two travelers if left unsupervised with them on the FAR SIDE of the bridge. On the near side, Heimdallr is guarding the mice. You are allowed to "sacrifice" some of your members to this danger. Leaving one cat on the far side with any number of mice results in a (m) mortality. A cat will only kill once. A mortality incurs a duration penalty equal to the (d) value of the member that was sacrificed, because a proper viking burial will have to be carried out for the fallen warrior, resulting in heavy hearts, and more delay. The winning algorithm will do this in the lowest (d) duration time and with the lowest (m) mortality rate. The type-assignment and bridge-crossing algorithms must be correct. Expected input: 100 (suggested starting point) Expected output: Total Fortran programmer duration: __d Total Cat duration: __d Total Mouse duration: __d Total traveler duration: __d You can add statistics about which category took up the most time, etc. It's all for fun. The answer could be ridiculously easy. -- Tommy Butler -------------- next part -------------- An HTML attachment was scrubbed... URL: