Authentication and Authorization in Mojolicious

John Scoles will give a talk at YAPC::Europe 2012 described as

Using two new CPAN modules I will demonstrate how to implement

1) Authentication with a DB backend

and

2) Authorization with a DB backend

This will be a live tutorial demonstrating all the code involved

Golfing for Gotchas

I’ve been building a little stand alone command line tool lately, which led to me looking at using App::FatPacker to make a standalone, single-script download. This was going well until I tried to load Digest::Perl::MD5, which caused fatpacker to mysteriously crash with an undefined value. The reason for this is interesting…

When fatpacker goes to analyze a module list, it at one stage runs require on all of them, like so:

require $_ for @packages;

Then later on it uses @packages and discovers that one of the elements has is now undef. How did this happen?

Well, if the module you require fiddles with $_ without localizing it first, that will ultimately result in modifying @packages. How did Digest::Perl::MD5 do this?

while (<DATA>) {

Every Day Is Exactly The Same

Recently Mark Keating of the Enlightened Perl Organisation created a new Google Calendar for Perl community events, particularly for Perl Monger group meetings. As I haven't been updating the other calendars I have access to for some time, it gave me the push needed to clean-up my script, and post all the forthcoming events to the calendars.

I've now updated the Birmingham.pm events page, to display the new calendar, as well as the West Midlands Tech Events calendar.

If you have access to any similar calendars, you can now update them with Perl (if you weren't already), with the aid of my helpful script. Feel free to use and abuse as you wish. Note that you will need to have a login to Google Calendars, and have access to the calendars you are submitting to.

How many people read your blog?

I was just wondering if authors on blogs.perl.org know how how many people read their posts? I looked around the options inside Movable Type but could not locate anything.

If there is a way, could anyone explain please?

I have a solution ...

Perl benchmarking is boring

Steffen Schwigon will give a talk at YAPC::Europe 2012 described as

In contrast to all my past talks about benchmarking Perl I now actually have a running benchmarking infrastructure and actual results.

I this talk I will

- summarize again what I do at all
- present some obvious or non-obvious conclusions
that can be derived from the results
(depending on your and my prior knowledge) and
- tell what's missing

All that from my core-outsider's point of view.

Session affinity (sticky sessions) for Perlbal

Following the concept of "if you haven't blogged about it, it doesn't exist", I'd like to let you know of a new Perlbal plugin, which you might find useful: Perlbal::Plugin::SessionAffinity.

Session affinity (also known as sticky sessions) is the ability to provide a user with a consistent backend from a reverse proxy, such as Perlbal. This is useful in case you cannot share the session data between backends, but do not want to lose the session.

Mind you, although Perlbal doesn't support session affinity in core, there is a plugin available on CPAN, but while trying to get it working, I've found a few major problems with it. It requires patches, it's outdated, and most importantly: it doesn't seem to work.

Since StickySessions was already taken, I've decided to take the SessionAffinity namespace and start using that term instead, in order to divert from the previous plugin.

Comparing YUI - Dojo - Ext JS - jQuery

Hi Folks

After spending a lot of fragmented time over the last 7-8 weeks, I've finally finished my 2nd comparison of JS libs. I can no longer find the first on the old blogs site, but by now I don't think it matters.

This one is in HTML because the original is in POD, and that gives me a much easier time of it in the proof-reading phase.

Cheers
Ron

Vim highlighting question

Dear lazyweb, is there a highlighting scheme for vim which makes method calls more readable?
Compare:

How can I highlight either method calls or arrows between them?

Also, shouldn't we patch the standard color scheme for perl now that direct access to accessors is generally discouraged and lots of object-oriented code looks so monotonously blue?

Easy Ways to Get Started in Open Source

Noirin Plunkett will give a talk at YAPC::Europe 2012 described as

You might not feel like it yet, but if you're considering this talk, you have what it takes to make it in open source!

If you just want to help and don't know where to start, we'll talk about how to find a project, and all the prerequisites. It's easy to think you don't have anything to offer--but you're wrong!

If you've found a project and don't know how to start contributing, this talk will give you tips on getting in the door, finding things you can help with, and learning how to work with the existing contributors.

And, if you already have a project, you'll still learn a lot from this talk--how to attract new contributors, and how to keep them once they've shown an interest!

With years of experience in community development, and as editor of the popular Open Advice book, Noirin knows what it takes to get involved from both sides. Come and learn from her experience, and avoid her mistakes!

Yet Another Friday the 13th

I'm an avid horror fan, big surprise! I like horror movies of all types: zombies, slasher, B-grade, C-grade, gore and even oldschool thriller horror movies like Hitchcock. To this day, I host a Friday the 13th event at my house every time for my friends and I. We run a marathon of as many movies as we can. Sometimes we make it through two, sometimes five. It's not always easy to stay up! :)

These past few months have been pretty difficult and busy. At 10pm I got a message from a friend in Canada: "happy Friday the 13th!" - Shit! I missed one! Well, no matter. The question is: how do I make sure not to miss one again? This is something I considered more than once and was always too lazy to actually try out.

So, I jotted down this code to accomplish it. I'd be happy to hear of better ways you can come up with:

Architecture testing

Yes, I was architect for more than 10 years, but here I'm writing about testing computer architectures.

The most heard complaints on perl or parrot testing is about certain unknown architectures and platforms. If it's Windows, 64bit, little-endian, sparc, hpux, AIX, solaris, arm and so on.

So why not test out all those OS and architectures by our own?

On Windows you only got VMWare, VirtualBox and Hyper-V, but on debian you can simulate everything easily with qemu-kvm. On MacOSX I was not so happy with virtualization.

I suppose you have an amd64/x86_64 system and linux, with more than 4GB RAM. 16GB was good enough for me to run 8 images and compile bigger programs. With kvm you got fast native support for i386 and x86_64, and the rest can be simulated with qemu.

Perl module ideas #4

About the Perl Module Ideas posting series. Previous posts: #1, #2, #3.

1. JSON::Color, YAML::Color. I'm loving colors on the terminal. Only recently (yes, recently!) found out that terminals can support 256 colors. After Log::Any::App and Data::Dump::Color, I'm looking forward to see JSON::Color and YAML::Color, and might even write them myself someday if needed.

Since there are already several syntax highlighters targetting HTML (like those Javascript-based ones, search.cpan.org is even using one), a feasible approach is to convert HTML output of syntax-highlighted JSON/YAML/others to ANSI. Sort of the reverse of HTML::FromANSI.

Yet another approach might be to raw dump the output of color-supporting text-based browser like links2 (complete with its ANSI escape codes), though I can't seem to activate its color support in my terminal ATM.

2. Compress::smaz. An interface to the smaz compression library. Might be useful someday, since I deal with language text a lot.

3. RSS::CPAN::ReverseDepends. In a similar spirit to previous idea, RSS::Mention::CPAN::Module, this module can generate feeds to let CPAN authors know when there is a new module on CPAN using (one of his, or any of his) modules. This should be easily done using the MetaCPAN API.

YAPC::Europe Pre-Conference meetup on Sunday 19th August

If you arrive on or before Sunday, there is an informal meetup on Sunday evening, 18:30 in the Café Extrablatt near the Bockenheim Campus of the University.

It would be good for us if we have a rough estimate of how many people plan to attend. So if you plan on coming, please head over to the wiki and add your name.

See you in Frankfurt!

The Fallacies of Distributed Computing

I've just proposed the following talk at YAPC::Europe:

Networks are great in theory, but have some well-known limitations that you should bear in mind when using them. Come find out what they are so that you don't make the same mistakes.

Updating Geo::GeoNames

I'm updating Geo::GeoNames, and my fork is on Github. I have a bunch of geo-coordinates where I want to know the country or city names so I can easily remember why I have those coordinates and tell them apart from the other coordinates.

Since it's last release, GeoNames changed the web services address and started requiring a username (which you can get for free). Once you respond to the email and enable free access on your account, you are ready to go. I've updated that.

I've also responded to all of the RT tickets and Google Code issues. I think I've fixed everything that I can fix.

The tests pass, at least for me. Many of the current failures come from the outdated interface before GeoNames required usernames. There's some tests that I've made TODO until I care about those features. If you'd like something that isn't supported, send a pull request.

I don't know if the current module handles all of the search types. I'm not particularly interested in making it definitive as long as it has the stuff I need. When other people need unsupported types, they can add those too. If there is someone who is motivated to maintain Geo::GeoNames long term, I can make co-maintainters.

CPAN modules for getting module dependency information

I've written a review of CPAN modules for getting module dependency information. There are 8 modules on CPAN covered, plus I've included a module I've just written, as none of the ones I reviewed did quite what I wanted.

I've taken a slightly different approach to this review: previously I've spent a lot of time learning about each module, trying to fix any bugs I come across etc, so the first version published is fairly polished. As an experiment, this time I've done a much quicker first pass, and essentially published a first draft. I started off with 6 modules, but two more were pointed out by readers.

I wanted one of these modules for another review I'm working on, where I was curious what all the modules were getting pulled in by some of the modules under review.

Any comments on the review, and identifying missing modules, appreciated as ever.

Curtis 'Ovid' Poe comes to Frankfurt

We're happy to announce that Curtis Poe will be attending YAPC::Europe 2012. If you don't know him, he is a programmer, prolific blogger about living and working abroad and the author of "Beginning Perl".

The unofficial subtitle of his book is 'Get a job, hippy!' It's focused very heavily on real-world skills that you'll need in the marketplace. It's based not only on Curtis' 13 years of experience with Perl, but also on surveys that show what companies are actually using. For a short time, you can read it for free at http://ofps.oreilly.com/titles/9781118013847/

We are very happy to have him visit Frankfurt and give a keynote.

Logging LWP HTTP requests with Log::Any

Yet another effort to add Log::Any logging to a popular module, this time LWP. Presenting: Net::HTTP::Methods::patch::log_request. Inside, tt's currently just a wrapper for format_request() method in Net::HTTP::Methods, which is where the raw HTTP request is being formed.

To use it:


use Net::HTTP::Methods::patch::log_request;

# now all your LWP HTTP requests are logged

use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
my $response = $ua->get('...');

Sample usage and output (by using LWP via WWW::Mechanize; you can see how Google redirects to the country-specific domain here):

10 Out Of 10

How to File a Perfect Bug Report

My criteria for a perfect bug report...

  1. The report is filed correctly.
  2. The issue identified affects the latest version of the software.
  3. The report includes a test script illustrating the problem
  4. ... which is self-contained
  5. ... and is minimal
  6. ... and conforms to the Test Anything Protocol.
  7. The report includes an explanation.
  8. The report includes patch
  9. ... which is well-written
  10. ... and obeys coding conventions.

Obviously all reports of genuine bugs are welcome, but that doesn't mean all bug reports are equal; some are better than others. Getting 10 out of 10 is a lot of work, but even 6 out of 10 is better than average in my experience.

Why is writing a good bug report important? Because the better the bug report, the faster the issue can be solved; and the faster the issue is solved, the sooner you can use the fixed software.

So let's look at those criteria a little more closely.

File the Report Correctly

The Quantified Onion

Since Joel has outed me already. :-)

At this year's YAPC::NA I had a chance to meet David Mertens and Joel Berger.

After some email exchange with David and Joel I decided to create a Google Group, The Quantified Onion, for discussing the use of Perl in science. This will hopefully work with Joel's Perl 4 Science site.

I hope we are in for a fun ride.

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.