This Week in PSC (131) | 2024-01-12

We discussed

  • Some issues with PPCs in flight - meta (0022), qt strings (0019). More mails or PRs may be inbound
  • A gap in the PPC process overall; it seems unclear how to edit and amend accepted documents to resolve questions that come up during implementing

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 252: Unique Sum Zero

These are some answers to the Week 252, 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 January 21, 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: Unique Sum Zero

You are given an integer, $n.

Write a script to find an array containing $n unique integers such that they add up to zero.

Example 1

Input: $n = 5
Output: (-7, -1, 1, 3, 4)

Two other possible solutions could be as below:
(-5, -1, 1, 2, 3) and (-3, -1, 2, -2, 4).

Example 2

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.

This Week in PSC (127) | 2023-12-07

This week we:

  • Worked out final resolving actions for security issues.
  • Discussed recent mailing-list posts about making method non-public by default. This probably won’t work but we could open a PPC discussion on my method + $obj->&method syntax.
  • Reviewed Projects in Flight - posted below
  • Merged the PR for PPC 0022 (Metaprogramming API). Discussions on individual points can be made using GH Issues

Projects in Flight

  • HTTPS out of the box — (Paul) has nudged Mark Gardner by email
  • PPC 0013 overload in join — (Philippe) should open an issue with his thoughts on the topic
  • PPC 0014 English names — (Paul) should check in with Joe McMahon
  • PPC 0019 qt Strings — (Paul) now has TPF Core Development Grant so can start writing this Any Day Now(TM)
  • PPC 0021 Optional chaining — (Paul) should check in with Veesh Goldman
  • PPC 0022 Metaprogramming API — (Paul) has a CPAN module, would be nice if anyone started using it for any reason
  • (Graham) to write a PPC for ->&
  • Perl roadmap for 2024 — Yeah it’d be nice if we had one, but without having any weight of promise behind it it’s just words
  • TODDR to write a draft pod/security_disclosure_process.pod (not in December), and also offered to coordinate the next incident

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:

Perl Weekly Challenge 229: Two out of Three

These are some answers to the Week 229, 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 13, 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: Two out of Three

You are given three array of integers.

Write a script to return all the elements that are present in at least 2 out of 3 given arrays.

Example 1

Input: @array1 = (1, 1, 2, 4)
       @array2 = (2, 4)
       @array3 = (4)
Ouput: (2, 4)

Example 2

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.

This week in PSC (126) | 2023-11-30

Three Perl releases have been published this past week, containing patches for security issues CVE-2023-47038 and CVE-2023-47039. This kept us busy for the past few weeks (explaining the somewhat thinner recent updates).

  • Paul will publish a post-mortem on the recent releases, looking at what went wrong and some thoughts on how to improve it so those don’t happen again
  • We discussed a plan to improve documentation of the security disclosure process
  • We took note of what projects we have in flight (e.g. PPCs being implemented) and may find a way to keep that list published and updated

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.

Perl Weekly Challenge 227: Roman Maths

These are some answers to the Week 227, 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 July 30, 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: Roman Maths

Write a script to handle a 2-term arithmetic operation expressed in Roman numeral.

Example

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

This Week in PSC (124) | 2023-11-16

This week we:

  • Reviewed some recent email threads:
    • Returning values from require multiple times - seems not useful as compared to using do FILE or the new load_module builtin
    • CPAN.pm observed to use lots of memory, but also complicated to fix. It might benefit a new smaller simpler tool being provided by Perl core
  • Perl 5.39.5 is due soon and we have release managers up to 5.39.8, but we’re still in need of folks to do up to 5.40.0

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 226: Zero Array

These are some answers to the Week 226, 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 July 23, 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: Zero Array

You are given an array of non-negative integers, @ints.

Write a script to return the minimum number of operations to make every element equal zero.

In each operation, you are required to pick a positive number less than or equal to the smallest element in the array, then subtract that from each positive element in the array.

Example 1:

Perl v5.36, Debian, and Ubuntu

I normally only write about the Perl Weekly Challenge/The Weekly Challenge, but today I have a couple things to say about recent Perl versions. I've been watching the videos from TPRC2023, and loving the talk by Paul Evans What's New in Perl v5.38. I like to have a minimum version in my code generally that I can rely on having all the features from. I think I previously ignored v5.36 because it wasn't in Debian yet (and I typically only use packaged Perl), but thanks to Paul's talk I've really enjoyed looking at the perldelta, where some really groundbreaking Modern Perl changes were made just in the use v5.36 syntax.

Well, now two things have happened. v5.36 is the oldest release still officially supported by the Perl team, and it's in Debian stable. This makes it a great candidate to be my new target version for most code!

Unfortunately, Ubuntu 22.04 (one of my servers) is still stuck on v5.34, and this makes me sad. 😥

In related news, the new object system in v5.38 and beyond looks pretty sweet! I'm excited. Can't wait to see what else gets implemented in the next couple versions.

This Week in PSC (121) | 2023-10-19

  • Reviewed recent mailing list threads - multiple namespaces, moose + warnings conflicts. Determined there’s not a lot the perl core can do (at the moment)

  • Reviewed PR#21532 (Module loading function)

  • SSL out of the box still needs someone to project manage whatever various bits need to be done. A specific email on the subject will be sent to the list.

  • PR#18059 to fix up perl version number macros is still outstanding and needs fixing up so it can be merged

Matching simply

A little over ten years ago, when Perl 5.18 was approaching its release date, I released match::simple. This was mostly in response to the smartmatch operator (~~) being deprecated, but also a solution to the incredibly arcane rules for how the smartmatch operator operated.

match::simple was intended to be... simpler. The operator looks a little funky because it uses some clever trickery to fake being an infix operator:

    use match::simple;
    
    if ( $this |M| $that ) {
        ...;
    }

Perl Weekly Challenge 252: Special Numbers

These are some answers to the Week 252, 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 January 21, 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: Special Numbers

You are given an array of integers, @ints.

Write a script to find the sum of the squares of all special elements of the given array.

An element $int[i] of @ints is called special if i divides n, i.e. n % i == 0, where n is the length of the given array. Also the array is 1-indexed for the task.

Example 1

When Saif Met Sarah

The Perl and Raku Conference 2023

The Perl and raku Conference 2023 in Toronto was an event I was really looking forward to. A chance to rub shoulders with the giants of Perl and Raku, absorb insights and innovations of the nerdy Perly community...everything they said in the blurb. It was very well organised thanks to Alex, Sawyer, Makoto, Amber and Peter, herding an army of volunteers. Such a knowledge-intensive event should be recorded for posterity, trapping the wisdoms and inspirations from the wise and inspiring in the container that is YouTube.

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.