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;

Skipping DateTime::Format::Mail in the Pull Request Club

I was assigned DateTime::Format::Mail for September in the Pull Request Club. There was one open issue in its GitHub repository, so I hoped solving it would be my pull request for the month.

The reporter complained the module fails to parse the following e-mail header:

Date: Wed, 10 Jul 2019 11:20:02 +0200 (CEST)

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

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

Itch.scratch()

In writing my past few blog entries I’ve repeatedly come across a situation that Perl 6 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 Perl 6 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:

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

Perl Weekly Challenge 025: Pokemon Sequence and Chaocipher

The longest sequence

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

girafarig girafarig girafarig girafarig girafarig girafarig girafarig girafarig...

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.

Paws the IV

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';

Circular observations

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.

Let's do it any way

London Perl Workshop CFP Deadline: Mon 30 Sept

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!

Task::Kensho needs your help!

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.

Paws for Fun and Profit. Part the Second

So today I am going to start some actual work on Paws by playing with Paws::S3. For those that do not know S3 is the Amzazon's Simple Storage System a place where we AWS types can store just about anything we want up on the cloud.

One part of S3 is the ability to change the storage state/class of an artifact. It all depends on what you are doing with the artifact. If the artifact needs to be shared across the web, like an image, you would just put it in the 'Standard' class. If you are archiving artifacts for safe keeping and there is no requirement to get them back right away you could put them int the 'Glacier' class which is much cheaper.

Perl Weekly Challenge W025 - Longest Pokemon Sequence, Chaocipher

New week new challenge!

And for this week we have two awesome tasks for this week's challenge, too awesome not to blog about it.

If you'd like to join the fun and contribute, please visit the site site managed by Mohammad S Anwar.

Task #1 - Longest Pokémon Sequence:
Generate a longest sequence of the following “English Pokemon” names where each name starts with the last letter of previous name.

audino bagon baltoy banette bidoof braviary bronzor carracosta charmeleon cresselia croagunk darmanitan deino emboar emolga exeggcute gabite girafarig gulpin haxorus heatmor heatran ivysaur jellicent jumpluff kangaskhan kricketune landorus ledyba loudred lumineon lunatone machamp magnezone mamoswine nosepass petilil pidgeotto pikachu pinsir poliwrath poochyena porygon2 porygonz registeel relicanth remoraid rufflet sableye scolipede scrafty seaking sealeo silcoon simisear snivy snorlax spoink starly tirtouga trapinch treecko tyrogue vigoroth vulpix wailord wartortle whismur wingull yamask

The above names borrowed from wiki page.

SPVM monthly report 2019/9/11

Do you hear SPVM until now?

If you don't hear SPVM, it is good chance.

SPVM is the project to improve Perl culcuration and array operation.

I recently do benchmark.

SPVM add(+) operator performance in for loop is same as C language!

It is faster than Perl 100x.

I'm creating SPVM document in Japanese.

You can see the following.

SPVM Document

I almost finish(90%) specifications.

SPVM Launguage Specification

SPVM Exchange API Specification - Link Perl world to SPVM world

SPVM Native API - Link SPVM World to C World

Perl Weekly Challenge 25: Pokémon Sequence and Chaocipher

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

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

audino bagon baltoy banette bidoof braviary bronzor carracosta charmeleon cresselia croagunk darmanitan deino emboar emolga exeggcute gabite girafarig gulpin haxorus heatmor heatran ivysaur jellicent jumpluff kangaskhan kricketune landorus ledyba loudred lumineon lunatone machamp magnezone mamoswine nosepass petilil pidgeotto pikachu pinsir poliwrath poochyena porygon2 porygonz registeel relicanth remoraid rufflet sableye scolipede scrafty seaking sealeo silcoon simisear snivy snorlax spoink starly tirtouga trapinch treecko tyrogue vigoroth vulpix wailord wartortle whismur wingull yamask

Paws for Fun and Profit. Part the First.

Well I think it is time I get back to blogging as the one month hiatus I originally planned has now stretched out to I think 10 or 11 months with only two little posts on the SPW back in August..

One of the positive notes from that rather depressing (at least from a Perl perspective) meet-up was the feed back I received on my one year's worth of blogging.

A few points that where raised are;
  • I should try and do more community oriented posts rather than post from my own little development bubble.
  • Go more for quality vs quantity.
  • Try something new not something that has already been blogged to death.

So I am going to try and take these suggestion to heart starting with trying to give back the the community and as hacktoberfest is now running I think I will go for a t-shirt as well.

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.

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.

Simple CLIs using Do v1.70

Command-line Interfaces using Modern Perl

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.

According to Wikipedia:

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is hosted by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.