This week, Task 1 and part of Task 2 relate to Scalable Vector Graphics (SVG). I’d been using SVG a very long time ago and certainly didn’t remember any of the details. So, in my first blog relating to PWC 165, I stated that I didn’t have time for that and covered only the part of the challenge not related to SVG. I also said that, in the event that I find some time over the weekend, I might come back and fulfill the SVG part. I thought at the time that this was rather unlikely, but I was finally able to cover the SVG part, at least in Raku.
We want to express our disappointment with the recent transparency reports and associated actions from the Community Affairs Team (CAT).
On Monday 19th March, a first Transparency Report was issued, which said that an individual had been investigated for (1) behaviour on IRC and Twitter, and (2) behaviour at a Perl event in 2019. The report also reported that they had "found many instances of communication which alone may not have constituted unacceptable behavior, but when taken together did constitute unacceptable behavior", but no further details were given on those. The report issued a ban from all TPF events "in perpetuity", and furthermore issued a ban on the individual’s participation on irc.perl.org and any perl.org mailing lists. A second individual was issued a warning.
I had many ups and downs in the month of April. In all these, I have recieved plenty of supporting voices.
First, we had the start of Ramadan. I feel fortunate to be able to fast in this holy month. However I had to break my fast for two days because I suffered by Vertigo. Luckily I recovered very fast, thanks to ALLAH s.w.t.
Gee almost a year since my lat post. I better start posting again or Mohammad will catch up with me ;).
Been quite a year for every one on this big blue marble. I hope you are all good.
Ok here is the very short post for today.
I just did my first build and upload of PAWS to CPAN
Expect Version 0.43 to be up there later today some time.
It was a bit of an epic on my part as this whole releasing thingy, made some real bad goofs (deleting then checking in a folder), thank goodness for 'git revert' and getting the version number wrong.
Spoiler Alert: This weekly challenge deadline is due in a few of days from now (on May 22, 2022 at 24:00). This blog post offers some (partial) solutions to this challenge, please don’t read on if you intend to complete the challenge on your own.
Edit2: After further talk with CAT, i will acknowledge that it was not the intent of the CAT to make me wait, and they in fact did not even realize this was the effect.
I am the "second individual", i am intimately familiar with the events of both their investigations.
Shortly before the TPF informed me that their start-of-may update was nearly ready to be posted, i informed them that these were my expectations:
2021-04-29 19:00
> all i care about are correct, accurate, truthful and useful consequences
And interestingly the perl.reddit.com moderation team saw fit to censor the submission of this post. It can still be seen directly, but is not in the feed anymore. This is notable as a wide variety of posts and comments that violate the "no personal attacks" rule, but also were in nature against the accused by the TPF, were allowed to remain up and are up to this day and hour, often with completely false claims about people. chromatic and briandfoy are currently the most (and probably only) active moderators there.
If you want to challenge yourself on programming, especially on Perl and/or Raku, go to https://perlweeklychallenge.org, code the latest challenges, submit codes on-time (by GitHub or email).
Do tell me, if I am wrong or you strongly oppose my statements!
Well, I wake up early and get some time to blog about The Weekly Challenge again (in addition, correct some parts of my submitted code ‐ a brain with good rest well spots bugs!).
Both Perl and (guest language) Java codes for the two tasks have been done this week.
Task 1: Valid Phone Number
I started my Sunday afternoon with Java. "Eat the frog first."
There are several ways to read text files in Java, I chose the default class which I am most familiar with: java.util.Scanner.
I've been wanting to explore the Wx GUI toolkit bindings for Perl, but I couldn't get it to install correctly on my 64-bit Windows 7 machine.
When I ran cpan Wx, it failed to install the dependency Alien::wxWidgets. There were some cryptic errors about CreateProcess, which is (basically) Windows' equivalent of fork(2). Presumably, some process started by the build script was having some problems, but there wasn't much in the error message to go on.
From Google, I found an old reply posted on PerlMonks by Mark Dootson, the maintainer of Wx and Alien::wxWidgets, where he recommended to make sure to correctly set the PATH before building it.
Technically, my PATH seemed fine – it had all the necessary Perl directories in it. Still, suspecting that the problems may be caused by some other directory in the PATH, I reduced it to its bare elements and then ran cpan again:
Spoiler Alert: This weekly challenge deadline is due in a few of days from now (on May 15, 2022 at 24:00). This blog post offers some solutions to this challenge, please don’t read on if you intend to complete the challenge on your own.
Task 1: Prime Palindromes
Write a script to find all prime numbers less than 1000, which are also palindromes in base 10. Palindromic numbers are numbers whose digits are the same in reverse. For example, 313 is a palindromic prime, but 337 is not, even though 733 (337 reversed) is also prime.
Prime Palindromes in Raku
We use a data pipeline (chained method invocations) with two grep statements, one to keep palindromes and one to keep prime numbers. This leads to a fairly concise one-line solution:
say (1..^1000).grep({ $_ == .flip }).grep({.is-prime});
Continuing from my previous post ( https://blogs.perl.org/users/itcharlie/2021/04/calculating-ev-battery-charge-with-perl.html ) I learned that residential electricity charges are calculated using an electricity supply rate per kWh and a electric delivery rate per kWh which actually increases the total EV charge prices that I have calculated in my previous post. My current bill states that my electric supply rate is at 6.9057 cents per kWh and my delivery rate is 11.1785 cents per kWh making it a total of 18.0842 cents per kWh which is 5 cents more than my original post at $ 0.13 cents per kWh.
If you want to challenge yourself on programming, especially on Perl and/or Raku, go to https://perlweeklychallenge.org, code the latest challenges, submit codes on-time (by GitHub or email).
Task 1: Chowla Numbers
#!/usr/bin/perl # The Weekly Challenge - 109 # Task 1 Chowla Numbers usestrict; usewarnings; my $F = $ARGV[0] || 20; my @chowla_seq = (0,0,0); formy $n (4..$F) { my $s = 0; formy $k (2..$n-1) {
$s += $k unless $n % $k;
}
push @chowla_seq, $s;
}
print join ", ", @chowla_seq;
print "\n";
Employ no special tricks here except the use of unless and (roughly speaking?)the boolean value of 0 is equivalent to undef, while both mean false.
Task 2: Four Squares Puzzle
There are many improvisations we can do with it. The task is "N Boxes Puzzle" on my mind.
I recently got an Apple M1 Mac Mini, half out of curiosity, half because it was exactly what I would need: I have a low end Mac just to try out things like new Xcode betas etc, like a "canary" machine. My old 2012 Mac Mini stopped getting official Apple updates, so it could no longer do what I needed and the 8GB RAM, 256GB SSD M1 mini at $699 is easily the cheapest Mac you can buy.
Overall, unlike the typical Mac Minis of old which seemed to be on the slow side, it did feel quite fast from the start, so I thought I'd run some benchmarks on it for fun to see how Apple's ARM M1 fares against some x86 competition. And, as in my day job I use mostly Perl, I thought some perl-related benchmarks would be of interest to me.
Spoiler Alert: This weekly challenge deadline is due in a few days from now (on May 8, 2022 at 24:00). This blog post offers some solutions to this challenge, please don’t read on if you intend to complete the challenge on your own.
Task 1: Sum Bitwise Operator
You are given list positive numbers, @n.
Write script to calculate the sum of bitwise & operator for all unique pairs.
On behalf of the Dancer Core Team, I'd like to announce the availability
of Dancer2 0.301002. This release includes a number of enhancements and
documentation changes along with several bugfixes. The most notable
enhancement is a brand new command line interface, and I highly
encourage you to check it out.
The current Yet Another Society (The Perl Foundation) bylaws exclude the possibility of membership (see Article II https://www.perlfoundation.org/bylaws.html). As reference, the Python Foundation has 5 membership classes with various rights and privileges associated (https://www.python.org/psf/bylaws/).
I believe this to be a wasted opportunity to increase engagement with stake holders in the Perl community, be they individuals, business or other organizations. And also to secure funding for vital Perl related activities arranged by the Perl Foundation.
Rather than a complicated class system,a good starting point would be a single membership option with an annual renewal and no specific benefits than a warm feeling. (Although, throwing in some exclusive swag and a membership card might not be a bad little bonus)
This could then evolve based on feedback via a membership committee.
I have sent a brief proposal to the YAS (TPF) board to this effect. I invite your support in comments below and/or by contacting board members voicing your support (see https://www.perlfoundation.org/committees.html)
Presently I have great interest in “EVs” Electric Vehicles but I haven’t seen any data on how much it would cost to charge an electric vehicle from 0 % to 100 % battery charge at home in NYC ( So I wrote a Perl script to do just that ) but before we dig in into it I explain a few things about Electric Vehicles.
Electric Vehicles will have a battery capacity that is represented by kilowatt-hour units or kWh for short.
An EV’s driving range is represented in miles units ( In the US ) and the average mileage is determined by the EPA battery range rating ( the bigger the battery capacity usually means the more driving range you will have in a car ) after conducting a few tests ( so in reality your mileage will vary ).
Spoiler Alert: This weekly challenge deadline is due in a couple of days from now (on May 1st, 2022 at 24:00). This blog post offers some solutions to this challenge, please don’t read on if you intend to complete the challenge on your own.
Task 1: ISBN-13
Write a script to generate the check digit of given ISBN-13 code. Please refer wikipedia for more information.
Example
ISBN-13 check digit for '978-0-306-40615-7' is 7.
This how Wikipedia describes the calculation of the ISBN-13 check digit:
Let's examine if in 2021 an email redistribution list, i.e. perl5-porters@ (p5p) is still the best model for collaborating on the perl language. This is a discussion so comment below!
Advantages of an email list:
Familiar interface, people can use their client of choice
Low resources to run and maintain
Easy to derive automation from as email is all well known protocols
Everything is email
Disadvantages of an email list:
Email addresses disclosed to all participants (can be changed)
UI experience for participants inconsistent, may require client side configuration to "get right"
Email "reply" text can lower the signal to noise ratio
No topic categorization of posts, its all dumped in to your inbox
Tricky to respond to missed emails
Moderation is crude, every email is reviewed and approved, or everything is approved
Once an email is relayed it can't be moderated further
Encourages side channel correspondence
Everything is email
Given the long list of disadvantages we can guess why email lists (and newsgroups) have largely fallen by the wayside.
Kent was a prolific contributor to CPAN and Perl.
He released more than 150 distributions of his own to CPAN,
but also helped countless other authors and distributions,
with bug reports, puil requests, and more.
When a CPAN author dies,
their indexing permissions are dropped from PAUSE,
and where they had the first-come permission,
that will be passed to the pseudo-user ADOPTME.
This flags the distribution as being available for adoption.
So as of now, all of Kent's distributions are available for adoption.