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 133: Integer Square Roots and Smith Numbers

These are some answers for Week 133 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 10, 2021 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: Integer Square Root

You are given a positive integer $N.

Write a script to calculate the integer square root of the given number.

Please avoid using built-in function. Find out more about it https://en.wikipedia.org/wiki/Integer_square_root.

Examples:

Gisle Aas's CPAN distributions are available for adoption

Gisle Aas (GAAS on CPAN) is a well-known CPAN author, who made his first releases back in 1995. Over the years he has developed and maintained a number of keystone modules that most of us have relied on, whether we realised it or not. Gisle has informed the PAUSE admins that he will no longer be maintaining his CPAN distributions, and is open to responsible adoption. In this blog post we'll summarise what distributions are available, and our interpretation of responsible adoption.

If you're interested, please read this post, and if you still would like to adopt a distribution, contact the PAUSE admins (modules at perl dot org) and not Gisle.

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 .

Perl Weekly Challenge 132: Mirror Dates and Hash Join

These are some answers for Week 133 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 3, 2021 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: Mirror Dates

You are given a date (yyyy/mm/dd).

Assuming, the given date is your date of birth. Write a script to find the mirror dates of the given date.

Dave Cross has built cool site that does something similar.

Assuming today is 2021/09/22.

Example 1:

Input: 2021/09/18
Output: 2021/09/14, 2021/09/26

On the date you were born, someone who was your current age, would have been born on 2021/09/14.
Someone born today will be your current age on 2021/09/26.

Example 2:

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?

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

Perl Weekly Challenge 131: Consecutive Arrays

These are some answers to task 1 of the Week 131 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 26, 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.

You are given a sorted list of unique positive integers.

Write a script to return list of arrays where the arrays are consecutive integers.

Example 1:

Input:  (1, 2, 3, 6, 7, 8, 9)
Output: ([1, 2, 3], [6, 7, 8, 9])

Example 2:

Input:  (11, 12, 14, 17, 18, 19)
Output: ([11, 12], [14], [17, 18, 19])

Example 3:

Input:  (2, 4, 6, 8)
Output: ([2], [4], [6], [8])

Example 4:

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.

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

Perl Weekly Challenge 130: Odd Number and Binary Search Tree

These are some answers to the Week 130 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 19, 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: Odd Number

You are given an array of positive integers, such that all the numbers appear even number of times except one number.

Write a script to find that integer.

Example 1:

Input: @N = (2, 5, 4, 4, 5, 5, 2)
Output: 5 as it appears 3 times in the array where as all other numbers 2 and 4 appears exactly twice.

Example 2:

Input: @N = (1, 2, 3, 4, 3, 2, 1, 4, 4)
Output: 4

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

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.

Perl Weekly Challenge 128: Minimum Platforms

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

Note: very little time this week, so I only completed task 2.

You are given two arrays of arrival and departure times of trains at a railway station.

Write a script to find out the minimum number of platforms needed so that no train needs to wait.

Example 1:

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

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.