Running Down Moose

It running out of things to do day here in the Moose-Pen

So I am getting very close to being code complete on both Database::Accessor and Driver::DBI I thing I only have a few more little things to add. One that I am going to look at today is the problem of 'identity' fields.

97.654321% (a number pulled out of me arse) of SQL DB have some sort of auto-sequence field or a flag on the field to make the primary key auto increment on insert. There is only one main-stream DB that does not have this and that is ORACLE though there are some other out there I might not know about.

Update to XML::LibXML Tutorial

I've just updated my tutorial document Perl XML::LibXML by Example to include a section on Working With Large Documents.

This new section introduces the XML::LibXML::Reader API which is a pull-parser style with much lower memory overheads that a traditional DOM parser. It also covers hybrid operation where the Reader API is used to scan through the document and extract sections as DOM fragments for further interrogation via XPath.

ANTLR4::Grammar v0.1.0 to Perl 6 CPAN

ANTLR4::Grammar lets you convert ANTLR4 lexer and parser grammars from ANTLR to Perl 6. It currently works with all of the basic EBNF constructs, and for the moment chooses to ignore the features of ANTLR that the native Grammar type doesn't support. When I've added the basic Action class I'll probably add support for ANTLR4 modes. ANTLR4 types make a bit of sense as they've at least got string and int types, but actions don't make much sense as if you're using the tool, you're likely porting an existing Java- or C-based grammar over to Perl 6 and the existing Java code wouldn't make sense.

Future additions include automatically generating a basic Action class, and possibly enough code to build an object-only AST from the grammar itself.

Numbers and Strings in JSON

We needed to upgrade from EL6 to EL7 at work. After the upgrade, we noticed some of the JSONs returned from the APIs had changed: some numbers were suddenly enclosed in double quotes, while some others lost the quotes, which broke customers’ code written in strongly typed languages (e.g. Java).

We used the system default perl to drive our web application, using libraries provided by the vendor. While Perl’s version changed from 5.10.1 to 5.16.3, the version of JSON::XS responsible for creation of JSON data jumped from 2.27 to 3.01. Both the changes contributed to the problem.

No More Moose Case

Its rethink my case day here in the Moose-Pen.

Some of my loyal readers (if there are any) my remember when I started playing with the 'Case' statement I had a few iteration with the naming convention for my API. I finally settled on 'whens' that holds all the case conditions and 'statement' for the 'then' part of the case like this;

Rakudo.js update - working source maps and adhoc fixes

Four backends now for GUIDeFATE...but the struggle continues

Just as you are thinking you got the hang of something, believing you know how to work the system, imagining you have a problem licked, then you wake up to find out it was just a dream. That has been my experience in developing GUIDeFATE (A contrived acronym for the project - Graphical User Interface Design From A Text Editor).

Perl Module Tools (pmtools) v2.2.0 Released - Many RT Fixes

Perl Module Tools (pmtools) v2.2.0 has been released (and updated on GitHub). The focus was on fixing RT bugs. The only outstanding RT issue will be 52851, which is a feature request for pmeth to also display a description for the method. This will require some contemplation to see if I can do this in a reasonably simple manner.

(I say "will be" because rt.cpan.org does not yet have 2.2.0 as a valid version number for pmtools.)

Sunday Moose Test

Test postette day again here in the Moose Pen.

Time to re-run my tests suites again to check the 'Sate of the Onion' before I move on. I expect this will be a very short post.

For Database::Accessor as expected I did not have many changes since last week

 2 files changed, 70 insertions(+), 24 deletions(-)
and the test run was;

All tests successful.
Files=29, Tests=490, 81 wallclock secs ( 0.23 usr  0.06 sys + 77.55 cusr  1.71 csys = 79.55 CPU)
Result: PASS
Now Driver::DBI which had a modest number of changes;

 6 files changed, 358 insertions(+), 45 deletions(-)
and the test results for it are;

Yancy - Mojolicious CMS - Version 1 released

I'm happy to announce the release of version 1 of Yancy, a simple content management system for Mojolicious websites. Yancy is designed to be added to your website to make it easier to develop a web application and manage the content inside.

screenshot.png

Yancy features a responsive web application that uses your database schema to build forms to edit your site's content. Yancy currently understands databases like Postgres, MySQL, and SQLite, and the DBIx::Class ORM.

Pi Day!

Yesterday, when I published and wrote a blog about my new RPi::StepperMotor distribution, I didn't even think that the very next day was Pi Day.

So, although nothing significant could be done in the meantime, I updated that dist with a cleanup() method which resets the GPIO pins at the end of your script, and published version 2.3623 of RPi::WiringPi, which is the top-level framework that allows you to safely pull in all of the other RPi:: distribution objects.

Changes include:

  • bumping GPSD::Parse prereq due to having added some convenience methods to it

  • Documentation fixes and updates (all broken links now work!)

  • incorporation of said RPi::StepperMotor distribution

Nothing major, but since most of my personal programming time the last two years has gone into Raspberry Pi work for Perl, thought I'd do at least something :)

byterock, this one's for you...

byterock_moose.jpg

Perl Module Tools v2.1.0 Released - Windows Fixes

It turns out there are several tools in the Perl Module Tools (pmtools) that need to execute other commands with the current Perl specified, like:

system "ls -l " . `$^X -S $Bin/pmpath $module`;

(note the additional "$^X").

As a side note, in Windows you may need to "use FindBin qw($Bin);" so your programs can actually find the Perl to run. (I had wondered if this use of FindBin was just cargo-cult programming carried over from old versions of Perl - now I know better.)

Final Moose Case

ts final Case postette day here in the Moose-pen

For the final clean up of Case I am going to add in a few tests in Database::Accessor that should have been there in the first place.

First I will add this;

Try::Tiny::Tiny

Last year I released this new module.

I want to talk about its purpose briefly, because in the time since, people have published benchmarks of how it performs compared to other modules that offer alternatives to eval. The latest example of such a benchmark is part of the Exceptions chapter in Minimum Viable Perl (via), but they go as far back as Diab Jerius’ shootout right after I released the module.

It is, of course, interesting to see the figures to see where Try::Tiny::Tiny falls.

However, simply treating it like another contender in such a contest misunderstands its purpose. Try::Tiny::Tiny is not meant to compete with any of the other modules. It is not meant to be your choice for exception block syntax.

I do not recommend that you use Try::Tiny::Tiny in your own code.

Building a Software Consulting Firm

Hey, I'm not dead! I just haven't posted in a while because I've been so busy on Tau Station (which, if all goes well, will be open for everyone real soon™).

In the meantime, I've written a bit about building a software consulting firm. You might find it interesting.

If you need to outsource software development with a firm you can trust, contact us.

The Perl Conference Newsletter: 3/11/18

The latest TPC Newsletter is out!

Last round of talks submissions. CFP closes 3/18/18!

Round 1 and Round 2 Speakers/Sessions announced.

Still on a Moose Case

It case out day here in the Moose-Pen

After looking at some more examples of 'CASE' in SQL I cam across one I have not encountered yet;

SELECT CASE 
              WHEN Products.Price < 10 THEN 'under 10$'
              WHEN (Products.Price >= 10 
                 AND Products.Price <= 30) 
                    OR (Products.Price >= 40 
                 AND Products.Price <=50) THEN '10~30$ or 40~50$'
                ELSE 'Over 50$'
                 END 
    FROM Products

Perl Module Tools (pmtools) v2.1.2 Released - Version Fixed

Perl Module Tools v2.1.2 has now been released to fix the version number everywhere.

Controlling a stepper motor with the Raspberry Pi

I live in an extremely remote part of Northern British Columbia, Canada. It is a minimum of an hour to get to the nearest town. We are exceptionally sparsely populated with a vast amount of land right on the second-largest lake in the province.

To that end, we have a wild abundance of wildlife everywhere. Bears, moose, wolves, coyotes, deer etc etc. I set out to set up a series (eight) wildlife cameras using Raspberry Pis (four on my house, the other four each on a separate cabin), all streaming to a central server that I can display on a television set, with all eight camera streams within a single window.

After I accomplished the bulk of that work, I wanted a way to pan and tilt my cameras individually. The tilt part I use a standard servo with the the servo() functionality of the RPi::WiringPi distribution.

A decade of classes in Lausanne

I'll be back in Lausanne again this May...my tenth visit to UNIL and my second to EPFL. Both of these prestigious institutions were founded well before my own country became an independent nation (and UNIL actually dates back to 50 years before the first European even set foot on the Australian continent).

To celebrate a decade of visiting lectures at the University, we're going to offer a rare public performance of my classic Fun With Dead Languages presentation. It's many years since I had the chance to give the full two-hour version of this talk and I've been busily updating it for the occasion. The talk is completely free, but we do want people to register in advance if possible so we can schedule a suitable venue for it.

In addition to that event, of course, we'll still be running a full range of classes on technical and presentation topics:

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.