Slides for my YAPC::Europe 2012 Keynote

When I gave my keynote at YAPC::Europe 2012, I had not yet put the slides online because the talk was very much a work in progress. My intent was to repeatedly update the slides until I felt comfortable with them, but the talk was popular enough that people kept requesting the slides, so here are the slides for Agile Companies Go P.O.P.

A few notes:

  • Slideshare did an awful job of converting them
  • Slides are like subtitles: you can lose a lot of important information
  • There a few areas which need to be rewritten.

The basic idea of the talk is simple: just as having a powerful V8 engine doesn't mean you have a car, using XP, Scrum or similar agile project management methodology doesn't mean you're agile. An agile company goes P.O.P.:

  • People
  • Organization
  • Process

The process bit is what most of us think when we say "agile", but you need the right people and the right organizational mindset to get to truly have an agile company.

Going to Perl School

[This is a repost of what I wrote over here ]

Ocaml and Hashtables

Coming from a Perl background and seeing the Ocaml Hashtbl documentation for the first time, it can be really confusing. Especially since there is no keys, values, and each functions in the documentation. So, first of all while Ocaml doesn’t give you these functions out of the box and I would argue that it should, you can write them fairly easily yourself using the fold function.

let keys htbl =
  Hashtbl.fold (fun k _ accum -> k::accum) htbl []

As you can see above the fold function gets three params, the first two are the key and value. The third is the “accumulator” or in this case just a list where you will append the k variable. The underscore means “anything” and tells the compiler that you don’t really care about the binding and it is not then necessary.

The values function works similarly.

xsd:choice equivalence to individual xsd:elements

Just noticed this in XSD -- an xsd:choice with minOccurs=1 and maxOccurs=unbounded that contains 2 xsd:element(s) each with minOccurs=0 and maxOccurs=1 is roughly equivalent to just having 2 xsd:element(s), each with minOccurs=0 and maxOccurs=unbounded.

The only difference I see is that having the xsd:choice lets you alternate between the xsd:element(s). In many common processing cases (that I've seen), these 2 sub-schemas are completely equivalent.

Thanks to Olaf Alders for HTTP::CookieMonster

The old, horrible way, to get a cookie by name with LWP::UserAgent or WWW::Mechanize:

my $cookie = $a->cookie_jar->{COOKIES}->{".$SITE_DOMAIN"}->{'/'}->{$COOKIE_NAME};

The new way, with HTTP::CookieMonster:

my $monster = HTTP::CookieMonster->new( cookie_jar => $a->cookie_jar );
my $cookie = $monster->get_cookie($COOKIE_NAME);

Much better. Thank you. I’d love to see something like this built right into WWW::Mechanize.

YAPC::Europe Day 3

The third and last day of YAPC::Europe and everyone is a little tired after all the socialising and thinking.

This morning there was a little presentation about YAPC::Europe next year in Kiev, Ukraine. Should be cooler!

Stevan Little presented A MOP for Perl 5 which sounds like he's chosen a very simple syntax for nice concise OO code (and a backend).

Kenichi Ishigaki presented CPANTS: Kwalitative website and its tools where he explained the story behind taking over CPANTS and improvements he has made.

Shawn Moore presented Moose Role Usage Patterns to a very packed room where he explained some useful patterns behind roles.

Philippe Bruhat presented Organizations of the Perl community where he listed the many and varied Perl organisations, how they came to be and what they are doing now.

Mark Keating presented Adventures in Marketing: Part Two where he explained marketing Perl over the last year and plans for this year, such as learning Perl, a Perl desktop environment and more.

The goodness of testing

This is not strictly related to Perl, but I was thinking about my practice of testing recently and I've come to some conclusions, some of them proving to be a bit controversial. Read more here and have your say!

Precedence parsing made simpler

This post describes a new approach to precedence parsing, one that makes it simpler and more flexible. Many programmers find precedence is an intuitive way to look at problems. The traditional rules of arithmetic are a familiar example:

E ::= ( E )
E ::= n
E ::= E * E
E ::= E + E

Here, as in the rest of this post, the rules are ranked from tightest ("highest") precedence to loosest ("lowest"). The order in the above display indicates that multiplication takes precedence over addition, and parentheses take precedence over everything else.

The old way and the new way

The traditional way to deal with precedence centers on symbols. The symbols are divided sharply in two: those that define structure and those that carry information. The structural symbols (often called "operators") are assigned associativities and precedence. To help guide the parse, symbols may be further classified as infix, prefix, circumfix, etc.

Update to review of Dependency modules

I've updated my review of modules for getting dependency information. The previous version listed 8 modules on CPAN — it now covers 18 modules!

The following modules have been added:

  • App::FatPacker::Trace
  • Devel::Modlist
  • Devel::TraceUse
  • Dist::Requires
  • Module::Extract::Use
  • Module::Info
  • Module::Overview
  • Module::PrintUsed
  • Module::ScanDeps
  • Module::Used

One of the recommendations has changed: if you want an approach based on parsing, I'd now go with Module::Extract::Use rather than Perl::PrereqScanner. There's not much between them (both use PPI), but Module::Extract::Use returns a bit more information.

Given I'd missed 9 modules in my first scan of CPAN, and then missed 2 on my thorough search, I wouldn't be surprised if there are still a few to add...

Update 2012-08-27

Indeed: I've now added Module::Inspector, Module::ParseDeps and Module::MakefilePL::Parse, bringing the total to 21 modules. I also updated the section on Devel::TraceUse, following email with Philippe Bruhat.

YAPC::Europe Day 2

Yesterday's attendees dinner in Sachsenhausen was excellent and we did indeed have Apfelwein.

The day started off with Curtis Poe explaining to us the agile manifesto. I think he was trying to get us to all launch startups or at least reengineer our current employments.

Then Clinton Gormley presented To infinity and beyond: Storing your Moose herd in ElasticSearch" where he talked a little about ElasticSearch, a little about scaling and a little more about object mapping.

Sawyer X presented Asynchronous programming FTW! where we went through IO::Async, POE, and AnyEvent and how to think in callbacks.

Bernd Ulmann presented Array programming for mere mortals where he scared us with APL.

Alberto Simões presented Building C/C++ libraries and applications with Module::Build‎ and went through all the options.

Then it was time for my talk: The Fallacies of Distributed Computing which was a general talk about how network are useful but there are some things you need to keep in mind.

I'm currently in Matt S Trout's Distributed Daemon Discovery which is a nice little story.

After that we have another hour of lightning talks and then off to Beers for Engineers...

Building C and C++ libraries with Perl

It seems that somebody screwed it, and forgot one 20 pages article I wrote for YAPC::EU::2012 proceedings. Therefore, the proceedings are shorter, and are shamelessly incomplete. Anyway, you can read my article in all its glory here . And sooner or later I'll add the presentation too.

A NYTprof encoding hiccup

While using Devel::NYTProf on a new application I started getting this message

fid 33 has no src saved for /usr/lib/perl5/5.14.2/autodie.pm (NYTP_FIDf_HAS_SRC not set but src available!)

Now my first thought was this has something to do with either the newest version of autodie or utf8::all. So I checked to make sure all the modules I was using were up to date and tested again, still there. Then I wrote a really short program to recreate this error and for some reason I couldn't. Going back and forth between the two files I finally noticed what was different and I was shocked by what it was.

This script generates the above message with `perl -d:NYTProf`

and this one does not.

Just switching the order of autodie and utf8::all fixed this. My mind was blown. I could not think of another time I had seen the use order do something like this. So I did some searching to see if this was known or not. Bug 70211 says it is 'use open qw( :encoding(UTF-8) :std );' followed by a use module statement that causes the issue. So my "fix" is not really a fix but there appears to be no actual problems with nytprof but I am keeping an eye on it.

Devel::Trepan 0.31 release

A new release of Devel::Trepan is out there.

A number of changes were the result of problems found in writing the various debugger blogs and in preparing for a little local NY Perl Mongers meeting.

Possibly there will be one more debugger blog on stepping.

YAPC::Europe Day 1

It's the first day of YAPC::Europe in Frankfurt and it's the hottest day of the year so far. It's pretty warm in the conference venue. Max gave us a good introduction to the conference and handed over to the announcement of YAPC::Europe next year: Kiev, Ukraine. Then the star of the show: Larry Wall took a small Perl 5 script and slowly converted it to Perl 6 live, showing some useful debugging features and nice compact clear code.

David Leadbeater presented An exploration of trie regexp matching where he explained the inner workings of Perl's regular expression engine and RE2.

Damien Krotkine presented Dancing with
WebSockets
digging into the live web.

I really enjoyed Lenz Gschwendtner's talk on Continuous deployment with Perl on how to build robust deployment and deploy all the time.

Then I went to sleep outside in the shade as it was all getting a little too hot for me. The organisers kindly provided some icecream!

I came back to see Eric Johnson present Selenium testing with Perl which mirrors work I've been doing recently with Cucumber / Capybara / PhantomJS.

After that it's time for the lightning talks, hosted by me. Lots of little talks with lots of speakers: what could go wrong?

Tonight we have the attendees dinner on the other side of Frankfurt. Time for a little Apfelwein...

#perl6 summary for week ending 2012-08-18

Summary entries suggested/written by #perl6 users. Editing by raiph.

(The rest of this blog entry, following this paragraph, was originally a reddit post. I decided to copy it here as a first entry for this new "Perl 6 reports" blog, which is the home for these summaries and other Perl 6 reports from now on.)

I fondly recall the excellent summaries of Perl 6 mailing list discussions Piers Cawley posted back in the day. He kept it going for years. Nowadays the main Perl 6 action is the freenode IRC channel #perl6. This is the first of what I hope will be a regular series of #perl6 highlight posts.

2012-08-11:

2012-08-12:

DIY personal analytics

How many times a day do you reach for <ctrl> + r when using the shell? What about the history command? !! anyone?

Do we as programmers evolve and stop making the same mistakes? Do we really optimize our workflows? This is where the idea of personal analytics comes in. I am going to see what I can learn from looking at my bash history for the last few years. Here are the relevant settings in my .bashrc file:

shopt is a bash command that shows and changes shell option names. The histappend option tells bash to append the history collected to the filename specified in HISTFILE instead of overwriting the file. cmdhist tells bash to save all lines of a multiple-line command in the same history entry.

HISTFILE allows me to tell bash where and what to name history files. For example 2012-08-20.hist is today's bash history file.

#perl6 summary for week ending 2012-08-18

Summary entries suggested/written by #perl6 users. Editing by raiph.

(The rest of this blog entry, following this paragraph, was originally a reddit post. I decided to copy it here as a first entry for this new "Perl 6 reports" blog, which is the home for these summaries and other Perl 6 reports from now on.)

I fondly recall the excellent summaries of Perl 6 mailing list discussions Piers Cawley posted back in the day. He kept it going for years. Nowadays the main Perl 6 action is the freenode IRC channel #perl6. This is the first of what I hope will be a regular series of #perl6 highlight posts.

2012-08-11:

2012-08-12:

YAPC::Europe day -1

YAPC::Europe 2012 in Frankfurt am Main, Germany starts on Monday. This is the biggest gathering of Perl people in Europe and I'll keep you updated day by day.

I'm presenting The Fallacies of Distributed Computing‎ on Tuesday afternoon.

The star of the conference for me is the lightning talk sessions: lots of speakers giving 5-minute talks. R Geoffrey Avery normally hosts them but unfortunately he can't make it this year, so I'll be your host for the lightning talks this year. There are lightning talks at the end of each day. I can squeeze in a few more lightning talks: if you'd like to give one, come see me and send me an email: acme@astray.com.

A comparison of stopword list modules

Hi Folks

I've just released Benchmark::Featureset::StopwordLists.

It compares 3 modules implementing stopword lists.

You can skip the review and just examine the report.

Various other modules have stopword lists, sometimes using one of these modules.

If you know if any stand-alone modules implementing a stopword list, please comment here.

An overview of spell checking modules

Spell checking is one of those problems that is already solved... sorta.

Like all problems it really depends on context. Take Jon Bentley's Programming pearls: a spelling checker where he examines the problem space and the differences between a spell checker and a spelling corrector. I start by searching the keyword 'spell' across all of CPAN.

wget http://www.cpan.org/modules/01modules.index.html
ack -i spell 01modules.index.html

The above covered all 22,442 distribution names but not the sub modules names. A few metacpan searches later and I was able to compile the following list.

Direct checkers - modules that actually do the spell checking
  • Lingua::Ispell A module encapsulating access to the Ispell program via IPC::Open2
  • Meta::Tool::Aspell run aspell for you. Meta is a class library of about 250 classes and is abandonware.
  • Text::Aspell Perl interface to the GNU Aspell library
  • Text::Hunspell Perl interface to the GNU Hunspell library
  • Text::Ispell A wrapper module for Ispell. The ispell cli is called via IPC::Open2.

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.