It was a good YAPC although I already knew FFM and their slightly musty University, so it lacked the excitement of a new unknown place. But I guess its part of the joy to meet the class of Perl again, greet domm here, say hai to karen there and so on.
Highlight was to me Stevan Littles presentation (no keynote was utterly important), even if I extracted the crucial infos before. I was especially sceptical to declare one line to get the getter/setter like in Moo/s/e. But combined getter/setter are not always right, you might follow the damian or even (god forbid) your own taste. So to declare that and not deliver that part by default seems to be very perlish and sane. And I got the impression that there is not much uprise against it and that and that it might even arrive in 5.18.
FUSE (Filesystem in USErspace) is a useful kernel module with an API which allows file systems to be implemented in user space applications, mounted and fully integrated into the system's VFS. Originally implemented for Linux, FUSE API-compatible kernel modules are now available on *BSD, OpenSolaris and MacOS. That said, this was written on a Linux machine so there may be assumptions made about the tools available, their output etc. Feel free to submit info on other *nix-like systems for inclusion if you encounter any inconsistencies. This also goes for corrections and suggestions - if I get the details plain wrong or the code stinks and so on...
Some examples of popular FUSE file systems are ntfs-3g, which provides full NTFS support for the Linux kernel, and sshfs, which mounts remote directories over SSH with SFTP support. FUSE also powers ambitious projects, such as the distributed filesystem, MooseFS as well as providing easy access to proprietary protocols such as MTP.
We can combine this power with the power of Perl using the excellent FUSE API binding.
Tomorrow morning I'll be needing to get up in the wee small hours of the morning to travel to the Moving to Moose Hackathon 2012. In the mean time, here's some sugar for the awesome MooseX::Traits...
package traits;
use MooseX::Role::Parameterized;
parameter namespace => (
isa => 'Str',
default => '',
);
role {
with 'MooseX::Traits';
has '_trait_namespace' => (is => 'ro', default => shift->namespace);
};
1
YAPC::EU is over. It was a nice conference, but there were a couple of things I've missed. The first one is obvious: air conditioning. We had a too hot weather. I understand that Germany is used to cold, not hot. Nevertheless, next YAPC::EU users, remind that 300 or more people in a room, half with their laptops and gadgets turned on, produce a lot of heat. So, be sure at least the main room has a decent air conditioning system.
So, I’m sitting in the car, while Jess is driving back to the UK (well, the chunnel … well, to Luxemberg to find cheap gas ) on the way back from the Perl reunification summit and YAPC::EU 2012, Frankfurt. I figure this is a good time to do the blogging thing again, and give some of my throughts about Perl (the programming language), perl (the implementation of the programming language), Perl (the city^Wtown), and other such things, and possibly even my role in them in the future.
So, Ocaml does not support Unicode out of the box. The “string” type is an 8 bit byte and that’s that. Some find this to be a major failing of the language in general and it is a pain in the ass. However, there is a unicode library for ocaml Camomile which fills the gap.
In the project that I have been working on, I had to read in a Unicode file into Ocaml and create a “seen” hash. Just as you would do in perl normally. However, because Ocaml doesn’t support Unicode natively, you cannot use the generic Hashtable type “(‘a, ‘b) t”, which stands for an arbitrary type for a key (the first ‘a) and an arbitrary type for the value (the second ‘b). The key value types will be filled in by type inference as you use the Hashtable based on what you do with it. This won’t work because the generic Hashtable depends on an equal function that will not conform to the Unicode standard compare.
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.
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.
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.
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.
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!
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.
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.
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 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.
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.
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.
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.