Main

December 29, 2005

Komodo anyone?

Komodo LogoThere is a promo code which gives you the personal edition of Komodo for free ;) As a late Christmas present from ActiveState.

Well worth the effort for a IDE and is built upon Mozilla's XUL framework.

Award-winning IDE for dynamic languages, providing a powerful workspace for editing, debugging and testing your programs. Komodo offers advanced support for Perl, PHP, Python, Ruby, and Tcl. Komodo runs on Linux, Mac OS X, Solaris, and Windows.

UPDATE:

The offer ends on December 31st 2005.

August 9, 2005

p5-Perlbal for FreeBSD

There's a slight delay with my p5-Perlbal port for FreeBSD, as I need to figure out the correct way of figuring out if p5-libwww is installed (that's where the HTTP::Date package comes from after a bit of digging) and ensuring that Danga::Socket is installed.

I suppose one of the nicer sides of digging around with the FreeBSD ports tree is that one tends to learn something new each time you play around with creating ports for various applications and libraries that you use, even if you just update ports.

July 26, 2005

Perlbal 1.3 has been released

Perlbal 1.3 has been released! :) Perlbal is an uber cool Perl-based reverse proxy load balancer and web server.

July 20, 2005

10 essential development practices

Picked up via Jim Winstead:

damian conway’s “ten essential development practices” article (via daring fireball) may appear on perl.com, but the basics are applicable to any software project.

i would put “use a revision control system” way at the top of the list, and i would also add “use a bug-tracking system.”

July 15, 2005

Perlbal with IO::AIO support

Noticed that Brad has committed to IO::AIO support to perlbal, so in theory perlbal should be a happy camper under FreeBSD.

April 29, 2005

Code readability

Jim Winstead, Jr. brings up a point which deals with the subject of bad code readability which Neil has brought up previously.

It's the simple things like taking the time to make your programming easier. For example Jim shows us the following example:

$query = "SELECT id,name,url,rss,md5sum,method,updated AS up,"
         . "       UNIX_TIMESTAMP(lastchecked) AS lastchecked,"
         . "       UNIX_TIMESTAMP(updated) AS updated"
         . "  FROM blogs "
         . " WHERE updated > NOW() - INTERVAL 10 MINUTE AND method = 0"
         . " ORDER BY up DESC"
         . " LIMIT 10";

Which he goes onto mention that he is now doing it like:

$query= "SELECT id,name,url,rss,md5sum,method,updated AS up,
                  UNIX_TIMESTAMP(lastchecked) AS lastchecked,
                  UNIX_TIMESTAMP(updated) AS updated
             FROM blogs
            WHERE updated > NOW() - INTERVAL 10 MINUTE AND method = 0
            ORDER BY up DESC
            LIMIT 10
          ";

Which makes it easier to copy and paste into the mysql command line utility. I'm known for having extremely long lines of code for SQL queries when I was programming in PHP back in the day. Also in certain ways it can make it worse when you have long long lines which you are trying to debug and are unable to figure out quickly what your 900+ character SQL query is doing!

A line like:
$categories = $dbh->getall ("SELECT directory_company_category_map.company_id, directory_categories.id AS category_id, directory_sub_categories.id AS sub_category_id, directory_categories.category, directory_sub_categories.sub_category_name FROM directory_categories LEFT JOIN directory_sub_categories ON directory_sub_categories.category_id=directory_categories.id LEFT JOIN directory_company_category_map ON directory_company_category_map.category_id=directory_categories.id LEFT JOIN directory_companies ON directory_companies.id=directory_company_category_map.company_id WHERE directory_company_category_map.category_id=directory_categories.id AND directory_sub_categories.category_id=directory_categories.id AND directory_company_category_map.sub_category_id=directory_sub_categories.id AND directory_company_category_map.company_id='" . $listings[$i]['id'] . "'");

is quite a bit to process ;) It looks way better like:


<?php
$categories
= $dbh->getall ("
SELECT
    directory_company_category_map.company_id,
    directory_categories.id AS category_id,
    directory_sub_categories.id AS sub_category_id,
    directory_categories.category,
    directory_sub_categories.sub_category_name
FROM directory_categories
LEFT JOIN directory_sub_categories
    ON directory_sub_categories.category_id=directory_categories.id
LEFT JOIN directory_company_category_map
    ON directory_company_category_map.category_id=directory_categories.id
LEFT JOIN directory_companies
    ON directory_companies.id=directory_company_category_map.company_id
WHERE
    directory_company_category_map.category_id=directory_categories.id AND
    directory_sub_categories.category_id=directory_categories.id AND
    directory_company_category_map.sub_category_id=directory_sub_categories.id AND
    directory_company_category_map.company_id='"
. $listings[$i]['id'] . "'
"
);
?>

April 1, 2005

Perl Documentation Site

Via Ask:
The Perl Documentation website has found a new home over @ perl.org and Jon Allen was responsible for that. Great addition to the perl.org resources. :)

March 31, 2005

Random Python Notes

Coming from a PHP and Perl background sometimes using python can be a bit of a challenge when remembering what sort of array to use as python calls these dictionaries, tuples, or lists.

I've started compiling a random python notes and am planning on comparing various perl and perlism's with their equivalent python version.

December 24, 2004

Movable Type Comment And Trackback Closing Script (PHP)

I've hacked together a script which closes commenting and allowing trackback pings to blog entries that are older than 15 days. You can view it over here.

This is a early christmas present. It was written using PHP and PEAR DB (which should be in your include_path).

I was trying to get Kasia's perl based comment closing script to work but it did not and I was not in the mood for perl a few days ago and I hacked up the following php script.

It's been done by others before (Jeremy has it on his blog, mine is better cause it's longer!) but in the spirit of "not invented here" I wrote my own script which closes MT entries to comments and pings.

The idea is to cron it and forget about it and it has worked in that capacity well enough for the last few weeks.. so if anyone wants to use it (or they just like to amuse themselves by reading perl written by a Java programmer) the code is available here.

Remember you need to change the database connection details and you are good to do.

October 11, 2004

perl.org subversion and cvs server

Ask has been blogging about the perl.org subversion and cvs server being on the blink. It takes me back a couple of years to when clients here were using SCSI disks.

The server hosting the perl.org subversion and CVS repositories, request tracker and our spam and virus filters took "a break" with a billion SCSI errors a few hours ago. It should be completely up again soon.

Hurrah again for the console server. Had it not been for that and the fancy power strips I'd be in the datacenter downtown cursing at the server instead of home cursing at it.

Ironically it's one of our older (lots of our hardware is old, but this one is Really Old) boxes and we have been working slowly on moving stuff off it... Time to speed that up.

Afrigator