A little More API Moose

Its piddle with old code day here in the Moose-Pen

Yesterday I managed to clean up the '$container' param and now it only sends down to the DAD only items that match with the present view. After cleaning up all the related tests and adding a few more test in other test cases I have a little time last night to try some piratical use of Database::Accessor.

The first thing I discovered was it is very frustrating to the end user to send a '$container' down to a DAD have something unexpected happen and not know why or at least be able to see what was acted on.

Therefor I am going to expand my API yet again and include the both the passed in '$container' and the processed '$container' param in the 'Database::Accessor::Result' class.

Easy enough to implement but there are a few little problems. Being a param '$container' is only in local 'sub' level memory as it is entered by this calling structure;

At Perl Station

So I visited Perl. More pictures to follow.

Perl train station at night

IMG_6469.jpg

Perl train station during daytime

From the distance. Right Germany, Left Luxembourg, Behind France

IMG_6668.jpg

PTS 2018 - Day 1

I'm at the Perl Toolchain Summit 2018 in Oslo for a few days working with the MetaCPAN team. This is the 10th year of the summit (although confusingly the 11th actual summit!), and the 3rd year I've been able to attend.

My focus for day 1 has been making MetaCPAN front end and API more resilient and also to put together a what to do if site down and Disaster Recovery plan (day 2 I will be testing that DR plan).

I've setup our 2nd datacenter back to being a production ready cluster (of Elasticsearch). I added health checks and load balancing from Fastly (our CDN) to both the web front end (now using 4 nodes, 2 in each datacenter) and also setup our API (3 nodes in 1 datacenter as they all need to talk to the same elasticsearch). You can see what is running where in our domains document.

Now Github are running public projects you can see what MetaCPAN team are doing and have done

A huge thank you to the sponsors who make this possible:

NUUG Foundation, Teknologihuset, Booking.com, cPanel, FastMail, Elastic,
ZipRecruiter, MaxMind, MongoDB, SureVoIP, Campus Explorer, Bytemark, Infinity Interactive, OpusVL, Eligo, Perl Services, Oetiker+Partner.

Dancer2 0.206000 released, addresses potential security issues

Dancer2 0.206000 has been released, and it is recommended that all users of Dancer2 should upgrade as soon as it is feasible to address several potential security issues:

  • There is a potential RCE with regards to Storable. We have added session ID validation to the session engine so that session backends based on Storable can reject malformed session IDs that may lead to exploitation of the RCE. Please see the Storable documentation for more information.

  • We have changed from HTTP::Body to HTTP::Entity::Parser (the same as Plack uses) for parsing requests. Apart from being faster, this change also resolves a situation when forwarding requests where the request body could be re-parsed without correctly seeking a filehandle to the beginning of the request body, potentially resulting in an infinite loop. The implementation using HTTP::Entity::Parser does not require the request body to be re-parsed. This addresses a potential DoS attack vector.

Moose Forges Ahead

Its take one step forward day here in the Moose Pen

today I am going to try and fix that stoppage I had yesterday . To recap I have a rule in my API that states that I can only 'update' or 'create' on elements that have the same view as the DA. So given this DA hash

German Perl Workshop

I am just back from German Perl Workshop. The workshop is held every year and I finally had a chance to visit it!

I had these reasons to go:
  • Meet Perl hackers and community members who I have known online for years
  • Talk about TPF
  • Visit Perl, a small town in Germany

I'd like to express my gratitude for the organizers who worked hard to make it happen. They had to change the venue with a short notice and train track repair impacted the transportation but the organizers did a fantastic job.

My talk went well and the material is at https://docs.google.com/presentation/d/14zub1nzTlt-EPWJCAawHLb-MIKbDHXllHdqLhD-uZnk/edit?usp=sharing

The key takeaway is that TPF is doing its job well but I'd like us to reach more people to help the right people and market ourselves more.

There was a BoF among TPF volunteers. Good discussion was had and we will reflect that to the organization.

I hope to see you in Munich next year. IMG_6395.jpg

Tau Station is now live!

It's been a few years in the making, but Tau Station is now live!

It's a free-to-play post-apocalyptic interstellar MMORPG that runs in a browser, tablet, or mobile. The backend is written in Perl.

Join Tau Station and let's show the world the awesome things you can do with Perl! (And hey, spend money if you can; I need to keep the lights on) :)

We follow WCAG 2.0 AA standards for accessibility (blind and mobility impaired people can play).

Tau Station is now live

WANTED: Perl 6 Historical Items

Read this article on Rakudo.Party

The Perl 6 programming language had a turbulent birth. It was announced in the summer of 2000 and the first stable language release shipped out only 2 years ago, on Christmas, 2015. A lot has happened during that decade and a half, yet the details are hard to piece together.

After my recent facelift to rakudo.org, I'm working on a (second) facelift to perl6.org website.

Part of the work involves bringing all the Perl 6 deliverables under one umbrella, so the user isn't thrown around multiple websites, trying to find what to install. At the same time, we want to strengthen the distinction between Perl 6 the language and the compilers that implement it, as well as encourage more implementors to give it a go at implementing a Perl 6 programming language compiler.

A little ahead but really back Moose

Its practical test day here in the Moose-pen

Yesterday I set up a new class that would generate a nice little set of DB table for me on what ever DB the end user may have by using a plug-in to supply the generation SQL. Today I greatly expanded that class but there is no real reason for me to dump it here as it is just more of the same from yesterdays post.

I did create a new class to test complete with a Data::Accesosr definition which is below;

Version 3 of "Parsing: a timeline"

I have published version 3 of my parsing timeline. It has many changes-- so many, it might be considered a new work. It is longer and now provides sources. The new material includes coverage of combinator and monadic parsing, and operator expression parsing, making it considerably less Marpa-centric.

The link above is to the announcement on my own blog. You can also "cheat" and go straight to the timeline itself. For more about Marpa, my own parsing project, there is the semi-official web site, maintained by Ron Savage. The official, but more limited, Marpa website is my personal one. Comments on this post can be made in Marpa's Google group, or on our IRC channel: #marpa at freenode.net.

Refurbished App::DBBrowser

Hello,

it's now available an improved version of App::DBBrowser with new features.
Some of the new features:
- attach databases to a SQLite database
- use sub-queries in different places of the statement
- choose if identifiers should be quoted or not

A new wobbly wheel for GUIDeFATE

Extend that Moose

Still extending my Moose tests here in the Moose pen today.

For my next extended tests I will need to have some tables on the target tests database. This of course poses some problems as the DDL (Data Definition Language) of each SQL db is slightly different;

Take dropping a table. You very basic SQL works fine

DROP TABLE people;
however this;

DROP TABLE IF EXISTS;
will not work on Oracle and some versions of Infomix and this is just one small example. I need to write a test suite that can handle these differing flavours of SQL and good old MooseX come to my rescue again.

A Guide to Versions in Perl

Version numbers in Perl are very important; they allow orderly updating and maintenance of modules and distributions across the CPAN, and allow CPAN modules and consumers to require the versions of modules with the bugfixes or features they need. However, in this context, they are also a very unique beast with a complex and bumpy history that leads to some surprises for those who are not familiar with the nuances. These are the things CPAN authors should know about versions in Perl, and are nice for consumers to know as well.

To summarize:

WWW::Mechanize Best Practices

Recently at $work we were discussing some of the behaviours of WWW::Mechanize when submitting forms. For instance, when you pass the fields parameter to the submit_form() method, Mechanize might take a very lax approach to submitting your data.

I've discussed some ways to make your useragent more secure and easier to debug. The whole article is at http://www.olafalders.com/2018/04/13/wwwmechanize-best-practices/

StackOverflow that!

The Perl 6 IRC channel is an excellent place for all your Perl 6 needs. Any problem is solved in no time. However, it's not the best place for storing and searching those questions and answers. There's a place for that: StackOverflow.

Extend Your Moose Tests

Its extended test Day here in the Moose-Pen

Now that I have what I think is 99.95% of my API set and both Database::Accessor and Driver::DBI are code-complete and passing all test cases, I think is is time to do some practical tests on my system.

By piratical I mead testing on a 'real' SQL db. So far I have been testing with the very limited 'dbi:ExampleP' DBD, and little less limited 'dbi:DBM' and only in two test cases. All the other thests cases I really just check the generated SQL so I have know idea, but a good assumption, that the code will work on a real SQL DB.

blead Breaks CPAN a.k.a. BBC

Next week I will take part of the toolchain summit 2018 in Oslo, Norway.
This would be my second participation after last year event in Lyon, France, where I mainly focus on grep.metacpan.org prototype.

One recurring discussion during the last Perl events brought by kid51 is to improve detection of BBC - blead breaks CPAN. (note: blead is the branch tracking current perl development)

You can read more from kid51 on these topics here:
- What do we want and need for teting
- Do We Need a Tertiary Test Suite?

I think that we already have a lot of tools, matrix, smokers... in place. I've no intentions at this point to provide an extra smoking service. But I mainly struggle to get the vision I would like for these data.... It's a challenge to represent multidimensional data on a single webpage.

By gathering the data from matrix.cpantesters.org I think we could provide an easy way to see the state of the "CPAN River" across perl version

My "Go for Perl Hackers" Cheatsheet

Last year I found myself working on some Go code at $work. When I'm trying to pick up constructs in a new language, I find it helpful to see how I would have done the same things in Perl. This sheet is far from complete, but I think it's already helpful. You can find it at https://github.com/oalders/go-for-perl-hackers. Comments, critique and pull requests are welcome. I've already had some helpful feedback via Twitter which I've incorporated.

As an aside, I did this a long back for Objective-C.

Proposed new data structure: Pile

We're all used to working with arrays to implement queues and stacks using shift, unshift, push, and pop. They allow you to keep your data nice and tidy, well-ordered and predictable.

But life isn't nice and tidy, well-ordered or predictable.

We need something in our programming language that reflects the mess of the real world.

The Pile

Enter the concept of the Pile. A pile, like a stack, allows you to add data to it, as well as retrieving it. But, rather than using the neat pop and push, you use mush and mop.

Adding data is done using the mush operator. You can mush arbitrary collections of data into a pile.

Retrieving data is done with the mop operator. When mopping data from a pile, you can specify how many items to mop (i.e. the "capacity").

Syntax

The first problem with this new data type is to find a proper sigil for piles. Since Perl supports unicode, I would suggest U+1F4A9. This would give us:

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.