From jacoby.david at gmail.com Tue Jul 21 08:55:55 2015 From: jacoby.david at gmail.com (Dave Jacoby) Date: Tue, 21 Jul 2015 11:55:55 -0400 Subject: [Purdue-pm] challenge problem for next Perl Mongers meeting In-Reply-To: <27411.1437492714@pier.ecn.purdue.edu> References: <27411.1437492714@pier.ecn.purdue.edu> Message-ID: I suppose it's a fair issue, but every campus building is on Google Maps and presumably available in different ways on different search engines. I certainly understand locking away access to reserving rooms, to the list of buildings itself? It's a late 90s programming problem trying to get data in a late 90s format (OK, CSV blooms eternal) through a late 90s interface. I have no interest in it. But if anyone else wants in, enjoy. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jacoby.david at gmail.com Tue Jul 21 09:03:43 2015 From: jacoby.david at gmail.com (Dave Jacoby) Date: Tue, 21 Jul 2015 12:03:43 -0400 Subject: [Purdue-pm] Fwd: challenge problem for next Perl Mongers meeting In-Reply-To: <27411.1437492714@pier.ecn.purdue.edu> References: <27411.1437492714@pier.ecn.purdue.edu> Message-ID: I thought, being a reply, the message body would've gone along with the response. Sorry. ---------- Forwarded message ---------- From: Mark Senn Date: Tue, Jul 21, 2015 at 11:31 AM Subject: challenge problem for next Perl Mongers meeting To: Dave Jacoby , Derrick Kearney < derrick at csociety.org>, Joe Kline , Mark Senn < mark at purdue.edu>, Michael Gribskov , Rick Westerman < westerman at purdue.edu> Challenge problem for next Perl Mongers meeting: Using these instructions from Brandon Case: SMAS also maintains the complete list along with mailing addresses in their Space Inventory application at https://www.smas.purdue.edu/inventory/ Log in and then choose "Building(s)" from the navigation menu on the left. The entire table can be exported to PDF or CSV from the "Generate Report" button. write a Perl 5 or Perl 6 program that uses Perl 5 and/or Perl 6 CPAN to do the above and prints out all building abbreviations and building names. Your password must be kept encrypted in a separate file that only you can read. -mark -- David Jacoby jacoby.david at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at purdue.edu Tue Jul 28 05:48:22 2015 From: mark at purdue.edu (Mark Senn) Date: Tue, 28 Jul 2015 08:48:22 -0400 Subject: [Purdue-pm] Perl 6 Message-ID: <9980.1438087702@pier.ecn.purdue.edu> Perl 6 is a much better language than Perl 5 in my opinion. I'm using it for simple programs now and am very happy with it. Perl 5 has Comprehensive Perl Archive Network (CPAN) http://www.cpan.org 153,637 open source Perl modules ready to download and use and Perl 6 has Perl 6 Modules http://modules.perl6.org a few hundred Perl 6 modules (that aren't as mature or tested as Perl 5 modules) Perl 5 and Perl 6 are both planned to be further developed and supported in the future. I like to use what I think are the best tools possible so I plan to use Perl 6. I suggest you use Perl 6 for small simple programs that are not mission-critical now because trying to learn Perl 6 all at one time later may be prohibitively difficult. Perl 6 is experimental now, a production version will be released later---this year has been mentioned---but the date has slipped before. You can see the notes from my July 15, 2015 talk Let Perl 6 Do It at https://engineering.purdue.edu/~mark/perl6-2015-07-15.pdf (Go into full screen mode and hit the down arrow key repeatedly to see the talk unfold (that works for me using acroread). Warning: this relies a lot on what I said during the talk.) Here is a complete Perl 6 program for Linux that defines command line options (-d, --digits, -p, --passlen, -r, --rows, -u, --uppercase), their default values, and prints $rows rows of $cols columns of $passlen character long random passwords. #!/usr/new/bin/perl6 sub MAIN ( Bool :d(:$digits), Int :p(:$passlen) = 8, Int :r(:$rows) = 20, Bool :u(:$uppercase) ) { my @char = 'a' .. 'z'; ($digits) and @char.push('0' .. '9'); ($uppercase) and @char.push('A' .. 'Z'); my $cols = (78 / ($passlen + 1)).Int; for 1 .. $rows { # ( # Originally I had # say (@char.roll($passlen).join xx $cols).join(' '); # I like this representation because the code for rows # is spread out over multiple lines (vertically) and the # code for a single line is horizontal (one line). # In practice, it doesn't take long to get used # to the left-to-right reading of Perl 6 syntax with # variable.method1.method2.method3 # and is so much easier to read than the Perl 5 syntax of # function3(function2(function1(variable))) # Perl 5 allows using no parentheses but you still need # to read "from the inside out" to understand what's going on. # ) # I divided what I originally had into two lines to # make it easier for beginners to read. # 1. Start with the array @char. # 2. Choose $passlen elements at random from it (.roll might # choose the same element more than once, use .pick to # choose the same element no more than once). # 3. That gives us a new array that we join together (take spaces # out of) to form one password. # 4. The xx $cols gives us $cols random passwords. my @pass = @char.roll($passlen).join xx $cols; # Print the $cols passwords on one line separated by spaces. say @pass.join(' '); } } Here are some results of running the program % ./t.p6 -h Usage: t.p6 [-d|--digits] [-p|--passlen=] [-r|--rows=] [-u|--uppercase] % ./t.p6 -p=5 --rows=3 nbmtu lrelu zeqas ptvmj ctcub axieh jsikn ilsro vuaje cybvh npoeb pfcrb jwwxi ynwji xpndp rgmcd oewhw dtmas pckxt wdfbm lxwtq eeltp zkkwv lamda jlvdg vbcrf telfq xsljq cpiik gvmes mipyx hoihp tadbs ijzeh uwqmz bmnco ixgjs iydmk yxnai The message below explains how to get and find out more about Perl 6. -mark > Date: Mon, 27 Jul 2015 21:35:11 +0200 > From: Moritz Lenz > To: perl6-users , > perl6-compiler , > Perl 6 Language > Subject: Announce: Rakudo Star Release 2015.07 > > A useful, usable, "early adopter" distribution of Perl 6 > > On behalf of the Rakudo and Perl 6 development teams, I'm happy to > announce the July 2015 release of "Rakudo Star", a useful and usable > distribution of Perl 6. The tarball for the July 2015 release is > available from . > > This Rakudo Star release comes with support for the MoarVM > backend (all module tests pass on supported platforms). > > In the Perl 6 world, we make a distinction between the language > ("Perl 6") and specific implementations of the language such as > "Rakudo Perl". This Star release includes [release 2015.07.2] of the > [Rakudo Perl 6 compiler], version 2015.07 of [MoarVM], plus various > modules, documentation, and other resources collected from the > Perl 6 community. > > [release 2015.07.2]: > https://github.com/rakudo/rakudo/blob/nom/docs/announce/2015.07.md > [Rakudo Perl 6 compiler]: http://github.com/rakudo/rakudo > [MoarVM]: http://moarvm.org/ > > Some of the new compiler features added to this release include: > > * Cool.substr(-rw) and &substr(-rw) now also accept a Range > * Added trait "is required" on class attributes > * &?ROUTINE and &?BLOCK > * &words implemented (to completement .words) > * Numeric comparison ops (== > etc) for DateTimes > * samewith() now also works in subs > * Calling the .clone method with alternate values no longer changes original > * .grep and &grep now consume multiple elements for many-param blocks > * ENTER phaser now can be used as an r-value > > Notable changes in modules shipped with Rakudo Star: > > * Bailador: Add links to documentation > * DBIish: Use Postgres environment variables for test configuration > * doc: More documentation, mostly for IO-related classes and methods > > There are some key features of Perl 6 that Rakudo Star does not yet > handle appropriately, although they will appear in upcoming releases. > Some of the not-quite-there features include: > > * advanced macros > * non-blocking I/O (in progress) > * much of Synopsis 9 and 11 > > There is an online resource at > that lists the known implemented and missing features of Rakudo's > backends and other Perl 6 implementations. > > In many places we've tried to make Rakudo smart enough to inform the > programmer that a given feature isn't implemented, but there are many > that we've missed. Bug reports about missing and broken features are > welcomed at . > > See for links to much more information about > Perl 6, including documentation, example code, tutorials, reference > materials, specification documents, and other supporting resources. A > draft of a Perl 6 book is available as docs/UsingPerl6-draft.pdf in > the release tarball. > > The development team thanks all of the contributors and sponsors for > making Rakudo Star possible. If you would like to contribute, see > , ask on the > mailing list, or join us on IRC \#perl6 on freenode. From mark at purdue.edu Wed Jul 29 07:59:54 2015 From: mark at purdue.edu (Mark Senn) Date: Wed, 29 Jul 2015 10:59:54 -0400 Subject: [Purdue-pm] challenge problem for next meeting? Message-ID: <14704.1438181994@pier.ecn.purdue.edu> Is there interest in this challenge problem for the next meeting? Write back if you'll talk, email, or blog about your solution. Given a list of names, for example Abe Alan Ben Cat Cathy print a list of all names, shortening them as much as possible, with them still remaining unique, like this Ab Abe Al Ala Alan B Be Ben Cat Cath Cathy in Perl 5 and Perl 6. Read the names from a Perl data section one name per line. Do error checking to make sure you aren't given duplicate names. Perl 6 has grammars http://doc.perl6.org/language/grammars and sets, bags, and mixes: http://doc.perl6.org/language/setbagmix -mark From mdw at purdue.edu Wed Jul 29 09:02:56 2015 From: mdw at purdue.edu (Mark Daniel Ward) Date: Wed, 29 Jul 2015 12:02:56 -0400 Subject: [Purdue-pm] challenge problem for next meeting? In-Reply-To: <14704.1438181994@pier.ecn.purdue.edu> References: <14704.1438181994@pier.ecn.purdue.edu> Message-ID: <55B8F930.8040103@purdue.edu> Dear Mark, That's a pretty interesting question (to me, at least), because I study retrieval trees in my research, and this is a very closely related topic. I am eager to see what contributions that people make! I am assuming you have an amazing way to do this in Perl 6. Mark On 7/29/15 10:59 AM, Mark Senn wrote: > Is there interest in this challenge problem for the next meeting? > Write back if you'll talk, email, or blog about your solution. > Given a list of names, for example > Abe > Alan > Ben > Cat > Cathy > print a list of all names, shortening them as much > as possible, with them still remaining unique, like this > Ab > Abe > Al > Ala > Alan > B > Be > Ben > Cat > Cath > Cathy > in Perl 5 and Perl 6. > > Read the names from a Perl data section one name per line. > Do error checking to make sure you aren't given duplicate names. > Perl 6 has grammars > http://doc.perl6.org/language/grammars > and sets, bags, and mixes: > http://doc.perl6.org/language/setbagmix > > -mark > _______________________________________________ > Purdue-pm mailing list > Purdue-pm at pm.org > http://mail.pm.org/mailman/listinfo/purdue-pm From mark at ecn.purdue.edu Wed Jul 29 09:30:06 2015 From: mark at ecn.purdue.edu (Mark Senn) Date: Wed, 29 Jul 2015 12:30:06 -0400 Subject: [Purdue-pm] challenge problem for next meeting? In-Reply-To: <55B8F7B7.5060505@purdue.edu> References: <14704.1438181994@pier.ecn.purdue.edu> <55B8F7B7.5060505@purdue.edu> Message-ID: <41761.1438187406@pier.ecn.purdue.edu> Mark Senn wrote on 2015-07-29 at 10:59 -04: | Is there interest in this challenge problem for the next meeting? | Write back if you'll talk, email, or blog about your solution. | Given a list of names, for example | Abe | Alan | Ben | Cat | Cathy | print a list of all names, shortening them as much | as possible, with them still remaining unique, like this | Ab | Abe | Al | Ala | Alan | B | Be | Ben | Cat | Cath | Cathy | in Perl 5 and Perl 6. | | Read the names from a Perl data section one name per line. | Do error checking to make sure you aren't given duplicate names. | Perl 6 has grammars | http://doc.perl6.org/language/grammars | and sets, bags, and mixes: | http://doc.perl6.org/language/setbagmix Michael Gribskov wrote on 2015-07-29 at 11:56:39 -04: | Do you want the output to be unique, e.g., both Cat and Cathy contain | CAT, should it occur only once in output? Yes, just once. After the program runs (This column is not part of the original problem definition, I only added it to give an example of what I mean in the paragraph following this list.) THESE NAMES COULD REFER TO THESE PEOPLE ----------- -------------------------------------------------- Ab Abe Abe Lincoln Al Ala Alan Alan Turing B Be Ben Ben Carson Cat Cat Stevens Cath Cathy Cathy Rigby Cath is not shortened to Cat because we'd get Cat Stevens and Cathy Rigby confused. -mark From gribskov at purdue.edu Wed Jul 29 10:14:41 2015 From: gribskov at purdue.edu (Michael Gribskov) Date: Wed, 29 Jul 2015 13:14:41 -0400 Subject: [Purdue-pm] challenge problem for next meeting? In-Reply-To: <41761.1438187406@pier.ecn.purdue.edu> References: <14704.1438181994@pier.ecn.purdue.edu> <55B8F7B7.5060505@purdue.edu> <41761.1438187406@pier.ecn.purdue.edu> Message-ID: <55B90A01.1080309@purdue.edu> It significantly changes the challenge if you want the output to inlclude only the (possibly) shortened forms that are unique to one person. In this case, there is no way to refer to Cat Stevens. the logic to identify that Cat must be maintained for Cat Stevens, and further reductions of Cath must be rejected seems to be complex. Is this included in the challenge? I have a pretty straightforward way to solve this more complicated problem, as well as a very simple ways to solve the problem as originally stated in minimum time. On 7/29/2015 12:30 PM, Mark Senn wrote: > Mark Senn wrote on 2015-07-29 at 10:59 -04: > | Is there interest in this challenge problem for the next meeting? > | Write back if you'll talk, email, or blog about your solution. > | Given a list of names, for example > | Abe > | Alan > | Ben > | Cat > | Cathy > | print a list of all names, shortening them as much > | as possible, with them still remaining unique, like this > | Ab > | Abe > | Al > | Ala > | Alan > | B > | Be > | Ben > | Cat > | Cath > | Cathy > | in Perl 5 and Perl 6. > | > | Read the names from a Perl data section one name per line. > | Do error checking to make sure you aren't given duplicate names. > | Perl 6 has grammars > | http://doc.perl6.org/language/grammars > | and sets, bags, and mixes: > | http://doc.perl6.org/language/setbagmix > > Michael Gribskov wrote on 2015-07-29 at 11:56:39 -04: > | Do you want the output to be unique, e.g., both Cat and Cathy contain > | CAT, should it occur only once in output? > > Yes, just once. After the program runs > > (This column is not part of the original problem > definition, I only added it to give an example of > what I mean in the paragraph following this list.) > THESE NAMES COULD REFER TO THESE PEOPLE > ----------- -------------------------------------------------- > Ab Abe Abe Lincoln > Al Ala Alan Alan Turing > B Be Ben Ben Carson > Cat Cat Stevens > Cath Cathy Cathy Rigby > > Cath is not shortened to Cat because we'd get Cat Stevens > and Cathy Rigby confused. > > -mark -- Michael Gribskov Hockmeyer Hall of Structural Biology Department of Biological Sciences Purdue University 240 S. Martin Jischke Drive West Lafayette, IN 47907-1971 gribskov at purdue.edu vox: 765.494.6933 fax: 765.496.1189 calendar: http://www.google.com/calendar/embed?src=mgribskov%40gmail.com From gribskov at purdue.edu Wed Jul 29 10:19:16 2015 From: gribskov at purdue.edu (Michael Gribskov) Date: Wed, 29 Jul 2015 13:19:16 -0400 Subject: [Purdue-pm] challenge problem for next meeting? In-Reply-To: <41761.1438187406@pier.ecn.purdue.edu> References: <14704.1438181994@pier.ecn.purdue.edu> <55B8F7B7.5060505@purdue.edu> <41761.1438187406@pier.ecn.purdue.edu> Message-ID: <55B90B14.6090807@purdue.edu> might i suggest this list of the top 100 male and female baby names of 2013 Girls' Names 1. Sophia 2. Emma 3. Olivia 4. Isabella 5. Mia 6. Ava 7. Lily 8. Zoe 9. Emily 10. Chloe 11. Layla 12. Madison 13. Madelyn 14. Abigail 15. Aubrey 16. Charlotte 17. Amelia 18. Ella 19. Kaylee 20. Avery 21. Aaliyah 22. Hailey 23. Hannah 24. Addison 25. Riley 26. Harper 27. Aria 28. Arianna 29. Mackenzie 30. Lila 31. Evelyn 32. Adalyn 33. Grace 34. Brooklyn 35. Ellie 36. Anna 37. Kaitlyn 38. Isabelle 39. Sophie 40. Scarlett 41. Natalie 42. Leah 43. Sarah 44. Nora 45. Mila 46. Elizabeth 47. Lillian 48. Kylie 49. Audrey 50. Lucy 51. Maya 52. Annabelle 53. Makayla 54. Gabriella 55. Elena 56. Victoria 57. Claire 58. Savannah 59. Peyton 60. Maria 61. Alaina 62. Kennedy 63. Stella 64. Liliana 65. Allison 66. Samantha 67. Keira 68. Alyssa 69. Reagan 70. Molly 71. Alexandra 72. Violet 73. Charlie 74. Julia 75. Sadie 76. Ruby 77. Eva 78. Alice 79. Eliana 80. Taylor 81. Callie 82. Penelope 83. Camilla 84. Bailey 85. Kaelyn 86. Alexis 87. Kayla 88. Katherine 89. Sydney 90. Lauren 91. Jasmine 92. London 93. Bella 94. Adeline 95. Caroline 96. Vivian 97. Juliana 98. Gianna 99. Skyler 100. Jordyn Boys' Names 1. Jackson 2. Aiden 3. Liam 4. Lucas 5. Noah 6. Mason 7. Jayden 8. Ethan 9. Jacob 10. Jack 11. Caden 12. Logan 13. Benjamin 14. Michael 15. Caleb 16. Ryan 17. Alexander 18. Elijah 19. James 20. William 21. Oliver 22. Connor 23. Matthew 24. Daniel 25. Luke 26. Brayden 27. Jayce 28. Henry 29. Carter 30. Dylan 31. Gabriel 32. Joshua 33. Nicholas 34. Isaac 35. Owen 36. Nathan 37. Grayson 38. Eli 39. Landon 40. Andrew 41. Max 42. Samuel 43. Gavin 44. Wyatt 45. Christian 46. Hunter 47. Cameron 48. Evan 49. Charlie 50. David 51. Sebastian 52. Joseph 53. Dominic 54. Anthony 55. Colton 56. John 57. Tyler 58. Zachary 59. Thomas 60. Julian 61. Levi 62. Adam 63. Isaiah 64. Alex 65. Aaron 66. Parker 67. Cooper 68. Miles 69. Chase 70. Muhammad 71. Christopher 72. Blake 73. Austin 74. Jordan 75. Leo 76. Jonathan 77. Adrian 78. Colin 79. Hudson 80. Ian 81. Xavier 82. Camden 83. Tristan 84. Carson 85. Jason 86. Nolan 87. Riley 88. Lincoln 89. Brody 90. Bentley 91. Nathaniel 92. Josiah 93. Declan 94. Jake 95. Asher 96. Jeremiah 97. Cole 98. Mateo 99. Micah 100. Elliot On 7/29/2015 12:30 PM, Mark Senn wrote: > Mark Senn wrote on 2015-07-29 at 10:59 -04: > | Is there interest in this challenge problem for the next meeting? > | Write back if you'll talk, email, or blog about your solution. > | Given a list of names, for example > | Abe > | Alan > | Ben > | Cat > | Cathy > | print a list of all names, shortening them as much > | as possible, with them still remaining unique, like this > | Ab > | Abe > | Al > | Ala > | Alan > | B > | Be > | Ben > | Cat > | Cath > | Cathy > | in Perl 5 and Perl 6. > | > | Read the names from a Perl data section one name per line. > | Do error checking to make sure you aren't given duplicate names. > | Perl 6 has grammars > | http://doc.perl6.org/language/grammars > | and sets, bags, and mixes: > | http://doc.perl6.org/language/setbagmix > > Michael Gribskov wrote on 2015-07-29 at 11:56:39 -04: > | Do you want the output to be unique, e.g., both Cat and Cathy contain > | CAT, should it occur only once in output? > > Yes, just once. After the program runs > > (This column is not part of the original problem > definition, I only added it to give an example of > what I mean in the paragraph following this list.) > THESE NAMES COULD REFER TO THESE PEOPLE > ----------- -------------------------------------------------- > Ab Abe Abe Lincoln > Al Ala Alan Alan Turing > B Be Ben Ben Carson > Cat Cat Stevens > Cath Cathy Cathy Rigby > > Cath is not shortened to Cat because we'd get Cat Stevens > and Cathy Rigby confused. > > -mark -- Michael Gribskov Hockmeyer Hall of Structural Biology Department of Biological Sciences Purdue University 240 S. Martin Jischke Drive West Lafayette, IN 47907-1971 gribskov at purdue.edu vox: 765.494.6933 fax: 765.496.1189 calendar: http://www.google.com/calendar/embed?src=mgribskov%40gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at ecn.purdue.edu Wed Jul 29 11:46:51 2015 From: mark at ecn.purdue.edu (Mark Senn) Date: Wed, 29 Jul 2015 14:46:51 -0400 Subject: [Purdue-pm] challenge problem for next meeting? In-Reply-To: <55B90A01.1080309@purdue.edu> References: <14704.1438181994@pier.ecn.purdue.edu> <55B8F7B7.5060505@purdue.edu> <41761.1438187406@pier.ecn.purdue.edu> <55B90A01.1080309@purdue.edu> Message-ID: <29304.1438195611@pier.ecn.purdue.edu> Michael Gribskov wrote on 2015-07-29 at 13:14:41 -04: | It significantly changes the challenge if you want the output to | inlclude only the (possibly) shortened forms that are unique to one | person. In this case, there is no way to refer to Cat Stevens. the | logic to identify that Cat must be maintained for Cat Stevens, and | further reductions of Cath must be rejected seems to be complex. Is | this included in the challenge? | | I have a pretty straightforward way to solve this more complicated | problem, as well as a very simple ways to solve the problem as | originally stated in minimum time. I'm only interested in the more complicated problem. Sorry for the bad problem description. To summarize, read these names from a Perl data section one name per line. Abe Alan Ben Cat Cathy Do error checking to make sure there aren't duplicate names in the input. Print the names under THESE NAMES one per line in your output. Note that the COULD REFER TO THESE PEOPLE column below is totally irrelevant to the problem. It was just added to better explain the problem. THESE NAMES COULD REFER TO THESE PEOPLE ----------- -------------------------------------------------- Ab Abe Abe Lincoln Al Ala Alan Alan Turing B Be Ben Ben Carson Cat Cat Stevens Cath Cathy Cathy Rigby Cath is not shortened to Cat because we'd get Cat Stevens and Cathy Rigby confused. Of course, your program should not just literally print Ab Abe [...] The output should be dependent on the input data. -mark