Paws XXII (Plana est terra)

The next action I had a crack at was 'PutCORSConfiguration' and I was getting the usual;

<Error> <Code>MalformedXML</Code> <Message>The XML you provided was not well-formed or did not validate against our published schema </Message> </Error>

At this points in my Paws adventure I checked the API doc for URI Request Parameters of the PutCORSConfiguration;

PUT /?cors HTTP/1.1 Host: Bucket.s3.amazonaws.com Content-MD5: ContentMD5

and I see I don't have to deal with the 'id' in the 'URI' bug here as I get what I want in the request URI;

Perl Weekly Challenge 35: Binary Encoded Morse Code

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

Spoiler Alert: This weekly challenge deadline is due in a few days (November 24, 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.

This week, both tasks were contributed by Paul Johnson.

I usually first do task 1 in Perl 5 and in Raku (formerly known as Perl 6), or sometimes the other way around, and then task 2 in both languages. This week, however, the two tasks are so closely related that it makes sense to do both tasks together in one language, and then the two tasks in the other language.

The tasks

Task # 1: Encode Text into Binary Encoded Morse Code

Write a program to encode text into binary encoded morse code.

Pay attention to any changes which might need to be made to the text to make it valid morse code.

Desire for Perl wrapper of Mozilla's IoT platform

I've spent more than four years working on Raspberry Pi stuff for Perl, and although it's only garnered a relatively small but thorough interest, it's been a wonderful one to be a part of.

Mozilla has opened up a new IoT Platform, and I'm wondering if it'd be worth the time to provide a Perl interface to it or not.

Thoughts?

Raku gets its very own subreddit

This is a sensible step forward for both languages.

The moderators of r/perl have had a discussion and we've agreed that going forward, this subreddit will be for the discussion of Perl 5 (and, I guess, earlier versions). Posts about Raku are off-topic here. I think that's what most readers here wanted and I think the Raku people will welcome the separation too.

See all the discussion at https://www.reddit.com/r/perl/comments/dmtxk1/raku_posts_in_rperl/

Paws XXI (The Adult Version)

We last left out PAWS hero she was just about ready to fix the S3 'PutBucketAnalyticsConfiguration' call. Having first fixed up the botocore json file to properly define the URI for the call.

She now had to find a way to get the 'xmlns' schema attribute add to the root of the XML that is sent to the API.

Turns out I was in very virgin territory there has been no Paws code to take this into account and checking the py code it was not very helpful so I have to put my thinking cap on for this one.

I was thinking I could just make it a new 'trait' like I did for the 'Status' attribute but then I remembered some of my XML from years ago the the 'xmlns' always should be in the root node so It will appear only in one place so not really an attribute trait.

Data Marketing Plan by Perl modules

At first, see the following entry.

Data Science and Perl

Our company goes into many other companies and helps them build new Perl systems or fix old ones. Needless to say, we see how many companies work and a typical example is one of our clients I'll call "AlphaCorp." They use lots and lots of Perl. Their primary web site is almost entirely Perl. So when I went in to help them with their A/B testing (amongst other things), I was surprised that they also used a lot of Python. It turns out they had a specific need that Python fills and Perl does not: data science.

After thinking a few weeks, I create the plan to do Data Marketing.

Data Marketing Plan by Perl modules

This is Japanese. Please translate it using google translation.

Request for Feedback: Perl Documentation Site

The official Perl documentation site at https://perldoc.perl.org was recently overhauled. Independently, I put together a reimagined documentation site that would be hosted at https://perldoc.pl. In the interest of providing a documentation site that best serves the needs of the Perl community, we need your feedback. Please give both sites a try, in-depth if you want, or just how you would most commonly use the site. What do you like about the design or the functionality of each site? What is missing or can be improved? Any feedback regarding what you want from the Perl documentation site is helpful and appreciated. Please leave comments here or in the linked posts by Monday Nov 18th.

Reddit comments

PerlMonks comments

Perl Weekly Challenge 031: Division by Zero & Dynamic Variable Name

Division by zero

Create a function to check divide by zero error without checking if the denominator is zero.

Perl already checks the denominator when dividing. All we need to do is to catch the exception it throws and check it instead of checking the value of the denominator.

The following division subroutine uses Try::Tiny to catch the exception. It’s a good practice not to use the low level eval, see for example Bug in eval in pre-5.14 for the reasons.

Paws XX (Dos Equis)

Well the saw-buck edition of Paws proved to be a real tough one a least for me. I my last post I was just thinking of fixing all the S3 calls that do not have a test I was just going to start with all the delete calls but I decided to rater take a functional approach and tackle the calls in that order so I started out with the 'Analytics' calls

  • DeleteBucketAnalyticsConfiguration
  • GetBucketAnalyticsConfiguration
  • ListBucketAnalyticsConfigurations
  • PutBucketAnalyticsConfiguration

The first one I was going to play with was the 'PutBucketAnalyticsConfiguration'. This is where I ran into a little bit of a sticky wicket.

I noticed that I could easily write up a 10_resposne test but no where did I see in the test case that would test how the data is being called?? There are a few S3 call tests in 05_service_calls.t which look like this

Perl Weekly Challenge 33: Count letters and Multiplication Tables

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

Spoiler Alert: This weekly challenge deadline is due in a few days from now (November 10,, 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: Count Letters (A..Z)

Create a script that accepts one or more files specified on the command-line and count the number of times letters appeared in the files.

So with the following input file sample.txt:

The quick brown fox jumps over the lazy dog.

the script would display something like:

London Perl Workshop 2019 - Report

DISCLAIMER: All photos courtesy to the official twitter handle of London Perl Workshop.

As you know, LPW2019 just happened last Saturday 19th Oct 2019. It was my second year as a member of LPW Organizing team. Although I was the least active members in the team as compared to others. On the day, I arrived the venue around 8:10 am and saw Katherine, Tom and Lee unloading event materials from the cab. I joined the team and gave helping hands. I was managing the registration desk along with Katherine. People sarted arriving about 8:30 am. It was always great to see so many friends.

Announcing MooX::Press

MooX::Press is a quick way of building a bunch of Moo roles and classes in one use statement.

The most basic example would be:

  package MyApp {
    use MooX::Press class => ['Foo', 'Bar'];
  }
  
  my $thing1 = MyApp::Foo->new();
  my $thing2 = MyApp->new_foo();   # alternative constructor

But do-nothing classes with a constructor and nothing else aren't very exciting. Let's define a class with some subclasses which have attributes and roles and methods and stuff.

Paws XIX (The I between)

Paws S3 is coming together nicely I just have one more 'S3' todo test to look at and that is the get 'ListObjectVersions' test.

To start I fixed up the 'ListObjectVersions' test much like this

Perl Weekly Challenge 31: Illegal Division by Zero and Dynamic Variables

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

Spoiler Alert: This weekly challenge deadline is due in a few days from now (October 27, 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: Illegal Division by Zero

Create a function to check divide by zero error without checking if the denominator is zero.

Illegal Division by Zero in Perl 5

Perl 5 has a number of modules to implement exception handling using the try ... catch pattern found in a number of other languages, such as, for example, Try::Tiny or TryCatch. Even Autodie might actually fit the bill. But, because this is a coding challenge, we prefer to avoid using modules that do the work you're supposed to do.

In fact, not doing anything special will check the division by zero, as shown in these one-liners:

Perl 5 is now on github

Not sure if this has been posted on here on blogs...

https://www.nntp.perl.org/group/perl.perl5.porters/2019/10/msg256484.html

Cor - Background core Perl OO

So far, the work on Cor is going well. Here's the timeline.

Paws XVIII

Well the first thing for my S3 todo fixes was to get everything back up to github for my fix for 'GetBucketLocation' once that was done I decided to tackle the rest of the 'todo' tests.

I started out with 'GetBucketPolicy' but I notices that when I set up a real test for the code I get this as the content response;


'content' => '{"Version":"2012-10-17","Id":"S3-Console-Auto-Gen-Policy-1567770368320","Statement":[{"Sid":"S3PolicyStmt-DO-NOT-MODIFY-1567770368320","Effect":"Allow","Principal":{"Service":"s3.amazonaws.com"},"Action":"s3:PutObject","Resource":"arn:aws:s3:::dev.cargotel.storage/*","Condition":{"StringEquals":{"aws:SourceAccount":"985173205561","s3:x-amz-acl":"bucket-owner-full-control"},"ArnLike":{"aws:SourceArn":"arn:aws:s3:::dev.cargotel.storage"}}}]}',

Very odd I am getting JSON back from 'AWS' not 'XML' maybe something has changed ? I think this time on the AWS side of things or maybe my botocode is out of date? I will have to do a little digging.

On the aws site I found this

Response Syntax HTTP/1.1 200

{ Policy in JSON format }

in the latest version of the S# API for the 'GetBucketPolicy'.

The API returns both XML and JSON/Text response!

Perl Weekly Challenge 32: Word Histogram and ASCII Bar Chart

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

Spoiler Alert: This weekly challenge deadline is due in a few days (November 3, 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.

This week, both tasks were contributed by Neil Bowers.

Task # 1: Word Histogram

Create a script that either reads standard input or one or more files specified on the command-line. Count the number of times and then print a summary, sorted by the count of each entry.

So with the following input in file example.txt:

The London Perl Workshop 2019

I went to the London Perl Workshop 2019 this weekend. I've been attending the London Perl Workshop several times in the past, and it has always been a great workshop. This year the workshop had a brand new team of organisers, and they did a great job of following up on the legacy that is the London Perl Workshop (LPW).

Going to London

My LPW weekend, didn't start that great. I had a flight from Copenhagen to Gatwick at nine in the evening, but the flight was delayed by almost an hour. This could mean missing the last Gatwick Express train, which would mean I would arrive at the hotel past midnight. Not the best start of a short weekend trip to London.

Finally the pilot was allowed to take off, and he managed to catch up somewhat for the lost time. I had a seat on the second row, I had booked that to be able to get quickly off the plane and get to my train.

London Perl Workshop: Platinum Sponsor Booking.com

The London Perl Workshop was on Saturday, and it was awesome! If you missed it, or you'd like to reminisce, our Twitter feed has pictures through out the day. Hopefully there will be some write ups posted soon.

As well as getting the talk videos live and actioning your feedback (please fill in your survey, it really helps!) we want to say a massive thank you to everyone who made the day such a success. The attendees, the speakers, the venue and our sponsors - without any one of you it wouldn't have been the same, and in particular we'd like to thank our Platinum Sponsor Booking.com for their support.

Booking.com is a large Perl shop with some of the greatest developers and as a company they sponsor almost all Perl events around the globe to support the Perl community.

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.