This week in PSC (119) | 2023-10-05

This week we discussed the following topics:

  • Module::CoreList is still somewhat awkward and manual to update around releases. We need better instructions and possibly some automation around the simpler
  • Pod’s new U<> format needs more documentation around its limited availability.
  • Test2::Suite sometimes spuriously fails in perl core; needs some poking
  • We should put out a call for bugfixes for a possible 5.38.1 release

Of Go, C, Perl and fastq file conversion Vol I : intro

Next Generation Sequencing (NGS) has really taken off the last few years, as both devices and the cost of experiments have dramatically declined. NGS decipher the identity (base composition, the sequence of letters in the alphabet of DNA and RNA) of nucleic acids and return the results in the fastq open data format. Fastq files are flat text files with a standardized layout: each molecule present in the sample that is captured by the sequencer is represented with four fields:

  1. a '@' character and is followed by a sequence identifier and an optional description

  2. one (typically) or more lines of characters in the four letter alphabet of nucleic acids

  3. a metadata field starting with the "+" optionally followed by the same sequence identifier and description as in the first field

  4. one, or more lines of the quality of each symbol sequence reported in field 2

An example of such a four field entry may look something like this

Perl Weekly Challenge 263: Merge Items

These are some answers to the Week 263, 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 April 7, 2024 at 23:59). This blog post provides some solutions to this challenge. Please don’t read on if you intend to complete the challenge on your own.

Task 2: Merge Items

You are given two 2-D array of positive integers, $items1 and $items2 where element is pair of (item_id, item_quantity).

Write a script to return the merged items.

Example 1

Komodo IDE is now Open Source

Hi all,

Please note that Komodo IDE is now open source. Komodo IDE is a very feature-rich Integrated Development Environment (IDE). Basically a sophisticated source-code editor. Notable features why I used Komodo IDE:

  • Syntax highlighting
  • Code intelligence (autocomplete, code refactoring etc.)
  • Run and debug programs easily
  • Debug with breakepoints and inspect the variables and their values in the GUI
  • Integrates with version control

You can read more about Komodo IDE here.

The blog post announcing Komodo IDE going Open Source is here.

The blog post also contains an explanation why it is made open source. One of the reasons is that there is already a lot of free and good editors available, e.g. Visual Studio Code. Though, as I was using Komodo IDE for at least 7 years now, I still very much like it and it’s OOTB feature set.

Komodo-IDE.png

This week in PSC (118) | 2023-09-28

All three of us returned. We talked about

  • Getting a Perl 5.38.1 maint release out of the door
  • How to progress Pod format improvements (i.e. U<>)

Perl Weekly Challenge #231 - Not Going to Extremes but Accepting Senior Citizens

Hi everybody! In this week's weekly challenge, we're searching for anything but the minimum or maximum in a dataset, and searching for senior citizens on a plane.

Min And Max

This challenge is a very interesting one, because obviously the easiest solution in terms of development is to sort and filter the first and last element. However, that is O(n log n) and it's very little added complexity to do the O(n) solution with a single-pass filter.

Perl Weekly Challenge 231: Senior Citizens

These are some answers to the Week 231, 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 August 27, 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: Senior Citizens

You are given a list of passenger details in the form “9999999999A1122”, where 9 denotes the phone number, A the sex, 1 the age and 2 the seat number.

Write a script to return the count of all senior citizens (age >= 60).

Example 1

Input: @list = ("7868190130M7522","5303914400F9211","9273338290F4010")
Ouput: 2

The age of the passengers in the given list are 75, 92 and 40.
So we have only 2 senior citizens.

Example 2

Next stable DBD::SQLite will be released in the middle of September

DBD::SQLite 1.73_01 (with SQLite 3.42.0) is a release candidate for the next stable DBD::SQLite. This release is mainly to upgrade the bundled SQLite library.

I'll wait for about a month and release 1.74 in the middel of September if there's no blocker nor request to wait for more. Thank you for your patience.

This week in PSC (117) | 2023-09-21

Two of us again, here's the summary of our meeting:

  • While implementing PPC 0013, it turned out it was vague in some places, so further discussions and refinements to the PPC document are needed
  • POD extensions - do we keep stealing features from Markdown (like tables, images, language markers)? Do we switch to Markdown? Neither are easy.
  • We’ve disabled the Wiki and enabled Issues on the PPCs repository, to better separate discussions on the form and substance of PPCs
  • PPC 0022 will soon be merged, and moved to “Exploratory” status

Perl Weekly Challenge #230 - Turning Numbers into Characters and Words into Numbers

Hi everybody! I'm finally back with another PWC/TWC blog post for week 230.

Separate Digits

For the first challenge we want to split all the numbers in the array into single digits. Here's the code:

use v5.36;
my @nums;
push(@nums, split(//, $_)) for @ARGV;
say $_ for @nums;

It very simply splits anything in its arguments into individual characters and pushes them onto a new array.

Count Words

Our second challenge asks us to count the words that start with the given prefix. Here's a 4-liner (minus boilerplate) to help us out with this one:

Why YACM (yet another color module) ?

At the recent YAPC::EU (still running) I gave a talk about my latest CPAN module: Graphics::Toolkit::Color (in short GTC - v1.53). It went a little out of hand and even worse: some of the key thoughts I did not formulate as clear as wanted. That is why I use this channel to correct that. In this first part I outline the goal of the module and the next part will be about the design principles of the public API, moving than into implementation details and the general issues when dealing with colors.

Perl Weekly Challenge 230: Count Words

These are some answers to the Week 230, 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 August 20, 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: Count Words

You are given an array of words made up of alphabetic characters and a prefix.

Write a script to return the count of words that starts with the given prefix.

Example 1

Input: @words  = ("pay", "attention", "practice", "attend")
       $prefix = "at"
Ouput: 2

Two words "attention" and "attend" starts with the given prefix "at".

Example 2

This week in PSC (116) | 2023-09-14

There were only two of us this week, and the list is still a bit quiet.

The main topic was stalled PPC work: we have a few PPCs that have been approved and are in the “Implementing” state, but still waiting for an implementor. We’ll send a separate email asking for volunteers on those.

Resource::Silo - declarative lazy resource container library

Resource::Silo is a declarative lazy resource container library for Perl. It allows to declare resources such as configuration files, database connections, external service endpoints, and so on, in one place; acquire them on demand; cache them; and release in due order.

It may also be described as the single source of truth for the application's side effects.

For those unfamiliar with Bread::Board:

Hey, hey, hey, hey! A shiny new solution just arrived!

  • declare all of your application's resources / dependencies in one place using a simple DSL;
  • instantiate them on demand and only once, with little overhead;
  • override them with mocks in your tests & guard against unexpected side effects;
  • gain more fine-grained control via the ctl frontend.

For Bread::Board users:

Foswiki-2.1.8 has been released

Dear all,

we've got a new release out. Update is highly recommended as it fixes 9 critical security related bugs, i.e.

  • CVE-202: 3-33756: SpreadSheetPlugin's EVAL feature exposes information about paths and files on the server
  • CVE-2023-24698: Local file inclusion vulnerability in viewfile

Read more about it at https://blog.foswiki.org/Blog/Foswiki218IsReleased

Regards,
Michael.

Perl Weekly Challenge 263: Target Index

These are some answers to the Week 263, 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 April 7, 2024 at 23:59). This blog post provides some solutions to this challenge. Please don’t read on if you intend to complete the challenge on your own.

Task 1: Target Index

You are given an array of integers, @ints and a target element $k.

Write a script to return the list of indices in the sorted array where the element is same as the given target element.

Example 1

Input: @ints = (1, 5, 3, 2, 4, 2), $k = 2
Output: (1, 2)

Sorted array: (1, 2, 2, 3, 4, 5)
Target indices: (1, 2) as $ints[1] = 2 and $k[2] = 2

Example 2

No One Is Immune to Abuse

Once again I'm writing about a TPRC talk instead of a weekly challenge project, but that's because I feel it's a very important topic to be aware of both inside and outside our community as Perl programmers. Sawyer X gave a really great talk about the abuse he personally experienced as a member of the Perl community. I've never experienced abuse in this or any other technology community, but I have experienced abuse before in other contexts. Also, as a disclaimer, although I'm sure many have seen some of Sawyer's situation play out in public, I haven't, as I believe it happened during my extended break from Perl and development in general.

More prototype play: Dispatch::Fu

I was seeing this so much talk about smartmatch or given/when, I decided to experiment with a prototype powered pseudo structure I'd been thinking about. The results were pleasing to me, and I plan on releasing this soon. I could rename it to match/case (versus fu/on), but the huffman in me likes the short (and semi-ambiguous) "keywords". Let me know what you think in the comments below.

I still need to do more unit tests, POD, dist.ini, etc. But it's the closest I could get what I was observing on P5P. And the current implementation is about as fast and tight as I think it could be. I also enjoy using Perl's datatype coercion capabilities via prototypes* quite a bit. It is a very powerful, underutilized, and misunderstood capability that can be used to bring about a lot more ideas via a "keyword" experience (which is the entire point).

https://github.com/oodler577/p5-Dispatch-Fu

DESCRIPTION

Why we use Perl at our company

I've been programming in Perl for almost two decades now. A lot has changed in Perl, and also in the way I program with it.

Several years ago my partners and I started a software company, I was in charge of everything to do with tech, so as CTO it was my responsibility to choose the tech stack our company was going to use. And it was an easy one: Perl.

Years have gone by, our company has continued to grow, our product catalogue has increased and the amount of data processing and analysis we do it's exponentially higher than when we started. And Perl has continued to show what a great option it is.

I would like to list some of the reasons why Perl has been such a great fit for our company.

Versatility

Perl Weekly Challenge 262: Count Equal Divisible

These are some answers to the Week 262, 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 March 31, 2024 at 23:59). This blog post provides some solutions to this challenge. Please don’t read on if you intend to complete the challenge on your own.

Task 2: Count Equal Divisible

You are given an array of integers, @ints and an integer $k.

Write a script to return the number of pairs (i, j) where

a) 0 <= i < j < size of @ints

b) ints[i] == ints[j]

c) i x j is divisible by k

Example 1

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.