YAPC::NA Idea Collector

YAPC::NA Idea Collector :

We’ve set up a site specifically for you to submit and vote on ideas for YAPC::NA 2012. Whether it be ideas for about speakers you’d like to come see present, or the subject of talks you’d like to see, or maybe a social activity you’d like to participate in. Any idea is welcome. And then everyone can vote on those ideas so that the most popular ideas will float to the top. 

The volunteers - VIPs every event need

An event can't be done without them and every organizer ist happy when there are lots of these people - the volunteers.

Only a few minutes after the announcement that we host YAPC::EU 2012 some people came to me to offer their help...

Getty will do all the social media stuff, Wendy offered to help at the event (help with registration desk, help people to find the rooms, ...), and Steffen, Roman, and Gabi offered to help with stuff that can be done remote.

There is enough to do :-)

We'd like to say thanks in advance. You rock!

Looking up the location of an IP address

This review of perl modules for looking up the location of an IP address is now hosted elsewhere.

Using modules that are not installed

Yesterday I stumbled across an error message of perl5 I've never seen before:

Can't locate loadable object for module X in @INC

I was trying to test a module A that uses a module B that isn't installed. The perlmonks told me that it had something to do with DynaLoader.

I already had a

use lib "'MODULEB/blib/lib";

in my setup.

What made it work was an additional

use lib "'MODULEB/blib/arch";

The reason is that module B is XS based and results in a moduleb.so. DynaLoad looks for this moduleb.so and is only able to find it if the "arch"-directory is in @INC.

Since the application has lots of modules that use each other, I've come with the following snippet I include in every test:


BEGIN {
  my $fh;
  # this is the directories where all modules are in seperate directories
  my $dir = '..';
  opendir($fh, $dir) || die "can't opendir $dir: $!";
  my @entries=sort readdir($fh);
  closedir $fh;

  # get rid of '.' and '..'
  @entries= grep { /^[^.]/ } @entries;

  # add the directory name to get a name we can give 'use'
  @entries= map { "$dir/$_" } @entries;

  # we only want directories ...
  @entries= grep { -d } @entries;

  # expand @INC
  for my $dir (@entries) {
  # Perl-only modules
  eval "use lib '$dir/blib/lib'";

  # modules with XS
  eval "use lib '$dir/blib/arch'";
  }
}

That naturally gives me a quite impressive @INC.

Official Hash Tag: #yapcna2012

If you make any posts about YAPC::NA 2012 and wish to tag it, please use #yapcna2012 as the official hash tag.

cmd to compare contents of two directories

diff -qr dir1 dir2

Making RESTful Dancing easy with Dancer::Plugin::REST

An useful plugin for writing RESTful Dancer web applications is Dancer::Plugin::Rest by Alexis Sukrieh, available at https://metacpan.org/module/Dancer::Plugin::REST.

To use it when defining routes, easily:


package MyApp;

use Dancer;
use Dancer::Plugin::REST;

This exports the resource keyword, which can be used as such:


resource camel => (
create => sub {},
get => sub {},
update => sub {},
delete => sub {},
);

This automatically creates the following route handlers:

  • post /camel (create)
  • post /camel.:format (create)
  • get /camel/:id (read)
  • get /camel/:id.:format (read)
  • put /camel/:id (update)
  • put /camel/:id.:format (update)
  • del /camel/:id (delete)
  • del /camel/:id.:format (delete)

The format param can be used in requests such as


GET /camel/larry.xml

Next to that, this module exports a whole bunch of error handler methods, such as

  • status_unauthorized
  • status_ok
  • status_length_required
  • status_not_found
  • status_forbidden

which can be used to make life easier:


return status_unauthorized("Not Larry") unless $user->is_larry;

Logging wide characters with Log4perl

I gave my "Surviving Perl Unicode" tutorial at the Mad Mongers this weekend. After I mentioned Test::Builder's Unicode issue, JT Smith asked how I would silence wide character warnings from Log::Log4perl. I'd never really thought about it.

For instance, here's an easy program that wants to output U+2020 (ᴅᴀɢɢᴇʀ):

use utf8;
use strict;
use warnings;

use Log::Log4perl qw(:easy);
Log::Log4perl->easy_init( level => $DEBUG );

DEBUG( 'Is this a † I see before me?' );  # warning

I get this warning:

YAPC::NA Planning Meeting Tonight

It’s the first Tuesday of the month, so that means it’s YAPC::NA Planning Meeting time. If you’re in the Madison area, or don’t mind a drive there is a YAPC planning meeting tonight at the Essen Haus at 7pm. As always the food and beer are sponsored by Plain Black, and the room is sponsored by Essen Haus.

We’ve got a lot to discuss so the meeting will probably last until around 9pm, but you’re free to come and go as you please.

MetaCPAN August Roundup

August was another busy month for MetaCPAN, so I think a recap is in order. I'll proceed chronologically.

2011-08-01

Gabor Szabo included MetaCPAN in his first issue of the Perl Weekly. It's an excellent aggregation of all Perl things blog and newsworthy. I can tell you just from the time involved in a MetaCPAN recap that Gabor is spending a huge amount of time on his weekly newsletters. I follow a lot of blog posts, but I find his weekly recap helps me find interesting stuff I may have missed.

2011-08-03

On Unicode and Sorting

Tom Christiansen published an article on Perl.com on the topic of sorting and unicode.

It's good and it explains a little bit about why Unicode is so difficult and why sorting Unicode (or even ascii) is even more difficult, mainly because it depends on your local definitions what results you expect from a sorting operation.

It might be nice to point out that the modules he proposes on using, Unicode::Collate, and Unicode::Collate::Locale, have been in core perl since 5.8 and 5.14, respectively.

Happy sorting!

CPAN Testers Server Failure

Unfortunately the CPAN Testers server has a failing hard disk, which is only allowing READONLY mode access. As such, all CPAN Testers operations are now failing.

The host company has confirmed that ...

a) our disk has a fault
b) we don't have a second RAID disk (even though we're paying for it!)

As such to replace the disk it requires complete data loss!

As you might anticipate this is not making me happy today. I had already started making plans to migrate to a new server, but to do this gradually over the next month. However, it looks like this will need to be sped up.

As things stands the CT server is effectively out of action. I have read access, but will need to wait until the new server is ready before I can copy over everything as it currently stands. Although I have several backups of data, I would rather avoid rebuilding the complete set of data files.

cPanel is one of those critical pieces of infrastructure that...



cPanel is one of those critical pieces of infrastructure that you often don’t think about, but that makes the world a better place for so many people. It’s available from web hosts around the world to make hosting a painless point and click experience rather than a frustrating conundrum of editing config files. 

I’m pleased to announce that cPanel is our first Diamond Level Sponsor for YAPC::NA 2012. And they’re also hiring!

Why work at cPanel?

We speak Perl

cPanel & WHM is developed in Perl. cPanel has and will remain a proud supporter of the Perl community. At cPanel, we welcome both seasoned Perl Developers and promote internal advancement of learning Perl through various venues such as attending YAPC::NA, in house training, Perl Mongers and working side by side with Perl experts.



Benefits

Method::Signatures::Simple 1.01 released to CPAN

I’m pleased to announce version 1.01 of Method::Signatures::Simple. It provides a little sugar for writing methods and functions. Chip Salzenberg requested the addition of a function keyword with the same signature processing, and kindly provided me with the implementation (on github).

Here’s some example code from the synopsis:

Padre 0.90, the Delayed Release Announcement

Normally when Padre, the Perl IDE is released, we like to let people know about it through the release announcement. It serves a dual purpose. it both lets us acknowledge the awesome work that goes into Padre while letting everyone out there see what has changed, what has been fixed and where we are in terms of the project and whether or not it's ready for your use, or to upgrade.

0.90 was released with little fanfare, so I'd like to take the time now to cover off some of the changes in Padre 0.90 in a little more depth.

OK, so I can't help myself here, but with the work done by Ahmad Zawawi to bring us a modern Scintilla with the Wx::Scintilla package, we now get squiggles!

Kickstarting the Gitpan

If you've played with Gitpan at all, you probably have an idea of how cool this project is. The idea behind Gitpan is to take all of CPAN and make it available as Git repositories which are tagged by release. It's a great idea. It makes it trivial for Github (and Git users in general) to create patches for modules which don't already exist in a public Git repo. It's also useful in the case where the original Git repositories for modules on CPAN may no longer easily be found online.

Now, if you've followed the Gitpan project, you probably also know that it is not currently up to date, which is a shame. I contacted Schwern about this recently and he was kind enough to create and tag some issues which are blockers to the resumption of Gitpan.

Vim vs Emacs

This contest is a no-holds-barred match, and is scheduled for one fall. In the corner to my left, hailing from vim.org and weighing in at an awkwardly anemic 9.1MB - Vim! In the corner to my right, hailing from gnu.org and weighing in at a morbidly obese 46MB - Emacs! 

At YAPC::NA 2012, we will once and for all declare a definitive winner in the decades old battle between Vim and Emacs! Two editors go in, but only one comes out. Be there to witness this history making event!

In Zürich with Damian

For the last two weeks Damian has been here in Zürich teaching classes on Perl and vim. We attendees are having a great time and learning a lot. He managed to give us a lot of information and understanding in a very short time. We also had the chance to ask many questions, which he answered very competently.

For everybody who missed it, come and join us next year! I will keep you posted on that.

The UTF8 flag and you

If you are looking at the UTF8 flag in application code then your code is broken. Period.

The flag does NOT mean that the string contains character data. It ONLY means that the string contains a character > 255 either now or could have, at some point in the past.

For strings that contain characters > 127 < 256, you have no idea whatsoever about whether the string contains characters or bytes regardless of what the UTF-8 flag says. (For strings with only characters < 128 there is no difference whether they are ASCII or binary, and strings with any characters > 255, must be either all characters – or corrupt (character and binary data mixed together).)

The following will produce a perfect copy of lolcat.jpg in lolol.jpg:

my $funneh = do { local ( @ARGV, $/ ) = 'lolcat.jpg'; <> };
utf8::upgrade( $funneh );
# now the utf8 flag on $funneh is set!
open my $copy, '>', 'lolol.jpg' or die $!;
print $copy $funneh;

Certification vs. Certificates

I posted earlier today about O'Reilly's Perl Programming Certificates that accompany several of their Perl based courses available now. Because I wasn't completely clear in my understanding of certificates vs. certifications, I used the word certification in describing their offering, when really I should have said certificate.

So what's the difference anyway? Do you get a certificate if you have a certification? If you have a certificate does that mean you are certified? I didn't find a canonical comparison between the two, but this web page seems to have a reasonable comparison between the two. Posting the table here:

Certification

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.