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).
Thanks
for the volunteers, there are code Reviews on Perl/Raku;
in addition, on each Monday, you can read the RECAP linking others' solutions and
blogs; I often learn something from both RECAP and Perl Review.
Do tell me, if I am wrong or you strongly oppose my statements!
---
While the weekly challenge is fighting towards new record of number of submissions, I am starting my own programming adventure. Congratulations to CY Fung, she knows how to code in Python and Java now. I am going to submit guest solutions in these two languages for the coming challenges.
Spoiler Alert: This weekly challenge deadline is due in a couple of days, on Independence Day (July 4, 2021). 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: Swap Nibbles
You are given a positive integer $N.
Write a script to swap the two nibbles of the binary representation of the given number and print the decimal number of the new binary representation.
A nibble is a four-bit aggregation, or half an octet.
To keep the task simple, we only allow integer less than or equal to 255.
The following is my reflection on those results and doesn't reflect anyone else's opinions. They may not even really be my opinions.
Who responded?
Some 85.9% respondents self identify as Perl programmers and 22.7% as Raku programmers, 33.2% as Software project leaders, and 30% as Business Owners.
Brand Values
In regards to brand values there is a huge gap between perception and expectation. I've cut off the long tail of "Other" responses for clarity, follow the link at the top to see them.
(The long titles overlap. The first 5 are Amateur, Passionate about helping software projects, Powered by Volunteers, Professional, Secretive)
(The long titles overlap. The first 5 are Passionate..., Powered by Volunteers, Professional, Servant Leadership, Supportive)
Skipped blogging on Perl Weekly Challenge(PWC) for a few weeks!
Let's review what I learnt
from PWC#068 to PWC#072
first:
PWC#068
Inexperienced in object-oriented, (after a few hours violent trial and error,
) I finally gave up the task #2 reordering a singly linked list.
For the task #1 zero matrix (task statement here), I handled it innocently.
By the way, I read the review by Mr Crain
and deeply recommend others read
Myoungjin Jeon's solution.
PWC#069
Task #1 - Strobogrammatic Number
I use the combinatorics library on CPAN. However, a poorly designed code
performs poorly in the face of combinatorial explosion, in comparison with other PWC members' scripts. If I had considered symmetry, as the Perl Reviewer Mr Crain stated, the code would be more effective.
There is a mistake on my code: I treat all single digits as strobogrammatic.
Forgetting what happened around during that week...
Spoiler Alert: This weekly challenge deadline is due in a couple of days (June 27, 2021). 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: Binary Palindrome
You are given a positive integer $N.
Write a script to find out if the binary representation of the given integer is Palindrome. Print 1 if it is otherwise 0.
Example:
Input: $N = 5
Output: 1 as binary representation of 5 is 101 which is Palindrome.
Input: $N = 4
Output: 0 as binary representation of 4 is 100 which is NOT Palindrome.
Perl 7 has been announced as the next direction of Perl development. My previous blog post explored at a high level the risks and benefits of the announced direction, as well as those of a more incremental proposal. The primary and critical difference between these two approaches is the decision to change interpreter defaults in an incompatible manner; specifically, to have strict and warnings and possibly other features enabled by default for code that does not specify otherwise. I would like to explore each of the arguments presented for this design choice.
Optimizing For New
The primary benefit of changing the implicit defaults is, of course, to allow Perl programmers to write code in a more modern way and newcomers to program in a safer environment without having to know the sometimes arcane or niche ways to activate such an environment.
Mom is a shortcut for creating Moo classes (and roles). It allows you to define a Moo class with the brevity of Class::Tiny. (In fact, Mom is even briefer.)
Spoiler Alert: This weekly challenge deadline is due in a couple of days (June 20, 2021). 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: Missing Row
You are given text file with rows numbered 1-15 in random order but there is a catch one row in missing in the file.
Yesterday I posted about this in the Perl Weekly newsletter and both Mohammad and myself got 10 new supporters. This is awesome.
There are not many ways to express the fact that you really value the work of someone.
You can send them postcards or thank-you notes, but when was the last time you remembered to do that?
Right, I also keep forgetting to thank the people who create all the free and awesome stuff I use.
Giving money as a way to express your thanks is frowned upon by many people, but trust me, the people who open an account on Patreon to make it easy to donate them money will appreciate it.
In any case it is way better than not saying anything.
Patreon, GitHub sponsor and Perl
So pick one or all three of us and depending on your financial possibilities sign up to give a monthly donation.
Update
New names were added and support via GitHub is also mentioned.
Spoiler Alert: This weekly challenge deadline is due in a couple of days (June 13, 2021). 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: Number Sequence
You are given a number $N >= 10.*
Write a script to split the given number such that the difference between two consecutive numbers is always 1 and it shouldn’t have leading 0.*
Print the given number if it impossible to split the number.
Before reading this, you should watch this video where Bryan Cantrill explains a value-conflict between Joyent and Node.js, I believe we have a similar problem.
In it he defines a list of project values:
All these values are important - but they are in tension. In the end one has to choose between them.
Perl's has traditionally prioritized certain values over these others, and in my experience these are:
I've been posting some Perl related polls in Perl Programmers over the last few weeks. Despite the obvious weaknesses in the sampling method, they've provided some good insights and great talking points.
Here's some results as of this afternoon. People can still respond to these polls.
Regarding area's where Perl could help out:
This surprised me, I didn't expect Performance Monitoring to come out on top.
Regarding what Perl is being run on:
This didn't surprise me at all. The weakness in this poll is that we didn't find out if people are using their own App Perl or the System Perl. But we know that CentOS+RHEL & Debian+Ubuntu are what the majority are running, with Windows and MacOS being important too.
Regarding the question of Perl's logo:
Folks seem to be happy with the Raptor and feel a bit of a facelift is all that's needed. My favorite suggestion (in the comments) was for a new Perl7 logo was a bike shed.
I will use more polls to dive deeper in the above in the near future. Please come Join Us
Spoiler Alert: This weekly challenge deadline is due in a couple of days (June 6, 2021). 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: String Chain
You are given an array of strings.
Write a script to find out if the given strings can be chained to form a circle. Print 1 if found otherwise 0.
A string $S can be put before another string $T in circle if the last character of $S is same as first character of $T.
Examples:
Input: @S = ("abc", "dea", "cd")
Output: 1 as we can form circle e.g. "abc", "cd", "dea".
Input: @S = ("ade", "cbd", "fgh")
Output: 0 as we can't form circle.
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).
Thanks
for the volunteers, there are code Reviews on Perl/Raku;
in addition, on each Monday, you can read the RECAP linking others' solutions and
blogs; I often learn something from both RECAP and Perl Review.
---
One week to the end of August!
Alan J. Perlis said, “A language that doesn’t affect the way you think about programming, is not worth knowing.”
I would add a clause to it: unless it helps you earn your living...
Self Challenge
Making risky/improbable promises are usually looked down in Hong
Kong, though some people do support the venturesome spirit (not quite
for females, but – personal feelings). “Jump-in, jump-out” is not
welcomed, as for my understanding to Hongkongers. (I actually stay on
Internet more than in Hong Kong society.)
DBD::SQLite 1.65_03 (with SQLite 3.32.3) is a release candidate for the next stable DBD::SQLite. There are no big changes, maybe except for the ncrease of the default upper bound on the number of parameters from 999 to 32766 (since SQLite 3.32).
I'll wait for about a month as always, and release 1.66 at the end of August if there's no blocker nor request to wait for more. Thank you for your patience.