Code comes and Code goes but the App goes on!

Well how about some coding today?

Lets look at the first little bits from my last post the 'View' and 'Element' and I am going to focus in on using it with SQL in this post. So we have this;

Perl QA Hackathon 2016: Configure

I write this from sunny Rugby, England, where I’m attending the QA Hackathon 2016. It’s always great to spend time with people who are active in the Perl community, not just socialising, but working on the software we all depend on.

Half time at the Perl QA Hackathon 2016

Two days down, two to go.

The Perl QA Hackathon for 2016 is being held in Rugby. We are now half way though. This is the first year in quite a few when I haven't come to the event with Devel::Cover failing tests against the imminent new Perl release, and this has given me a little more time to concentrate on other matters.

A large part of the value of the QA hackathon is in the discussions that take place when people can sit together and thrash something out, or bounce ideas off each other. I have been able have a number of interesting discussions, some relating to things I brought with me, and others arising because of ideas others have had.

Test2/Test::Builder Update from the QAH

Yesterday was the first day of the QA Hackathon in Rugby, UK. The first item on the agenda was a discussion about Test2 going stable. This blog post will cover the important points of that discussion.

For the impatient, here is a summary:

  • Test2 is going to be part of the Test-Simple dist. It will not be a standalone dist.
  • The next stable Test-Simple release will include Test2 and a Test::Builder that runs on Test2.
  • The release date for the next stable Test-Simple, which includes Test2, will be no sooner than Friday May 6'th, which is our planned release date.

The QAH discussion focused around a single question: "What is the best path forward for Test::Builder when we consider both end-users and test tool authors?"

And the Plot Thickens

Yesterday I looked at maybe abstracting my API to make it common across a number of Data Accessor Derivers such as SQL and MongoDB and that got me thinking of how I am going to put all the pieces together?

Now what I would like is the end user to be able to something like this
 
my $address_da = SomeDa::Address()->new();
my $address_hash = {};
my $dbh = DBI->connect(“DBD::aything”,$uid,$ps);
 $address_da->retrieve($dbh,$address_hash,$options);
print $address->{steet}...

It's Earth Day - time to clean up CPAN!

Happy Earth Day 2016!

Fortuitiously, Earth Day this year falls during the QA Hackathon in Rugby, UK. Earth Day is a great time to clean up old distributions in one's CPAN directory, to save storage space on the countless CPAN mirrors and generally reduce clutter. To do this, I run my cleanup script, available here.

Virtual Spring Cleaning (part 6 of X) wherein I expose my bad taste for all to see

Part of my motivation for the virtual spring cleaning is that I have many slow-cooking pet projects in which I try out new modules or features that have not yet passed the test of time, at least at the moment of creation. Usually, I only work on these projects when I have both, inspiration and downtime, usually right after Perl workshops. One example of such a project is a prototype of a rogue-like game named App::StarTraders (unpublished) which is intended to become a clone of Elite.

Announce: Rakudo Perl 6 compiler, Release #98 (2016.04)

Announce: Rakudo Perl 6 compiler, Release #98 (2016.04)

On behalf of the Rakudo development team, I'm very happy to announce the
April 2016 release of Rakudo Perl 6 #98. Rakudo is an implementation of
Perl 6 on the Moar Virtual Machine[^1].

This release implements the 6.c version of the Perl 6 specifications.
It includes bugfixes and optimizations on top of
the 2015.12 release of Rakudo, but no new features.

Upcoming releases in 2016 will include new functionality that is not
part of the 6.c specification, available with a lexically scoped
pragma. Our goal is to insure that anything that is tested as part of the
6.c specification will continue to work unchanged. There may be incremental
spec releases this year as well.

The tarball for this release is available from http://rakudo.org/downloads/rakudo/.

Please note: This announcement is not for the Rakudo Star
distribution[^2] --- it's announcing a new release of the compiler
only. For the latest Rakudo Star release, see
http://rakudo.org/downloads/star/.

Back in API again

Now onto another problem!

With present Perl version of my Data Accessor I had only a very small set of common methods, the CRUD ones and add_dynamic_criterion while the DA::SQL brought into the API many methods and attributes that are SQL specific.

  • Table
  • Fields
  • Group_by
  • Where
  • Having
  • ...

So if one of my evil plans is to make DA work across a number of differing DB platforms it would not be a good thing if for each of the accessor drivers would have its own API. Could also see the case where drivers for the same sort of DB say Mongo and Clusterpoint could have completely different APIs.

This would be no problem for the end user (remember her out on the pointy end writing up REST ful web services and desktop apps) as they would just have that nice little CRUD API to play with.

CV-Library is sponsoring the QA Hackathon

We're delighted to announce that CV-Library is supporting the QA Hackthon for the first time, as a gold sponsor.

CV-Library is the UK's leading independent job site, attracting over 3.8 million unique job hunters every month and holding the nation's largest database of over 10 million CVs.

Another release of Net::SSH2 is comming... test it, please!

I have been working on a new release of Net::SSH2 that has undergone mayor, mostly internal, changes.

There are not too many new features. The aim has been to simplify the code, made it reliable and improve the overall consistency and behavior of the module.

Most important changes are as follows:

  • Typemaps are used systematically to convert between Perl and C types:

    In previous versions of the library, inputs and specially output values were frequently handled by custom code with every method doing similar things in slightly different ways.

    Now, most of that code has been replaced by typemaps, resulting on a consistent and much saner handling of input and output values.

  • Only data in the 'latin1' range is now accepted by Net::SSH2 methods. Previous versions would just get Perl internal representation of the passed data without considering its encoding and push it through libssh2.

That caused erratic behavior, as that encoding depends on the kind of data, but also on its history and even latin1 data is commonly encoded internally as utf8.

Current subroutine signatures implementation contains two features which purposes are different

I want to write about subroutine signatures more.

This is previous topic.

I think subroutine signatures don't need arguments count checking

Current subroutine signatures contains tow difference features

  1. Syntax suger of my ($x, $y) = @_
  2. Arguments count checking

My opinion is that this two features has different purpose. First is for syntax sugar. Second is for aruments count checking.
I think it is good to separate two features because each feature has different purpose.

I don't hope "perl subroutine + (syntax suger + argument count checking)".

I hope "perl subroutine + syntax sugar + argument count checking".

It is not good that different purpose features is mixed into one feature.

I want syntax sugar and I don't need argument count checking in my program. This is natural for me.
but there are people who want also argument count checking.

We should not assume all people want arumengt count checking.

Syntax sugar is the feature most poeple wait, but argument count checking is not.

It is safe implementaion in the Perl future that any perfomance cost don't force to user

And the word for Today is Abstract

Well lets play with some code today.

So I spent a little time having a look at MooseX::AbstractMethod and at first glance it look promising as is suppose to allow on to create an Abstract Class. So having a little time I created a little test code and of course a test file.

The code is simple parent Abstract class that has one sub and one required or abstract sub and then a child class that extends that parent but does not have the required sub so it should fail. This give me a simple four test plan;

  1. use the extended child class
  2. fail to instantiate the child class
  3. use the abstract class
  4. fail to instantiate the abstract class

So in my first run with MooseX::AbstractMethod I get

ok 1 - use DA_AM::Memory;
ok 2 - DA_AM::Memory dies requires _execute sub
ok 3 - use DA_AM;
ok 4 - Directly opened DA

Perl 5 Porters Mailing List Summary: April 5th-13th

Hey everyone,

Following is the p5p (Perl 5 Porters) mailing list summary for April 5th week. Enjoy!

All our other sponsors for the QA Hackathon

The QA Hackathon (QAH) will be kicking off on Thursday morning this week, starting 4 days of intensive work on the CPAN toolchain, test frameworks, and other parts of the CPAN ecosystem. The participants will be gathering from all over the world on the Wednesday evening.

The QAH wouldn't be possible without the support of all of our generous sponsors. In this post we acknowledge the silver, bronze, and individual sponsors. Many of the Perl hackers taking part wouldn't be able to attend without your support. On behalf of the organisers and all attendees, thank you!

Git::MoreHooks::CheckIndent - Force accurate indentation in Git commits

Git::MoreHooks::CheckIndent Released

Git::MoreHooks::CheckIndent is a plugin for the Git::Hooks framework. It checks that indentation is correct in the committed files. Please read Git::Hooks documentation on how to use plugins.

Stop the press! Git Already has …

Yes, it does indeed! The not-so-well-known Git configuration parameter core.whitespace is quite versatile in this respect. It supports different values, even tabwidth to tell how many space characters an indentation (tab) must be equal to.

core.whitespace : A comma separated list of common whitespace problems to notice. git diff will use color.diff.whitespace to highlight them, and git apply --whitespace=error will consider them as errors. You can use prefix ”-” to disable any of them (e.g. -trailing-space):

Pretty Patterns All in a Row

Now that I have things mostly sorted out let's actually do some code or at least some pseudo-code on how I going to make it work.

I could go the pure Perl route and do the same sort of thing DBI does, an interface then drivers under it following this design pattern

pic1.png

I have cloned out and customized the DBI code and pattern in other applications and it really works well when you want the common glue on-top approach.

One thing I want to avoid is API deviation or sub bloat as I like to call it. It is an all to common occurrence with this design pattern. I am guilty of it myself when I added Scrollable Cursors into DBD::Oracle. Nothing in the DBI spec about these and I recall a little note from Tim asking to explain why I didn't create a generic DBI version before I added into DBD::Oracle.

Veure's Test Suite

We're still hacking away on the Veure MMORPG and things are moving forward nicely, but I thought some folks would like to hear more about our development process. This post is about our test suite. I'd love to hear how it compares to yours.

Here's the full output:

$ prove -l t
t/001sanity.t ... ok   
t/perlcritic.t .. ok     
t/sqitch.t ...... ok     
t/tcm.t ......... ok       
All tests successful.
Files=4, Tests=740, 654 wallclock secs ( 1.57 usr  0.20 sys + 742.40 cusr 15.79 csys = 759.96 CPU)
Result: PASS

Let's break that down so you can see what we've set up. You'll note that what we've built strongly follows my Zen of Application Test Suites recommendations.

A Date with CPAN, Part 8: Curse You, Daylight Savings Time!

[This is a post in my latest long-ass series.  You may want to begin at the beginning.  I do not promise that the next post in the series will be next week.  Just that I will eventually finish it, someday.  Unless I get hit by a bus.

IMPORTANT NOTE!  When I provide you links to code on GitHub, I’m giving you links to particular commits.  This allows me to show you the code as it was at the time the blog post was written and insures that the code references will make sense in the context of this post.  Just be aware that the latest version of the code may be very different.]

Last time I talked briefly about the raft of failures that CPAN Testers threw up for me to look at.  I mentioned that there were roughly 3 groups of failures, and that one of them was bigger than the other two.  I even gave a hint as to what it was in one of my examples:

Virtual Spring Cleaning (part 5 of X) in which I release Backblaze::B2(::Async)

I'm a sucker for early access to free APIs. So I quickly went forward when Backblaze opened up access to their B2 storage API, and implemented a client for it, Backblaze::B2. I feel a bit guilty for releasing a module without having a use case for it myself, but instead of letting it rot on my filesystem, I'm putting it out for others to use.

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.