Well I manages to plow though the final few S3Control actions the other day so today I move into the much more complex CloudFront API.
This one was to say the least a little daunting as the XML calls are massive some with as many as 60 nodes. Well as usually I just blundered right into it without any sort of plan except I figured I better do the harderst one first CreateDistribution.
Well as usual the first thing I ran into was someting I have not seen before.
Invalid Iteration
on the XML.
It took a little while to figure out that I was sending blocks like this
Spoiler Alert: This weekly challenge deadline is due in a few hours . 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: Minimum Sum Path
Given an m × n matrix with non-negative integers, write a script to find a path from top left to bottom right which minimizes the sum of all numbers along its path. You can only move either down or right at any point in time.
At the start of the year 2019, I made new year resolution that I will submit at least 50 Pull Request each month in the year 2019. It wasn't easy but I was able to hold on to my resolution with the help of many CPAN authors. In the year 2020, I am going to take little easy and revert back to one Pull Request a day each month.
Perl Weekly Challenge
The main attraction of the year was "Perl Weekly Challenge" started on 25th March 2019. It is platform for Perl and Raku fan to share the knowledge. As of now, we have successfully completed 9 months of weekly challenge. As of today, we have 140 active members.
The Chaos Communication Congress is the hugest convention and festival for hackers on the continent. Its part 5-9 track lecture conference, part massive parallel soldering and other workshops, part dance party and part carneval. I liked especially the one guy, just walking around while making music on it's novation circuit - but there was so much going on - he was hardly noticeable. Because it was gigantismic. When even a small self made booth for baking dough (one of several dozens food stands) sells over a ton (literally > 1000 kg), serving > 13000 people, it earned its name: waffle operation center (WAP). But that's the spirit and humor around here.
So I was quickly knocking off the various S3Control actions until I ran in to 'ListJOBS' which I though would be an easy one as there is no XML content on this call. I kept on getting
InvalidRequest
The call cannot be any simpler a GET with this URL;
Spoiler Alert: This weekly challenge deadline is due in a couple of days (June 7, 2020). 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: Last Word Matching a Regex
Define sub last_word($string, $regexp) that returns the last word matching $regexp found in the given string, or undef if the string does not contain a word matching $regexp.
For this challenge, a “word” is defined as any character sequence consisting of non-whitespace characters (\S) only. That means punctuation and other symbols are part of the word.
The $regexp is a regular expression. Take care that the regexp can only match individual words! See the Examples for one way this can break if you are not careful.
CPAN Pull Request Challenge used to match CPAN maintainers to contributors. Contributors would sign up to receive monthly assignments. The goal was to submit at least one pull request. It was fun, but it came to an end at the end of 2018.
I wanted this challenge to go on, so I created Pull Request Club. It has been a whole year since it started, so here’s the annual report with some insights.
New features
While Pull Request Club took its basics from CPAN-PRC, I wanted to make it more self-served. Users can take various actions such as signing up or skipping an assignment with a few clicks.
Users sign up to the site with their GitHub accounts. This lets them add their repositories to the assignment pool without hassle.
Users can see both their “assignment history” and “assignee history”.
You are given two or more arrays. Write a script to display values of each list at a given index.
For example:
Array 1: [ I L O V E Y O U ]
Array 2: [ 2 4 0 3 2 0 1 9 ]
Array 3: [ ! ? £ $ % ^ & * ]
We expect the following output:
I 2 !
L 4 ?
O 0 £
V 3 $
E 2 %
Y 0 ^
O 1 &
U 9 *
The pound sign is not part of the standard ASCII, so we’ll need to properly encode it. The use utf8; clause tells perl that the script itself contains UTF-8 encoded characters, the binmode function sets the encoding for the given filehandle, i.e. standard output.
Write a script that takes a list of email addresses (one per line) and sorts them first by the domain part of the email address, and then by the part to the left of the @ (known as the mailbox).
Note that the domain is case-insensitive, while the mailbox part is case sensitive. (Some email providers choose to ignore case, but that’s another matter entirely.)
If your script is invoked with arguments, it should treat them as file names and read them in order, otherwise your script should read email addresses from standard input.
Bonus
Add a -u option which only includes unique email addresses in the output, just like sort -u.
The German Perl Workshop is an Open Source conference for everyone, organized by community of the Perl Programming Language and its sister language Raku yearly in Germany. The 2020 edition will be from Wednesday, March 4th, 09:00 to Friday, March 6th, 16:00 in Erlangen.
Most of the talks will be held in German, German talks will have English slides at least. English talks are welcome as well.
The website already is open for talk submissions, so if you want to present something in addition to attending, please submit a proposal!
Spoiler Alert: This weekly challenge deadline is due in a couple of days (May 24, 2020). 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: Max Sub-Array Product
Given a list of 4 or more numbers, write a script to find the contiguous sublist that has the maximum product.
Example:
Input: [ 2, 5, -1, 3 ]
Output: [ 2, 5 ] which gives maximum product 10.
Max Sub-Array Product in Raku
Let’s start with a simple loop over a list of indices, as we would do in most procedural programming languages. We loop over the existing indices of the input array, compute the product of each item with the next one, and store in the @max array the max product so far, as well as the two items that led to it:
"No one sews a patch of unshrunk cloth on an old garment, for the patch will pull away from the garment, making the tear worse. Neither do people pour new wine into old wineskins. If they do, the skins will burst; the wine will run out and the wineskins will be ruined. No, they pour new wine into new wineskins, and both are preserved."
This is a Bible quotation, but needs some explanation.
The Dancer Core Team has one more holiday treat in store for you: Dancer2 0.300000 is headed to CPAN, and it's a good one: Dancer now offers typed route parameters!
To be clear, all of the existing route syntax is unaffected. You don't have to use types, and typed parameters might not be good for all situations. There is a lot to be gained from having them though, and we're excited to bring them to you!
Using them in your own code is simple:
get '/thing/:id[Int]' => sub {};
# if not Int then perhaps a Num...
get '/thing/:id[Num]' => sub {};
The default type checking library is Type::Tiny, but you can also specify your own type checking library too. See the manual for more information.
A big thanks to SysPete for making this long-standing request a reality.
I'd also like to apologize to Tom Hukins. I erroneously listed a PR of his in the last release that didn't seem to make it in. I believe that I have made things better in this release.
Happy holidays from your friends at Dancer! See you in 2020.
The next chapter in the 'Book of PAWS' is to the S3 control working.
I do not see this project to go on to long as the S3 as there are only eight actions that are exposed by the S3control API. Given this, the many fixes I have made to the XML Rests side of the perl code my full test suite and my handy test generating caller. I think I can get this control working very quicky.
Well to start out I decided to have a quick look at the Documentation for AWS S3 Control
https://docs.aws.amazon.com/AmazonS3/latest/API/API_Operations_AWS_S3_Control.html and looking there I notices there where some sixteen calls not the eight that I found when I was poking about in the boto and perl code.
Please note that this blog post will be shorter than usual, since I’m a bit short of time to prepare it.
Task 1: Excel Columns
Write a script that accepts a number and returns the Excel Column Name it represents and vice-versa.
Excel columns start at A and increase lexicographically using the 26 letters of the English alphabet, A..Z. After Z, the columns pick up an extra “digit”, going from AA, AB, etc., which could (in theory) continue to an arbitrary number of digits. In practice, Excel sheets are limited to 16,384 columns.
Example:
Input Number: 28
Output: AB
Input Column Name: AD
Output: 30
This version fixes several bugs, introduces some enhancements and made refactoring on some internal code. Translations to several languages have been mostly completed. Administrators are encouraged to upgrade Sympa to this version.
Highlight of this version
Significant changes
Some scenarios and list creation templates for "intranet" use cases were made optional: They have been moved into samples/ #119. See also "upgrading notes" for details.
Internationalization
Thanks to heavy works by translators on translation site, Sympa almost completely supports following languages:
Russian (Русский)
German (Deutsch)
Spanish (Español)
Galician (Galego)
French (Français)
Japanese (日本語)
Italian (Italiano)
US English
Along with languages above, help documents for users are provided in following languages: