Monthly Report - July

Survived another month?

God, the year 2020 seems never ending. I just pray it gets over quickly and we start fresh with new year 2021. Unfortunately we have to wait for another 5 months. In the current situation, anything can happen in this period. Please stay safe and avoid unnecessary human contacts.

So what was the main attraction of last month?

Well, quite a few, to begin with, I submitted 12 Pull Requests which is much better than the month before i.e. 9 Pull Requests. I remember there was time when I used to submit at least 50 PR every month. I aim to do at least 1 PR every 2 days i.e. 15 PR every month. Unfortunately I have only managed to do that in January i.e. 22 Pull Requests. I did come close to the target in two months e.g. May (13 Pull Requests) and July (12 Pull Requests). I am going to keep trying hard. Wish me luck.

Perl Weekly Challenge 115: String Chain and Largest Multiple

These are some answers to the Week 115 of the Perl Weekly Challenge organized by Mohammad S. Anwar.

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.

The Swiss Raku and Perl Miniconf 2020 Will Not Take Place

Hello from the Swiss Alps, where we have been working from home and avoiding all but essential trips out like so many others over the last few months.

The current situation has led to the cancellation of several community events, including this year's main Raku and Perl conferences in North American and Europe. We have been following the situation closely in Switzerland, and have also decided not to go ahead with our event this year.

We will be following the news, recommendations, and restrictions from The Federal Council and may have a smaller meetup sometime in late Summer/early Autumn. This will be an informal event with no expectation of presentations/workshops/etc. Details will be announced later, and probably at relatively short notice.

Hoping you are safe and well, and that we will meet again in Switzerland next year.

The Swiss Raku and Perl Miniconf organisers.

SanDiego.pm Meeting, Tuesday, July 14th, 2020

The SanDiego.pm Quarterly Meeting is tonight, 7 PM PDT.

Because of the pesky disease that's been spreading, we'll be gathering online. The agenda for tonight is: Normal conversation and seeing how everyone is doing; if there are any questions that need to be answered, we'll do that; followed by jumping into our presentations. We have at least three, though if anybody would like to step up and add another to the mix, please let me know.

Meeting ID: 896 3919 9931 Link to the meeting: https://us02web.zoom.us/j/89639199931

BLOG: The Weekly Challenge #069

https://perlweeklychallenge.org/blog/weekly-challenge-069

Perl Weekly Challenge 114: Next Palindrome Number and Higher Integer Set Bits

These are some answers to the Week 114 of the Perl Weekly Challenge organized by Mohammad S. Anwar.

Spoiler Alert: This weekly challenge deadline is due in a few days (May 30, 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: Next Palindrome Number

You are given a positive integer $N.

Write a script to find out the next Palindrome Number higher than the given integer $N.

Example:

Input: $N = 1234
Output: 1331

Input: $N = 999
Output: 1001

Next Palindrome Number in Raku

Perl Mongers, Unite!

TL;DR:
Promote your next Perl Mongers meeting on The Meetings Page at The pm.org Wiki.

Detail:
pm.org is great for resources, but there's no obvious way to promote your meeting. Not that there needed to be when the meetings were local events, but now, thanks to Covid-19, these meetings are taking place virtually. Why limit yourself to your local members? I am convinced that there are plenty of pockets of mongers that, if united and connected, would make the world realize that Perl Is Not Dead.

If you are a Perl Monger organizer, consider putting your meeting on the wiki page. Let's see just how many active orgs we have!

A FIXIT-dive into an old CPAN module

Let’s have a thought experiment. Assume there is an Open Source-licensed Perl module published on CPAN that you care about, and that hasn’t had any updates in a very long time - what are your options?

In this blog post, I’ll take a dive into this problem, and use the Geo::Postcodes::NO module as an example. As of this writing, the module version is 0.31, and it’s most recent release was in September 2006.

Initial assumptions

Before we begin, let’s lay bare the most important assumptions I’m having. Your case may differ, but I think the following ones are pretty safe.

Chicago.pm Virtual Meeting: July 23

Chicago.pm will host a virtual Perl Mongers meeting July 23 at 6:30 pm (Chicago time).

Perl Weekly Challenge 113: Represent Integer and Recreate Binary Tree

These are some answers to the Week 113 of the Perl Weekly Challenge organized by Mohammad S. Anwar.

Task 1: Represent Integer

You are given a positive integer $N and a digit $D.

Write a script to check if $N can be represented as a sum of positive integers having $D at least once. If check passes print 1 otherwise 0.

Example:

Input: $N = 25, $D = 7
Output: 0 as there are 2 numbers between 1 and 25 having the digit 7 i.e. 7 and 17. If we add up both we don't get 25.

Input: $N = 24, $D = 7
Output: 1

I’m very late and have very little time this week, so I’ll implement this task only in Raku.

Represent Integer in Raku

Late Weekly challenge 67 #1 only

I wrote some library to make combination in 2013.
I was overwhelming when I found this challenge but I found that it is buggy !!!

I think that finding combination isn't necessarily written using recursive calling.
so this is my first "working" solution.

it is possible to use some list of words (ex) "a", "b", "c" ) instead of number.

It was bound to happen.

While I don't actually work in Perl these days, and not by choice, I still keep an eye on the community. The language is chugging along nicely. Perl 6 is out, so at least that joke has died down, features are being added, some beneficiary, some not. All is well in perland.

Then the news dropped. Perl 7. I was very interested. More so when I realised that it was a rebranding of the latest Perl. First, let me say one thing right off the bat. It's a good call. I'm all for it. In fact, I'm so all for it that I called for it in a post from 2011. At the time I suggested using codenames like Apple and others do, or to rebrand Perl 5.14 (at the time) as Perl 14 like Java did.

Here's why I thought, and still do, that this "rebranding" is a Good Thing:

CY's Take on PWC#067

This is a part of Perl Weekly Challenge(PWC) and the followings are related to my solutions. If you want to challenge yourself on Perl, go to https://perlweeklychallenge.org, code the latest challenges, submit codes on-time (by GitHub or email)(before Monday GMT+0 00:00) if possible, before reading my blog post.


The discussion of Perl 7 in blogs.perl.org # was so hot last week made me too shy to write PWC experience (stop, it's just an excuse!).

Some discussions were quite technical for a beginner. Anyway as a beginning coder in Perl 5, I would add "use warnings" in my final coding stage from now on to prepare for the change.

PWC#67 Task #2: Letter Phone

Perl Weekly Challenge 112: Canonical Path and Climb Stairs

These are some answers to the Week 112 of the Perl Weekly Challenge organized by Mohammad S. Anwar.

Spoiler Alert: This weekly challenge deadline is due in a few days (May 16, 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: Canonical Path

You are given a string path, starting with a slash ‘/’.

Write a script to convert the given absolute path to the simplified canonical path.

In a Unix-style file system:

- A period ’.’ refers to the current directory

- A double period ’..’ refers to the directory up a level

- Multiple consecutive slashes (’//’) are treated as a single slash ’/’

The canonical path format:

- The path starts with a single slash ’/’.

- Any two directories are separated by a single slash ’/’.

- The path does not end with a trailing ’/’.

- The path only contains the directories on the path from the root directory to the target file or directory

Example:

YouTube: The Weekly Challenge - 067

Task #1: Number Combinations (Perl)

Task #2: Letter Phone (Perl)

Lucky Number Per7

I swear it was Perl 5 just a moment ago. I turned my back for all of 5 minutes ...

I don't need the new features, but I don't like boilerplate and I'm happy to accommodate those who seek progress. Harking back to lessons from the past, SysAdmins of a certain age may remember the venerable a2p program for converting awk scripts to perl and the horrendous (but working) code that it produced. We had one of those running in production less than 2 years ago until I finally decided to re-write it in Modern Perl. A bit like moving house, as a community we need to face the pain every so often and address the risks and ptifalls, not as reasons to keep to the status quo, but as a checklist of problems to be solved.

Perhaps the most Perlish thing to do would be to actually go and ask the Python community what they would do differently in migrating to python3. Learn from other people's mistakes.

Breathing life into the (Emacs) cperl-mode

If you are an Emacs user, you might know or even use cperl-mode. I am using it, more or less since my first days with Perl. Back then, newsgroups were a thing, and Ilya Zakharevich recommended it occasionally. In older times cperl-mode was shipped with Perl, today it is part of Emacs.
If you use cperl-mode, you might also have had a look at the code and noticed that it hasn't seen much love in the last decade or so.
Perl, on the other hand, evolves. Version 5.32, for example, brings a new infix operator, and some future version might bring Cor.
Wouldn't it be nice if cperl-mode understood these new keywords?
I'm on my way to get familiar with emacs-lisp, ERT, and other stuff to see what I can do.
Ideas, contributions, comments, bug requests and criticism is welcome - There's a GitHub repository to get started.

Perl Weekly Challenge 111: Search Matrix and Ordered Letters

These are some answers to the Week 111 of the Perl Weekly Challenge organized by Mohammad S. Anwar.

Spoiler Alert: This weekly challenge deadline is due in a few days (May 9, 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: Search Matrix

You are given 5x5 matrix filled with integers such that each row is sorted from left to right and the first integer of each row is greater than the last integer of the previous row.

Write a script to find a given integer in the matrix using an efficient search algorithm.

Example:

BLOG: The Weekly Challenge #068

https://perlweeklychallenge.org/blog/weekly-challenge-068

From the user perspective, Perl strings have no bugs and work well.

I feel that in the upcoming version of Perl, the core team fixes the Unicode bug as a reason to break backward compatibility Perl 5.

Unicode in Perl internally has some inconsistencies due to conflicts between latin-1 and UTF-8.

this is true.

On the other hand, from the user's point of view, a Perl string works perfectly fine if you only accept it can't tell whether it's a decoded string or a bytes.

We are solving this problem by convention.

Where do we determine if it is a string or a bytes?

The inside and outside of the program are completely separate.

If the data comes in from outside, then we will determine if it is a bytes or a string.

If it is a bytes, do nothing.

If it is a string, decode it.

This is simple and all of all works well.

In fact, this way is a good one.

Inside the program, we don't need to worry about the character code.

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.