Perl Weekly Challenge 238: Persistence Sort

These are some answers to the Week 238, 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 October 15, 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: Persistence Sort

You are given an array of positive integers.

Write a script to sort the given array in increasing order with respect to the count of steps required to obtain a single-digit number by multiplying its digits recursively for each array element. If any two numbers have the same count of steps, then print the smaller number first.

Example 1

PSA: Changing your b.p.o password is recommended

HTTPS support on blogs.perl.org, announced last month, has now undergone some additional small improvements to prevent the previously still theoretically possible exposure of session cookies in unencrypted requests.

As such, now is a good time to update your blogs.perl.org password to ensure you are not using credentials which may have previously been passively collected on an open network or the like.

Note: this recommendation is not a response to any known breach of blogs.perl.org. It is a response to the fact that security on blogs.perl.org has finally reached the level necessary to make this precautionary measure useful.

SemVer but with Extra Steps

This is a variant of SemVer which mostly meets all its rules, except for releases prior to 0.2.0, where we bend them slightly.

It is my intention to use this versioning system for all open source software I develop from 1 January 2023 onwards. Existing open source projects I manage will adopt this scheme from their next release onwards. (Type::Tiny already somewhat does.)

Done before, Done better, Done again differently.

A Fool's Errand, and Quantum Theory

It is my firm belief that every thought or idea that you or I have, has been had before. On the balance of statistics, the chances are that those that had these ideas handled it better, and have developed more powerful utilities to exploit these innovations. One therefore has a few possible options, when thinking of creating a solution to a problem. The first probably is to look for other published solutions and use them; these may be more mature, tried, tested and optimised. The second is to go ahead and implement another idea, foolishly perceived as an innovation, leading to a proliferation of methods duplicating, triplicating existing work, in the end producing a half-baked distraction.

Perl Weekly Challenge 236: Array Loops

These are some answers to the Week 236, 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 October 1, 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: Array Loops

You are given an array of unique integers.

Write a script to determine how many loops are in the given array.

To determine a loop: Start at an index and take the number at array[index] and then proceed to that index and continue this until you end up at the starting index.

Example 1

Moving from Perl_5.8.8 (2007) TO Perl_5.36.0 (2022)

Hi ! Everyone, here is a quick question.

As for the CGI script, the first line was

#! /usr/bin/perl -w

Is it not good enough to evoke PERL program at current Perl_5_36.0 (2022)??
If it is not good enough, let me know how should I write at the first line of CGI script???

Thanks !

Automatic Art

After the Harmonograph (which got in the meantime greatly extended), I got another tool for you to create art with - the Cellgraph:

GUIglobal.png

PerlayStation Games Console (Part 1)

Itchy fingers

A few reddit posts ago I saw an interesting article about maze generation and game written in Perl. Game development, I fully believe, is key to intellectual engagement, provides amusement to developers and non developers, and highlights the capabilities of a programming language. This led to an brief exploration of other Perl arcade/action games; Such games such as construdo and deliantra show how complex games can be created. Frozen Bubble is another addictive Perl classic. As a non-developer, I find these games only demonstrate the chasm between my lack of coding agility and the cleverness of others.

It's been done before

SDL and OpenGL seem like a way to go. A useful list of gaming libraries are provided by Debian Games Perl development packages and deliantra are examples of what can be achieved. Some interesting frameworks Quest3 are available although many with no recent updates e.g. this one.

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

TWC 195: Special Speedy Frequency

In which count only what we must.

In Raku, Perl, and C {via Perl's Inline::C} .

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.

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

TWC 194: Bag Time!

In which analysis speeds, and mis-leads.

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.

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

I am jumping my Web pages from 2007 to 2022(now).

Hi Everyone, especially Web-Casting Programmers !!

Naturally I encountered various problems. When I moved from an old computer platform Compaq-Evo with Fedora Core 7 (2007 Red Hat LINUX) to a newer Ubuntu and Rocky 9.1 (2022) as Web-Casting, Web codes encounters various errors and weird displays on the screen. I have to fix all the problems one by one. O.K. let me start one question. Will you help me if you have similar experience. In my case this is a big jump from 2007 -> to 2022.

Here is my first question . HELP me !

When I tested PERL script at Rocky 9.1, I needed to have the command "perl" in front of excitable script filename.

[ At Fedora-Core 7 ] $ script.pl [ENTER] -> it runs. Of course, the file script.pl has an executable file permission.


[ At Rocky 9.1 ] $ script.pl [ENTER] -> It didn't run. But,
[ At Rocky 9.1 ] $ perl script.pl [ENTER] -> It runs.

Should I have to call the interpreter "perl" explicitly like the second line always ???
This is all the way my first posting at this blog, so I hope this posting will work to communicating with someone. Thank you !!

Good bye PrePAN

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

I Perl, Therefore I am

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

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.