While updating Set::Jaccard::SimilarityCoefficient to v1.6.1, I realized that I should install it on a clean, clean system so I find all missing prerequisites (not just the ones I already knew about). So where do I get a clean, clean system? Aha - a minimal Docker container (like the plain-vanilla Ubuntu 16.04 LTS) would be just the ticket as I am using an Ubuntu 16.04 LTS laptop. As an example, here are the steps I ran through:
Run: "sudo docker run -v /home/mark/src/perllib/Set-Jaccard-SimilarityCoefficient/Set-Jaccard-SimilarityCoefficient-1.6.0:/Set-Jaccard-SimilarityCoefficient-1.6.0 -it ubuntu".
Because this is a plain-vanilla Ubuntu, I need to install some development tools (including missing pieces of Perl) by running: "apt-get update; apt-get install gcc make perl-modules-5.22". Followed by: "cpan -i App::cpanminus"
(If anyone points out in the comments how I could use the direct "curl" install for "cpanm" rather than using "cpan", I will update these directions.)
This article covers scalar styles in YAML 1.1 and
1.2. It mostly works the same in both
versions.
YAML is a data serialization language, and one design goal was that it's
human friendly. It should be easy to read and edit, even if that makes parsing
it harder.
Let's look at strings, specifically.
If you look at JSON, you have only one style to encode strings, and that's
the double quoted style which doesn't allow literal linebreaks.
YAML files are used for many different purposes, and there are many types of
strings, especially multiline strings. For each use case, you can choose the
type of quoting (or no quoting) that makes the string readable and easy to edit.
This gives you lots of freedom, but you also have to learn using it to avoid
mistakes.
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;
Somebody once said, that the power of a programming language is not what it lets you do, but what it lets you do easily. Might be Larry himself who said it, not sure, but I heard it at the London Perl Workshop. I started learning Perl from an old second hand book I found in a charity shop a few years ago. I can't say I am any good at it. While previously I could find lots of resources available, these are increasingly harder to find, more outdated, and less able to address modern use cases. Some folk even suggest it is terminal decline. It would be a pity. It is a powerful language, and using it for me has given me a daily discovery for some feature that I didn't know, and exposed me to a large number of clever folk who can bring a different angle to a problem you have struggling with. To my mind it reflects the versatility of a language that has more than one way to to anything.
Usually people deal with YAML files from trusted sources. But maybe you want
to load input from a Website as YAML. This can lead to problems, and this
article will talk about what you can do to make the loading safe.
The problems I'll talk about are loading objects, cyclic references and general parsing
problems.
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
Recently, I came across a somewhat-frantic comment on StackOverflow that describes a 2017.01 change to the type of return value of .sort:
"you just can't be sure what ~~ returns" Ouch. […] .list the result of a
sort is presumably an appropriate work around. But, still, ouch. I don't know
of a blog post or whatever that explains how P6 approaches changes to the
language; and to roast; and to Rakudo. Perhaps someone will write one that also
explains how this aspect of 2017.01 was conceived, considered and applied;
what was right about the change; what was wrong; etc.
Today, I decided to answer that call to write a blog post and reply to all of the
questions posed in the comment, as well as explain how it's possible that such an "ouch"
change made it in.
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!
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.
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 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.
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.
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.
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.
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;