Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Yanick (3196)

Yanick
  (email not shown publicly)
http://babyl.dyndns.org/techblog

Journal of Yanick (3196)

Wednesday November 28, 2007
08:23 PM

Redux

Lately, I've been having fun with GreaseMonkey. Net result: I've re-implemented my Perl-themed friends/foes icons (originally done using Stylish) and hacked RT to provide sorting of bugs by severity (I got the idea for that one from Schwern's journal). Both monkey scripts are available on userscript.org.

Also, a new version of Pod::Manual is out. The code to generate my unexpectedly wildly popular ad-hoc Catalyst manual was already included in the previous distributions, and in this one I added a similar manual for Rose::DB::Object. The order in which the modules are given is a little rough and need improvement, but it's a start. For those who care more about the end than the means, the pdf of both manuals are available here

.

Wednesday August 01, 2007
07:21 AM

No-one expected the Technorati inquisition

Slightly amusing trivia: before the hoola-baloo of the last few days, I was persuaded that it was the technocrati, and that it was secret organization of nefarious hackers -- an amalgam of the Illuminati and WhiteWolf's Technocracy.

Anyway, here goes: Technorati Profile.

Sunday July 22, 2007
11:10 AM

Trying to define badness: Shakesphackers

Shakesphacker: (n.) a programer who, at the instar of Shakespeare's infamous chimps, randomly bang on the keyboard until the laws of probability make him generate a working line of code.

I came up with that term Friday to try to put a label on a coding philosophy I observed. I'm not entierely satisfied by it though -- it sounds way too sophisticated for the kind of feeling it try to convey. "Foo flinger" could be more adequate.

In all cases, shakesphackers can be easily identified by their exuberant love of evals -- they firmly believe that, just like violence, if it doesn't solve your problems, it's because your not using enough of it.

Saturday July 14, 2007
08:27 PM

Pod::Manual

A while ago, I hacked together a way to gather many pod files into a single pdf file. Well, finally I got around cleaning up the code and released it as Pod::Manual.

It's still very muchly alpha quality, but the basics seem to work. For example, the following works (at least on my machine)[*]:

use Pod::Manual;

my $manual = Pod::Manual->new({ title => 'Catalyst' });

$manual->add_chapter( $_ ) for qw/
    Catalyst::Manual::About
    Catalyst::Manual::Actions
    Catalyst::Manual::Cookbook
    Catalyst::Manual::DevelopmentProcess
    Catalyst::Manual::Internals
    Catalyst::Manual::Intro
    Catalyst::Manual::Plugins
    Catalyst::Manual::Tutorial
    Catalyst::Manual::Tutorial::Intro
    Catalyst::Manual::Tutorial::CatalystBasics
    Catalyst::Manual::Tutorial::BasicCRUD
    Catalyst::Manual::Tutorial::Authentication
    Catalyst::Manual::Tutorial::Authorization
    Catalyst::Manual::Tutorial::Debugging
    Catalyst::Manual::Tutorial::Testing
    Catalyst::Manual::Tutorial::AdvancedCRUD
    Catalyst::Manual::Tutorial::Appendices
    Catalyst::Manual::WritingPlugins
/;

$manual->save_as_pdf( 'catalyst_manual.pdf' );

At this stage of the game, bug reports and feature requests would be very welcome. As well as suggestions for other example manuals.

[*] caveat: for the moment you need TeTeX installed to generate pdf documents. One of the items on my todo list is to allow for other means to generate the pdf (jadetex, FOP, etc)

Wednesday June 27, 2007
04:04 PM

push @ISA, 'Married::Man'

On Saturday, June the 23rd, me and my lovely lady joined APIs before friends, families and the Great Whitely-Bearded Hacker in the Sky (He was even kind enough to schedule some wicked light effects for the event).

Funnily enough, both the bride and the groom were wearing pearls for the occasion (in my case, it was an heirloom tie-pin given by the mother-in-law). As unforgivingly geeky as it is, I must say I got a secret kick out of that.

Wednesday April 18, 2007
09:41 PM

Catalyst's manual

Don't get me wrong, I love perldoc. But for documentation that span several manpages, I often catch myself dreaming of tables of content, indexes, real dead-tree margins on which to annotate stuff. I'm funny that way.

So I went back to the script that I wrote to create the XPathScript manual and tinkered a bit with it. I then used that newly-concocted black magick (which basically convert and agglomerate pods into a docbook, which is then LaTeXified and subsequently pdfed) to turn the Catalyst manual into a cute little pdf. Me likes. I think I'll tidy up the aforementioned script and publish it as Pod::Manual or something of the kin as soon as time (ah!) allows.

(and yeah, I'm in the process of getting my feet wet with Catalyst. Last week I was hopelessly Not Getting It, but sometime during last week-end, an angel came to me and bapped me over the head with its trumpet. Epiphany! I grok it, now! Even better: I think I'm digging it too!)

Saturday March 10, 2007
01:00 PM

Meeting Availability Dialect

Background

Organizing the March meeting of Ottawa.pm, I came across the problem that setting a date is pretty much like playing Battleship. If a specific date is proposed, people tend respond with boolean answers (can/can't come on that day), which is perfect to assess the punctual value of the attendency function, but quite lousy to determine its monthly optimum.

So, taking the premise that there's no simple problem that can't be solved by an overcomplex solution, I thought about a way we could all signal our availabilities for a certain month in a simple, standard and easy to parse way (for I have evil plans to hack a script to help me do the scheduling). A few bus commutes later, MADness was born.

Meeting Availability Dialect

A MAD signature line has the following syntax:

                month : availability

The month is simply the name of the month. Availability is defined by a sequence of tokens that add or remove available days, depending if they are modified by a plus or minus sign.

E.g.:

                April : WD + Sat - Wed - Day(13)

which means any work day, plus Satudays, but not Wednesdays or the 13th of the month.

The base token are:

Mon
Tue
Wed
Thu
Fri
Sat
Sun
AD - Any day
WE - Week-end (same as 'Sat + Sun')
WD - Week days (same as 'Mon + Tue + Wed + Thu + Fri')

For a specific date, use Day(X), where X is the date. For example, 'WD - Day(14)' means all week days, except on the 14th (one can surmise that was for February).

To target a specific week, append '(X)' to the token, where X is the week in question. Several weeks can be given, separated by commas or a range operator '..'. For example, 'Tue - Tue(2)' is equivalent to 'Tue(1,3..4)' and means the first, third or fourth Tuesday of the month.

Availability is resolved from left to right, which means that, for example,

                April : AD - WE + Sun(1)

means any day, except week-ends, although the first Sunday is okay. Note that
this is equivalent to

                April: WD + Sun(1)

MAD doesn't consider whitespaces as significant. The full availability, however, must be represented on a single line.

Thursday February 15, 2007
10:09 PM

$tea="Earl Grey";print $tea

Don't go and gnaw off your fingers just yet. Judging from this demonstration of the bleeding edge of speech recognition technology, we will need our ten stubby friends to bang on keyboards for a little while still....

Saturday January 20, 2007
06:46 PM

XML::XPathScript 1.47 is out

It is with great relish that I announce that XML::XPathScript v1.47 is on its way to a CPAN mirror near you.

[ ED: Do'h! The test that was supposed to gracefully skip if B::XPath isn't installed bombs instead. (blame it on my naive assumption that 'eval { use B::XPath; 1 }' would work). I'll do a s/use/require/ on that test and release 1.48 tonight. ]

What is new in this release:

* template tag attributes can now be functions as well as strings.

        For example,

                $template->set( 'foo' => { testcode => sub {
                                my( $n, $t ) = @_;
                                my $name = $n->findvalue( 'name()' );
                                $t->set({ pre => transfurbicate( $name ) });
                                return $DO_SELF_AND_CHILDREN;
                        }
                } );

        can now be written

                $template->set( 'foo' => { pre => sub {
                                my( $n, $t ) = @_;
                                my $name = $n->findvalue( 'name()' );
                                return transfurbicate( $name );
                        }
                } );

* The 'content' template attribute, which associates template elements to
mini-stylesheets.

        E.g., the code

        <%
                $template->set( 'foo' => {
                                pre => '<newFoo foo_myattr="{@myattr}" >',
                                post => '</newFoo>',
                                action => 'bar', # only process 'bar' node children
                } );
        %>

                can now be written

        <%
                $template->set( 'foo' => { content => <<'END_CONTENT' } );
                        <newFoo foo_myattr="{@myattr}" > <%# look Ma, we interpolate! %>
                                <%~ bar %> <%# only process bar children %>
                        </newFoo>
        END_CONTENT
        %>
        <%# process all foo's %>
        <%~ //foo %>

        Or, to be more easy on the eye, we can use the short-hand version:

        <%@ foo
                <newFoo foo_myattr="{@myattr}" > <%# look Ma, we interpolate! %>
                        <%~ bar %> <%# only proces bar children %>
                </newFoo>
        %>
        <%# process all foo's %>
        <%~ //foo %>

* B::XPath now a supported DOM tree. Bored with transforming XML documents?
How about transforming Perl Optrees? :-)

                use B::XPath;
                use XML::XPathScript;

                sub guinea_pig {
                        my $x = shift;
                        print "oink oink " x $x;
                }

                my $xps = XML::XPathScript->new;

                $xps->set_dom( B::XPath->fetch_root( \&guinea_pig ) );
                $xps->set_stylesheet( '<%~ //print %>' );

                print $xps->transform;

Thursday January 11, 2007
10:26 PM

Resurrecting Ottawa.pm

One of my resolutions for the new year is to try and see if I can stir Ottawa.pm back to life (it kinda went under two year-ish ago). I've already sent a humble request to the Power that Is at pm.org to get the keys to the ottawa.pm.org website and mailing list. But still remains the most daunting task: gather minions. I already spotted 11 Perl programmers on meetup.com that would probably be interested. And I should also be visiting the local LUG, always a fertile ground for young llamas....

Anyway. No need to say, if you are in the vicinity and want to join the fray, please feel free to frantically wave in my direction. If not, well, wish me luck. :-)