Paws for Fun and Profit. The III

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

Perl Weekly Challenge 024: Inverted Index and Shortest Oneliner

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.

Time Flies, Memories leak...GUIDeFATE getting a timer

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.

Perl Weekly Challenge W024 - Smallest Script, Inverted Index

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 $% :
perl -e '$%'

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.

Signatures vs. Methods

I've still been thinking about proper OO in the Perl core and hit an interesting case.

Imagine the following, hypothetical Perl 5 OO syntax. Inheritance is handled via is and inheritance order is assumed to parent class declaration order. Thus, UnlovedChild inherits from MissingFather first.

What do you think the output should be?

class MissingFather {
    method shout() { say "I'm outta here!" }
}

class DrunkenMother {
    method shout($message) { say "$message!" }
}

class UnlovedChild is MissingFather, DrunkenMother {}

UnlovedChild->shout("Where's my beer?!")

Perl Weekly Challenge # 24: Smallest Script and Inverted Index

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

Spoiler Alert: This weekly challenge deadline is due in several days from now (September 8 , 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: Smallest Script With No Execution Error

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 the smallest one-liner.

I was first puzzled by this strange specification. Can it be that we really want a script that does nothing? Does it have to be the shortest possible script.

Well, after reading again, yes, it seems so.

I'll go for one-liners.

My script in Perl 5:

$ perl -e ''

berrybrew, the Perlbrew for Windows v1.26 released

I've finally found some time to get some wanted and needed changes implemented into berrybrew.

Some changes were for development and testing of the software itself, a couple of features were added due to community requests, and yet more were requested by a client.

Here's a summary of the new features:

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.

Fastmail and Perl: an interview with Ricardo Signes

Ricardo (Rik) Signes is a member of the Perl community who has helped the programming language move forward as far as features, stability, and popularity. Previously, he was Perl’s Pumpking (manager of the core Perl 5 language), during which time he oversaw 5 major releases. Currently, he is a board member at the Perl Foundation and CTO at Fastmail, leading a development team working in Perl every day.

This blog post is brought to you by Fastmail, a gold sponsor for PTS. More information about Fastmail is provided at the end of this article.

Monthly Report - August

The main activity for me last month was "The Perl Conference in Riga". It was my second European Perl Conference and the most memorable one. You can read my full report, if you are interested. During the conference, I got to meet, Heart & Soul of any Perl event, Liz & Wendy. It is embarrassing that I still don't know who's Liz and who's Wendy. One day, I will sort that out once for all next time when I meet them. I hope they would attend the London Perl Workshop next month. I met Paul Johnson first time in person. I have interacted with him on Twitter before. I also met many CPAN contributors who received Pull Request from me in the past. Icing on the cake was a gift, a book titled "Learning to program with Perl6: First Steps" by JJ Merelo.

To compute a constant of calculus
(A treatise on multiple ways)

𝑒 is for economics

The first task of the 21st Weekly Challenge was a very old one:
to find (what would eventually become known as) Euler’s number.

The story starts back in 1683 with Jacob Bernoulli, and his investigation of the mathematics of loan sharking. For example, suppose you offered a one-year loan of $1000 at 100% interest, payable annually. Obviously, at the end of the year the markclient has to pay you back the $1000, plus ($1000 × 100%) in interest...so you now have $2000. What can I say? It’s a sweet racket!

Perl Weekly Challenge W023 - Difference, Factors and Poem

This week's challenge is composed of three tasks.The first one is to get the n-th order of forward difference of a given list.

Task #1 - N-th order difference:
Suppose we have list (X) of numbers: 5, 9, 2, 8, 1, 6 and we would like to create 1st order forward difference series (Y). So using the formula Y(i) = X(i+1) - X(i), we get the following numbers: (9-5), (2-9), (8-2), (1-8), (6-1). In short, the final series would be: 4, -7, 6, -7, 5. If you noticed, it has one less number than the original series. Similary you can carry on 2nd order forward difference series like: (-7-4), (6+7), (-7-6), (5+7) => -11, 13, -13, 12.
Solution:

Perl Weekly Challenge 023: Forward difference series & Prime decomposition

Forward difference series

Create a script that prints nth order forward difference series. You should be a able to pass the list of numbers and order number as command line parameters.
Series592816
Order
1(9-5)(2-9)(8-2)(1-8)(6-1)
4-76-75
2(-7-4)(6+7)(-7-6)(5+7)
-1113-1312
3(13+11)(-13-13)(12+13)
24-2625
4(-26-24)(25+26)
-5051
5(51+50)
101

Perl Newbies weekly update 2019/8/31 - uc, lc, ucfirst, lcfirst functions

Hear Good News!

I report Perl Newbies weekly update.

I add uc, lc, ucfirst, lcfirst functions.

Perl Newbies

I start to work writing perl document for Perl 5 Newbies.

I think Perl Community(Mainly USA and more Mainly Silicon Valley) isn't intereted in Yung Perl People who want to know Perl programing language.

There are no easy, understandable, modern entries and perl programing examples in blogs.perl.org.

I try to continue to write entries for Perl 5 Newbies.

Is Perl 6 Being Renamed?

By now, many of you have seen the Perl 6 Github issue "Perl" in the name "Perl 6" is confusing and irritating. The issue suggested renaming Perl 6. While some may think that the name of the issue is trolling, or offensive, the actual issue was created by Elizabeth (Liz) Mattijsen, one of the core Perl 6 developers, a long-time Perl 5 developer, and with her spouse, Wendy, has long been an enthusiastic support of Perl 5/6. There is no trolling here. There is a lot of deep thought, careful discussion, and a genuine desire to find a way to bypass some deeply divisive issues in the Perl community.

While the proposed name was "camelia", Damian Conway made a strong argument in favor of "raku" and it appears the community is leaning towards this name for various reasons.

This post is my attempt to summarize what's going on for those who have missed it. Any errors are, of course, Damian's. (just kidding!)

Shorewall 5.2.3.4 Released

Shorewall 5.2.3.4 is now available for download. Shorewall is a gateway/firewall configuration tool for GNU/Linux, written in Perl.

Problems Corrected:

1) If multi-queue NFQUEUE (e.g., NFQUEUE(0:1) ) WAS used as a policy, an error such as the following was previously incorrectly raised.

ERROR: Invalid policy (NFQUEUE(0) /etc/shorewall/policy (line
15)

That has been corrected such that no error is raised.

2) If multi-queue NFQUEUE( e.g., NFQUEUE(0:1,bypass) ) was passed to a
macro, an error such as the following was previously incorrectly
raised:

ERROR: Invalid ACTION (PARAM:1c,bypass)))
/usr/share/shorewall/macro.BitTorrent (line 12)
from /etc/shorewall/rules (line 40)

Now, the NFQUEUE action is correctly substituted for PARAM in
the Macro body.

3) If shorewall[6].conf didn't set AUTOMAKE, the 'update' command
previously produced a new file with 'AUTOMAKE=Yes'. This resulted
in an unexpected change of behavior. Now, the new file contains
'AUTOMAKE=No', which preserves the pre-update behavior.

4) Shorewall-rules(5) incorrectly stated that the 'bypass' option to
NFQUEUE causes the rule to be silently bypassed if there is no
application attached to the queue. The actual behavior is that the
rule acts like ACCEPT in that case. Shorewall-rules(5) has been
corrected.

Perl Weekly Challenge # 23: Difference Series and Prime Factorization

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

Spoiler Alert: This weekly challenge deadline is due in several days from now (September 1, 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: nth Order Difference Series

Create a script that prints nth order forward difference series. You should be a able to pass the list of numbers and order number as command line parameters. Let me show you with an example.

Splitting on a change in Perl6

I had more thoughts about splitting on character changes, partly thanks to a mailing list thread, which led to more questions.

As a prelude, here are regexps that splits when changing to the letter B

# If the cursor is before B, and is after a character, and is not after B, split
> say "ABBBCDEEF".split(/<?before (B) {} ><?after . ><!after B >/).perl
("A", "BBBCDEEF").Seq
# If the cursor is before B, and is after character-class-exlcuding B, split
> say "ABBBCDEEF".split(/<?before (B) {} ><?after <-[B]> >/).perl
("A", "BBBCDEEF").Seq
And when changing from the letter B
# If the cursor is after B, and is before a character, and is not before B, split
say "ABBBCDEEF".split(/<?after (B) {} ><?before . ><!before B >/).perl
("ABBB", "CDEEF").Seq

Perl Weekly Challenge - 6 months

Last time we presented you the success story of 3 months. It is now time to share 6 months story with you. I would like to take this opportunity to thank each and every contributors. I would also like to take a look what have we achieved in these 6 months.Here is the list of achievements

#1 Active bloggers

I would call this one of the biggest achievements that we have had 228 blogs in the last 6 months. On top this, we have had 11 blogs , as listed below, by Damian Conway . Some of the bloggers started blogging again after long break and some were first timers. You can find all the blogs in the weekly Recaps and Reviews .

Recaps

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.