PAWS XXXXV (You are now leaving S3. Please have your customs forms ready.)

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

Perl Weekly Challenge 64: Minimum Sum Path and Word Break

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

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.

Example

Input:

[ 1 2 3 ]
[ 4 5 6 ]
[ 7 8 9 ]

The minimum sum path looks like this:

Annual Report - 2019

Annual Report - 2019


2019 Resolution

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.


Perl Weekly Challenge Club

Communication at the 36c3 Perl and Raku Assembly

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.

Paws XXXXIV (More Boto Fun)

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;

'https://985173205561.s3-control.us-east-1.amazonaws.com/v20180820/jobs?nextToken=dddd& jobStatuses=Active,Cancelled,Cancelling,Complete,Completing,Failed,Failing, New,Paused,Pausing,Preparing,Ready,Suspended &maxResults=5'

So I had a look on the API doc and this is what I found;

/v20180820/jobs?JobStatuses=JobStatuses&MaxResults=MaxResults&NextToken=NextToken

Hmm all upper case!. So I checked the generated class and they where all like this one;

Perl Weekly Challenge 63: Last Word and Rotate String

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

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.

Examples:

Pull Request Club 2019 Report

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”.

Numbers

Perl Weekly Challenge 040: Multiple Arrays & Sort SubList

Multiple Arrays

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.

Paws XXXXI (Doubble Sawbuck plus 1)

I was hoping that I would have an easy time with S3Control once I figured out the XML problems. Sadly I was a little premature on that thought.

I spent a good while over the past few days getting either an 'Access Denied' or 'Forbidden' response to my 'CreateJob' call.

I eventually though that I might as well try one of the simpler calls and get that working and then work may way up. So I tried the simplest of all;

Perl Weekly Challenge 62: Sort Email Addresses

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

Task 1: Sort Email Addresses

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.

Example:

If given the following list:

22nd German Perl Workshop 2020 in Erlangen from 4th to 6th March 2020

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!

berrybrew, the Perlbrew for Windows 1.30 released

Merry Christmas fellow Perlers!

I have been working tirelessly on the newest version of berrybrew, and thought there's no better day to release it.

It brings significant new features:

New Features

  • Added a UI, runs out of the System Tray, allows installing, removing and switching Perls using a button
  • Added new associate command, allowing berrybrew to manage .pl file associations
  • Added berrybrew-refresh command, to be run after switching perls. No more having to re-open command line windows
  • If a newer point release of a major version is introduced, we now seamlessly integrate installed previous point-releases into the Perls available
  • Configuration options are now based in the Windows Registry
  • Added new options command, allows changing configuration options at runtime
  • We now supply a bb command, which is simply a short-hand form for berrybrew
  • Greatly enhanced the self-extracting installer
  • Much more precise handling of the PATH environment variable
  • More graceful handling of exceptions
  • Added info command which displays various internal directory path information
  • Added new hidden/developer commands

UI

Merry Christmas & Happy New Year




From the team of "Perl Weekly Challenge", we wish you all
Merry Christmas & Happy New Year

Perl Weekly Challenge 61: Max Subarray Product and IP Address Partition

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

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:

Larry said "No one sews a patch of unshrunk cloth on an old garment"

When he aproved Raku naming change, Larry said .

"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.

Larry said "No one sews a patch of unshrunk cloth on an old garment" - Subrutine signatures opinion blog

Dancer2 0.300000 released

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.

Paws XXXX (A new Start)

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.

Perl Weekly Challenge 60: Excel Columns and Find Numbers

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

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

Sympa 6.2.50 released

The Sympa Community is proud to release the newest version of Sympa.

Sympa 6.2.50 is the newest stable version of Sympa 6.2.

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:

  • Catalan (Català)
  • Basque (Euskara)
  • Polish (Polski)

Have a great new year with Sympa!

The Sympa Community

Type Constraints using Type::Tiny and attribute handler of subroutine signatures

If you can perform type checking with an attribute handler and Type::Tiny, Perl will be more attractive.

For example.

use Type::Tiny::Signatures;

sub foo ($str : Str, $num : Int) {
  
}

Type Constraints using Type::Tiny and attribute handler - Perl Subroutine Signatures Opinion Blog

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.