The Moose Case

Its get off my case day here in the Moose-Pen

Well I am getting close to running out of things to add into Driver ::DBI as I have all the operators covered, functions, expressions, elements, etc etc so I do see and end in sight maybe I won't get a year of blog posts in after all??

Today I am going to try and tackle on of the much abused SQL commands the 'CASE' statement. The question is where to test this one as it can appear anywhere a predicate can so in a 'sort/order by', 'element/field', even a 'link/join'. I was thinking the best spot for it would be back in 32_where_operators.t but the most common form of case I have seen is in SQL like this

Carp::Always comeback

originally published in PerlMonks

Carp::Always is a minimalist debugging aid, often used from the command line with usage patterns like

perl -MCarp::Always script.pl

or

PERL5OPT=-MCarp::Always script.pl

Using Carp::Always decorates the output of each warn() and die() with stacktraces. For example,

$ perl -MCarp::Always -e 'sub f { die "arghh" }; sub g { f }; g;'
arghh at -e line 1
        main::f() called at -e line 1
        main::g() called at -e line 1

This is meant to help finding where issues actually coming from at the code being inspected.

Exploring Type::Tiny Part 4: Using Types::Standard as a Ref::Util-Like Library

Type::Tiny is probably best known as a way of having Moose-like type constraints in Moo, but it can be used for so much more. This is the third in a series of posts showing other things you can use Type::Tiny for. This article along with part 1, part 2, and part 3 can be found on my blog and in the Cool Uses for Perl section of PerlMonks.

Even if you read the documentation of Types::Standard pretty thoroughly, you'd probably miss that you can do things like this:

   use Types::Standard qw(is_ArrayRef is_HashRef);
   
   if (is_ArrayRef($var)) {
      ...;
   }
   elsif (is_HashRef($var)) {
      ...;
   }

It is documented that Types::Standard exports functions called ArrayRef and HashRef, which are constant-like functions returning Moose/Moo-compatible type constraint objects, but where did these is_ArrayRef and is_HashRef functions come from?

The 100 Day Plan: The Update on Perl 6.d Preparations

Read this article on Rakudo.Party

Today's is a milestone of sorts: it's 100 days before the first scheduled Rakudo Perl 6 compiler release that will occur after this year's festival of Diwali. As some know, Diwali is also the code name for the next major release of the Perl 6 language, version 6.d, which means there's a high chance that in about 100 days you'll be able to install and use that.

I figured, I'd write a update on the subject.

When?

The oft-asked questions is when is 6.d going to be released. The plan is to have the 6.d specification good and ready to release on this year's Diwali, which is November 6–7.

Validated Moose Collective

Its little validation day here in the Moose-Pen

Since I didn't put any new code in yesterday just take out I figure I might as well do that little validation I talked about in my last post namely you can only have one aggregate function inside another aggregate. As usual I start with a test;

The Perl Conference - what is new?

Before I say anything, I must say, I am who I am today because of the wonderful Perl Community. I have been attending London Perl Workshop since 2012. Ever since I have seen plenty of improvements as far as the quality of talks, venue management and other activities.

Exploring Type::Tiny Part 3: Using Type::Tie

Type::Tiny is probably best known as a way of having Moose-like type constraints in Moo, but it can be used for so much more. This is the third in a series of posts showing other things you can use Type::Tiny for. This article along with part 1 and part 2 can be found on my blog and in the Cool Uses for Perl section of PerlMonks.

This works:

   use Types::Standard qw(Int);
   
   tie(my @numbers, Int);
   
   push @numbers, 1, 2, 3;     # ok
   push @numbers, "four";      # dies

Well, if you try it, you may find it complains about not being able to load Type::Tie.

Type::Tie is an add-on for Type::Tiny distributed separately. It's an optional dependency, so if you want to use this feature, you'll need to make sure it's installed.

Introducing: Perl 6 Marketing Assets Web App

Read this article on Rakudo.Party

As some of you already may have known from occasional tweets and mentions in the Weekly, we have a perl6/marketing repo that contains some flyers and brochures for Perl 6.

With one of the Perl 6 coredevs making a living as a Multi-Media Designer, the repo has seen a steady stream of new pieces designed, when inspiration strikes, or when someone makes a request. There are now several pieces available, but GitHub isn't the greatest interface for this sort of stuff.

Introducing marketing.perl6.org

To make it easier to see what we have available, we made a front-end for our marketing repo, that lets you browse all of the assets. It's hosted at marketing.perl6.org

The Assets

3 Weeks left to sign up for the Perl 6 Tutorial course at TPC in Glasgow

Be ready for all the new Perl 6 content at the Glasgow Perl Conference, join me at the day-long Perl 6 Tutorial session on Monday the 13th, get trained before the talks start!

Comparative Analysis - Report (July 2018)

July has been little stressful for me. Why? For the first time ever, I struggled to find issues to help with PR. Partly because the "Kwalitee" link was broken for first 2 weeks. Even when it became active, there was hardly anything for me to work on. Is it because CPAN authors are becoming smarter these days? At one point, I thought I am going miss the target of average 1 PR a day. Luckily the second half of the month was really productive. Apart from PR, there is another thing that kept me on my toes, which is daily uploads to CPAN. Having done this for over 1000 days without break in the past, I am finding it hard to carry on currently at 345 days. However I have enough things to carry on for at least another 2 weeks. I would be happy if I could complete 1 year without break.

Lets do comparative analysis on the listed points:

  • Pull Request
  • Git Commits
  • Pull Request Challenge
  • Perl Blog
  • PerlWeekly Newsletter
  • Adopt CPAN Module

The Future of Perl 5

No, I'm not speculating about where Perl 5 is going, but I was imagining a few minor (hah!) features that would make life much simpler.

In fact, I was imagining a minimalist OO system with optional typing.

The following is a simple LRU cache in Moose:

perldoc.pl now powered by Elasticsearch

perldoc.pl, the alternative perldoc browser, originally leveraged PostgreSQL full text searching. But as I encountered new issues as well as ones I encountered before, I started working to make the search backend swappable.

There are now three search backends available: PostgreSQL, Elasticsearch, and SQLite using the FTS5 extension. While SQLite is of course the simplest to deploy as it requires no setup, I decided against using it for the main perldoc.pl instance as it does not support skipping stopwords, but the backend is now provided so basic search features can be added to a deployment without setting up a database. Additionally, the application can be deployed without any search backend configured, which will just remove the search box and allow viewing of all pages normally.

Iridium Flare End-Of-Life II

Late last year, I blogged about my plans for handling the Iridium flare functionality in the Astro-satpass distribution given that these satellites are being taken out of service in favor of a new design that does not flare.

For some time now, most of the updates to Astro-satpass have been to maintain the canned Iridium status table. This seemed wrong to me, so I have pulled Astro::Coord::ECI::TLE::Iridium out into its own distribution. This is currently available on CPAN. The first distribution of Astro-satpass without this module will be version 0.100, which should be out in a few days.

For people who use one of the CPAN clients, this should be a non-event. I know of no downstream packagers except for ActiveState and MacPorts. Last I looked, ActiveState was just automatically picking up all of CPAN (or not, as the case may be), though if there was no PPM package a CPAN client would work. I have filed a bug with MacPorts describing what is going on. We will see what happens.

opensource.com: Confessions of a recovering Perl hacker

"I always insisted on commenting my Perl. I never got to the very end of the Camel Book. Not in one reading, anyway. I never experimented with the darker side-effects; three or four separate operations per line was always enough for me. Over time, as my responsibilities moved more to programming, I cut back on the sysadmin tasks. Of course, that didn't stop the Perl use completely--it's amazing how often you can find an excuse to automate a task and how often Perl is the answer. But it reduced my Perl to manageable levels, levels that didn't affect my day-to-day functioning."

Read on: https://opensource.com/article/18/7/confessions-recovering-perl-hacker

Release SPVM 0.0359

Release SPVM 0.0359

SPVM - Fast array and numeric operation, and provide easy way to C/C++ Binding

0.0359 2018-07-16
  - SPVM::CORE become done native compile
  - add join function
  - fix const assignment bug
  - support list syntax
      my $nums = [(1, 2), (3, 4), (5, 6)];
  - object have body field at offset 0. This will fix alignment bugs.

New githook-perltidy feature: README from POD

It has been six years since I last mentioned anything about githook-perltidy, a tool for the automatic tidying of Perl and POD files during a Git commit. I rely on it every day, and I still make minor improvements to it, so I thought it worth a quick shout out to others who haven't heard about it or upgraded for a while.

Some CPAN distribution authoring tools come with automatic README generation support. At least in the case of Module::Install::ReadmeFromPod and the various Dist::Zilla plugins I've seen, that generation occurs when Makefile.PL is run. For reasons related to my workflow, Git and GitHub, that timing is too late for me. So I've added a README generation feature to githook-perltidy. See the documentation for details.

One final thing to note. This latest round of work on githook-perltidy was triggered by an unrelated minor issue that a user raised. So don't hesitate to let the author of a tool know when you use something, and that you find it sub-optimal. It might just motivate them to do a bunch of work.

Machine learning in Perl: Kyuubi goes to a (Model)Zoo during The Starry Night.

Hello all, this is a fourth blog post in the Machine learning in Perl series, focusing on the AI::MXNet, a Perl interface to Apache MXNet, a modern and powerful machine learning library.

If you're interested in refreshing your memory or just new to the series, please check previous entries over here: 1 2 3

If you're following ML research then you're probably well aware of two most popular libraries out there, Google's TensorFlow and a relative newcomer to the field but rapidly gaining widespread acceptance, Facebook's PyTorch.

The reason why PyTorch has gained so much ground on TensorFlow is in dynamic nature of that library. TensorFlow started as a static graph library (which is easier to optimize) and PyTorch went with dynamically allocated graphs and NumPy (read PDL) style of programming (with a robust GPU support and auto-differentiation of the gradients) that is as easy to debug as an ordinary Python's code.

Evozon Perl internship

Our new Perl internship started on the 9th of July, 7 daring new interns took on the challenge of becoming Perl developers. The internship will last for 4 weeks, during which they will get familiar with Perl and all that goes with it.

Perl is one of the pillars of Evozon, the company was founded in 2005 as a Perl and Java shop, expanding to other technologies over the years. After 13 years of Perl development we have plenty of experience and excitement for this language, something we want to share with this new group of interns.

We have one of the largest Perl teams in Europe and we’re proud to say that quite a few of our developers started their career with us, learning about Perl through internships just like this one. Now, they’re passing on the knowledge they’ve accumulated over the years to another round of Perl developers to be.

The internship will have two parts, a theoretical part where the interns will be introduced to the world of Perl by our trainers and a practical part where they will be working on an application built in Mojolicious with DBIx and MySQL, using the microcontroller Raspberry Pi. The microcontroller will have several types of sensors attached and will be able to monitor the temperature and humidity in our office.

Perl6 Readline update

A long time coming, this looks along /usr/lib64 and /lib/x86_64-linux-gnu for existing libreadline.so.* libraries, otherwise assumes v7. I'll add more directories as I find them, and make sure that it looks recursively in /lib if all else fails as part of the next release. I'll be adding comments to the GitHub issues shortly, as it should address most of the existing problems.

"Undershoot: parsing theory in 1965"

The newest blog post on the Ocean of Awareness blog is "Undershoot: parsing theory in 1965". It revisits the question "Why, despite all evidence, is parsing considered solved?", this time supplying some more background.

If the state of the art of computer parsing is taken as anything close to its ultimate solution, then it is a case of "human exceptionalism" -- the human brain has some power that makes it much better at parsing than computers can be. It is very unlikely resorting to human exceptionalism as an explanation would be accepted for any other problem in computer science. Why is it accepted for parsing theory?

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is hosted by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.