Relief from Regexes

As most of the readers on this blog know that my sys-admin skills are not on the high side. Well also one thing that I am very poor at is regexes. I know I hold my head in shame in this, I just never used them very much and most of my programming hasn't been in the area of text processing so I have never use them very much.

Most of the time when I run into a regex I can figure out what is going on but when the complex ones come into play I am just flustered.

Well I stumbled across this today Padre::Plugin::RegexExplain well not as powerful as my old standby The Regexe Coach

Well it was easy enough to install and when I called it up I got this

regex-1.jpg

Ok simple enough UI lets test it with a regex that always torments me is extracting dates out of a string.

Here is the one I usually have grief with

m|(\d+)/(\d+)/(\d+) (\d+):(\d+):(\d+)|

You Can Help MetaCPAN by Helping the QA Hackathon

As I was spending some time updating the list of MetaCPAN sponsors, it occurred to me that we had not listed the QA Hackathon as one of our sponsors. I came to realize that this was a fairly significant omission since, if you run the numbers, the QA Hackathon is one of our biggest sponsors. The hackathon has sponsored a MetaCPAN hacker for 3 years now. 2011 (Amsterdam), 2012 (Paris) and 2014 (Lyon). The 2012 and 2014 sponsorships involve me flying across the Atlantic and all 3 years involved hotels, meals, etc. If you take all that together, it really adds up.

Czech Perl Workshop

Announcing the first Czech Perl Workshop, which will be held on 20th-21st of May 2014 in Prague, hotel Jurys Inn. Call for papers closed on 25th of March for english presentations (1st of April for czech ones).

More info here.
Contact via e-mail

Let´s meet there :)

pjam on rails - build server for perl applications.

Pjam - is the build server for perl applications.

Hi All! It's still in alpha stage, but anybody is welcome to try it out. Pjam provides standard continues integration server api with additional features:

  • checks out source code from subversion VCS
  • creates builds
  • keeps artefacts
  • notifies users on successful / failed builds
  • shows differences between builds
  • shows users activity log - who, what and when changed
  • shows build's detailed logs
  • and more ...
Pjam uses pinto to handle cpan dependencies, Pjam is a rails application. Sqlite or mysql database engine may be used as data storage. Check out more on https://github.com/melezhik/pjam-on-rails

A Little more Testing of the waters

Still exploring the MooseX name-space these days and today I was going to have a look at 'MooseX::YAML' as that was the format I was saving my AD&D data in it (for the time being) I thought it might be a good fit to load things up faster or at least save me some code in writing a YAML parse role.

So I started out with a little YAML to test

An author's CPAN dashboard

I've created a first proof-of-concept for a 'CPAN Dashboard'. I want a summary of all my dists, with all sorts of information per dist, and with dists presented in the order of 'needing something done'. I'm hoping something like this could be added to MetaCPAN.

More details, and a list of ideas for inclusion, can be found on my blog. Any and all suggestions very welcome - I'm going to bounce ideas around with Olaf later this week.

How to compile DBD::mysql on Windows

Putting this down here both for the public and for myself as a reminder.

I still run ActivePerl v12, both because our production servers are at that version and because i see a lot of windows users at that version and lower. I use CPAN a lot and do tend to find obscure issues that break modules on v12 or cause incompatibilities.

However there's a fairly big stone in the way when going that path, since ActiveState has followed their rolling lockdown policy and with the release of Pumpkin Perl v18 locked the PPM servers for v12 (and below) to the public, leaving them only accessible to paying business customers. So i ended up having to compile it manually and this time managed to navigate the maze and figure out the right incantations.

Converting a PHP Library to a Perl Module

Come participate at MadMongers on Tuesday night.

[From my blog.]

My Master Voice

One part of AD&D that I allays loved and why I played it for so long was its story telling nature. I can't tell you how many reams of paper myself and the rest of us players and DMs produced in our epic mutil-year game, Still have a few stuffed upstairs in the attice where they where shoved after life caught up with me and my cohorts and the joys or, wives, husband, jobs, houses and kids overtook our game.

It was the 'in-character' and 'NPC' conversions that where always best as some of my fellow players where very good at it. One player what an expert at imitating a ranting nut bar that may or may not have some good info for the party a.k.a. 'the old man from scene 24'.

scene24.jpg

Well I was wondering if there as a way to add this sort of thing into my game rather than the rather stale, tablets or very expensive 'cut out' videos many of todays games.

Another way to rank languages

I didn't see this posted recently, and searches here for redmonk and ranking returned nothing, so... I give you - Language Popularity:

GitHub (x-axis) 'v' StackOverFlow (y-axis).

From this article.

And Tim Bray on why a whole heap of things are in a bad way.

One week left to submit your TPF grant application

The deadline to submit grant application is March 14th. So far we got one submission. See here for the application procedure.

http://news.perlfoundation.org/2014/03/call-for-grant-proposals-1.html

Perl and Me, Part 13: Here's To Future Days

This is part 13 (and the final installment) of an ongoing series where I explore my relationship with Perl.  You may wish to begin at the beginning.

This week we look at what comes next.

I suppose at the end of any long rumination on the past, it’s only natural to think about the future.  I’ve tended to avoid pontificating on Perl’s prospects for a number of reasons, not the least of which is that I don’t have any special knowledge to share.  I’m not an author of Perl books, a contributor to the Perl core, or even a particularly prolific creator or maintainer of CPAN modules.1  I don’t have any inside knowledge of Perl from hanging out with Larry, or the folks that run the Perl Foundation, or the current Pumpking (nor any past ones, for that matter).  I’m just a regular Joe JAPH—admittedly one who has made his living off Perl for 17 years, well enough to support a nice house in southern California and a complement of five humans, three cats, one guinea pig, and a tank full of tropical fish, snails, and shrimp—but just a working schmoe nonetheless, whose opinion isn’t any better or smarter or wiser or more likely to be true than yours.  So, you should definitely not listen to me.

Still Plinking Away, The End Game

Well it is time to make a choice! I started with three and took another good look at was available in the MooseX space on CPAN today and didn't see anything else that I think would do what I want. Though I was quite interested in Moose::Templated until I figured out it was a template system for rendering content utilizing roles rather that what I was looking for a template system to create roles and classes.

Anyway back to my choice.

At least it was easy to eliminate MooseX::ClassCompositor as it did not do what I wanted though I could see it use some-where else. To use it I would have to trash a good deal of code and have no 'Base' class just roles. Well AD&D is just a little too static for that but if I had a very large number of characters and classes like in the 5thEd. I might start out that way.

Falsehoods Programmers Believe About Names

Falsehoods Programmers Believe About Names (with 544+ comments) is a thorough dissection of the various falsehoods programmers believe about names.

Two takeaways for me:

  • Depending on the application, a person may have no name at all -- think about hospitals and automobile accidents, for example.
  • Thinking carefully about what name or names you need. Is this name for display to the user? Does it have to be used for email or postal mail? Should the name be sortable? There are lots of issues to consider.

(This makes a nice companion piece to Falsehoods programmers believe about time.)

MetaCPAN Welcomes its Newest Sponsor: GitHub

We've been doing a lot of work behind the scenes on MetaCPAN lately and we've come to the realization that we needed some private repository hosting. In the past, we've reached out to companies where we had contacts, and they've been happy to help. Last night, I wondered if anyone on Twitter would be able to help us out. That was at 11:17 PM EST. By 12:27 AM Johannes Plunien had forwarded my request to a real, live GitHubber and by 9:32 AM we had our Github-sponsored account. It probably would have happened even faster if I hadn't indulged in sleep last night.

A few different things make me happy here.

Extracting values from a list of (key, value) pairs

If you need ordered key, value pairs, you can either use something like Tie::IxHash or a simple array of key, value pairs. I found myself in the situation where I needed to extract just the keys from such an array.

There are a number of ways to do it, but which is the fastest? I tried a few pure Perl approaches, as well as List::Util::pairkeys (which as of this writing isn't yet in a stable release of Perl, assuming that List::Util remains in the core). The pure Perl approaches either use various means of flipping a binary toggle, or splice()ing through a sacrificial copy of the array.

Here we go:

lex parsimoniae

For the less classically trained Occam's Razor or to dumb it down even more, the answer is staring you in the face, is the topic for tonight.

Well to make a short story long, I was happily programming along, in the zone if you will, when I was flustered by a small problem. How to tell if something is an object??

The problem occurred in a class pre-loader, it gladly recursively searches though a name-space and loads in classes for future use. There is some sanity checking such as making sure the file at least ends in '.pm' as don't want any silly subversion or '.pl' files loading do we?

Anyway at the tail end of the process we do something like this

Status update on the p5 MOP project

As I was doing my daily check of blogs.perl.org, I noticed a recent post by Ovid in which he said ...

Of course, we also need the p5-mop, but that hasn't been touched in a while; I hope it's not dead.

... and that reminded me I really needed to write a blog post to update folks on the status of the p5-mop effort, so here goes.

MetaCPAN is Hiring!

OK, so that's maybe not 100% accurate, but we are looking for students who want to get paid to work with us. How can you get paid to work on MetaCPAN? There are currently two really great options: the Outreach Program for Women (OPfW) and the Google Summer of Code (GSoC).

What MetaCPAN needs from you is to help spread the word to interested students who may want to participate. Here's the pitch:

There are lots of things you can learn by working on the MetaCPAN stack. Our stack includes Catalyst, Plack, ElasticSearch, jQuery, Bootstrap and nginx. We also use Puppet for deployment and Vagrant + VirtualBox for development VMs. We have integration with Twitter, Github, PAUSE, Facebook and Google.

Subroutine signatures in Perl are long overdue

The upcoming subroutine signatures in Perl aren't needed so that Perl can be "cool" (we're long past that). They're needed to make your code more correct.

I have a client that I sometimes write code for and they have the layers of their application nicely defined. Their front-end code makes AJAX calls back to an API written in Perl. That, in turn, calls their backend code, also written in Perl. Much of their API code resembles this:

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.