Moose Does Case

Finally its Driver::DBI Case day in the Moose-Pen

Has it really been since August 15th that I have been mucking about with Case? I guess after almost two weeks I am glad to finally get into the DBI::Driver part of things. As usual to start (well recap really) lets look at this SQL;

SELECT ProductName,
       CASE WHEN Price < 10 THEN 'under 10$'
            WHEN Price >=10 AND Price <= 30 THEN '10~30'
            WHEN Price >30 and Price <= 100 THEN '30~100'
            ELSE 'Over 100' END AS price_group
  FROM Products
which will translate into this hash ref using my Database::Accessor model language;

Perl Toolchain Summit 2018: Oslo, Norway

Every year we bring together the lead developers of the Perl and CPAN toolchain! This event was previously known as the QA Hackathon, but in 2016 it became the Perl Toolchain Summit (PTS) to more accurately reflect the scope and purpose.

This is an event where pressing issues around Perl’s toolchain, CPAN, testing infrastructure and much more are hacked on, fixed and improved, and where important issues are discussed and decided on. The focus is the continued support and development of the tools used every day by individuals, organisations, and companies that rely on Perl in Production.

Many improvements in the CPAN ecosystem can trace their roots to this event, including Test2 improvements, the “River of CPAN” analogy, numerous MetaCPAN additions, improvements to the Perl Authors Upload Server (PAUSE), policies on how to handle CPAN distribution adoption and takeover, work on the CPAN Testers service, several consensus documents and much, much, much, more!

Lab::Measurement 3.620: More Modern Perl

Lab::Measurement 3.620 was released yesterday.

The most important addition is a new high-level sweep framework written with Moose. Check out the new tutorial Lab::Moose::Sweep::Tutorial!

Comparing with the older Lab::XPRESS framework, the main new feature is support for block data. This is needed when working with instruments like spectrum analyzers or vector network analyzers which return an array of data in each measurement.

Perl in Romania

perl romania.jpg

Perl is a programming language created by Larry Wall in 1987. It gained popularity in the 1990’ and was also referred to as the “duct tape that holds the Internet together”. For esthetic and practical purposes I will be referring to Perl 5 in this article as Perl.

Last December it turned 30, an important milestone for every language, 30 years of Perl, 30 years of people and companies from all over the world using Perl.

And I do mean, all over the world, Perl developers are everywhere, from California to Japan, from the Netherlands to Romania. Actually, the most popular countries are United States, the United Kingdom, Germany, Spain, The Netherlands, Japan. Romania is also on the list, but that’s not the point here, the point is that the Perl bug is in Romania and has been for some time now.

Before diving into the local Perl scene there are a few things that should be pointed out about software development in Romania.

transfagarasan.jpg

Transfagarasan, Romania

IT in Romania


Another Moose Test

Well it why stop a good thing day here in the Moose-Pen

I usually try once a week to do a full regression test on both Database::Accessor and Driver::DBI so I figure I might as well keep that going and have another testing postette again.

Looking at Database::Accessor I see that we had quite a few changes since my last full regression

8 files changed, 579 insertions(+), 158 deletions(-)
but I have been trying to keep up so I am expecting fairly good results. On the first test run I get;

All tests successful.
Files=29, Tests=484, 78 wallclock secs ( 0.22 usr  0.05 sys + 75.39 cusr  1.90 csys = 77.56 CPU)
Result: PASS
so bonus.

Now let's see what sort of sorry shape Deriver::DBI is in.

Videos for London Perl Workshop 2017

The organisers of the London Perl Workshop 2017 are very happy to announce that the videos of the talks are now on YouTube. In the rest of this post we'll give a summary of the videos, with links to each talk.

App-RemoteCommand

Last Friday, kichijojipm was held at Shinjuku, Tokyo, Japan. It is a japanese local Perl Monger group organized by magnoliak. The talks were about not only Perl but also a wide variety of subjects.

I talked about App::RemoteCommand there, which is a simple remote command launcher via SSH, built on top of an excellent module Net::OpenSSH.

Here is the slide. I hope you try it!

Perl 5 Porters Mailing List Summary: February 1st-11th

Hey everyone,

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

Enjoy!

Not Tomorrow for Moose

No!! Still on a case here in the Moose-Pen.

I just started my first test for '22_fields_extended.t' and then I saw one other little point I forgot to take into account. I should add in some validation for my 'Case' class as it is invalid to have a case that has only one condition.

Therefore this test;

Easily back up your Github repositories and/or issues

It's been in the works at the lower-end of my priority list, but after having a bit of a bug-closing weekend, thought I'd tackle getting out an initial release of Github::Backup.

The cloud is a great thing, until the sun evaporates it one way or another. Github, although fantastically reliable, is prone to issues just like any other site on the Internet. I'd go as far to say that even they could be prone to data loss in very rare circumstances.

This distribution, which provides a command-line binary, allows you to quickly and easily back up your repositories and issues to your local machine. The repositories are cloned so all data is retrieved as-is as legitimate Git repos, and the issues are fetched and stored as JSON data. Useful if there was ever a catastrophic issue at Github, or simply for offline perusal of your information.

Finally, a BNF for Perl 5 regexps: The Regexp::Parsertron

See Regexp::Parsertron V 1.00.

Current users of Regexp::Assemble may find something of interest there.

Perl 5 Porters Mailing List Summary: January 10th-31st

Hey everyone,

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

Enjoy!

Maybe Tomorow Moose?

Oh well! Still stuck in DA day here in the Moose-Pen.

Well I still have a little more work to do as I just read that you can have a 'case' in a 'Join/link' as this;

YAML::PP Grant Report January 2018

Hi,

thanks for reading my report. This report will be quite short because I have been busy with other things, and a lot of time went into discussions rather than coding, and I never logged time for discussions.

I have been working on YAML::PP about 10 hours.

See also my previous reports on blogs.perl.org (Aug/Sep, Oct, Nov, Dec )

Call for Tutorial Sessions

Are you an experienced instructor or speaker who would like to offer a course at The Perl Conference this year in Salt Lake City?

Great! We hereby invite you to participate by submitting a Tutorial Session!

We would like to offer the Perl community a selection of courses and tutorials before and after the conference. This is your chance to be a part of that.

Tutorial Sessions can be a half day (3 hours), full day (6 hours) or 2 days in length and will run on Sunday 17th, Thursday 21st, or Friday 22nd of June.

To submit your proposal please complete the following information here: https://goo.gl/forms/WUj0IBwzjZDL0xaf1

Mocking Should Not Require Interfaces

Exploring the ecosystem outside Perl, I have found multiple examples of languages and frameworks that require you to implement your classes as an interface + an underlying engine class when you want to mock that class during testing. This is all fine and dandy if the interface can be used as part of multiple classes. However, if the only reason you have an interface is so you can mock this class during testing, then I would call that a language-runtime smell.

If you are never going to use the interface for anything other than mocking, then you are violating both DRY (Don't Repeat Yourself) and YAGNI (You Ain't Gonna Need It). Using interfaces requires synchronizing method signatures between the interface and its classes, thereby violating DRY. If the interface is only used for mocking that class, your are violating YAGNI. DRY and YAGNI reduce your code complexity, making it easier for you to understand your code later (and you always have to understand your code later).

More Moose Case Tests

It't clean-up test day again here in the Moose-Pen

Well over the past few days I seem to be just about ready to go back to Driver::DBI but I find yet another little thing wrong with my Database::Accessor when playing with my new test Class.

The first thing is to clean up the test case '15_case.t' as it hard 255 fails with;

Can't call method "statement" on unblessed reference at 15_case.t line 281.
That one is really just an update to take into account yesterday's change from a flat array-ref to an array-ref that can contain other array-refs and the final tests now like this;

Next stable DBD::SQLite will be released at the end of February

It's been a year since the last stable DBD::SQLite was released. Actually, it's been a year and a half since the SQLite library bundled in the last stable DBD::SQLite was released by the upstream. A lot have happened there, and some here. It's time for you to test them all against your applications/modules, at last.

DBD::SQLite 1.55_07 (with SQLite 3.22.0) is a release candidate of the next stable DBD::SQLite. It has various query planner improvements, optimizations, performance enhancements, and bug fixes, especially on LEFT JOIN queries, IN and OR operators, and WITHOUT ROWID tables. It also supports "row values", that means now you can write a query like this:

UPDATE foo SET (id, text) = (SELECT id, text FROM bar WHERE id = 1);

Follow the links in http://www.sqlite.org/chronology.html, or each of the following links, to see full details.

Lab::Measurement at DPG Spring Meeting in Berlin

The Lab::Measurement module stack will be featured with a poster at Europe's largest physics conference this year, the DPG Frühjahrstagung (Spring Meeting) of the Condensed Matter Section, Berlin, march 11. - 16. 2018.

So please come by on Monday, March 12, 2018, 15:00–19:00, Poster B, TT 29: Poster Session: Cryogenic Particle Detectors and Cyotechnique.

If you cannot wait until march, please consider the Perl in the Physics Lab presentation at FOSDEM by Andreas K. Hüttel, my supervisor, next weekend!

Rakudo.js update - NFG / unicode collation and role bug fixes

Rakudo.js update - NFG, unicode collation and more bugfixes

Rakudo.js has been in bugfixing mode recently.

Rakudo.js now uses NFG (Normal Grapheme Form) semantics in some places.
This means some string operations treat strings as sequences of graphemes instead of unicode code points. Graphemes are "user-perceived characters" (See http://unicode.org/reports/tr29/). This isn't done everywhere yet but it allows us to pass a bunch of roast tests.
Because JavaScript doesn't use graphemes underneath in it's string implementation like MoarVM does using NFG semantics can be much more expensive.
As such in low level setting code we often want to use the native javascript semantics when they are good enough.
To make that a choice I added a bunch of NFG aware op variants like (nqp::charsnfg) so we can pay the price only when it's necessary.

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.