The Moose Case

Its get off my case day here in the Moose-Pen

Well I am getting close to running out of things to add into Driver ::DBI as I have all the operators covered, functions, expressions, elements, etc etc so I do see and end in sight maybe I won't get a year of blog posts in after all??

Today I am going to try and tackle on of the much abused SQL commands the 'CASE' statement. The question is where to test this one as it can appear anywhere a predicate can so in a 'sort/order by', 'element/field', even a 'link/join'. I was thinking the best spot for it would be back in 32_where_operators.t but the most common form of case I have seen is in SQL like this

Stack Overflow Considered as a Grimoire or Trove

Back in the day, when I came upon a particularly juicy tip/hint/trick/kludge/etc. I would write it down somewhere (way back -- in a paper notebook; more recently, somewhere like TiddlyWiki). But I don't do that anymore -- why?

The answer is Stack Overflow. When I have a question, a web search often has 1 or more Stack Overflow answers at the top - answers that usually help me fix (or work around) the problem I have. It really is impressive how often Stack Overflow has just the answer I need and in just enough detail. (Disclosure: I answer questions on Stack Overflow on a semi-regular basis.)

New Website and URL for HTML::FormFu

Sitting on my TODO list has been a refresh (resurrection perhaps?) of the FormFu website.

In 2017 the various contributors consolidated into a single Group on GitHub - authors of related modules are invited to donate them into that group for future maintenance etc.

Having some time off has allowed me to get through much of that aforementioned TODO list and over the last few days, the FormFu website has been ticked off of that list.

GitHub has a "pages" feature, which is based upon Jekyll. This is a convenient system for generating a static site from templates and content from Git - which also includes the hosting part for free. Everyone in the group can make changes, with 3rd parties able to use Git's normal mechanisms to send PR's, issue reports etc.

So I donated a funky new .rocks domain and used the GitHub pages to create simple new website for FormFu. Any and all feedback is much appreciated.

And without further ado, http://formfu.rocks

Year 2017 - Annual Report

Looking back year 2017 brought many sweet moments, both at professional and personal front. On personal front, I have been blessed with twin girls, Aabia & Aania. Raising twins without family support is not easy for me and my wife. I am told to be prepared for more surprises.

On professional front, there have been many positives to talk about. First I completed third consecutive years of CPAN PullRequest Challenge without missing a single month. I hope to carry on with the same spirit in the year 2018.

Took part in Hacktoberfest challenge, third consecutive years, and submitted 40 PR. Recently received the specially designed T-shirt, Thanks Digital Ocean.

I also completed 24PullRequest, again third consecutive years, and submitted 34 PR.

On the same line, submitting PR, I planned to do at least 1 PR each day on average most of the months in the year. Before year 2017, I was able to do that in 3 months at the most (in the year 2015).

Validated Moose Collective

Its little validation day here in the Moose-Pen

Since I didn't put any new code in yesterday just take out I figure I might as well do that little validation I talked about in my last post namely you can only have one aggregate function inside another aggregate. As usual I start with a test;

Perl 5 Porters Mailing List Summary: December 11th - January 1st

Hey everyone,

Following is the p5p (Perl 5 Porters) mailing list summary for the past month.

Enjoy!

YAML::PP Grant Report December 2017

Hi there!

Thanks for reading my report. In the last report I included a mini tutorial about string quoting methods in YAML. This time I've written an introduction into YAML Schemas and Tags.

In December I have been working about 60 hours on YAML::PP, YAML::XS, libyaml and the Schema article.

See also my previous reports on blogs.perl.org (Aug/Sep, Oct, Nov ) and news.perlfoundation.org (Aug/Sep, Oct, Nov ).

An alternative to HTML::Tagset

HTML::Tagset is a popular module on CPAN and has nearly nine thousand descendants in the "River of CPAN". Unfortunately its last version was in March 2008, nearly ten years ago, so it doesn't feature the HTML5 tags yet. There has been some discussion on the HTML tag set bug tracker but so far that has not come to fruition. As an alternative to HTML::Tagset, I made the module HTML::Valid::Tagset, which incorporates the data tables of the "Tidy HTML5" project.

It's partly based on HTML::Tagset's interface, so it can substitute for some of that module's functionality, and it also has specific tag sets for each version of HTML, including HTML5.

Having the Tidy HTML5 data tables means I was also able to add a function attributes which returns a list of valid attributes for a tag, and tag_attr_ok, which returns true or false depending on whether a particular tag can take a particular attribute. This is part of a larger distribution called HTML::Valid, based on the Tidy HTML5 project.

Aggregte Moose

Its plan but do not code days here in Moose Pen

So I was all prepped and ready to start on the aggregate command for SQL as I had research the MongoDB and other similar non-sql dbs and they all shared the same basic set of commands. I even started writing up some tests starting with this SQL

SELECT person.last_name,SUM(person.pay)  FROM person GROUP BY person.last_name
all well and good you need to use the group by with that aggregate. However I forgot that about 90% of the dbs out there let you do this

SELECT SUM(person.pay)  FROM person

Announcing P6lert: Perl 6 Alerts Directly From Core Developers

Read this article on Rakudo.Party

Development of Rakudo Perl 6 is quite fast-paced, with hundreds of commits made each month to its five core repositories. Users undoubtedly feel some impact from those commits: bug fixes may break code that relied on them, backend changes may have unforeseen impact on the user code, new useful features may be implemented that users would want to know about.

In the past, for things with very large impact, we made blog posts, but there are lots of small things that fly under the radar, unless you actively pay a lot of attention to Rakudo Perl 6's core development.

To help all of our users to be aware of important issues, we're announcing introduction of P6lert service: tweet-sized alerts from Perl 6 Core Developers.

The Goods

The P6lert service primarily consists of alerts.perl6.org website, but with it come a variety of ways to receive alerts posted on it:

Decoding gzinflate(base64_decode()) with Perl

I must admit that I love Perl, but sometimes it forces me to go through the documentation to get what I need. In this case, I will try to summarize how I managed to decode the text string 80jNyclXKM8vykkBAA== , which I found in a PHP file in a code with the nested functions gzinflate(base64_decode()).

perl-logo.png

The history.

I found this text string while analyzing the folder /wp-content/ into blog www.vozidea.com, which according to its owner, it seems that someone left that file there during a time when the web had a vulnerable WordPress plugin with security issues.

That string was something disturbing for the administrator of the blog, a person outside the programming. But in reality it is very easy to decode using PHP, the following code would suffice:

<?php echo gzinflate(base64_decode('80jNyclXKM8vykkBAA==')); ?>

Decoding the strings.

Verifying your distribution's revdeps still work after a change

In one of my pieces of software, Mock::Sub, I recently found that I wanted to add a new feature, and as always, I wrote a test file for the new work before modifying code. After making the first round of changes, I stumbled upon a previously unknown bug, so I opened an issue, and decided to tackle that before adding the new feature, to ensure all previous tests would run.

The new feature is quite minor and actually requires a specific parameter to be sent in to change existing behavour (ie. no existing code that uses the distribution should have been affected), but the bug was a little more complex, and did change things internally.

After I got the bug and new feature added, and before just blindly uploading it to the CPAN, I of course wanted to know whether the reverse dependencies (down-river distributions) would not be adversely affected, which would cascade Testers failure emails to the poor souls who's distributions I broke (most are mine in this case, but I digress).

Last Moose

It the last operator day here in the Moose-Pen

Well today is a very short postette but at least I am adding in the last operator 'ANY' and this time I need only this test;

Why I recommend using the "++" system of Metacpan

A few days ago I bought some Christmas tree lights from amazon.co.jp, the Japanese version of Amazon:

https://www.amazon.co.jp/gp/product/B076WTG77B/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1

One of the words in the description of the item is パーティスマスツリー, which seems to be "party-mas-tree". You might think that is some kind of Japanese neologism, but there's no such word as "パーティスマスツリー" in Japanese. A google search just brings you back to Amazon.co.jp.

https://encrypted.google.com/search?hl=en&q=%22%E3%83%91%E3%83%BC%E3%83%86%E3%82%A3%E3%82%B9%E3%83%9E%E3%82%B9%E3%83%84%E3%83%AA%E3%83%BC%22

Merry Christmas from Tau Station!

I know some people have waited a long time for this. Here's a quick blog post about how to sign up for a chance to participate in the closed alpha.

Smartmatch in 5.27.7

What happened?

In the latest development release of perl, smartmatch changed quite a bit.

Almost everything you believed about smartmatching is now wrong

No really, everything. All previous rules are gone except a single one: you can smartmatch against any object that overloads smartmatching (the only "objects" that overload them out of the box are qr// regexps).

Matching against a scalar value? Gone. Matching against a list of values? Also gone.

when is no more.

The when keyword is gone, split into two keywords: whereis and whereso; one smartmatches the value against the current subject and the other does a simple boolean check much like if. I'll let you guess which is which. This split is for good reasons (when sometimes does one and sometimes the other, sometimes depending on things like optimizations), but that doesn't make this any more intuitive.

use 5.010/use 5.028 won't guard you from this.

Penultimate Moose

Its penultimate operator day here in the Moose-Pen

This is just a quick postette today add in what I think is next to last special 'operator' the 'All' and as before I start with a test;

Introduction to YAML Schemas and Tags

I wrote this article as part of my YAML::PP Grant report for December 2017.

This article will give you an overview how a YAML document is loaded into a data structure and how a processor decides if something is a string, a number, a boolean or something else.

If you look at JSON, the rules are quite obvious:

{
    "string": "just a string",
    "boolean": true,
    "integer": 42,
    "float": 3.14159,
    "undefined": null,
    "list": [1, 2, 3]
}

I wrote a Perl book

(This article is cross posted here and on my own blog)

I wrote a Perl book accidentally during my vacation. I started typing and everything just fell out of my head over the next few days. Its still pretty rough but I think its a decent start.

The book is called Minimum Viable Perl..

mvp-book.jpg

Ok, its not a real published book. Maybe I’ll self publish it on Amazon some day. For now its just a website. I’m going to call it a book anyway.

What its about

This book is for developers who want to get up to speed with Perl quickly through concise tutorials (about 1 screenful in size).

Being concise is one of the primary goals. In the age of stackoverflow and blogs and info graphics everyone is in a hurry. People shouldn’t have to wade through unnecessary prose. I literally review each sentence in each article and try to remove unnecessary words.

Patreon and Perl

Once upon a time there was Gittip that became Gratipay that got shut down. Several Perl developers had account there and many got contributions through that platform.

A few days ago I've started to use Patreon that allows people to support each other on a monthly basis. (Or per creation.)

Searching for perl shows lots of unrelated entries. So it won't be easy to find other people contributing to Perl or writing about Perl.

This is my account: Gabor Szabo on Patreon.

This is the account of David Farrell.

Do you have a Patreon account? Post your link in the comment section so others can find you!

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.