The mysterious case of the SVt_PVIV

The other day I wanted to send my friend some silly emojis on LINE and so I updated my flaky old Unicode browser to the new-fangled Unicode with values above 0x10000, so that I could fetch the Emojis, which start around here. The thing also features a perl script which fetches values from Unicode::UCD using the charinfo function. I also updated to Perl 5.32 around the same time. Now the funny thing was that I started getting all kinds of errors about invalid JSON in the browser console. My Perl script was sending something of the form {... "script":Common ...} from my module JSON::Create, which is not valid JSON due to not having quotes around Common, and obviously my module was faulty.

Perl Weekly Challenge 145: Dot Product

These are some answers to the Week 145 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 2, 2022 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: Dot Product

You are given 2 arrays of same size, @a and @b.

Write a script to implement Dot Product.

Example:

@a = (1, 2, 3);
@b = (4, 5, 6);

$dot_product = (1 * 4) + (2 * 5) + (3 * 6) => 4 + 10 + 18 => 32

An important point is that we are told that the arrays have the same size. Thus, we don’t need to check that. We’ll also assume that they contain only numbers.

Dot Product in Raku

Where is Rob?

Does anybody know Rob Seegel (aka RCS), the author/maintainer of Tk::MListbox?

I tried to contact the author by e-mail but didn't get any feedback so far.
I would like to adopt the module Tk::MListbox (and the other packages).

REST::Neo4p catches up to Neo4j V4.0+

For a long time (since 2012), REST::Neo4p has provided a way for Perlers to play, and even work, with the graph database Neo4j.

Neo4j has made many changes and improvements in its server and its query language in that time. However, as it has become successful commercially, it has made breaking API changes of one kind or another more and more regularly. In the last major release, version 4.0, Neo4j retired the REST endpoint on which REST::Neo4p was based. This endpoint was "entity-based", as it were, allowing direct access to nodes, relationships, and the like via entity IDs. It was well suited to the object (HAR HAR) of REST::Neo4p. But Neo4j decided to focus exclusively on its declarative query language Cypher, and to move away from the "graph walking" paradigm that the REST endpoint represented.

JSON::Create now features indentation

In version 0.27 of JSON::Create I added a new indentation feature. This was added basically out of necessity. Originally the purpose of the module was sending short bits of JSON over the internet, but I've been using JSON more and more for processing data too. I've spent quite a long time working on a web site for recognition of Chinese, and I've been using JSON more and more extensively. The basic data file for the web site is a 168 megabyte JSON file. Not indenting this kind of file makes for "interesting" problems if one accidentally opens it in an editor or on a terminal screen, a million characters all on one line tends to confuse the best-written text reading utilities. So after years of suffering the relief is tremendous, and now I have tab-based indentation in JSON::Create.

Originally I thought that I should make all kinds of customisable indentation possible, but then it occurred to me that basically any fool armed with a regular expression could easily alter the indentation however they want to. I put a simple example in the documentation.

Perl Weekly Challenge 144: Semiprimes and Ulam Sequence

These are some answers to the Week 144 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 December 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.

Task 1: Semiprimes

Write a script to generate all Semiprime number <= 100.

For more information about Semiprime, please checkout the Wikipedia page.

In mathematics, a semiprime is a natural number that is the product of exactly two prime numbers. The two primes in the product may equal each other, so the semiprimes include the squares of prime numbers.

Example:

10 is Semiprime as 10 = 2 x 5
15 is Semiprime as 15 = 3 x 5

Permutations and Recursion

(Originally published on samirparikh.com.)

I founded a company called Perl Research Institute, Ltd.

I founded a company called Perl Research Institute, Ltd in Japan.

The main purpose of the Perl Research Institute is to restore Perl's honor.

Its reputation was miserable compared to the excellence of Perl's features.

Perl and its users have suffered in many negative campaigns.

Perl was seen by the people who say We are loved in the whole world as an abandoned stone.

I'm not afraid to talk about Perl Even if I'm surrounded by mighty powers who Do a lot of cheating.

Perl Research Institute

CY's Take on PWC#086

pascal_userinterface.jpg# (I will write more some hours later. This may not be a good practice. But) #HKT November 15, 2020 3:32 PM

I am excited by the Sudoku task and eager to share.

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



Perl Weekly Challenge 143: Calculator and Stealthy Numbers

These are some answers to the Week 143 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 December 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: Calculator

You are given a string, $s, containing mathematical expression.

Write a script to print the result of the mathematical expression. To keep it simple, please only accept + - * ().

Example 1:

Input: $s = "10 + 20 - 5"
Output: 25

Example 2:

Input: $s = "(10 + 20 - 5) * 2"
Output: 50

Calculator in Raku

Perl Podcasts

(Originally published on samirparikh.com.)

Like any well-entrenched programming language, Perl has a rich history and a number of personalities who shape and lead its community. In addition to wanting to learn its syntax and how to write simple scripts with it, I'm also trying to learn more about that history and the people who influence it today. I do this by following some blogs (which perhaps I'll write about later) and reading online books and articles but the best way for me is to listen to relevant podcasts. I'm an avid podcast listener and love learning about new concepts or technologies while walking the dog, doing the dishes, or pre-pandemic, sitting in traffic. Over the past few weeks, I've been listening to some contemporary as well as not so recent Perl-related podcasts and thought I'd share some select episodes that others may find interesting:

Thank You, Coveralls.io

For letting me know my test coverage has increased by 0.00006%.

Coveralls.io screenshot

(Seriously it's a pretty cool service though.)

#Perl on Dev.TO

Dave Cross already suggested to use other forums for Perl-related posts, especially pointing to dev.to where our posts can be more visible to the outside world than here on bpo.

I followed his advice and started to post there too. I even volunteered to become a moderator of the #perl tag on dev.to.

So I'd like to invite you to follow that tag and to post articles there using the #perl tag and other tags that might be relevant to your posts.

Perl Weekly Challenge 142: Divisor Last Digit and Sleep Sort

These are some answers to the Week 142 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 December 12, 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: Divisor Last Digit

You are given positive integers, $m and $n.

Write a script to find total count of divisors of $m having last digit $n.

Example 1:

Input: $m = 24, $n = 2
Output: 2

The divisors of 24 are 1, 2, 3, 4, 6, 8 and 12.
There are only 2 divisors having last digit 2 are 2 and 12.

Example 2:

News regarding GraphViz2

Ed J has taken over maintenance of my suite of GraphViz2 modules.

The first change has been to split it into multiple distros, so that anyone using just GraphViz2 will have a much smaller download and only 6 pre-reqs.

Another change is to rework the decision, which I copied from the original www.graphviz.org, and which meant nodes and port names were joined with a colon. For e.g. MS Windows users wanting to represent disk names like C:, this is clearly problematic.

There is a new option combine_node_and_port, which defaults to true but in May 2021 or so will switch to defaulting to false. When true, the current problematic behaviour occurs. When false, more DWIM-ish behaviour happens:

Perl Weekly Challenge 085

(Originally published on samirparikh.com.)

The latest installment of the Perl Weekly Challenge just dropped so I thought I would take a crack at it. Please note that the challenge is still currently open (as of date of publishing) in case you are participating.

Task #1

Task #1 asks the following:

You are given an array of real numbers greater than zero.

Write a script to find if there exists a triplet (a,b,c) such that 1 < a+b+c < 2. Print 1 if you succeed otherwise 0.

Example 1:

Input: @R = (1.2, 0.4, 0.1, 2.5)

Output: 1 as 1 < 1.2 + 0.4 + 0.1 < 2

Example 2:

Input: @R = (0.2, 1.5, 0.9, 1.1)

Output: 0

Example 3:

Input: @R = (0.5, 1.1, 0.3, 0.7)

Output: 1 as 1 < 0.5 + 1.1 + 0.3 < 2

Monthly Report - October

Men Don't Cry.

I must confess I do cry and cry like a baby. It feels nice afterwards, I must say.

Last month was really difficult for me, on personal and professional front. On personal level, I am undergoing therapy for Depression and Anxiety.

On professional front, I missed many things. For the first time, I couldn't take part in Hacktoberfest in the same passion as before.

Another low point, I stopped contributing in Swift for The Weekly Challenge.

Then I stopped taking part in the weekly challenge completely. No weekly blog either talking about my contributions.

I didn't stop there, I even stopped doing live session video.

At one point, I even decided not to do monthly report.

With all the negativity, I received plenty of support and helping hands. Thanks everyone.

Let's take a quick look through last month main activities.


Pull Request

Perl Weekly Challenge 141: Number Divisors and Like Numbers

These are some answers to the Week 141 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 December 5, 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: Number Divisors

Write a script to find lowest 10 positive integers having exactly 8 divisors.

Example:

24 is the first such number having exactly 8 divisors.
1, 2, 3, 4, 6, 8, 12 and 24.

This is quite straight forward. We can look at consecutive integers, count their factors, and stop when we reach ten integers having 8 divisors.

Number Divisors in Raku

Is it possible to return to development with traditional P5P mailing lists?

Is it possible to return to development with traditional P5P mailing lists?

I still think the traditional method is suitable for advancing Perl development.

why?

We're used to it, and Perl development has been done that way.

We tend to think of it as a poor method, but it's actually a good one.

The first is that it will be developed with backward compatibility in mind.

The second is that we will not proceed unless there is a lot of consensus on the important points.

Some people say that Perl development can't proceed because of opposition.

I think there is no need to proceed with development with a lot of opposition.

I think it's important to find a way that as many people as possible can agree.

The culture of being able to decide everything because we have a majority is not good.

Make everything public and discuss about important decisions.

Small decisions are made by good P5P leaders.

On the other hand, big decisions will be disclosed and discussed to all users.

If the opposite happens, it's a normal reaction.

Is it possible to adjust features and modifications to the point where an agreement can be reached?

Is it possible to return to development with traditional P5P mailing lists?

Finding Squares in Matrices

I don't usually take part in the Perl Weekly Challenge but one of this week's challenges caught my eye. I thought it could be a fun thing to attempt and decided to use Zydeco to help solve it.

The problem is that you're given a matrix of 0s and 1s:

You need to find any squares (equal length sides) where all four corners are 1s:

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.