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

Keeping Your Valuables Under Lock and Key

Consider the following fairly simple class, which creates a lookup object for month names:

Hours left to donate to The Perl and Raku Foundation in the US 2022 tax yer

There are still a few hours left to donate to The Perl Foundation in the US 2022 tax year. Please support the great work the foundation does to support Perl and Raku

https://www.perlfoundation.org/donate.html

Marketing Committee Achievements in 2022

Looking back over 2022 the Marketing Committee presents our accomplishments to the Board and the Communities we serve.

Our sincere and abundant thanks to all those who have volunteered their time to deliver these outcomes.
  • Created the Prospectus for 2022
  • Arranged to have 2 Perl related articles published in the Linux Format magazine
  • Launched The Perl store offering Official Perl merchandise with profits going to the Perl Fund
  • Organized and held the Perl IDE Hackathon at The Perl and Raku Conference in Houston. This in response to community feedback about the importance of IDE support.
  • The Perl Foundation continues to grow on Facebook
  • Perl and Raku Conference page continues to grow on Facebook
  • Secured FOSDEM booth space in 2023
  • Secured the Camelia logo for The Perl and Raku Foundation

We are excited for the opportunities that the new year presents and express our continuing commitment to growing the Perl and Raku communities.

The committee exists to coordinate and facilitate volunteer efforts to promote the Perl and Raku ecosystems, create and distribute quality content, promote Perl and Raku related events, and assist with getting people involved.

All willing hands are welcome to attend our monthly meetings via Zoom. Please contact the committee via email for meeting invites.

Original post

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

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 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

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 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

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 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

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 !!

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.

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.