Rakudo.js Final Grant Update

We have a Dart Pad inspired REPL called 6Pad that allows you to play with Rakudo.js without installing it.
We have a step by step tutorial how to get your code running in Rakudo.js

You can see an example that uses a canvas to draw a spaceship at https://perl6.github.io/6pad/#5a889cc9d6385853af2ff6a3fa165662

6pad has been used in the Perl 6 advent calendar demonstrating that it's usable by community members not directly working on rakudo.js

Rakudo.js has been released on NPM as rakudo
The Rakudo.js backend has been fully merged into the master branches of rakudo and NQP

Look at the Rakudo NPM page for information on how to use it.
The NPM package release process is fairly complex. But a repo yarn workspace helps set everything up.

For deploying Perl 6 in the browser we have a Parcel plugin parcel-plugin-nqp.
The plugin will be upgraded to Parcel 2 once that has a non-alpha relase (or maybe even sooner).

Paws X (Well not XXX)

I had my response from my question up in github.

If I am remembering correctly we are throwing an exception because at some point in time AWS has returned invalid XML on non-200 responses (the test suite tries to covers more cases). The error message was too cryptic when invalid XML came in, so we started to throw a Paws::Exception that at least gives you an indication of what went on.

Hmm ok so the test case might be valid though I do not see how that is a problem for Paws if AWS is returning invalid XML.

Taking a peek about at what else does a 'throw' vs a 'new' Paws::Exception I found that all of the classes in 'lib/Paws/Net' that have a 'unserialize_response' sub use 'throw' vs 'new' except for one 'Paws::Net::RestXMLResponse'

Monthly Report - September

What did I do last month? Let me guess, the short answer would be "I was managing Perl Weekly Challenge". Although it sounds so simple, it is tough task, I must admit. Having said that, I really enjoy it. I get to interact with so many great people and learn from their experience. Above all, when I receive "Thank You" message, that takes away all the pain. I simply love the positive vibes I get from each and every member of the community.

I noticed a trend in "Perl Weekly Challenge", members now trying different languages as well. Python is one such where we have had more than one solutions. If you want to know what others are doing, please do check out the blogs. Also please do follow us @PerlWChallenge, so that you don't miss out any announcements. On top of that, members discuss task as well.

My thinking about Subroutine Signature in 2019.

My thinking about Subroutine Signature in 2019.

Rethink the syntax of @ and%

Subroutine signature syntax should be simple and small.

One blame for Perl is that Perl is complex.

The introduction of new symbols such as "@" and "%" complicate Perl.

At first glance, you will not know what you are doing.

sub func($foo, $bar, @) {
  # What is "@"?
}

sub func($foo, $bar, %) {
  # What is "%"?
}

Allow only scalar variables and do not check the number of arguments

Having lots of features is useful, but complicates Perl's grammar.

Perl Weekly Challenge 027: Intersection of Straight Lines and Historical Data

Intersection of Straight Lines

Write a script to find the intersection of two straight lines. The coordinates of the two lines should be provided as command line parameter.

I vaguely remember we did the general form of the equation of a straight line at secondary school. The formula itself is pretty simple:

Ax + By + C = 0

Now, clearly, if we have two straight lines A1, B1, C1 and A2, B2, C2, their intersection are the x and y such that A1x + B1y + C = A2x + B2y + C2. From the general formula we know that

x = (-B1y - C1) / A1

It takes a bit of pen and paper work to find out that

y = (A2C1 - C2A1) / (A1B2 - A2B1)

Paws The IX (Not Quite X)

I am getting close to finishing off my first Paws patch.

I left off with this test failing

not ok 27 - got exception # Failed test 'got exception' # at t/11_client_exceptions.t line 104. # expecting: Paws::Exception # found: Moose::Exception::ValidationFailedForTypeConstraint (Attribute (host_id) does not pass the type constraint because: Validation failed for 'Str' with value undef at /wwwveh/lib/x86_64-linux-thread-multi/Moose/Meta/Class.pm line 275 # Moose::Meta::Class::new_object at (eval 429) line 28 # Throwable::Error::new at /home/scolesj/aws-sdk-perl/lib/Paws/Net/RestXMLResponse.pm line 60 # Paws::Net::RestXMLResponse::error_to_exception at /home/scolesj/aws-sdk-perl/lib/Paws/Net/RestXMLResponse.pm line 25 # Paws::Net::RestXMLResponse::process at /home/scolesj/aws-sdk-perl/lib/Paws/Net/FurlCaller.pm line 48 # Paws::Net::FurlCaller::caller_to_response at /home/scolesj/aws-sdk-perl/lib/Paws/Net/MockCaller.pm line 116 # Paws::Net::MockCaller::caller_to_response at /home/scolesj/aws-sdk-perl/lib

...

Perl Weekly Challenge 27: Intersection Point and Historical Values

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

Challenge # 1: Intersection of Two Lines

Write a script to find the intersection of two straight lines. The co-ordinates of the two lines should be provided as command line parameter. For example:

The two ends of Line 1 are represented as co-ordinates (a,b) and (c,d).

The two ends of Line 2 are represented as co-ordinates (p,q) and (r,s).

The script should print the co-ordinates of point of intersection of the above two lines.

LPW2019 Silver Sponsors

The London Perl Workshop is a free event and we’re very grateful to our sponsors for making this possible. We would like to thank the following four awesome companies for their support of LPW2019 as our Silver Sponsors! Sign up for free to LPW2019 here.

Adestra
Here at Adestra we empower our clients to maximize marketing ROI through email-driven technology. Our flexible account structure, obsession with customer success, and award-winning service have gained the trust of global and growing brands alike. We’re proud to say we treat our people well: from excellent opportunities for career development to a positive, collaborative culture and great company perks, our global offices are a fantastic place to work at any stage of your career. As our client base continues to grow, we’re looking for talented individuals who share our values to come and grow their careers with us. With opportunities in the UK, Australia, and North America, now is an exciting time to join Adestra and become part of our global success.

Hacktoberfest with Perl Weekly Challenge

Hacktoberfest 2019 is going to be the first event since the launch of the Perl Weekly Challenge. Dave Cross recently suggested doing Perl Weekly Challenge in the month of October would be enough to earn specially designed T-shirt from Digital Ocean.

I must confess, it didn't cross my mind. Thanks Dave Cross for the suggestions. Taking the cue from Dave Cross, I decided to blog about and share few tips.

Paws The VIII (The Henry Factor)

Ok today I am going to look a the impact my changes from the last few post have had on the systems as a whole. So far I have tinkered with a few things

  1. Got my RestoreObject to work
  2. Modified the Botocore S3 json file to add in some documentation
  3. I added code to get the 'resopnse' status back by modifying both the code generation templates and the Paws/lib code
  4. Expanded on the test suite
  5. I fiddled with the S3 json file to see if I can get correct error to come up. I did roll this back as Paws does not use these
  6. Created a new test and then modified the paws lib code to get what I think is the correct response back from Paws when there is an error returned by the server
  7. Started to work on the tests I broke with my changes

So today I am going to see what I else I have broken since I have started.

Perl Newbies Forum is started at 2019/09/27

I create Perl Newbies Forum using Slack.

This forum is private room. Let's send mail at the following form.

Perl Newbies Forum Registration

Perl Newbies Forum is run by Perl Newbies

Perl Weekly Challenge 026: Stones and Jewels; Mean of Angles

Stones and Jewels

Create a script that accepts two strings, let’s call them “stones” and “jewels”. It should print the count of “letters” from the string “stones” found in the string “jewels”. For example, if your stones is “chancellor” and “jewels” is “chocolate”, then the script should print 8. To keep it simple, only A-Z, a-z characters are acceptable. Also, make the comparison case sensitive.

The most important thing is to realise that we only want to consider unique characters in the “stones”. My initial idea was for each character of the “stones” to count how many times it appears in the “jewels”. Remember that the global matching operator m//g returns the number of matches in list context.

Let’s call the subroutine with two names parameters, stones and jewels, each of them containing a string.

Come to the London Perl Workshop, write better code!

We’re kicking off our trailers for LPW 2019 with two talks that will improve the code you write!

Dave Cross will be talking about Measuring the Quality of your Perl Code. As Dave says, we'd all like to write "better" code, but how do you know what "better" means, and how do you know how well your current code scores on whatever scale you choose? His talk on the same topic was standing room only at TPC in Riga this year, so be sure to come along to learn about possible measures for the quality of your code and ways to incorporate these into your development process.

Paws the VI (Pardon my Error)

Now things are going good so far but I have run into a little snag with the program that is using my S3 RestoreObject code with Paws. Namely at this point my end user is trying to make the same restore request before the first restore has finished.

Right now if I capture the error with an eval {} in my call I get in the @$ is 'Conflict';

The API documentation does state that I can get as few special errors that are interesting to me;

Perl Unicode versions

A spell of hacking around with Unicode got me wondering which version of Unicode shipped with which version of Perl. Here's what I came up with:

Perl version Unicode version
5.7.33.1.1
5.8.03.2.0
5.8.14.0.0
5.8.44.0.1
5.8.74.1.0
5.8.95.1.0
5.9.44.1.0
5.9.55.0.0
5.10.15.1.0
5.11.35.2.0
5.13.76.0.0
5.15.86.1.0
5.17.16.2.0
5.19.56.3.0
5.21.17.0.0
5.23.08.0.0
5.25.39.0.0
5.27.210.0.0
5.29.211.0.0
5.29.912.0.0
5.29.1012.1.0

This table is in order by Perl version (obviously), and lists every time the Unicode version changed as Perl version increased. Unicode version does not increase monotonically with Perl version because Unicode 5.1.0 was retrofitted to Perl 5.8.9, which was actually released after 5.10.0.

The Unicode version numbers come from file lib/unicore/version under the top-level directory in each distribution, where it has been since Perl 5.7.3.

Perl Newbies weekly update 2019/09/21

Perl Newbies weekly update 2019/09/21. Perl Newbies is a site for people who want to learn Perl from now.

I wrote articles about sin function, cos function, warnings module, FindBin module at this week.

sin function

sin function - calculate the sine value

cos function

cos function - calculate the cosine value

warnings module

warnings module

FindBin module

FindBin - Get the path of the directory where the script exists

Information

Perl Newbies is created by Giblog. Giblog is a tool to create your website and blog. If you use Giblog, you can mange all entries using git.

Author

I'm yuki kimoto, a Japanese Perl engeneer. If you want to ask question about Perl newbies, please lnform at Twitter.

Itch.scratch()

In writing my past few blog entries I’ve repeatedly come across a situation that Raku doesn’t handle as well as I could wish. It’s a little thing, but like so many other little things
its presence is a source of minor but persistent irritation.

In my previous entry I used some Raku code that illustrates the point perfectly. I needed to build an object for every value in the @values array, or a single special object if @values was empty:

Paws the V (The Joy of Paws)

Lest see I last left off with this in my test;

not ok 10207 - Exception accessing status: Can't locate object method "status" via package "Paws::S3::RestoreObjectOutput" at t/lib/Paws/Crawler.pm line 19.

I think I am going to fix that but first I will as a general question up on the Paws website to get a little advice in case I am going down a rabbit hole.

While I am waiting for a response this is a good opportunity to have a look at why test driven development is fun.

Right now I have that failing test and I would like to make it pass, but first, let's create the second test for the '202' case.

In Paws test when we are writing more than one test for the same call we add in a sequential number in the test name and data so it will keep the same order when the test cases are run.

So a quick rename and copy I know have

London.PM Tech Meet - Report

Having missed the last Tech Meet because of fasting during the month of Ramadan, I made every attempt to attend the 3rd Tech Meet of the year. Not only that but I decided to give a short talk on "Perl Weekly Challenge", an improved and updated version of lightning talk that I gave earlier at The Perl Conference in Riga.

Perl Weekly Challenge 26: Common Letters and Mean Angles

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

Spoiler Alert: This weekly challenge deadline is due in several days from now (September 22, 2019). This blog post offers some solutions to this challenge. Please don't read on if you intend to complete the challenge on your own, which you're strongly encouraged to do.

Challenge # 1: Common Letters Count

Create a script that accepts two strings, let us call it, “stones” and “jewels”. It should print the count of “alphabet” from the string “stones” found in the string “jewels”. For example, if your stones is “chancellor” and “jewels” is “chocolate”, then the script should print “8”. To keep it simple, only A-Z,a-z characters are acceptable. Also make the comparison case sensitive.

We're given two strings and need to find out how many characters of the second string can be found in the first string.

Common Letters Count in Perl 5

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.