Perl Weekly Challenge 235: Duplicate Zeros

These are some answers to the Week 235, Task 2, of the Perl Weekly Challenge organized by Mohammad S. Anwar.

Spoiler Alert: This weekly challenge deadline is due in a few days from now (on September 24, 2023 at 23:59). 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 2: Duplicate Zeros

You are given an array of integers.

Write a script to duplicate each occurrence of ZERO in the given array and shift the remaining to the right but make sure the size of array remain the same.

Example 1

Input: @ints = (1, 0, 2, 3, 0, 4, 5, 0)
Ouput: (1, 0, 0, 2, 3, 0, 0, 4)

Example 2

Input: @ints = (1, 2, 3)
Ouput: (1, 2, 3)

Example 3

Perl fediverse network

ED: This is also posted on reddit, https://www.reddit.com/r/perl/comments/zp8d5g/perl_fediverseactivitypub_social_network/ so please check there also

A while back I bought the https://perl.social/ domain without much immediate use for it. I originally had it redirecting to the perl twitter community. However with the recent twitter drama going around I started setting up an activitypub based network to take the place of the twitter community in the advent that there was an exodus of Perl programmers from twitter. That seems to have been happening so I finally kicked into gear to get it ready for use.

This week in PSC (091) | 2022-12-16

  • Continued discussing the lack of reviews for PRs. Maybe we need a bit of a defined process for how to review small/medium/big PRs
  • Paul suggested he might find time to begin implementing qt{} strings soon
  • HTTPS support in core still needs a project manager to help coördinate the efforts

We won’t be meeting next week due to the Christmas holidays. Next meeting may be 30th or may be in 2023.

TWC 194: Bag Time!

In which analysis speeds, and mis-leads.

Perl Weekly Challenge 235: Remove One

These are some answers to the Week 235, Task 1, of the Perl Weekly Challenge organized by Mohammad S. Anwar.

Spoiler Alert: This weekly challenge deadline is due in a few days from now (on September 24, 2023 at 23:59). 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: Remove One

You are given an array of integers.

Write a script to find out if removing ONLY one integer makes it strictly increasing order.

Example 1

Input: @ints = (0, 2, 9, 4, 6)
Output: true

Removing ONLY 9 in the given array makes it strictly increasing order.

Example 2

Input: @ints = (5, 1, 3, 2)
Output: false

Example 3

Kephra: goto (last) edit

Welcome to my musings: how editing should be (aimed to all users of an editor as food for thought). After select all I will today choose as feature of the day: goto edit (Strg+E) by which I mean jump to the location where you did the last change to the document. In latest version 0.404 I even extended the feature to make it more productive.

This week in PSC (090) | 2022-12-09

Just Paul and Rik, Philippe could not join us today.

  • We talked about the difficulty of taking work that the author thinks is good, and may commit, but on which no significant feedback has been received. Rik will post more about this a bit later.
  • We ran through the RFC tracker, putting the “updating ' as package separator” for Tony Cook’s pull request, and resetting the counter on the ?-> implementation, as Veesh G. has begun taking a crack at that.

Good bye PrePAN

The domain was snapped up by a squatter sometime between July and August. 🙁 What a pity, I always enjoyed those conversations.

Perl Weekly Challenge 234: Unequal Triplets

These are some answers to the Week 234, Task 2, of the Perl Weekly Challenge organized by Mohammad S. Anwar.

Task 2: Unequal Triplets

You are given an array of positive integers.

Write a script to find the number of triplets (i, j, k) that satisfies num[i] != num[j], num[j] != num[k] and num[k] != num[i].

Example 1

Input: @ints = (4, 4, 2, 4, 3)
Ouput: 3

(0, 2, 4) because 4 != 2 != 3
(1, 2, 4) because 4 != 2 != 3
(2, 3, 4) because 2 != 4 != 3

Example 2

Input: @ints = (1, 1, 1, 1, 1)
Ouput: 0

Example 3

I Perl, Therefore I am

And js/node/ts, python, etc., and even prolog! But perl is the best. :D

TWC 193: Evens and Oddballs

In which we revisit seventh grade, and sing in the key of "A".

This week in PSC (089) | 2022-12-02

Back to the full three of us. Not much needed looking at this week.

  • Posted the smartmatch deprecation message to p5p@; will post it to blogs etc.. after a round of responses.
  • Sent off a reminder that we're looking for help or a project manager on getting SSL support out of the box.
  • Reviewed the RFC tracker and found some that are ready to implement but not nobody has started; they are nearing their expiry time. These are:
    • ${^ENGLISH_NAME} aliases for punctuation variables
    • Optional chaining
    • Drop support for ' as package name separator
    • Template Strings (qt)

Perl Weekly Challenge 234: Common Characters

These are some answers to the Week 233, Task 1, of the Perl Weekly Challenge organized by Mohammad S. Anwar.

Spoiler Alert: This weekly challenge deadline is due in a couple of days from now (on September 17, 2023 at 23:59). 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: Common Characters

You are given an array of words made up of alphabetic characters only.

Write a script to return all alphabetic characters that show up in all words including duplicates.

Example 1

Input: @words = ("java", "javascript", "julia")
Output: ("j", "a")

Example 2

Input: @words = ("bella", "label", "roller")
Output: ("e", "l", "l")

Example 3

Making GitHub CI work with Perl 5.8.

A while back. I got a pull request from Gabor Szabo adding a GitHub action to one of my distributions. I have been working with this, but have not (so far) blogged about it because, quite frankly, I am still not sure I know what I am doing.

One of my personal desires was to test my distributions on the oldest practicable Perl for each available architecture. For Unix (i.e. Linux and macOS) this is 5.8.8, provided the distribution itself supports that. A couple days ago, though, I pushed a modification to one of my distributions and had the 5.8.8 tests blow up.

The problem turned out to be that Module::Build, for reasons I have not investigated, has Pod::Man as a dependency. The current version of Module::Build requires Pod::Man version 2.17, but according to corelist Perl 5.8.8 comes with Pod::Man version 1.37, so cpanm wants to upgrade it.

German Perl/Raku Workshop 2023 Call for Papers

The German Perl/Raku Workshop takes place from February 27 to March 1st 2023 in Frankfurt/Main, Germany.

We are looking for your contribution in the form a talk (20 minutes or 40 minutes), a lighting talk (5 minutes) or a workshop (2-4 hours). Please submit your proposals using this online form.

The theme in 2023 is Perl Futures - of course the two developments of Perl, Raku and Perl as well as the reference to the financial metropolis Frankfurt am Main. Presentations with these emphases are especially sought after, but all contributions on Perl, Raku and software development in general are welcome.

Read the complete Call for Papers

New feature: HTTPS support

The site is now served over HTTPS.

Perl Weekly Challenge 233: Frequency Sort

These are some answers to the Week 233, Task 2, of the Perl Weekly Challenge organized by Mohammad S. Anwar.

You are given an array of integers.

Write a script to sort the given array in increasing order based on the frequency of the values. If multiple values have the same frequency then sort them in decreasing order.

Example 1

Input: @ints = (1,1,2,2,2,3)
Ouput: (3,1,1,2,2,2)

'3' has a frequency of 1
'1' has a frequency of 2
'2' has a frequency of 3

Example 2

TWC 192: Frosting a cake without flipping the spatula

In which we refine and refactor past the point of recognition:

(  [\+] ( @a X- target )  )».abs.sum

In Raku, Perl, and Rust.

An objective criteria for deprecating community platforms

Perl has been around for a couple of years longer than Python and Linux. Perl 5 was released in 1993, the same year as FreeBSD and NetBSD.

In the 90's for Open Source projects the "community platforms" where Usenet newsgroups and mailing lists run on Listserv or Majordomo (Mailman didn't show up until 1999). IRC was used for text based chat but without SSL!. CVS was the open source version control system of choice or you might have been unlucky enough to use Visual Source Safe at work, whilst Subversion wouldn't show up until 2000.

But the 90's are more than 20 years in the past and IPv6 is actually seeing meaningful adoption now. Many of the above technologies are as completely foreign to people with 10+ years of industry experience as Compact Cassettes, VHS, LaserDisc and maybe CDs or even DVDs.

As people have embraced Git and even now IPv6 - we too can and must embrace newer platforms that offer a better experience for us humans as we work together on Perl related projects.

Kephra: Select All

To continue my previous post about Kephra, please let me ramble about just one seemingly little feature. It is interesting in its own right - but also an example for the design principles I employ:

1. max productivity

2. max consistency (less to memorize)

3. breaking habits and customs only when 1 and 2 demand it.

As soon graphics plays a greater role I will add max beauty as new 2.

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.