From jacoby.david at gmail.com Fri Apr 3 06:56:18 2020 From: jacoby.david at gmail.com (Dave Jacoby) Date: Fri, 3 Apr 2020 09:56:18 -0400 Subject: [Purdue-pm] Why? Why? Why? Message-ID: >From code. $variable = sprintf("%02d", 0); This of course sets $variable to '00'. But if that's what you need to do... $variable = 00; Some may not have hit this -- I find new functions all the time -- but sprintf() is a variant of printf(), which formats a variable. printf() prints it, sprintf() returns it. in this case, "%02d" gives a zero-padded two digit decimal number. perldoc -f sprintf for more documentation. sprintf() is good for converting variables, but if you hardcoded 0, you can hardcode '00'. Clearly nobody involved in this code is on this list, but really, is there any justification besides cargo-cult programming? -- Dave Jacoby jacoby.david at gmail.com I deal with my software the way I treat my eldritch abomination: It's not human, it's not even alive in the natural sense. It's nightmare-born and nightmare-shaped, and nightmares don't die easy. -- @yenzie -------------- next part -------------- An HTML attachment was scrubbed... URL: From gizmomathboy at gmail.com Fri Apr 3 06:59:38 2020 From: gizmomathboy at gmail.com (gizmomathboy) Date: Fri, 3 Apr 2020 09:59:38 -0400 Subject: [Purdue-pm] Why? Why? Why? In-Reply-To: References: Message-ID: I think $variable = 00 gets boiled down to $var = 0, but I could be wrong. I would have done $var = q(00); That should get it treated as a string versus a number. I haven't tested that theory yet. From gizmomathboy at gmail.com Fri Apr 3 07:05:48 2020 From: gizmomathboy at gmail.com (gizmomathboy) Date: Fri, 3 Apr 2020 10:05:48 -0400 Subject: [Purdue-pm] Why? Why? Why? In-Reply-To: References: Message-ID: Interesting, the sprintf does make it do 00. I guess sprintf output tips the string flag? perl is v5.28.0 $ perl -E ' $var1 = sprintf("%02d", 0); say qq(var1 : $var1); $var2 = q(00); say qq(var2 : $var2)' var1 : 00 var2 : 00 From mark at purdue.edu Fri Apr 3 07:11:50 2020 From: mark at purdue.edu (Mark Senn) Date: Fri, 03 Apr 2020 10:11:50 -0400 Subject: [Purdue-pm] Why? Why? Why? In-Reply-To: References: Message-ID: <42438.1585923110@pier.ecn.purdue.edu> > $variable = 00; 00 evaluates to 0, I'd use $variable = '00'; 011 evaluates to 9---leading 0 means octal I like to use perl -de 0 to explore stuff like this, e.g., $ perl -de 0 Loading DB routines from perl5db.pl version 1.53 Editor support available. Enter h or 'h h' for help, or 'man perldebug' for more help. main::(-e:1): 0 DB<1> $variable = sprintf("%02d", 0); DB<2> print $variable 00 DB<3> $variable = 00; DB<4> print $variable 0 -mark From jacoby.david at gmail.com Fri Apr 3 07:53:17 2020 From: jacoby.david at gmail.com (Dave Jacoby) Date: Fri, 3 Apr 2020 10:53:17 -0400 Subject: [Purdue-pm] Why? Why? Why? In-Reply-To: <42438.1585923110@pier.ecn.purdue.edu> References: <42438.1585923110@pier.ecn.purdue.edu> Message-ID: Mentally, I wrote '00' not 00, but clearly I was in the rant, not checking syntax. :kicks self: The question is, what's the point of using sprintf when you can just write the string you want? I'm 90% sure it's cargo cult. You can install Reply to get a repl, but perl -de 0 is cool as well. On Fri, Apr 3, 2020 at 10:11 AM Mark Senn wrote: > > $variable = 00; > > 00 evaluates to 0, I'd use > $variable = '00'; > > 011 evaluates to 9---leading 0 means octal > > I like to use perl -de 0 to explore stuff like this, e.g., > $ perl -de 0 > Loading DB routines from perl5db.pl version 1.53 > Editor support available. > Enter h or 'h h' for help, or 'man perldebug' for more help. > main::(-e:1): 0 > DB<1> $variable = sprintf("%02d", 0); > DB<2> print $variable > 00 > DB<3> $variable = 00; > DB<4> print $variable > 0 > > -mark > -- Dave Jacoby jacoby.david at gmail.com I deal with my software the way I treat my eldritch abomination: It's not human, it's not even alive in the natural sense. It's nightmare-born and nightmare-shaped, and nightmares don't die easy. -- @yenzie -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at purdue.edu Thu Apr 9 09:11:40 2020 From: mark at purdue.edu (Mark Senn) Date: Thu, 09 Apr 2020 12:11:40 -0400 Subject: [Purdue-pm] I prefer online meetings Message-ID: <21456.1586448700@pier.ecn.purdue.edu> I felt like the online meeting last night went very well and prefer those over in-person meeting. I'm lobbying for online meetings in the future, even after the COVID-19 emergency is over. -mark From mark at purdue.edu Thu Apr 9 09:48:49 2020 From: mark at purdue.edu (Mark Senn) Date: Thu, 09 Apr 2020 12:48:49 -0400 Subject: [Purdue-pm] Raku followup to last night's meeting Message-ID: <28482.1586450929@pier.ecn.purdue.edu> Raku (formerly known as Perl 6) is a completely redesigned and rewritten language but programming in it still feels like programming in Perl. I like it much better than Perl. Raku supports a legacy mode that supports Perl-style regular expressions, and it has a normal mode that supports the new style of regexes. [ https://en.wikibooks.org/wiki/Raku_Programming/Regular_Expressions ] My advice: don't use the legacy mode regular expressions---use the better Raku regexes. Raku's regexes are more powerful than regular expressions so the name has changed. Last night's meeting included information on zero-width assertions in Perl. The documentation for Raku regexes is at https://docs.raku.org/language/regexes It has zero-width assertions: Lookaround assertions, lookehead assertions, and lookbehind assertions. I like the syntax of these much better that Perl's. Raku regexes, tokens, and rules can be used to define a grammar. Raku itself is implemented using a Raku grammer. See https://docs.raku.org/language/grammar_tutorial for a grammar tutorial. -mark From jacoby.david at gmail.com Thu Apr 16 12:25:07 2020 From: jacoby.david at gmail.com (Dave Jacoby) Date: Thu, 16 Apr 2020 15:25:07 -0400 Subject: [Purdue-pm] "Perlmongers Conferences in the Time of Corona" Message-ID: http://blogs.perl.org/users/max_maischein/2020/04/perlmongers-conferences-in-the-time-of-corona.html I think, for the size we get for Mongers/HackLaf events, Jitsi is worth trying. Next Coffee & Chat will be a Jitsi stream, we just need to get it into the schedule. Anyone want to be part of a proto-Coffee event next week so we can know the issues? I believe it is or can be browser-based w/ no installation. -- Dave Jacoby jacoby.david at gmail.com I deal with my software the way I treat my eldritch abomination: It's not human, it's not even alive in the natural sense. It's nightmare-born and nightmare-shaped, and nightmares don't die easy. -- @yenzie -------------- next part -------------- An HTML attachment was scrubbed... URL: From gizmomathboy at gmail.com Thu Apr 16 13:05:34 2020 From: gizmomathboy at gmail.com (gizmomathboy) Date: Thu, 16 Apr 2020 16:05:34 -0400 Subject: [Purdue-pm] "Perlmongers Conferences in the Time of Corona" In-Reply-To: References: Message-ID: <6b8b53bb-1e11-44f0-0a1e-9c4ef50d7876@gmail.com> I can see if I can get something setup on the purdue.pl instance and see if we kill it. Say...3pm tomorrow? joe From jacoby.david at gmail.com Thu Apr 16 13:06:50 2020 From: jacoby.david at gmail.com (Dave Jacoby) Date: Thu, 16 Apr 2020 16:06:50 -0400 Subject: [Purdue-pm] "Perlmongers Conferences in the Time of Corona" In-Reply-To: <6b8b53bb-1e11-44f0-0a1e-9c4ef50d7876@gmail.com> References: <6b8b53bb-1e11-44f0-0a1e-9c4ef50d7876@gmail.com> Message-ID: I'm game. On Thu, Apr 16, 2020 at 4:05 PM gizmomathboy wrote: > I can see if I can get something setup on the purdue.pl instance and see > if we kill it. > > Say...3pm tomorrow? > > joe > > > -- Dave Jacoby jacoby.david at gmail.com I deal with my software the way I treat my eldritch abomination: It's not human, it's not even alive in the natural sense. It's nightmare-born and nightmare-shaped, and nightmares don't die easy. -- @yenzie -------------- next part -------------- An HTML attachment was scrubbed... URL: From jacoby.david at gmail.com Thu Apr 16 16:04:40 2020 From: jacoby.david at gmail.com (Dave Jacoby) Date: Thu, 16 Apr 2020 19:04:40 -0400 Subject: [Purdue-pm] "Perlmongers Conferences in the Time of Corona" In-Reply-To: References: Message-ID: OK, I've set this as the URL for the Coffee & Chat, but I see no reason why we can't reuse it. https://meet.jit.si/HackLafayetteCoffee Friday 3pm. See you there. On Thu, Apr 16, 2020 at 3:25 PM Dave Jacoby wrote: > > http://blogs.perl.org/users/max_maischein/2020/04/perlmongers-conferences-in-the-time-of-corona.html > > I think, for the size we get for Mongers/HackLaf events, Jitsi is worth > trying. Next Coffee & Chat will be a Jitsi stream, we just need to get it > into the schedule. > > Anyone want to be part of a proto-Coffee event next week so we can know > the issues? I believe it is or can be browser-based w/ no installation. > > -- > Dave Jacoby > jacoby.david at gmail.com > > I deal with my software the way I treat my eldritch abomination: > It's not human, it's not even alive in the natural sense. > It's nightmare-born and nightmare-shaped, and nightmares don't die easy. > -- @yenzie > -- Dave Jacoby jacoby.david at gmail.com I deal with my software the way I treat my eldritch abomination: It's not human, it's not even alive in the natural sense. It's nightmare-born and nightmare-shaped, and nightmares don't die easy. -- @yenzie -------------- next part -------------- An HTML attachment was scrubbed... URL: