I plan to release SPVM 1.0 at the end of July.
I plan to release SPVM 1.0 at the end of July.
If you have any feedback on the bugs or features, please contact Github Issue or kimoto.yuki@gmail.com
Perl Weekly Challenge 109: Chowla Numbers and Four Square Puzzle
These are some answers to the Week 109 of the Perl Weekly Challenge organized by Mohammad S. Anwar.
Spoiler Alert: This weekly challenge deadline is due in a few days (April 25, 2021). 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: Chowla Numbers
Write a script to generate first 20 Chowla Numbers, named after, Sarvadaman D. S. Chowla, a London born Indian American mathematician. It is defined as:
C(n) = sum of divisors of n except 1 and n
Output:
0, 0, 0, 2, 0, 5, 0, 6, 3, 7, 0, 15, 0, 9, 8, 14, 0, 20, 0, 21
Originally, the task requested us to generate the first 37 Chowla numbers and I wrote implementations in 12 different languages based on that requirement. This requirement has now been amended to the first 20 Chowla numbers. I’ll fix the program and output for some implementations, but will leave some as they were developed.
Chowla Numbers in Raku
Perl 7, not quite getting better yet
Hegel remarks somewhere that all great world-historic facts and personages appear, so to speak, twice. He forgot to add: the first time as tragedy, the second time as farce.
The Eighteenth Brumaire of Louis Napoleon - Karl Marx
Sawyer just announced his plans for perl 7. And while Perl 7 sounds like a lovely language, I do see a number of issues:
Cohabitation / Forking
The proposal is presented as a linear progress, I don't believe this is realistic. This would be fork much like the python 3 transition is (which also wanted to be a simple linear progression). As we all know, they're currently in year 12 of a 5 year transition.
There are several problems here. CPAN as an ecosystem is the one that is given most attention to (not without reason; it is without doubt the most important collection of Perl code), but it's not even the biggest problem.
CY's take on PWC#065
Good morning from the Asian timezone.
This is a part of Perl Weekly Challenge(PWC) and the followings are related to my solutions. If you want to challenge yourself on Perl, go to https://perlweeklychallenge.org, code the latest challenges, submit codes on-time (by GitHub or email)(before Monday GMT+0 00:00) if possible, before reading my blog post.
🤔
Handling Perl character codes is very easy even for beginners.
I feel that Perl users are losing confidence because of negative feedback from other communities.
The opinions of people who intend to harm Perl are 99% useless in my experience.
Handling character codes is actually simple.
Because all you have to do is remember the following three things.
1. use utf8 and save file as UTF-8
2. if you print text, encode text to platform charset(Linux is UTF-8, Windows is cp932)
3. if you get text from outside, decode text from platform charset(Linux is UTF-8, Windows is cp932)
If "use v7;" enabled "use utf8", it would be less memorable and less mistake.
Beginners will first remember that Perl source code is stored in UTF-8.
Next, the introductory person will notice that using a print statement results in a "Malformed ..." warning.
And, to get rid of the warning, he will have to encode with the platform character code.
Once he have learned that, he will naturally learn that he need to decode when he bring in text from the platform.
The Secret XS Diaries
I just rediscovered an old project of myself when I was learning Perl/XS and wanted to drop a hint to it here.
It might be useful for others who also have no idea how XS works and who would benefit from the approach and point of view of another XS newbie.
It is both the step-by-step description and a CPAN-ready Perl distribution.
You can find it on github:
Acme::The::Secret::XS::Diaries
Happy hacking.
Cannot change password
Wouldn't it be nice to be able to change my (hacked) password for blogs.perl.org?
Unfortunately, the password change form complains that it couldn't verify my current password, which doesn't come as a surprise as there is no field on the form to enter it.
+1 "use v7;" in Perl 7
As one of Perl user, +1 "use v7;" in newer version of Perl.
The use v syntax is worth it.
use v5.14
This syntax is the history of Perl and is also a mechanism for maintaining backward compatibility with newer versions of Perl.
The reason this was not used is simply the small granularity.
I don't remember much about Perl, so I can't tell the difference between use v5.20 and use v5.30.
And because the warnings and utf8 aren't turn on, I couldn't find a meaning to actively use it.
use v7; is very easy to understand.
use v7;
Imagine an application user actively uses it instead of writing use strict, use warnings, use utf8;, use feature'say', ....
I also think that I use it aggressively in application code.
Perl Weekly Challenge 108: Locate Memory and Bell Numbers
These are some answers to the Week 108 of the Perl Weekly Challenge organized by Mohammad S. Anwar.
Spoiler Alert: This weekly challenge deadline is due in a few days (April 18, 2021). 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: Locate Memory
Write a script to declare a variable or constant and print it’s location in the memory.
Locate Memory in Raku
Contacting author of Net::Azure::StorageClient
I am trying to contact Junnama Noda author of Net::Azure::StorageClient
I have sent two emails now to the public email address listed in his public github profile and have received no bounce or response.
If anyone is in contact with him, please have him contact me
Dean
CY's Post on PWC#064 - my shortcomings
Task 1:
A runner has to run from the upper-left corner to the lower-right corner in a race. The stadium of this race is rectangular, and each square meter area has different level of difficulty (caused by sand, cement, grass, slope...). Our runner has to choose a path with the least difficulty to complete the race.
My description makes it look like something from a competitive programming problem. Maybe someone will discover sometimes I made sentimental names in the codes. (I was a long-distance runner in high school and university, by the way.)
The heart of my solution for this task is:
graphql-perl - plugin to make GraphQL "just work" with Mojo publish/subscribe functionality
GraphQL is the new, shiny way to do APIs. It minimises number of round-trips for clients to query what need. But what about real-time updates? How can we cut down the time needed for clients to get new information? Are we forcing them to constantly poll? That seems expensive and also slow.
GraphQL's official standard now includes "subscriptions". The obvious transport for that is WebSockets, and the de facto standard for that is Apollo GraphQL's subscriptions-transport-ws.
As of 0.16, Mojolicious::Plugin::GraphQL supports WebSockets, and GraphQL subscriptions, conforming to the Apollo protocol.
A well-known model for distributing information in an event-driven way is "publish/subscribe" (or "pub/sub"). To both demonstrate the subscription capability, and to provide useful functionality, there is now a new "convert plugin" for GraphQL with the two Mojo modules that implement pub/sub (with Redis and PostgreSQL): GraphQL::Plugin::Convert::MojoPubSub.
Perl Weekly Challenge 107: Self-Descripting Numbers and List Methods
These are some answers to the Week 107 of the Perl Weekly Challenge organized by Mohammad S. Anwar.
Spoiler Alert: This weekly challenge deadline is due in a couple of days (April 11, 2021). This blog post offers some solutions to this challenge, please don’t read on if you intend to complete the challenge on your own.
Self-Descriptive Numbers
Write a script to display the first three self-descriptive numbers. As per Wikipedia, the definition of Self-descriptive Number is:
In mathematics, a self-descriptive number is an integer m that in a given base b is b digits long in which each digit d at position n (the most significant digit being at position 0 and the least significant at position b−1) counts how many instances of digit n are in m.
For example, 1210 is a four-digit self-descriptive number:
Stack Overflow Developer Survey 2020
There's a lot in it and we could question some of the methodology, but here's some thoughts.

Perl developers are older (and there aren't that many of them) but salaries are excellent.
I would note that TIOBE didn't match up too closely with common usage but there's no silver lining.
Ruby is now in consistent decline, I have read people linking this to Twitter moving away from Ruby on Rails but can't cite that claim. My observation is that RoR seems to have gone out of fashion in favor of lightweight server frameworks and I would suggest that Kubernetes has sidelined Puppet, so organizations aren't bringing in Ruby via apps/frameworks they want to use.
New Arel like SQL Manager
Some months ago I started working in a system similar to ActiveRecord. But then it became pretty big so then I centered my attention in a SQL AST manager instead.
So I made a library that is basically an Arel port. You can see the README with most of the basic info. After looking at implementations in CPAN I realized there are many of them already but all of them based on hash structures.
This impl can instead represent a full SQL AST mainly using builder chainable methods.
I need some feedback on wether you think it will be something that is useful.
Thanks in advance.
Repo link: https://bitbucket.org/juankpro/perl-sql/src/master/
PD: Here is another question. If you try to download and use the lib right now it will not work because it depends on another library made by me as well: https://bitbucket.org/juankpro/model-support/admin
This library is a group of packages with somewhat unrelated utility functions that allows me to support my own perl OOP engine implementation shared through other libraries I'm working on. I don't know what's the best approach to handle this. Is it ok to upload this library separately? if I need to reuse this code again, how do I prevent collisions if my other libs will use it as well?
Perl Weekly Challenge 106: Maximum Gap and Decimal String
These are some answers to the Week 106 of the Perl Weekly Challenge organized by Mohammad S. Anwar.
Spoiler Alert: This weekly challenge deadline is due in a couple of days (April 4, 2021). 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: Maximum Gap
You are given an array of integers @N.
Write a script to display the maximum difference between two successive elements once the array is sorted.
If the array contains only 1 element then display 0.
Example:
Prima: release v1.59 adds major text rendering functionality
Previously it was only possible to output text with strings using
text_out()method. Now, a more versatile and modern way is added withtext_shape()method that converts text string in a series of glyphs, that allows the following:- Full unicode bidi processing
- Support for font ligatures
- Native support for right-to-left text
- Transparent font substituion where a single font does not contain necessary glyphs
In addition to that, infrastructure was added to support RTL and shaping in all standard Prima widgets. Run
podview Prima::Drawable::Glyphsand check out the examples in the end of the document.PostScript backend rewritten to generate embedded Type1 fonts. This allows to generate unicode text in PostScript documents.
In X11 backend, standard key combination (Ctrl+Shift+U) accepts unicode hex number as a character input. Try typing "a" then Ctrl+Shift+U 300 ENTER.
Prima::*Dialog packages are moved to Prima::Dialog::* namespace

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.


