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
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
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
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.
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).
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.
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.3
3.1.1
5.8.0
3.2.0
5.8.1
4.0.0
5.8.4
4.0.1
5.8.7
4.1.0
5.8.9
5.1.0
5.9.4
4.1.0
5.9.5
5.0.0
5.10.1
5.1.0
5.11.3
5.2.0
5.13.7
6.0.0
5.15.8
6.1.0
5.17.1
6.2.0
5.19.5
6.3.0
5.21.1
7.0.0
5.23.0
8.0.0
5.25.3
9.0.0
5.27.2
10.0.0
5.29.2
11.0.0
5.29.9
12.0.0
5.29.10
12.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.
Well I left off in my last post with having 2 of the 3 tests I created failed;
ok 10210 - Got _status eq 200 from result
ok 10211 - Call S3->RestoreObject from t/10_responses/s3-restore-object.3.response
not ok 10212 - Got request_id eq 195AF4042CD6DF80 from result
# Failed test 'Got request_id eq 195AF4042CD6DF80 from result'
# at t/10_responses.t line 136.
# got: 'AC65B3BF8AC3AA34'
# expected: '195AF4042CD6DF80'
not ok 10213 - Got message eq Object restore is already in progress from result
# Failed test 'Got message eq Object restore is already in progress from result'
# at t/10_responses.t line 136.
# got: 'Conflict'
# expected: 'Object restore is already in progress'
ok 10214 - Got code eq 409 from result
10213 was easy to fix I just had to change the test value in the test file 's3-restore-object.3.response.test.yml'
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:
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.
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;
Generate a longest sequence of the following “English Pokemon” names where each name starts with the last letter of previous name.
I’m not sure whether the term “sequence” has a unique and generally accepted definition. For example, does it have to contain each element just once? If not, the longest sequence might be
If we want each element to appear just once in the sequence, we are in the graph theory and we search for the longest simple path. For a general graph, this is an NP-hard problem, but fortunately, our input is small enough to be solved in reasonable time.
We can implement a brute-force search (i.e. trying all the possible sequences) recursively. The recursive steps takes the sequence constructed so far and tries to extend it by all the possible next steps, calling itself to extend each of them further.
Selfies demonstrate one of the principal laws of physics, psychosocial development of teenagers and programming. The act of observation alters that which is being observed. It becomes more complicated if the observer is observing itself. As the observer changes, so might future observations particularly if the tool being used is known to impact the parameter that is being measured; rapidly one loses hope that any meaningful data will be obtained from such a direction of development. Sounds gibberish? Look at the collection of "duckfaces" on your teenage daughter's phone (if she ever lets you near it) and I am sure you will find no resemblance of those images to anyone you would recognise as your offspring.
The London Perl Workshop 2019 is fast approaching on Saturday 19 October!
We've already had some great talks submitted and will start announcing these soon. If you'd like to tell people about what you have been doing with Perl 5, Perl 6 or any related topics please submit your proposal before the end of Monday 30 September.
If you have any questions then write to us at organisers@londonperlworkshop.org - we are happy to discuss ideas with you. See you at the Workshop!
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.
CPAN is wonderful and it is vast. Task::Kensho offers a curated look at the best it has to offer for those who don't know what to look for. But to remain useful, it must keep up with the trends of CPAN and the community. Thus, the community's input is vital to its maintenance.
Please, take a moment and look through the open issues. Comment or add a reaction in support of changes that make sense to you, and open a new issue if you think something is missing.
Well I left off from my last post doing a little update to the documentation of Paws which introduced the basic layout and concept of botocore json data and it use in auto-generating code. In today's post I am going to look at an equally important part of auto-generated code and that is testing said code.
Paws has a massive test suite which is nice and good the only problem I have with it is it is 100% static data driven.
What this means you are testing against canned expected results, or as we say in the testing world
nugas quae in nugas quae sunt
or in other words you are not really testing anything you are just testing a test.
Lets look at a typical Paws test, the tests for S3 DeleteObject
It consists of two Yaml files the 'test';
Spoiler Alert: This weekly challenge deadline is due in several days from now (September 15, 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.
Challenge # 1: Sequence of Pokémon Names
Generate a longest sequence of the following English Pokemon names where each name starts with the last letter of previous name.ù
If you Perl or you're Perl-curious, or you build command-line interfaces, you
should read this, but before we dive in building the command-line application,
lets first talk about the command line.
Command-line programs have been with us since the early days of the computer
and are programs based upon on commands (single or multiple). A command-line
program is a program that operates from the command-line or shell.
A command-line interface is a user interface that is navigated by typing
commands in a terminal, shell or console, as opposed to using a GUI (graphical
user interface). The console is a display mode for which the entire monitor
screen shows only text, no images or GUI objects.