Perl and Opendata

Thiago Rondon will give a talk at YAPC::NA 2012 described as:

Opendata is the idea that certain data should be freely available to everyone to use and republish as they wish, without restrictions from copyright, patents or other mechanisms of control.

In Brasil, we worked last year with some solutions with opendata, that government can be transparent and make a good comunication with society.

And the result of this work are three websites that use Catalyst, DBIx::Class and a lot modules of CPAN.

One of this websites is “Where does my money go ?” -  http://www.paraondefoiomeudinheiro.com.br/.

Another one, is about where is crime in one state of Brasil, that with a map you can see where it is happy by time. - http://www.ondeacontece.com.br/

At last, one about our representants - http://www.deputando.com.br.

In this talk, I explain how Perl can be a good language to make nice and fast websites with opendata.

[From the YAPC::NA Blog.]

Perl is not a multi-paradigm language

Perl is a dialecting programming language.

A dialecticing language is a super-set of a multi-paradigm language. Lisp is another dialecting language.

Unlike lisp, where everything looks like an s-exp, a Perl dialect will look ridiculously different from Perl.

Officially, I think we can recognize the following dialects of Perl

  • Perl[1-4] : the Perl that everyone hates
  • CPAN perl : a dialect of Perl, which emerged with maintainability, readability and reusability as the core concern. (The changes introduced in Perl5 started the dialecting trend in Perl)
  • Perl5.[10-14+] aka Modern Perl : another dialect of Perl, now recommended for both script writers and cpan users. Modern Perl is that which adhres to the Grammar Nazi.

Any code that passes through Perl::Critic and Perl::Tidy is a safe bet on robustness and clarity, which is an improvement over the earlier dialects.

With a couple of modules you can even write Perl like ruby.

Using BEGIN and END blocks you can write Perl like awk.

My take on Modern Perl

Szagab recently provoked me. On his question "I wonder how to teach "Modern" Perl? http://szabgab.com/how-to-teach-modern-perl.html" I anwered him by pointing to the qore manual.

Modern Perl might be an established term already. As radical modernist (opposed to a radical post-modernist) I still like to use my own vision of a modern perl. Not directly opposing chromatic's modern perl. Just a real modern perl, as an outsider would consider it. Which just happens to be the qore feature set. Everything I would have done to make perl modern would have been what David Nichols already did in qore. Plus channels for IPC.

Qore is basically a modern perl, a rewrite with a modern vision. One can take a perl script, and optionally enhance it with types and background and get a qore speed-up and compile-time safety, but obviously a compatibility problem.

OT: Switching the MySQL replication Master

This is one of those blog posts where I (ab)use blogs.perl.org to document some notes, primarily for myself ...

  • Server A : is the old "Master"
  • Server B : is the new "Master" (a rebuild of A) and for a transition period is replicating from A until it is promoted to the main Master and A can be switched off.
  • Server C : currently replicates from A, however we want to instead move it to replicate from B in advance of replacing A with B.

Utils are Your Friends

Steven Lembark will give a talk at YAPC::NA 2012 described as:

Graham Barr’s Scalar::Utils and List::Utils are proof that long-lived does not have to mean obsolete. The modules provide simple, clean, fast interfaces for managing and querying references, objects, and lists — and have saved us from countless re-invented wheels. 

This updated talk includes using the Utils with 5.10+ features such as smart matching.

[From the YAPC::NA Blog.]

Never mind!

The rewrite was cancelled.

This is in part because of cost, and also because the client involved are, in the long term, including the functionality in their SAP "solution".

I could rant for several megabytes about how this is a silly desicion, but it was made so far above my head I can't even see it from here. Seems like that's always the case when SAP is involved.

So, after spending roughly €20.000 on something it's being scrapped, and some SAP consultant will implement it (sort of, anyway) in their way, and bill €1.000.000. Yep, makes perfect business sense for all involved.

Aaanyway, never mind this blog. It's not relevant.

Can I just say

How cool perldoc.perl.org is? There. I've said it.

Hats off to all involved.

Help Test::Builder 1.5

To keep myself focused on getting a feature complete Test::Builder 1.5 out this month, I've been writing down non-critical tasks rather than doing them myself. Refactorings, documentation and interface fixups. They're helpfully categorized:

  • Easy are things which are easy.
  • Gardening are refactorings and other cleanups.
  • Docs are for documentation.

If you'd like to help, I'd love the help. There's plenty to do for everybody. Our preferred workflow is laid out and pretty easy to follow. There's a design document to give you an overview of what's going on, though it is out of date in places.

BioPerl at YAPC

We’d like to do a BioPerl track at YAPC::NA 2012 this year. We’re looking for contributors willing to give a 20 or 50 minute talk about some aspect of the BioPerl ecosystem. The things people do in BioPerl line up very nicely with our “Perl in the Wild” theme. 

So if you’re a BioPerl  person, please submit a talk. Hopefully we can get enough talks on the subject to set up at least a day-long BioPerl track. 

[From the YAPC::NA Blog.]

Mojocast #4: Stash, Flash, and Sessions

It's Mojocast Monday, kids, which means a brand new Mojocast for your perusing pleasure.

Continuing to demonstrate Mojolicious::Lite, the Mojocasts are moving through Mojolicious basics, so newcomers can get up and running more quickly than ever (And dare I say it, have fun at the same time. *gasp*).

As the screencasts continue, you can bet your sweet ponycorn we'll be covering some of the more cutting-edge features, such as web-sockets and event-driven web apps.

For now, however, we have another installment to make sure those old and new can get started quickly with Perl web development, without a lot of fuss.

Mojocast #4: Stash, Flash, and Sessions

Keep in mind - the shortcuts link to specific times in the screencast, so you can share/bookmark specific topics.

Thank you to @kure_ji_neko and elb0w for agreeing to host the Mojocast video files. We can all feel that much more hip by using HTML5 video instead of flash.

Padre 0.92, the release!

As previously alluded to, Padre 0.92 was nearing completion for distribution.

Well, this is the announcement to say that Padre, the Perl IDE has finally been cut loose to venture into the wild world.

With the run up to 1.0 the next series of Padre releases will be the end result of a lot of refactoring work, mostly done by the ever industrious Adam Kennedy; and more polish and shine to key areas, such as the amazing work done by Ahmad Zawawi with Wx::Scintilla and its incorporation into Padre.

The change list for this release is simply massive, at over 160 lines ( not all of them single line changes, granted ) this is without doubt one of the larger set of changes to go out in a release. Helped somewhat by the rather lengthy development cycle. Typically Padre releases were about 2-4 weeks, but with the significant changes to the internals going on, it was clear that time would be required to get things back into shape.

Let's say no to NO

I'm now converting the videos from this year's YAPC in Riga and a number of them will be published this year (even before Christmas :-).

There's nothing bad if the speaker does not want the video recording to appear online, but I would like to say strict no to any prohibitions I found on the recordings this year (and there were similar bans last year in Pisa). I would not like such talks to appear in the following Perl events.

Double Prime is Hiring!

YAPC::NA 2012 sponsor DoublePrime is hiring. They have eight great Perl-related positions open right now! All three positions are in their New York offices. 

Backend Perl Engineer

We are looking for 4 full-time engineers to join our team. This is a full-time W2 position with a 401k and health benefits. Some roles are available as work-from-home (tele- commute from within the US) and others will be on site in NYC. 

Roles will include: 

  • day-to-day interaction with the our group, client management, and design firms, maintaining and developing websites
  • new application development
  • systems and network administration (solaris, linux, cisco)

Most importantly, a thorough knowledge of OO perl is required. Beyond that, since we are looking for people to fulfill multiple roles, specifics are listed below.

Frontend Javascript Engineer

Introducing Begin::Declare

While working on a module for source code injection, one of my example "macros" was one that allows you to declare and assign to a lexical variable at compile time, without having to write the variable names twice. That concept more or less hijacked the conversation, and after some prodding from p5p to make the interface better, I've used Devel::Declare to add two new keywords to Perl, MY and OUR.

Here is the synopsis from the module:

don't you hate writing:
my ($foo, @bar);
BEGIN {
    ($foo, @bar) = ('fooval', 1 .. 10);
}
when you should be able to write:
MY ($foo, @bar) = ('fooval', 1 .. 10);
just use Begin::Declare; and you can.

The module lifts the computation of the rhs to compile time, as well as the assignment.

https://metacpan.org/module/Begin::Declare

Unicode rant

People these days are saying that you should always decode your utf8 strings, enable utf8 binmode, etc.
This is not true.

I live in Russia, so half of strings I deal with contain cyrillic.
99% of the time they are not decoded.
And you know what, it's fine.

Here is the problem with decoded strings:

$ perl -MEncode -E 'my $a = "абв"; my $b = "где"; say $a.decode_utf8($b)'
абвгде

If you concatenate two strings, either both of them must be decoded, or neither of them.
You can't mix two styles.

So there is no way to migrate gradually to unicode in existing project if it's large enough.

But 99% of the time you don't need decoded strings at all.
And when you actually need them, simple wrappers are enough:

sub lc_utf8 {
my $x = shift;
$x = decode_utf8($x, 1);
$x = lc($x);
$x = encode_utf8($x);
return $x;
}

Perl Accepted For GCI - Now We Just Need Students

Some of you may remember that a couple of weeks ago I wrote about how The Perl Foundation was hoping to take part in the Google Code-in 2011 (GCI) and I badgered you for help in providing tasks and acting as mentors in the programme.

I am happy to announce that the application of The Perl Foundation has been officially accepted and Perl will be taking part in GCI 2011. This is due in large measure to the wonderful reaction to our appeals which has lead to numerous high quality tasks being added to the ideas page and many selfless developers volunteering to be mentors. Without your assistance our application would not have been successful, so thank you very much to everyone involved.

But the tasks are only part of the story. Undoubtedly the track record that Perl has in GSOC as well as last year's GCI was a contributing factor, as was the leadership of Florian Ragwitz and Mark Keating. So many thanks to everyone who has brought us to this point.

I’m very pleased to announce that Double Prime has decided...



I’m very pleased to announce that Double Prime has decided to sponsor YAPC::NA 2012. Here’s how they describe themselves:

Founded over 10 years ago to support an eCommerce initiative from a new client, Double Prime, continues to evolve and grow. Today, with a team of 80+ engineers, project managers and designers and over 150 eCommerce websites in 25+ countries, we have established ourselves as a leader in customized international and domestic technology solutions.

Our core technical and corporate philosophies have proven successful in the highly competitive world of eCommerce. What we hold true:

  • Creating solutions to meet and exceed your expectations  
  • Customizing our development around your requirements  
  • Personal and frequent interaction with our team  
  • Simple and efficient technical implementations  
  • Partnerships are critical to building and growing success

[From the YAPC::NA Blog.]

The End Of 5.6 Is Nigh!

It's that time again! Time when I hammer the last few nails in the coffin of a version of Perl. A few years back, I killed 5.004 and 5.005 in a stroke by uping the minimum version of Test::More, upon which 80% of CPAN relies, from 5.004 to 5.6.0. In a few months I'll be doing it again.

Graphing time-based data in Perl

Just posted about Graphing time-based data in Perl on my blog, documenting my decisions in picking a suitable module to easily graph potentially irregularly-spaced time-based data in Perl.

Chart::Strip turned out to be what I wanted. See the full post for what lead me to choose Chart::Strip, and sample usage & output.

BPO Meta : UserPics, API Passwords & Site Build notes

It's been reported that blogs.perl.org UserPics are broken. I don't agree.

First login to blogs.perl.org

Then click the link to your user preferences. (Click the images to get the fullsized versions that aren't "squished")

(update: an existing issue that isn't fixed is that some markup in the body of a post will show up incorrectly on the homepage because MT is truncating the post for the homepage, and clips the post badly half way through, leaving gargbage on the homepage .. hence this paragraph which pushed the next bit of HTML off what is shown on the homepage ... patches welcome .. see below)

1.png

Then upload a picture. Note a little further down you can also get the password required for the API / Web Services, which is another reported issue.

2.png

Then return to your blogs admin page:

3.png

And then republish your blog:

4.png

And that should then show your UserPic on your blog posts/profile. You may need to refresh/reload your browser to cache-bust.

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.