Hacktoberfest: Thank You

I have just completed the marathon of submitting Pull Request as a part of Hacktoberfest Challenge 2018. For those, who don't know what I am talking about. Hacktoberfest Challenge is an annual event organised by Digital Ocean where you are encouraged to submit at least 5 PR to any distributions hosted on GitHub. In return you get specially designed T-shirt deliver to you anywhere in the world for FREE. It was first started in the year 2014. How did I get started? I was introduced to the challenge first by one of the blogs by Neil Bowers in the year 2015. Ever since, I haven't missed once. I am really addicted to it, to say the least.

Moose Loose Ends Part the XII

Well its fix one break everything day here in the Moose-Pen

I thouhg it was just going to be one of those quick look how well things pass postette days today but I was dead wrong;

I did a check in a a quick push and then ran the full test suite and got

t/20_dad_load.t ............. Attribute (conditions) does not pass the type constraint because: ArrayRefofConditions can not be an empty array ref at /usr/local/lib/perl/5.18.2/Moose/Object.pm line 24
        Moose::Object::new('Database::Accessor', 'HASH(0x2eeb320)') called at t/20_dad_load.t line 15
# Looks like your test exited with 255 before it could output anything.
So many times I just had to kill the run. I am about 99.99756% sure it was this cnage from yeaterday

Type::Const released

I've created an experimental Type::Tiny library called Type::Const that coerces ArrayRefs and HashRefs into constants using Const::Fast.

Why?

When you have read-only attributes in Moo(se) classes:

has things => ( 
  is => 'ro',
  isa => HashRef,
);

While you can't change what hash reference things refers to, you can change the contents. This is fine:

$obj->things->{$key} = $val;

and there are good reasons for that.

But in other situations, you have built a table of data that you do not want changed. You can use this instead:

has things => ( 
  is         => 'ro',
  isa       => ConstHashRef,
  coerce => 1,
);

The coercion means that any hash reference will be made read-only.

The SSL certificate of the domain of the Perl 5 repository has expired

The SSL certificate of the domain of the Perl 5 repository has expired from 10/19.

https://perl5.git.perl.org/perl.git

Using Perlbrew after macOS Mojave 10.14 update

I would like to share a minor fixup when using Perl with Perlbrew on MacOS.

After updating to MacOS X Mojave... I was not able to compile any XS module.. or even reinstall a different version of Perl itself...

Here one example output when trying to compile Clone for example

Moose Loose Ends Part the XI

Never say never day here in the Moose-pen

Just when I though I had all the bugs out of my Database::Accessor I found a bunch more while finishing off tests case '42_new_validation.t'.

Most of the bugs where with the 'links' attribute. My test for this attribute are a check to make sure a link has a 'to' is present, and it not undef, and the same for type and then at lease on condition is present.

The first bug was

not ok 19 - type is proper link ; links
and the error it was throwing was;

 'links->type' Constraint: The Link 'undef', is not a valid Accessor Link! Try one of 'LEFT', 'OUTER', 'RIGHT'
and the value in the hash we

     'type' => 'bla',

Perl6::Math::Matrix (Part 5: patient with docs)

If you write any software package, you have to document it. This simple truth drives more than few developers into despair. But there is also a way to craft good documentation and make the writing of it a useful part of the development. This is the closing part about authoring a Perl 6 module and Math::Matrix in particular (part: one, two, three, and four).

New Dancer::Plugin::reCAPTCHA released

After a long, long time, Dancer::Plugin::reCAPTCHA has been updated. Most important in this release is that it now supports reCAPTCHA v2. Earlier versions only supported the v1 API, which is no longer usable. This required some minor changes to the module's API. Please see the POD for details.

Thanks to Shawn Sorichetti and Mohammad S Anwar for their contributions, without which this release would not have been.

These days, I have been using other means for fooling bots (which in part explains why this has taken so long to update). I will try to cover this in a future blog post.

Good luck, and happy Dancing!

Speedup Travis by tweaking your Dist::Zilla config

Dist::Zilla is a great tool... but its main weakness is nearly its main advantage...
In My Opinion, Dist::Zilla Plugins are what makes my dzil workflow so great....
but on the other side, installing all the plugins and their dependencies is painful and can be very slow...

It's acceptable to install all these packages that are going to let you save time while developing and releasing your distro.... but contributors and Travis CI should not be slowed down by requiring the installation of these extra packages...

By tweaking the dist.ini of my distro by using a combo of GatherDir + Run::AfterBuild plugins, I could reduced the travis build time for a single Perl version from more than 4 minutes to about 30 seconds...

When smoking with Perl versions from 5.14 to 5.28 the total build time was reduced from 32 min to 5 min.

Moose Loose Ends Part the X

Its make and mend day here in the Moose-Pen

Now that I have my constructor single error working the way I like I figure I better go back and clean up my test cases and create a new test case just to check the error on 'new' construction.

I am going to start with '30_view.t' as that is the one I have been mucking with most over the past little while.

The first thing I did was strip out the new 'validation' tests and suck them in a new tests case '42_new_validation.t' and after a few adjustments it presently looks like this;

Progress of blogs.perl.org grant

Hey all,

Here's another update about the grant for revitalizing blogs.perl.org. I'll start with an overview of what I wanted to achieve in the beginning, and where we got from there.

When I started this process, I looked at the "mainstream" PearlBee version as a basis for the new blogs.perl.org, and also the previous grant work that had be done. They each had different issues, in my view. The former was pretty much unfinished and barely usable, and the latter was way too big in number of features and requirements. I aimed for something small and stable, with just what was needed.

JSON::Transform - transform JSON-able data structures without code

Version 0.01 of JSON::Transform is now on CPAN. It lets you express transformations of JSON-able data (i.e. data that is only hashes, arrays, simple scalars plus booleans) concisely and declaratively, without writing any other code.

Locations within the data structure are expressed using JSON Pointer (RFC 6901), and there are both user and automatically-system-set variables available that can be interpolated to make such locations be computed.

What is this for?

Ben Bullock poses an excellent question in the comments: "What kind of jobs would we use this for?". My answer is that this provides another tool for separating out a common class of concerns, to reshape data. This is part of my ambition to eliminate a lot of code that people routinely write. By porting this module to other languages, that will make my libraries more widely usable.

Hacktoberfest 2018 - Memorable Moments

I remember the first time when I participated the Hacktoberfest challenge in the year 2015, I was so excited competing with other hackers. Although I only had to submit 4 Pull Request to get specially designed free T-shirt but I went ahead and submitted 45 Pull Request in that month. I was very pleased to receive my first T-shirt. I still wear it occassionally with pride. I continued participating the challenge every year ever since but never beat that first year record of 45 Pull Request.

Year 2016: 12 Pull Request
Year 2017: 40 Pull Request

This year 2018, has been special to me in many ways. Therefore I wanted to go out and break the record. Also this is the last year for Pull Request Challenge, I wanted to make it memorable. Thanks to all the people who have supported me all the way and accepted my Pull Request. I feel honored to see so many encouraging messages from the "Whos Who" of Perl Community.

With all the support and encouragement, I have gone past the 100 Pull Request mark and there are still 10 odds days left in the month. At this rate, I am hoping to go over 150 Pull Request. Fingers crossed. Acceptance rate is little over 50%, which is not bad.

Keep contributing !!!

Moose Loose Ends Part the IX

Another postette day here in the Moose-Pen

I had only one little goal today and that is come up with a really nice single construction error message. After a good hour or so of mucking about I finally came up with;

London Perl Workshop 2018 - give a talk

The London Perl Workshop (LPW) takes place this year on Saturday 24th Nov and you are encouraged to submit your talk proposals now (or if you have already, feel free to submit another!).

We welcome proposals relating to Perl 5, Perl 6, other languages, and supporting technologies.

Talks may be long (45-60 mins), short (15-20 mins) or very short (aka lightening, 5 mins). We would also be pleased to accept proposals for tutorials and discussions. The deadline for submissions is Wed 31st Oct.

We would really like to have more first time speakers this year. If you’d like help with a talk proposal, and/or the talk itself, let us know - we’ve got people happy to be your talk buddy!

Register (it's free!) and submit your talk at: http://act.yapc.eu/lpw2018/

We hope to see you there,

Pete, Rick, Lee, Katherine, Julien and Mohammad (the organising team)

Lab::Measurement paper published!

Good news: Our article Lab::Measurement—A portable and extensible framework for controlling lab equipment and conducting measurements was accepted for publication by Computer Physics Communications and is available for download!

The Lab::Measurement software stack is a feature-rich solution for measurement automation and instrument control, which is both lightweight and highly portable to different operating systems. It is actively used by an increasing number of research groups, mostly for experiments in mesoscopic physics, but recently also in particle physics and quantum optics. In many cases it has completely replaced proprietary tools like LabView or Matlab!

The paper also covers the ongoing port of the stack to modern Perl techniques which lead to a considerable improvement of maintainability and extensibility.

Happy reading!

Dancer2::Session::CHI released

I added a new session storage backend for Dancer2 today. Dancer2::Session::CHI is on its way to your local CPAN mirror. If you are currently using CHI in your Dancer2 applications, this will let you use CHI as your backing datastore for storage data. Please see the pod for details.

Contact me with any issues you may have, or file them on the github bugtracker.

Thanks! Happy Dancing!

Moose Loose Ends Part the VIII

Its quick add in day here in the Moose-Pen

Today I am going to add in another attribute called 'all_errors' a simple Boolean flag so my end user can either get a single error message of all the errors found or the 'MooseX::Constructor::AllErrors' object with all the errors when using the 'new'. Simple enough I can just add it here

Mocking -X File Checks using Overload::FileCheck

I wanted to share with you a new experimental project which could allow you to mock file tests also known as -X.

All started while we initiate a larger discussion about testing, and decided to give a size to our unit tests. Using sizes like the ones used for t-shirt: Small, Medium, Large...

The definition for each size might differ and evolve.
But at one point we were considering that a small test should not have any interactions with the file system....

So how could you test such a function, without any interactions of the filesystem...

XML::Invisible - writing parsers without pain or code

Version 0.03 of XML::Invisible is now on CPAN. This lets you write parsers that produce XML-like Abstract Syntax Trees (AST), or actual XML documents, without writing any code. Why did I write it?

Parsing: a tiny introduction

Parsing is turning a text input, into semantically valuable output. It is often broken into the stages of lexing (turning the initial text into tokens - errors detected if invalid tokens given), parsing (structuring those tokens into ASTs - errors if structure wrong), later processing (doing something with the AST).

There are a number of ways of writing parsers generally. The most maintainable way is using as much of a declarative style as possible, usually by writing a grammar. There are various options in Perl, including Marpa, Parse::RecDescent, and Pegex. For each of these, you have to write a grammar (obviously), and write some code to handle the text inputs and parsing results.

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.