From mark at purdue.edu Fri Mar 3 10:35:14 2017 From: mark at purdue.edu (Mark Senn) Date: Fri, 03 Mar 2017 13:35:14 -0500 Subject: [Purdue-pm] Dept of Math problem of week Message-ID: <28136.1488566114@pier.ecn.purdue.edu> Any interest in showing each other solutions to a Department of Mathematics problem of the week: https://www.math.purdue.edu/pow/discussion/2017/spring/41 using a literate programming: http://www.literateprogramming.com style? (I'll use Perl 6 with the LaTeX typesetting system and the TikZ and/or Metapost graphics systems if people are interested in doing this.) I think the upper bound for the lower bound :-) is small enough that this problem can be solved by brute force if nothing else works. Mark Senn, Systems Programmer, Engineering Computer Network, Purdue University From jacoby.david at gmail.com Wed Mar 8 10:58:04 2017 From: jacoby.david at gmail.com (Dave Jacoby) Date: Wed, 8 Mar 2017 13:58:04 -0500 Subject: [Purdue-pm] Tonight: Gizmo on Asynchronous Perl Message-ID: We meet again this afternoon, 5:30pm in EE317, for Joe Kline to talk about Asynchronous Perl. We have multiple cores; we might as well use them, right? Afterwards, we'll convene at Lafayette Brewing Company with non-mongers (I hope) for HackLafayette Open Source Food & Beer & Chat. One topic I hope and plan to bring up is sponsorship. Booking.com is a Perl shop and has offered to sponsor us, starting in in April. I look forward to seeing everyone tonight. -- Dave Jacoby jacoby.david at gmail.com I used to put Lou Reed lyrics right about here ... -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at purdue.edu Fri Mar 31 07:43:16 2017 From: mark at purdue.edu (Mark Senn) Date: Fri, 31 Mar 2017 10:43:16 -0400 Subject: [Purdue-pm] example Perl 6 program Message-ID: <26127.1490971396@pier.ecn.purdue.edu> #!/home/pier/e/mark/src/rakudo-star-2016.11/install/bin/perl6 # # I like to use Asian quotes to ?quote things verbatim?. # # On lines that match the Perl 6 regex ?/^\s*url\s*'='/? # this program changes # OLD NEW # _ \_ # & \& # but does not change any of these # \_ # {_} # \& # {&} # # THIS CODE HAS A BUG IN IT: ?A?? gets transformed into ??? # because information is being read in one encoding and written # using another encoding (I think). # # Complain if Perl 5 tries to run this program. use v6; multi MAIN($ifn, $ofn) { Main $ifn, $ofn; } sub Main($ifn, $ofn) { ($ifn eq $ofn) and die qq/Input file and output file are both "$ifn"/; my $ifh = open $ifn, :r orelse die qq/Can't open "$ifn" for input./; my $ofh = open $ofn, :w orelse die qq/Can't open "$ofn" for output./; for $ifh.lines -> $_ is copy { if (m/^\s*url\s*'='/) { # I like to use Asian quotes to ?quote things verbatim?. # Substitute globally # ?(<-[\\{]>)?matches anything except ?\? or ?{? (call this $0) # ?(<[_&]>)? matches ?_? or ?&? (call this $1) # and replace it with $0, followed by ?\?, followed by $1. # By default, spaces are ignored in the regex (formerly known as # regular expression) but not in the replacement text. s:g / (<-[\\{]>) # matches anything except ?{? or ?\? (<[_&]>) # matches ?_? or ?&? /$0\\$1/; } $ofh.say($_); } $ofh.close(); $ifh.close() }