Remorseful Moose

If back-paddle postette day here in the Moose-Pen

My great re-factoing did not really work as well as expected. I has a suspicion, when I started working on the re-factoring, that I would have trouble with the 'parenthesis' check. I though the problem would crop us when adding two or more conditions on separate 'adds' where I open the parenthesis on the fist on and close it on the last.

Fortunately I had a test case, '43_dynamic_conditions.t ', that tests this situation exactly;

RPerl at YAPC Europe - Day 2

On the second day of my newbie adventures in Glasgow, I had the pleasure to talk to Larry Wall, who stopped by our table and told me about the time he was a booth babe himself. That conference is really full of surprises.

We used this day to deliver new fliers, give more information about RPerl, and especially the different possibilities for programmers to try it, through Cloudforfree.org, rperl.org and our new packages.rperl.org installation files. Mahrez is working from day one with Will Braswell to get us a demo on a VM, and they’re making good progress.

Thank you Chris Jack for the photo below, I'm officially part of the TPC photo album! This is when Wendy convinced me to give a thirty-second commercial during the Lightning Talks. I presented our booth, the compiler, and told everyone to come have a look. I look like I know what I'm talking about, right? Well... my heart was racing, I was mostly scared of saying something stupid.. Very intense 30 seconds, glad I did it!

yapc2.jpg

Daily CPAN uploads: Mission continued...

I still remember the blog A year of CPAN uploads by Barbie published on 22nd March 2015. In his blog, he mentioned my name and my intention to break his record. At that point in time, I was at 150 odd days old. I was no where near the Barbie's record number. However I had made up my mind, no matter what I will go past his magic number. One day not only I crossed the magic number 370 but I reached 1000 days mark.

All-time Top 10(sourced: neilb.org)

On 23rd July 2017, I blogged about it. In response to my blog, I received appreciation from many greats like Larry Wall, Dave Cross, Shlomi Fish, Lee Johnson and Steve Bertnand. One comment by Larry Wall is still fresh to my mind as below:

msys2 is good environment to use Mojolicious in Windows

msys2 is good environment to use Mojolicious in Windows.

I write the entry to install msys2 and perl and Mojolicious.

msys2 installation to Windows(Japanese, use google translation)

Just Another Moose Day

Its test day again here in the Moose-pen

Today I am working of a separate branch 'trigger_dynamic' as I am trying out a large re-factotring of the code. The switch to the branch and then a pull I have

4 files changed, 341 insertions(+), 67 deletions(-)
so some major changes. On my first rung to the test cases I got fairly poor results with 14 test cases failing. The majority of fails were tests I invalidated by my code changes from the past few days;

 1/12 Gather view_element Price in not in the elements array! Only elements from that array can be added …

# Looks like your test exited with 2 just after 11.

How lazy am I?

Occasionally I find myself running some random Perl script from a Github gist or dealing with some code from a colleague that doesn't have proper dependency management (yet). It's a bit painful to

  • run the script
  • wait for it to die on a failed dependency
  • install the missing dependency
  • re-run the script
  • wait for it to die
  • install the missing dependency
  • rinse
  • lather
  • repeat

I've tried to solve this problem via lazy

Read the full post.

"Marpa and combinator parsing 2"

My new blog post is "Marpa and combinator parsing 2" . In it, I continue to talk about how to combine Earley and combinator parsing to get the best of both.

This time, I have a trial implementation. I take on parsing of Haskell's significant whitespace, implementing all the examples in the 2010 Language Report and the classic "Gentle Introduction". By the time I'm done this amounts to a substantial subset of Haskell's syntax.

Could anybody explain this code?

Hi,

I have a shell script and it looks like this:

#!/bin/bash
for i in *dat.gz do gunzip $i echo uniprot_sprot_archaea.dat | perl -slane '$a=(split /\_/, $_)[2]; $a=~/(\w+).dat/; $b=$1; print "perl screen_complete_proteome_from_uniprot_division.pl \$i >> uniprot_".$b.".fasta"' -- -i=$i done

I don't know coding. But I need to understand this perl commands. From echo to end of the command, I don't understand. Could someone please explain them?

Thanks a ton.

Moose Down the API hole

Still API day here in the Moose-Pen.

The first thing I did today was save all my work to github and create a new branch so I can work on that trigger idea I had yesterday.

This time out no need to write a test first my present test cases should be all that I need so I can dive right into the code today;

The fist code change I made was to comment out all the code that relates to the '' call for dynamic attributes, not need for that here. Next I changed the name of the trigger function;

-- sub _check_elements_present {
++ sub _check_dynamic {
Then I added this line to all four dynamic attributes

 trigger   => \&_check_dynamic

Exploring Type::Tiny Part 5: match_on_type

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 fifth in a series of posts showing other things you can use Type::Tiny for. This article along with the earlier ones in the series can be found on my blog and in the Cool Uses for Perl section of PerlMonks.

It's pretty common to do things like this:

My First Perl Conference

What a dull title. Anyway. This was intended to just be an account of my experience at TPCiG, but quickly developed into an tl;dr life story. Sorry about that, everyone. Sorry.

I had dreamed of attending YAPC/TPC ever since I discovered what an amazing community surrounded Perl. This year, I realised that dream.

The Perl Conference in Glasgow - Report

To begin with "The Perl Conference in Glasgow" was my first ever YAPC. Prior to this, I was only regular to London Perl Workshop. It was the gang at German Perl Workshop that I attended earlier encouraged me to come to YAPC as well. I think it was worth attending
the event. To make it even more fun, I brought my young family with me to explore the city as well.

Welcome to Moose Re-Factory

Its re-factor day here in the Moose-Pen

The first thing I got to today was complete the test case '40_dynamic_not_present.t' for all four dynamic attributes. No need to dump the many lines of very similar hash-refs here but here is the latest results from the case above;

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.

Never Ending API Moose

Still in API land here in the Moose-Pen

Yesterday I left off with a working API change that stopped users from entering a 'view_elements' on a dynamic 'gather/order by' that was not in the 'elements' array of the Database::Accessor instance. Now that is nice but it also got me thinking what about on some of the other 'dynamic' add, so I added this;

RPerl at YAPC Europe - Day 1

This is a first. First Perl Conference for me, and first time the RPerl compiler is represented at YAPC, also known as The Perl Conference. We had a table, fliers, chocolates, and a computer! Go team RPerl!!!

You may ask : what the heck is RPerl? Very good question, but please watch your tongue. It’s the Perl compiler, for Perl 5 software (and Perl 6 soon), and it’s the work of Will Braswell, long-time member of the Perl community. Its goal is to make your code run faster. Way faster. And it does.

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.

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.