Ubuntu + Perl Web Development Environment Building

I wrote here the steps to build a web system development environment using Perl and Ubuntu.

This is a very convenient procedure if you want to create a web application using Perl.

Ubuntu + Perl Web Development Envrinment Building

Week #079: Count Set Bits & Trapped Rain Water

Please follow the blog where I discuss the "Count Set Bits" and "Trapped Rain Water" task of "The Weekly Challenge - 079".

https://perlweeklychallenge.org/blog/weekly-challenge-079

Perl Weekly Challenge 127: Disjoint Sets and Conflict Intervals

These are some answers to the Week 127 of the Perl Weekly Challenge organized by Mohammad S. Anwar.

Task 1: Disjoint Sets

You are given two sets with unique integers.

Write a script to figure out if they are disjoint.

The two sets are disjoint if they don’t have any common members.

Example:

Input: @S1 = (1, 2, 5, 3, 4)
       @S2 = (4, 6, 7, 8, 9)
Output: 0 as the given two sets have common member 4.

Input: @S1 = (1, 3, 5, 7, 9)
       @S2 = (0, 2, 4, 6, 8)
Output: 1 as the given two sets do not have common member.

Disjoint Sets in Raku

while loops that have an index

Perl got this syntax that allow to use a while loop without having to explicitly increment an index by doing an i++. It is made possible by the each function.

Let's demonstrate this in a simple test that check that and array and an array ref contains the same things:

OO linked lists in Perl

After many days, trying to implement linked lists by nested hash (link to Rosetta Code) (link to my code) or Struct::Dumb, I get how to write the (singly) linked list in object-oriented style by Perl. One with bless, another one with Moose. Keep the learning record here.

Updated: See the link in comment section of Tobyink, a showcase of his OO module Zydeco. Thanks Toby!

Updated on 2nd Aug, 2021: Add Object::Pad .

I Write comment to Perl7 is a fork of values

I Write comment to Perl7 is a fork of values

I think the current Perl 7 plan is very heavy for the resources available to the Perl community.

Perl 7 will succeed if many people welcome it and everyone supports it.

However, I think the remaining users of Perl will remain because of the stability of that Perl.

If, in reality, the move to Perl 7 doesn't work, I think it's an opportunity to reconsider adopting "use v7".

I have a very similar thinking of Leon.

By the way.

Why doesn't my question get a reply when I post it to Per 5 Porters mailing list?

Perl Weekly Challenge 126: Count Numbers and Minesweeper Game

These are some answers to the Week 126 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 22, 2021 at 24:00). 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: Count Numbers

You are given a positive integer $N.

Write a script to print count of numbers from 1 to $N that don’t contain digit 1.

Example

Crosspost: Nginx/Certbot Recipe

Back in Februrary I posted an article in which I promised a follow up telling you how I now manage my certificates. We’ll all these months later I’ve finally published it to dev.to (to push its reach beyond just Perl) https://dev.to/joelaberger/no-magic-letsencrypt-certbot-and-nginx-configuration-recipe-3a97 .

Week #078: Leader Element & Left Rotation

Please follow the blog where I discuss the "Leader Element" and "Left Rotation" task of "The Weekly Challenge - 078".

https://perlweeklychallenge.org/blog/weekly-challenge-078

Zydeco::Lite

Today I released Zydeco::Lite, a re-implementation of Zydeco but just using standard Perl syntax. So for example, class { ... } becomes class(sub { ...});.

This has the advantage of much faster compile time, similar run time speed, fewer dependencies, and compatibility with older versions of Perl before the keyword API was introduced. Of course, in some circumstances these aren't important concerns, so the nicer syntax of the full Zydeco will be preferred.

Zydeco and Zydeco::Lite are both based on MooX::Press which itself is based on Moo, Type::Tiny, and other modules. I've taken the synopsis example from the Zydeco documentation and rewritten it using the different layers of abstraction.

Perl Weekly Challenge 125: Pythagorean Triples

These are some answers to the Week 125 of the Perl Weekly Challenge organized by Mohammad S. Anwar.

Task 1: Pythagorean Triples

You are given a positive integer $N.

Write a script to print all Pythagorean Triples containing $N as a member. Print -1 if it can’t be a member of any.

Triples with the same set of elements are considered the same, i.e. if your script has already printed (3, 4, 5), (4, 3, 5) should not be printed.

The famous Pythagorean theorem states that in a right angle triangle, the length of the two shorter sides and the length of the longest side are related by a²+b² = c².

A Pythagorean triple refers to the triple of three integers whose lengths can compose a right-angled triangle.

Example:

Mid September Software Releases 2020

Perl5-IDEA 2020.2.3 (Perl5 plugins for IntelliJ IDEA)

"Profiler support and bugfixes"

https://github.com/Camelcade/Perl5-IDEA/releases/tag/2020.2.3

LemonLDAP-NG Apache::Session::Browseable v1.3.8

"This release contains fixes for CVE-2020-16093, which concerns LDAP server certificate verification when using LDAPS."

https://github.com/LemonLDAPNG/Apache-Session-Browseable/releases/tag/v1.3.8

Pulled Pork 0.7.4

"This release includes numerous bug fixes for some issues that have been around for some time. PulledPork v0.7.4 has been tested with Snort 2.16.1 and Snort 3.0.1."

https://github.com/shirkdog/pulledpork/releases/tag/v0.7.4

LedgerSMB

Releases on each maintained branch

https://github.com/ledgersmb/LedgerSMB/releases/tag/1.8.2

https://github.com/ledgersmb/LedgerSMB/releases/tag/1.7.21

https://github.com/ledgersmb/LedgerSMB/releases/tag/1.6.25


CLOC (Count Lines of Code) 1.88

"Add missing Raku_or_Prolog() subroutine; new languages and file types LLVM IR, Logos, Meson, Mojo, Odin, Jinja Templates, WXML, WXSS; support MATLAB block comments; minor bug fixes."

https://github.com/AlDanial/cloc/releases/tag/1.88

SSL Tools (rolling)

Pull requests accepted

https://github.com/noxxi/p5-ssl-tools

Week #77: Fibonacci Sum and Lonely X

Please follow the blog where I discuss the "Fibonacci Sum" and "Lonely X" task of "The Weekly Challenge - 077".

https://perlweeklychallenge.org/blog/weekly-challenge-077

Expand one into two - CY's Take on TWC#077

If you want to challenge yourself on programming, especially on Perl and/or Raku, go to https://perlweeklychallenge.org, code the latest challenges, submit codes on-time (by GitHub or email).

I found that I gained unnecessary promotion due to being in a GMT+8.00 timezone - my blogpost appears on the top of https://blogs.perl.org for longer hours.

---

Task 1 Fibonacci Sum

Another dish for math geek!

Really??

Coding Process

I spent a whole day on the Perl script on Fib Sum task. I worked on it until night. Then I have a rest. In the morning next day, finally I gave up a subroutine for cases like "7, 5, 3" => "6, 5, 4, 3, 2, 1" or "11, 9" => "10, 9, 8, 7". The hard time made me recall what I learnt after Challenge #055 Task 2 Wave Array, using a hash to remove any duplicates occurred -- instead of crazy handling of exception cases again and again.

Task Explanation

Perl Weekly Challenge 124: Happy Women Day and Tug of War

These are some answers to the Week 124 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 8, 2021 at 24:00). 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: Happy Women Day

Write a script to print the Venus Symbol, international gender symbol for women. Please feel free to use any character.

Example:

Web Scraping with Zydeco

So I like to keep local copies of my blogs.perl.org blog posts as Atom entries, but noticed yesterday that I had a few gaps in my collection. The Atom feeds offered by blogs.perl.org only have the most recent articles though, so I decided to write a quick script to scrape the posts. Luckily, I managed to get a table containing the URLs for each post I needed, so I didn't need to bother with following links to find the pages; I just needed to grab the content from them.

I thought some people might find the code interesting especially for its use of lazy attributes. This is one of those "it only needs to be used once, so making the code maintainable isn't important" kinds of projects, do bear that in mind. I've cleaned up the whitespace and added comments for this blog post, but other than that, it's just a quickly hacked together script.

game code challenge

hi, as already indicated in that reddit post, a new bot contest was planned for next fall: it has now a planned starting date.

it would be nice to see more than ten perl lovers to join the fun, which will also permit to be seen in the loop back stats, unlike the previous contest.

i would like also to highlight:
  • the community developed an extension to write code locally.
  • the community can write contests from easy to expert: see Bender 1, 2, 3, against 4 ; or Pikaptcha 1, 2, 3, 4.
  • the admins will accept to upgrade to perl 7 when time has come, but, i guess, the level of priority will depend on the number of people asking for it.

TIL about Literate Programming

As a programmer whose first job was in the mortgage software industry, “TIL” has always meant “Truth In Lending” to me: you know, that document that the bank is required to give you when you get a mortgage, that’s supposed to explain how much you’re really paying after all the bank’s hidden finance charges, except the numbers don’t seem to make any sense so you just sign it anyway and don’t know anything more than you did before?  Yeah, that one.

Of course, nowadays it means something else, and I’ve had to redirect my ossified mental patterns into new channels, so that, now when I see “TIL,” I can have my brain recognize it as “Today I Learned.” Which is a handy phrase: it encapsulates feelings of discovery, serendipity, and epiphany all into one.  And TIL1 that the way I’ve always tried to write code has a name, a history, and a venerable progenitor—most of my life, without even realizing it, I’ve been trying to use literate programming (only without the tangling).

Perl Weekly Challenge 123: Ugly Numbers and Square Points

These are some answers to the Week 123 of the Perl Weekly Challenge organized by Mohammad S. Anwar.

Spoiler Alert: This weekly challenge deadline is due on August 1, 2021 at 24:00. 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: Ugly Numbers

You are given an integer $n >= 1.

Write a script to find the $nth element of Ugly Numbers.

Ugly numbers are those number whose prime factors are 2, 3 or 5. For example, the first 10 Ugly Numbers are 1, 2, 3, 4, 5, 6, 8, 9, 10, 12.

Example

Input: $n = 7
Output: 8

Input: $n = 10
Output: 12

Ugly Numbers in Raku

Week #76: Prime Sum

Please follow the blog where I discuss the "Prime Sum" task of "The Weekly Challenge - 076".

https://perlweeklychallenge.org/blog/weekly-challenge-076

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.