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 ]

milardj (4452)

milardj
  (email not shown publicly)

Journal of milardj (4452)

Thursday May 05, 2005
02:58 PM

No 'Louie Louie' FOR YOU!!

Band Banned From Performing 'Louie Louie'
http://story.news.yahoo.com/s/ap/no_louie_louie

Dawning said "Louie Louie" was not appropriate for Benton Harbor students to play while representing the district — even though the marching band wasn't going to sing it.

And my favourite ...

The best-known, most notorious version was a hit in 1963 for the Kingsmen; the FBI spent two years investigating the lyrics before declaring they not only were not obscene but also were "unintelligible at any speed."

Two years!

Monday April 25, 2005
08:05 AM

Does Randal drink single-malt scotch ...

From Saturdays Globe and Mail (couldn't find an online link) talking with Neil Bauman about Geek Cruises:

Okay, so who parties the hardest? According to Bauman, those who use Perl, a Web programming language. "They're a bright group of people. They like single-malt scotch and they're connoisseurs of beers."

Thursday April 07, 2005
01:18 PM

Whuffie in Action

Cory Doctorow wrote a book called Down and Out in the Magic Kingdom http://craphound.com/down/ which won the Locus and was nominated for a Nebula. Cory releases all his work under the Creative Commons license so follow the link if you want to download and read.

Down and Out takes place in a post-scarcity/post-mortality universe. Post-scarcity because basic human needs are met for all; post-mortality through cloning and brain backups. This isn't a book review (I was slightly underwhelmed but not to the point that I wouldn't read more from him) but I bring this all up because I see Cory's concept of Whuffie (think karma) all around me.

Autrijus has amassed so much whuffie in the past two months I would put him (not sure of the proper pronoun as a writeup of a perl golfing tourney kept referring to "her" and everyone else to "him" - I'll be able to settle this at YAPC::NA if no one sets me straight before then) as Thor to Larry's Odin and Damian's Loki (for the trickster aspect not the evil aspect - natch).

That doesn't mean that Autrijus has done more for the perl community then Tom C/Chip/Dan/Leo/Pierre/Alison/Luke/MJD/Damian or a dozen other good candidates. It doesn't mean that Autrijus is smarter then other people - it means that Autrijus started something that resonated with a lot of people and they repayed him in the new currency: respect.

What did Autrijus do? He started Pugs sure but more importantly he started his own tribe (an anarchist-collective of ADD/OCD/gay/straight/thumbed/thumbless/ritalin-taking/wage-slave/self-employed hackers - all hackers in spirit if not all necessarily in skill). Even more importantly I think Autrijus threw a virtual coffee cup against the wall and reenergized a community that desperately needed it. We don't need to wait for Perl6 - it's here right now. People are hacking in it now and exposing both warts and beauty marks.

I didn't mean this as another paean to the pugs-tribe but I've been thinking about whuffie lately. I've been watching as python-whuffie has been increasing as perl-whuffie has been steadily eroding. Surf lambda for a while, and though extreme, you'll get a pretty good sense of what perl-whuffie is like outside of our community. Loving Perl is starting to resemble an 80's John Hughes movie - really digging this girl but slightly embarrased about it and afraid you're friends will find out.

Which is a shame, because just like in that John Hughes movie (or think of Better Off Dead where John Cusack doesn't seem to notice that the hot french foreign exchange student is ... well .. hot) I am so excited about what @Larry has done with P6. There are things I don't agree with, and there are lots of things I still don't understand, but damn that hot french foreign exchange student is ... well ... hot.

Where Guido is removing features form Python so that developers don't have to think too much (that's almost a direct quote) I'm glad that the swiss army chainsaw is ... cue Mike Myers impersonation ... going nuclear, BABY!

Wednesday April 06, 2005
01:52 PM

Wanker

Hmmm.. haven't used that since my punk (MDC/Crass/Blitz/Clash/DK/Partisans still come to mind) days but it seems to fit ...

Frank Atanassow writes:

I've looked at the Perl apocalypses and they are hardly more than a scatter-brained enumeration of trivia and faux pas; it reads like a blind man's account of constructing a puzzle. It doesn't solve problems by solving problems; it's a misadventure in stochastic symbol-pushing. Perl 6 is just another iteration in that language's interminable and drunken meandering. Occasionally it stumbles across a good idea, in the same way that a construction worker might unearth a fossil when drives his pickaxe through it. According to you, I guess "we can regard him as" a paleontologist, then.

http://lambda-the-ultimate.org/node/view/309#comment-2405

(I'm sorry but I really need to get this off my chest, again:) Scripting languages thrive on hype because they have no other advantage; their advantage is the hype, and the popularity which accompanies it. Sure, Perl may be an improvement on sh (frankly, I am not so sure :) but it is hard to find a strawer man.

http://lambda-the-ultimate.org/node/view/186#comment-1428

1 will get you 10 that this guy is doing his PHD or first of many post doc's and has never held a real job ...

All theory and no practice ...

Monday March 21, 2005
04:20 PM

The King is Dead! Long Live the King!

Dan has officially stepped down as Parrot designer and has been replaced by Chip Salzenburg.

As anyone following parrot knows Dan has been MIA for the last few months so this is definitely overdue. I'm hoping that parrot will experience the revitalization and excitement that Perl6-Language has recently experienced (oh for the last 48 days or so).

Many, many thanks to Dan for all his work and many thanks to Chip for taking on the burden.

Now we just need to figure out a way to lock Leo, Chip, Autrijus, Sam Ruby, and @Larry in a room for a couple of weeks ...

Monday January 24, 2005
11:25 AM

Parrot Roadmap

It looks like Will Coleda has picked up the ball to put together a roadmap for Parrot (or at least to facilitate the creation).
http://www.nntp.perl.org/group/perl.perl6.internals/28131
Many thanks Will.
Friday January 07, 2005
10:18 AM

Homage to Simon Cozens

Thursday January 06, 2005
10:47 AM

RIP: Will Eisner

Will Eisner http://www.willeisner.com/index.html died on January 3rd. For those who have never heard of Will he created comic books and IMO the best comic to be distributed by newspapers: the 16 page supplement following the adventures of The Spirit.

Starting in the late 70's and continuing until his death Will also pioneered the creation of literaty graphic novels(in North America - Asia and Europe have never had the "comics are for kids" stigma prevalent here)

Will was an inspiration for multiple generations of comic artists and his work done 60-70 years ago holds up remarkably well today.

This weekend I need to wipe the cobwebs off of my comic collection and find the Kitchen Sink reprints of The Spirit and spend some time with an old friend.

Rest in peace.

Tuesday January 04, 2005
10:34 AM

Is Parrot going to self-destruct?

IMO the most important project in the perl world currently is Parrot. I love what I am seeing Perl6 evolve into (well most of it anyway) but it is Parrot that could evolve into the "killer" platform of the next decade.

I read quite a few technical blogs and it is amazing how much movement there is towards dynamic languages. The number of heavyweights who are extolling the virtues of Python and Ruby is pretty impressive.

I really see a great future for dynamic languages in the next decade and Parrot, if it is successful, could become the de facto standard.

Note the qualification. Will Parrot be successful? I'm starting to have my doubts. I could just as easily see the project flame-out in acrimony.

In the past month or two I've sometimes found it painful to follow the internals list because:

a) the same arguments are repeated endlessly
b) the animosity between the lead developers
c) the general black tone of some posts

I think part of the problem is that Dan has been pretty much out of touch for the last while. That's no slam against Dan because I have nothing but admiration for people working a full time job and essentially working a second full time job (Parrot) for the benefit of all of us. But I do believe it is hurting the project.

What is needed IMO is a clear roadmap of what is remaining, what is the design for what is remaining, what is the precedence and dependencies for the remaining tasks. This might exist already but if it does I see no evidence that it is being followed.

Does anyone have a good feel for where Parrot is in terms of completeness? Anyone else share my uneasiness with the interpersonal dynamics of peope working on the project?

I feel a bit hypocritical for sitting back and pointing my finger at the problems when I'm doing nothing to help on the project but I truly want parrot to succeed and I'm starting to wonder if it will.

NOTE: by "succeed" I mean widespread adoption by Ruby, Python et al developers and not simply a Perl6 VM.

Tuesday December 21, 2004
09:35 PM

My pet solution: Web framework

Amongst other things I intend to use this journal to discuss the design of existing and new projects and frameworks I have worked on. I tend to design in a vacuum these days (at my old job I was usually hooked up with a partner during design which I found to be educational and led to stronger designs - we both approached the problem from different angles and the design really benefited from that) and I miss having a feedback loop to point out missed opportunities and more effective strategies.

I'm a full time programmer who also operates a consulting/contracting company (very small scale) on the side. About 2 1/2 years ago I was contracted to create a web app which would allow:

  • Uploading of data files (typically market research results) into a database
  • Definition and generation of crosstab reports
  • Definition and generation of regular reports
  • Project, user, and client management

I decided on a framework that would be driven by XML. I borrowed the run mode concept from C::A and defined an XML file that would control the "steps" needed for each run mode:

    <rm name="login" next="main.html" on-error="login.html">
         <step handler="login"/>
    </rm>

"steps" could be predefined sql actions (see below) or delegated to a handler as shown above. "handlers" are defined in another xml file and are subroutines that are passed the CGI instance and the database handle:

<handler name="login">
    sub {
           my ($cgi,$dbh) = @_;
           #-- Do some stuff

           return $cgi;
        }
</handler>

I decided on this approach because I found that a lot of the perl code I needed as handlers were only a couple of lines long and I didn't feel the need to create a package.

In a questionable decision I decided to just pass the CGI instance throughout the framework. Any part of the framework could add new params to the instance or modify existing params. At the very least I should have created a wrapper to CGI. That is one of the items on my To Do list.

As mentioned previously "steps" could also be predefined SQL actions:

    <rm name="foo_search" next="foo.html">
         <step type="get" action="get_foo" using="foo_table.xml"/>
    </rm>

Where foo_table.xml contains all the SQL related to the foo table:

<sql name="get_foo">
        <statement>
                  Select col1, col2, col3 from foo
        </statement>
        <where>
                 where x = ? and y = ? and z= ?
        </where>
        <values>
            <column db_name="col1" alias="cgi_param_name1"/>
            <column db_name="col2" alias="cgi_param_name2"/>
            <column db_name="col3" alias="cgi_param_name3"/>
        </values>
        <bind>
            <column alias="x_alias"/>
            <column alias="y_alias"/>
            <column alias="z_alias"/>
        </bind>
        <struct alias_key="col1+col2" type="nested" cgi_param="foo_struct"/>
    </sql>

When RM.pm (the module which processes the run modes) sees a SQL step (type = get|delete|insert|update) it calls DAO.pm which is responsible for database interactions. DAO will execute the SQL and determine how to bundle up the result set. In this case because we defined the

<struct>

tag we are telling DAO that we want a more complex data structure returned. The struct tag instructs DAO.pm to return a hash where the key is the concatenation of the columns defined by the key attribute. The structure would be passed in $cgi with the param name "foo_struct" as defined by the cgi_param attribute in the

<struct>

tag.

If our result set is:

COL1      COL2    COL3
AAAA      11111   11111
AAAA      22222   12121

Then our return structure is:

{ "AAAA~11111" => { "COL1" => AAAA
                    "COL2" => 11111
                    "COL3" => 11111 },
  "AAAA~22222" => { "COL1" => AAAA
                    "COL2" => 22222
                    "COL3" => 12121}
}

If we specify type="nested" then the return structure is:

{
    "AAAA" => {
                11111 => {
                            "COL1" => AAAA
                            "COL2" => 11111
                            "COL3" => 11111
                         },

                22222 => {
                            "COL1" => AAAA
                            "COL2" => 22222
                            "COL3" => 12121
                         },
              }
}

By default, if no

<struct>

tag is defined, then each column is added to the $cgi instance where param name is equal to the alias attribute.

Run mode definitions can also import other defined run modes:

    <rm name="something_common">
            <step handler="always_need_this"/>
            <step handler="and_this"/>
   </rm>
    <rm name="foo_search" next="foo.html">
         <step type="get" action="get_foo" using="foo_table.xml"/>
         <step include="something_common"/>
    </rm>

We can also iterate run modes (or steps) when needed. For example say we have a multi select box and we want to execute a step for each highlighted option:

<rm name="delete_user" foreach="delete_user_list" set="user_id" next="userMgr.html">
        <step type="delete" action="delete_user" using="user_table.xml"/>
    </rm>

This run mode will iterate through $cgi->param("delete_user_list") set $cgi->param(-name=>"user_id", -value=>current id) and perform a delete for each user.

We can also iterate at the step level if some steps have to be executed for a list and some only once:

rm name="delete_user" next=" userMgr.html">
        <step foreach="delete_user_list "
                  set="user_id"
                 type="delete"
               action="delete_user"
                using="user_table.xml"/>
        <step handler="foobar"/>
    </rm>

So in summary - every interaction with the server is defined by a run mode. A run mode can consist of 0 or more steps (if 0 then we are essentially only setting the next page to serve up). Each step can consist of a predefined database interaction or be delegated to a handler.

I've found this to work very well for my purposes and I've been able to add many screens without having to write any new code at all. The SQL xml files are auto-generated by another program I wrote so some new screens (for example search/result/detail screens) can be created by simply defining the templates and by defining the run modes and steps. Since they all follow the same pattern I simply copy the existing run modes, change the template name, change the action names, and I'm done.