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.
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.
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';
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!
I left off on my last post with a little patch to do. To recap I successfully restored an S3 file that was on 'Glacier' back into 'S3' with the Paws::S3 RestoreObject command.
There was one little point and that was in the AWS S3 API documents I found this
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.
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.
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.
I’ll start with the second task, as the first one is somehow different (see below).
Inverted Index
Create a script to implement full text search functionality using Inverted Index.
An inverted index is an index storing a mapping from content to its location. I chose to store the filename and line number for all words in a given list of files.
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.
It appears that I have not had single blog post for 1 whole year. Let's face it, there isn't enough time in the day to everything one might want to do. Procrastination steals more than just time though. The longer one is away from a particular activity the more difficult it is to return to that activity physically or intellectually. Some of you will recall that I developed what I claimed to be the world's simplest GUI designer, GUIDeFATE. This was the topic of a couple of presentations already but as all such projects, remains in a state of flux.
I've been doing the Perl Weekly Challenge (PWC) for 3 weeks now. So far there's been unique challenges that made me utilize different modules. I even submitted a solution using APIs which I haven't done in my work because I didn't have any reason to. (lol)
If you'd like to join the fun and contribute, please visit the site link managed by Mohammad S Anwar.
Task #1 - Smallest Script:
The tasks for this week's challenge (#24) are a bit confusing at first but I just did what was asked. The first task was to create the smallest script as described below:
Create a smallest script in terms of size that on execution doesn’t throw any error. The script doesn’t have to do anything special. You could even come up with smallest one-liner.
There is no problem to solve, so in my entry I just put a
$%
: