Because I haven't neglected enough blogs

I've been thinking that a code journal of some kind would be nice. You know, the stuff that doesn't matter enough to spend days agonizing over whether I'm being too advanced or too simplistic. My other blog is okay, but I like the MT interface.

Why blogs.perl.org? I realize it may not be cool to say in some crowds, but I like Perl, Parrot, and Rakudo. This site seems like an excellent place to write about writing in those environments.

So, we'll see what happens.

Obligatory First Post

More to come in due course.

TPF Grants

To be an institution, or to represent an institution, is not a simple task. Namely, I represent The Perl Foundation (TPF), and specifically, I represent TPF Grants Committee (GC).

We, at TPF GC, receive quartely grant proposals on Perl, to be funded by TPF. We can't fund all (and we do not want to fund all). So, they are posted publicly for community discussion and are voted by the GC. We try to have in consideration the relevance of the grant to the Perl community (taking into account community comments), the grant proposal clearness (if it is clean, probably the proposer knows how to make his task), the amount requested (if it is worth the work proposed) and the proposer curriculum. This last item is, probably, the most abstract. But if the proposer has the skills and has previous contributions to the Perl community, that is usually enough. It is also important to analyze the proposer past on TPF Grants. If he failed any grant before, probably that will be taken into account.

More on 100% Test Coverage

I recently wrote about 100% Test Coverage. I was pointing out that in a personal project, I was working on increasing coverage and everywhere where there wasn't coverage, there were bugs. Here's the flip side: if it's covered, it doesn't mean its bug free. I've talked about this on my old use.perl blog, but it's worth repeating for new readers.

Google Talk with Perl

I was looking for a way to send a Google Talk message (via Perl) whenever a certain something occurs, and thought it'd be a simple task since Google Talk uses the Jabber protocol, XMPP and all that.

Boy was I wrong.

I found some code on the 'net which used Net::XMPP::Client to create the connection to talk.google.com, authenticate and send the message. It just didn't work.

Turning some debugging on revealed I was getting an "incorrect-authz" error from Google. The username and password weren't at fault (that'd be another error).

As from this page the reason for the authorisation failure has to be found in the feature called "JID Domain discovery".

This is an example of the string used to authenticate to gtalk:

Obligatory First Post

More to come in due course.

Odd issue with in-memory filehandles being cut off with Pod::Simple

Fayland Lam apparently got tired of me sending him patches so I released his Dist::Zilla::Plugin::ReadmeFromPod on CPAN today with some fixes, yay for GitHub powered collaboration.

Fayland previously released version 0.05 with a patch of mine which replaced IO::Scalar with an in-memory open(). This fixed an issue with PODs with non-ASCII E<> characters but introduced another one.

For some reason using in-memory open() like this yields a POD that's cut off, here's a test for it via Gist. I couldn't find out why in-memory open() behaved like this so I just used temporary files instead and released that as 0.06.

Theoretically I could have avoided all this by using Pod::Simple's output_string method to save the processed POD to a string instead of a filehandle, only that brought me right back to square one since that too has encoding issues.

Technology 'expertise' spam

I just got this email:
---
Subject: Agile Development Methodologies

... waffel ...

We are a Gold Certified Microsoft Partner but have the expertise to work in any technology.
---

I've asked:
---
Could you tell me who your experts in Assembler, Fortran, Haskell and Rakudo Star are?
---

I'll update this post if I hear back from them... somehow I don't think I will!

Agile Project Software Recommendations?

Here's a meeting from a previous company:

  • Project manager: we've chosen a new ticketing system.
  • Developers: which one?
  • PM: I'm not telling you.
  • Devs: What? Why not?
  • PM: Because you're just going to argue about it.

I can actually understand the business person's frustration, but this was a recipe for disaster. It was a blatant example of what seems to happen all too often: the people who choose software are often not the people who use the software.

Speeding Up Code

The latest heavy project at $work makes me miss C a bit. There's a lot of Moose objects, KiokuDB, MooseX::Getopt (which is evidently much lighter than I thought) and more. To display all the entries I have in a KiokuDB SQLite database, it takes roughly a second and a half!

Profiling with NYTProf 3.0 (FTW!) shows that Moose takes the most. I don't want to use Mouse for various reasons which I won't go into. Moose::Compile, MooseX::Antlers, nothing near production yet (but I'm keepings my fingers crossed). I tried to rewrite the MooseX::Getopt part and use Getopt::Long manually, but it only speed it up by 30ms. Oh, and yes, everything is immutable. Requiring KiokuDB::Navigator only in the part that loads the navigator gained me 300ms.

I can start rewriting everything with clean Perl objects. It could take a while, but I could get it done. However, that would be losing all the fun and power I get from Moose. Instead I thought of a different idea.

Google Summer of Code is coming

The mentor org activities for this year's Google Summer of Code are getting underway.

Now is the time to get involved if you are interested in mentoring or helping The Perl Foundation find students to hack on perl, parrot, or cpan modules this summer.

New functionality in Cantella::Worker

I just released a new version of Cantella::Worker and I'm really happy with the improvements. I updated Cantella::Worker::Manager::Prefork and added a couple of options to add a little more fine-grained controls to the worker processes, such as whether the workers should detach from the manager's session or not and a way to adjust the priority of worker processes. More importantly, I added the "program name" attribute and functionality and I made children automatically shut down if their manager dies, so that you never have an unsupervised worker pool. Special thanks to Rocco Caputo for his help. So, here's an example so you can see the progress made:

100% Test Coverage?

OK, you know how it works. Everybody who's really comfortable with testing often offers the following advice:

  • Use Devel::Cover
  • Don't strive for 100% coverage

This advice is absolutely correct, but misleading. It leaves you with an obvious question: what coverage do I want? This is where the danger lies.

Measuring the Progress of UI

Lately I've been learning ExtJS (which I might write about separately sometime) to try and create a UI for a small application I'm writing for a friend.

The application uses Dancer and KiokuDB. They're both easy to work with and I spent little time working on the backend. The problem lies in the frontend, where I need some UI. I've chosen ExtJS because it has built-in widgets.

I've played with tutorials, general documentation and (tried to) read the not-as-friendly-as-I-thought API. I was able to create a grid, a form and even a viewport. However, it kept feeling like it's stuck. Not stuck as in "this is going slow", but stuck as in "not moving at all".

New Safe.pm fixes security hole

Safe.pm, originally released with perl 5.002, has been an experiment to bring compile-time safety to perl. It allows to compile a (usually user-provided) snippet of perl code and execute it, while forbidding a configurable list of operations -- for example, all perl built-ins that would require disk or operating system access. Moreover, Safe "chroots" perl's main:: namespace, so the real program's variables can't be overwritten by the ones created by the code executed from Safe.

It's pretty clear that Safe does not provide absolute safety. For once, even overly restricted, it can be abused to execute code that allocates gigabytes of RAM, or goes into an infinite loop. Also, Safe is forced to share a small list of variables and functions with the main program; $_ is an obvious example, being the default topic for a lot of built-ins; functions from the UNIVERSAL:: and utf8:: namespaces also come to mind.

Really?

P****, the P*** I**, apparently has a blog. Unfortunately, it has a "please socially network me" crapstain (1) on every post, and requires Javascript and cookies to post. Color me not surprised.

(1) http://imgur.com/kmupS.png

Perl in Germany · My CeBIT Recap

I had the opportunity to help out the Perl::Staff at this years CeBIT. There was lots of interest in Perl, and we had lots of talks with people about what they are using Perl for, and how to bring the community and the companies using Perl closer together. This is quite a long post so I’ll put it behind the jump.

Dancer 1.160

Major release of Dancer finally out. You can read about it on Alexis' blog.

Basically this version provides a lot of improvements to Dancer:
  • Alexis Sukrieh worked hard on refactoring and optimizing.
  • David Precious did a lot of awesome work on documentation: we now have a cookbook and a deployment manual for various situations you might encounter. He also added a session backend with clean recursive dumps.
  • I added the route caching, which shows a significant speed improvement!
  • We have a mailing list
  • We have a new main domain (perldancer.org) and it's the first project to use a perlprojects.net subdomain: dancer.perlprojects.net.

I want to thank Sukriah and David for all their work and being great guys to work with.

Bust a move!

Compiling a full C library using Perl tools

ExtUtils::CBuilder supports C code compilation mechanisms whenever a C compiler is available. That is true on most Mac OS X installations and other UNIX flavors like Linuxes. Unfortunately that is not so common for Windows, but Strawberry Perl includes a GCC-based C compiler and a standard libc library.

This means that if a C compiler is available it should be possible to compile a C program, and to compile a C library. And that is true. Unfortunately ExtUtils::CBuilder includes method to compile bundle libraries and not common dynamic libraries. If you do not know what that means, probably you are using a common Linux. For Mac OS X we have that difference: the libraries created by standard Perl modules are bundles and not full featured libraries.

What's the Mad Doctor Doing?

In case you were wondering what Damian been's doing lately (and don't you dare say "Damian Who?" -- unless your name is Damian), he's been writing a series of articles for IBM Developer Works about the Vim editor.

On an unrelated note, one of my brothers is a psychiatric nurse. He often has to deal with patients in the Conway Ward. Coincidence?

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.