Baby Moose Starts Out Aagain

It is cheap clip show day here in the Moose-Pen

Now that I am finally finished with Database::Accessor for the moment as since my last post all my tests are passing, I think it is time for a quick recap of what when on since this post when I left the Dist-Pen and started up the Moose-Pen.

The first few post I set out on writing my first Driver::DAD, I worked out some name-space issues and finally came up with Database::Accessor::Driver::DBI rather than SQL as most DBI drivers run on SQL is just seemed locgial.

The second set of posts I started to write up my Driver::DBI and ran into the problem very quickly that I needed some sort of DBI DB present on the current box to do any testing. I solved this as 'DBD::DBM::db' comes with DBI so I decided to use that for my testing. I even got one or two test cases written and a little code done.

Collisions in Block Names in Jemplate

Two Blocks with the Same Name

In January this year, I got Jemplate in the CPAN Pull Request Challenge. The module implements Template::Toolkit in JavaScript, so you can transfer the burden to process the templates from the server to the client.

One of the open issues in its GitHub repository caught my attention: Jemplate compiled all the templates coming from different files into one large JavaScript code-block. If you declared two blocks with the same name in two different files, they’d end up in the same hash in JavaScript, and only one would survive—but you couldn’t tell which one. Keeping block names unique across files probably isn’t part of common practice, so making the module warn you in such a case sounded like a reasonable requirement.

The Perl Conference USA 2017

The Perl Conference this year is going to be in the DC-Metro area, specifically in Alexandria, VA at the United States Patent Office. We've got some great talks lined up and are continuing to update the schedule at http://www.perlconference.us/tpc-2017-dc/schedule.

Register and reserve your spot to listen to speakers like Damian Conway, Mark Jason Dominus and Sawyer X to name a few. You can purchase tickets for our event and/or the tutorial sessions here.

The local PM groups (DC and Baltimore) are really excited about hosting this year's Perl Conference. I hope to see you there.


Dawn

Signed Up!

Registered for YAPC The Perl Conference 2017. Travel and accommodations arranged!

Excitement level: 3/5 and rising.

Baby Moose Move Out

Just cleaning up the Moose-Pen today.

I left off from yesterdays post with few more tests to clean up and a new one or two to write up. Might as well get the low hanging fruit first and that is this error;

Can't locate object method "dynamic_conditions" via package "Database::Accessor::Driver::Test" at 43_dynamic_conditions.t line 54.
     
and the change was a very easy removal of that 'dynamic_' from the test;

Test::Database::Accessor::Utils::deep_predicate(
    $in_hash->{conditions},     $da->dynamic_conditions(),
--    $dad->dynamic)conditions(), 'dynamic conditions'
++    $dad->conditions(), 'dynamic conditions'
);
     

Virtual Spring Cleaning (part 2 of XX) - in which I implement fun parts of Excel

I don't mind working with Spreadsheets. Much of my work consists of creating Spreadsheets from SQL queries. Sometimes, the resulting spreadsheet should be a pivot table, listing some values across the spreadsheet. For most of my Spreadsheet-generation needs, Querylet is sufficient, but it cannot create pivot tables.

Alan Kay’s critique of the TPF grants program

Alan Kay:

A few principles:

Perl 6 IO TPF Grant: Monthly Report (April, 2017)

This document is the April, 2017 progress report for TPF Standardization, Test Coverage, and Documentation of Perl 6 I/O Routines grant

Timing

As proposed to and approved by the Grant Manager, I've extended the due date for this grant by 1 extra month, in exchange for doing some extra optimization work on IO routines at no extra cost. The new completion date is May 22nd; right after the next Rakudo compiler release.

Communications

I've created and published three notices as part of this grant, informing the users on what is changing and how to best upgrade their code, where needed:

IO Action Plan Progress

Most of the IO Action Plan has been implemented and got shipped in Rakudo's 2017.04.2 release. The remaining items are:

Baby Moose in a Pen

Still stuck in the Accessor.pm in the Moose-pen today.

Since I decided in yesterday's post to make one more round of changes I am a little closeer to getting back to Driver::DBI but not much.

For today's changes I decided to go full out and re-factor a good chunk of the common code between Accessor.pm and any DAD that I might write. Not to bore you with reamls of code pasting you will never read I will give you the over-view.

First action was to strip out the attributes from Database::Accessor::Roles::Driver and Database::Accessor that where the same and put them into a new role 'Database::Accessor::Roles::Common'. My Driver Role is now just a few lines

Soft call operator: ~> (thoughts)

Perl 5 Porters Mailing List Summary: April 11th-16th

Hey everyone,

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

Enjoy!

Alternatives to rand()

I recently added some functionality for random number generation to my modules, which led me on a digression about rand(). This is a short look at some modules for getting random floating point values. A later one will look at random ints and bytes.

Modules for rand()
Module
Algorithm
Stat
Quality
Interval Bits in
output
Auto
Seed
Predictable Speed
CORE::rand
drand48
Bad [0,1) 48 OK Yes 29000 k/s
Math::Random::MTwist
MT XS
OK [0,1) 53 OK Yes 14000 k/s
ntheory
ChaCha20 XS
Good [0,1) 53-113 Full No 12000 k/s
Math::Prime::Util::GMP
ISAAC XS
Good [0,1) 53-64 Good No 14000 k/s
Crypt::PRNG
Fortuna XS
Good [0,1) 53 Good No 700 k/s
Math::Random::MT::Auto
MT XS
OK [0,1) 52 Full Yes 5000 k/s
Math::Random::MT
MT XS
OK [0,1) 32 rand() Yes 2200 k/s
Math::Random::Secure
Math::Random::ISAAC
Good [0,1) 32 Full No 460 k/s
Math::Random::ISAAC
ISAAC XS or PP
Good [0,1] 32 None No 5700 k/s
480 k/s
Math::Random::Xorshift
Xorshift XS
OK [0,1] 32 Time Yes 16000 k/s

Baby Moose almost ready

Test case clean up day today in the Moose-Pen

All those changes I introduced in my last post did quite a job in mucking up my test suite as the latest run results show;

Files=27, Tests=328, 39 wallclock secs ( 0.24 usr  0.06 sys + 36.90 cusr  1.92 csys = 39.12 CPU)
Result: FAIL
Failed 9/27 test programs. 37/328 subtests failed.
The first thing I noticed was not a fail in a test but this warning;

Use of uninitialized value in string eq at …/lib/Database/Accessor.pm line 37.
coming up all over the place, I should of caught earlier but that is why we run tests. A little change in my 'around BUILDARGS' sub;

The Perl Toolchain Summit Project List

The Perl Toolchain Summit (PTS) is the annual event where we assemble the people who are actively working on the Perl toolchain, and give them 4 days to work together. In this blog post, we'll look at how we decide what everyone will work on, and give you a chance to make suggestions.

This blog post is brought to you by Perl Jobs by Perl Careers, which as well as helping Perl programmers find jobs, supports a number of community events, including the QA Hackathon last year.

Autoload::AUTOCAN - Autoloading the easy way

Autoload can be a very powerful tool in Perl, though often you should first consider if there's a better way; Autoload is not necessarily the best solution for cases where you just need to generate many methods by name, and definitely is not the best solution for "wrapping" static methods. But if your use-case does necessitate methods created on the fly, I have released Autoload::AUTOCAN to make this easier to get right.

Trials and troubles with changing @INC

With the upcoming 5.26 release series of Perl, there's a breaking change that's part of the release. The current directory, '.', is being removed from @INC. It's a good thing, it deals with a bunch of potential security problems and has been discussed more thoroughly elsewhere http://www.nntp.perl.org/group/perl.perl5.porters/2017/03/msg243763.html and http://www.nntp.perl.org/group/perl.perl5.porters/2017/03/msg243722.html

This means that a number of common patterns in many perl scripts, particularly tests, no longer work the way that they did in the past.

Baby Moose Promise

It is keeping promises day here in the Moose-pen

Keeping in step with yesterday's post I am continuing with my code-review of Accessor.pm. It was suggested that I explain a little more on my reasons for doing most of the validation on the Accessor.pm side rater than the DAD side so here we go.

As today’s title suggests I want to make a promise to the DAD from the Accessor.pm that all the attributes that I have passed down to it are ready to go into a the requested CRUD query, so only a minimal amount of extra Database::Accessor::Driver logic is required.

What this mean is that I will have to carefully explain to potential users that the Update and Create methods only work with the initial set of 'Elements' and only with elements that have the same View. I have already did this one in yesterday's post.

Virtual Spring Cleaning Interlude: A herd of yaks, all waiting to be shaved

In my long-term quest to host all of my data on my systems, one of the major points is to replace the note-taking app Google Keep with something that allows me to take my notes back to me. I've looked at various open-source apps for taking and synchronizing notes, but they either feel like overdesigned monsters that don't fit my workflow (Laverna) or don't have good synchronization from mobile phone to the server.

Sydney Perl Mongers: April Meeting

You are invited to join us for this months Sydney PM meeting. We are hosted for the fist time by BarNet and we are glad and grateful for their invitation.

Everyone with an interest is welcome regardless of your experience with Perl and although we appreciate people RSVP'ing on Meetup, there is no need. Feel free to show up (and bring a friend) if you can make it.

There will be two speakers.

Lloyd will be speaking on his config management system, written in perl6

Brendan will be speaking about HashiCorp's Vault software, and how you can make use of it in your systems

When? Tuesday, April 18, 2017 6:00 PM

Where? BarNet ( Technology Dispute Centre ) 7/155 King Street, Sydney (St James Station is probably closest)


Find us on Meetup.com or Facebook

MVC::Neaf - Not Even A (Web Application) Framework

Hello everyone, today I'd like to present Neaf [ni:f], a web tool that tries hard to stay out of the way. Initially it was started for my own education. However, the result may be worth looking at even for users of serious stuff like Mojo, Dancer, and Kelp.

The main usage scenarios are perhaps sharing an existing module or script via the network, as well as supplementary tools and admin interfaces.

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.