Month: July 2009

I'm not about to claim that I'm some kind of expert on the subject, but I think it's fair to say that I've experienced my fair share of ups and downs over the years which makes me a little bit wiser.

Put simply the questions is how do we avoid failure when designing and implementing complex software products?

This is how I would answer that question.

  • The golden rule of thumb to avoid failure is to figure out early what the biggest risks to success are, and then to keep them in mind every single day. Keep this up until success is achieved.
  • Another key to avoiding failure is to admit openly when things start to go wrong, or better yet when you expect that things might go wrong. Don't hide the truth because you are worried that your boss will get angry or that you will lose face with your team members.
  • If things start to go better than expected, then celebrate it and make it publicly known. You guys have struggled really hard and deserve the recognition for work done well. Go out and have a party, but don't get too drunk because it's bright and early as usual the following day.
  • Feel proud of what you are making and treat it like your baby. Protect and cherish it, nurture it and play with it.
  • Admit defeat if needed and just start all over again. It is much better to restart with new insights than it is to plug along with an ugly product which keeps getting uglier, and finally slowly sink into quicksand.
  • Use sound metrics to measure progress and regularly decide where you, where you are headed, and possible obstacles along the way which will delay progress.
  • Learn from your mistakes, write them down, keep this list with you at all times, and reread it at least twice a day.
  • Finally remain open-minded, honest and embrace change, which will happen whether or not you want it to. Change hurts while it is happening, but afterwards it makes you feel a whole lot better.

One could easily say that the statements above apply to developing successful software products as well as to most challenges in life.

| 3 Comments

In order to retain a well-grounded area of expertise as a so-called software developer, it's not only important to keep abreast of all the latest technologies, but also programming languages in general. The more you know the better.

That is why I make it a habit to learn at least one new programming language every three to five years. That way I can sustain my market value in an ever-changing and competitive market.

This time around Lua is my language of choice, and in order to celebrate my new pursuit of fame and wealth, I purchased the book Programming in Lua.

Here's some sample code. Tables can be used as associative arrays. This functionality allows us to store functions in a class table, ie. with the function name mapped to the function:

A = {}

function A:add(x,y)
  return x+y
end

print( A:add(1,2) )  -- prints 3

That will be a fun book to read during vacation.

You want to be notified by email every time that one of your servers reboots, for whatever reason that might be.

The most straight-forward way to accomplish this is by using the cron service. You want to fire up the following command:

$ crontab -e

and then add the following statement all on a single line:

$ crontab -l | grep reboot
@reboot echo "Rebooted, now online!" | Mail -s "`hostname` REBOOT" your@email.com

That's pretty easy now, isn't it?

I'm now reading the book "Sea of Poppies" by Amitav Ghosh and really like it. I like it so much that after having read the first one hundred pages, I found it so entertaining that I went back and read it all over again just in case I might have missed something (I did and maybe I should reread it again).

The backdrop of the book takes place during The Opium Wars of the eighteen hundreds, and the way the author writes pulls you into the story with such force that it's like you are walking right next to the characters and seeing stuff they see. Take the following excerpt for instance and upon reading it close your eyes and imagine you are there:

"The town was small, just a few blocks of houses that faded away into a jumble of shacks, shanties and other hut-houses; beyond, the path wound through dense patches of forest and towering, tangled thickets of sugar cane. The surrounding hills and crags were of strange, twisted shapes; they sat upon the plains like a bestiary of gargantuan animals that had been frozen in the act of trying to escape from the the grip of the earth."

Trying to follow the language of the so-called lascars (crew members onboard the ship) is sometimes frustrating, but if you need a helping hand with the strange slang you might want to print out the Ibis Chrestomathy and keep it on hand while reading the book.

On the one hand you have God playing with opium and using it as an instrument of fate, and on the other hand you have a list of characters entangled in a web of complexities and deception.

There's been some talk lately about this new-fangled Apache module called mod_perlite a.k.a. the do-it-all like mod_php but better module for Perl.

Since by nature I am a curious kind of guy looking for yet another interesting challenge, I'm going to have a look at it for myself.

The idea behind mod_perlite is appealing. As a lightweight replacement for mod_perl, mod_perlite is much easier to install, embeds a Perl interpreter in high memory, supports the core CGI functions and has a much smaller memory footprint.

Good old mod_perl is very powerful indeed. I've done alot with it and think it's a fantastic beast. However, it is simply not accessible to the average bloke because it is complex and hard to learn. Have you ever realized how heavy the book Practical mod_perl is with its nearly one thousand pages?! Also, hosting companies are not eager to allow its subscribers to twiddle around with potential dynamite and having to support poor customers sucked down in mod_perl quicksand.

Hey, let's make Perl as easy as PHP for regular users to deploy and for web hosting companies to give as an appealing dynamic web application server stack!

For those masses of kind folks out there who are not computer savvy and not waiting for the headaches of fighting mod_perl, this makes mod_perlite a no-hassle and feasible solution for the low-end plain vanilla servers out there.

Imagine how screaming fast it could be on quad servers hooked up together to provide high performance dependable web solutions.

Perhaps even Lighttpd can come into the picture, why not? Hey now, that's an interesting idea. Writing Lighttpd modules is fairly effortless and hooking this up with Lua could become a real eye-opener.

Wouldn't it be nice to have an one-two-three web server setup that installs easily and just does what it is supposed to do? The blog server market is exploding and could very well benefit from this.

I've got some time on my hands for the next week so I'm going to check mod_perlite out for myself.

Came home today to discover a package from Amazon waiting for me on my desk, and when I opened it I was excited to discover that the new Catalyst Book arrived.

I already started reading it, and I plan to devour it fully this weekend between my two golf tournaments.

In the meantime, I've already learned alot about the Catalyst Web Framework through weeks of hands-on experience at work, but I'm sure there's alot more extra stuff to learn by reading this fine book.

I'll be sure and write a (positive) review when I'm done.

I cannot wait to see the new movie by Sacha Baron Cohen.

This comedian is truly an amazing artist, and he certainly proves this with his third character which as usual he portrays convincingly, daring the public and challenging us with essential questions we'd rather ignore.

I find it very interesting how upset everyone gets, mostly for the wrong reasons. In their ignorance, these poor souls take things literally. Paranoia causes panic and off they go again for yet another meaningless witch hunt.

Let's avoid being confronted by our inner selves and instead take the easy route to stoning someone else to death.

Vulgarity, rudeness and harsh sexual jokes have been an essential part of comedy every since the very beginning of time. Ancient literature, Greek comedy, French theater of the Middle Ages, etc. Look at the classic "Gargantua and Pantagruel" which is full of pissing, farting, shitting, voluptuous boobs, etc. all over the place.

Why should things be different in this so-called modern day and age? People are by nature quite stupid and have got it all so very wrong.

May God forgive us all and someday save us from all this sin.

There were many interesting presentations given at the Sixth Dutch Perl Workshop earlier this year in Arnhem. The event was well organized and many people showed up.

I met many really interesting people there and even had the honor of giving my own presentation in front of the dynamic and fun-loving public. My presentation was called Perl and Scrum. Here's the powerpoint.

In the evening they drank some whiskey and played this weird card game called Fluxx.

| 4 Comments

For years now, I've been using a really great blogging tool called Movable Type Pro. This advanced utility does pretty much everything you'd ever want. Well, most everything that is.

Wouldn't it be great if you could also somehow automatically send out a twitter update (tweet) every time that you've created a new blog entry? Something like this:

Well, as of this very moment you can! All you have to do is keep reading, and if you are patient enough and read carefully what I have to say, then I will reveal to how it's done. Actually it's really quite easy.

Let's call it "blog tweeting".

This is the approach. Whenever a new entry is created, we want to tweet something interesting to the big bad world, grab everyone's attention that something really important has happened. Some kind of catchy phrase would be nice. I use the text "Yet another blog entry" followed by the entry title followed by a url you can click on if interested.

Nowadays, since tweets are deemed short and to the point, rather than use the complete url, which can get quite long, we want to include a shortened version of the url which fits nicely into the short message. The tinyurl service is the popular choice nowadays, so I will use that.

First of all, you need to have a couple CPAN modules installed, namely Net::Twitter and WWW::Shorten::TinyURL. These are installed in the usual way:

$ sudo cpan -i Net::Twitter WWW::Shorten::TinyURL

Net::Twitter is based on Moose meaning that the installation will pull in tons of extra dependencies. If you do not want this and only need to tweet an update, then you probably only want to install the lite version:

$ sudo cpan -i Net::Twitter::Lite

Alright, let's get started. At the top of your Perl script blog-tweet.pl include the following CPAN modules:

use DBI;
use WWW::Shorten::TinyURL;
use Net::Twitter::Lite;

Now you want to setup the usual database stuff using your movable type username and password like this:

my $dsn = 'DBI:mysql:<database>:<hostname>';
my $db_user_name = '<user_name>';
my $db_password = '<passwd>';
my $dbh = DBI->connect($dsn, $db_user_name, $db_password);
my $url = 'http://www.<domain_name>.com/';

The database query needs to grab the latest blog record from the mt_entry database where it is a blog entry (entry_class = 'entry') and the entry is published for view (entry_status = 2). This is what it should look like:

my $sth = $dbh->prepare(qq{
    select
        entry_title as 'title',
        entry_basename as 'basename',
        entry_created_on as 'created_on'
    from
        mt_entry 
    where
        entry_status = 2
            and
        entry_class = 'entry'
    order by
        entry_created_on desc
    limit 1
});
$sth->execute();
my $rec = $sth->fetchrow_hashref();

The field formats are:

  • created_on - "yyyy-mm-dd hh:mm:ss"
  • basename - "word_word_word"
  • permalink - "blog_root/yyyy/mm/word-word-word.html"
my $basename = $rec->{basename};
$basename =~ s/_/-/g;
my ($year, $month) =
    $rec->{created_on} =~ /(\d\d\d\d)-(\d\d)-.*/;
my $title = $rec->{title};
$url .= "$year/$month/$basename.html";
my $prev_url = '';

Get the previous url, if possible.

if (open(FH, '<blog-tweet.txt')) {
    # File exists.
    $prev_url = <FH>;
    close FH;
}

If new blog entry created, tweet update.

if ($prev_url ne $url) {
    open(FH, '>tweet-my-blog.txt')
        or die "Can't open 'blog-tweet.txt' file: $!";
    print FH $url;
    close FH;

    my $nt = Net::Twitter::Lite->new(
        username => '<username>',
        password => '<passwd>');

    # Convert longurl to shorter tinyurl.
    my $short_url = makeashorterlink($url);
    my $tweet_message =
        "Yet another blog entry '$title' $short_url";

    # Tweet you Update!
    my $result = eval{ $nt->update($tweet_message) };
    
    if ($@) {
        print "Tweet update: $tweet_message, failed ($@)\n";
    }
    else {
        print "Tweet update: $tweet_message, succeeded\n";
    }
}
else {
    print "No new blog entries yet.\n";
}

Finally, don't forget to cleanup.

$sth->finish();
$dbh->disconnect();

The final step is to create a simple cronjob which will run this script every once in awhile. Since I usually write at most one or two entries a day, I've added a cronjob to run once a day at 16.30 in the afternoon:

# crontab -e
30 16 * * * cd /path/to/cgi/scripts && ./blog-tweet.pl

That's pretty much it, have fun blog tweeting!

They say that practice makes perfect. However, the more golf I practice the worse I get.

At the beginning of the year after a long cold winter break from golf, I took out the old clubs and hit the links. I couldn't believe how well I hit the ball back then and golf was fun and relaxing.

Now after nearly a half golf season behind me, my game sucks and my handicap is slowly rising. Golf is getting frustrating and it has become stressful and not fun at all. I keep practicing but that does not help.

What makes it extra frustrating is the fact that I used to be really good and it's hard to accept that unless some miracle happens I will never be that good again. Or not?

I could just quit but I won't. Golf is all mental anyway, illogical and addictive.
Every minute and a half or thereabouts she received yet another text message. The notification beep of her mobile phone pierced the air. The high-pitched beep was so sharp and loud that it startled all those poor souls sitting next to her.

No one dared say anything, either they didn't notice, didn't care or were too polite to say something and risk a heated argument.

One wonders why folks crank the volume up so high like that. Why every incoming text message should be announced with such an aggravating peep seems strange to say the least.

Let's make it immediately known to everyone nearby that yes this young lady is so darned popular. She is sure receiving alot of text messages from one and another distant admirer. The public will go home and spread the word about the really popular girl in the train and it will be the talk of the town.

There I was observing this strange behavior from a distance. The next text message arrived right on schedule. She had the biggest smile on her face. When she looked up and saw that I too had noticed, she had to blush in purest satisfaction.
| 5 Comments

Everywhere you look these days in Perl literature, chances are that you'll come across references to Moose, how great and flexible it is and so forth.

Since I had such a lousy game of golf this afternoon and lost my first matchplay round six down, I needed a way to inspire myself. So what could be better then reading the Moose::Manual this evening?

Boy, was I in for a frustrating surprise.

I hate to admit it, but all this Moose stuff is not easy for me (grumble). Rather than getting all excited and inspired like I hoped, I'm sorry to admit that it's making me feel rather sad that I cannot figure this out.

Am I supposed to be able to understand this Moose stuff? After so many years of getting pleasure in tackling all kinds of complex programming issues, have I simply reached my limit? Time to give up trying to be a Perl guru, jump ship, and be forced to become a golf hacker the rest of my life? What do other fine Perl souls out there think about it?

Here's an example that better illustrates my frustrations. In the Moose::Manual::Concepts one goes on and on about classes, attributes, methods and roles. Not bad. A role has zero or more of this, a role has zero or more of that, a role has zero or more of this and that. Getting more difficult.

Later on one learns that a role is somewhat like mixins or interfaces in other OO languages. Getting more difficult. What the heck is a mixin (and how do you pronounce it)? The good old Wikipedia saves the day with a nice, clear definition:

"In object-oriented programming languages, a mixin is a class that provides a certain functionality to be inherited by a subclass, while not meant for instantiation (the generating of objects of that class). Inheriting from a mixin is not a form of specialization but is rather a means of collecting functionality. A class may inherit most or all of its functionality from one or more mixins through multiple inheritance."

Huh? Nearing apogee and getting impossibly difficult.

Whatever happens, I have promised myself to hang in there. Read and reread as much as I can. Stay smart. Get smarter. Figure it all out or else.

What with so many Perl gurus out there getting all fired up about Moose, mixin and stuff, why I want to join the fun as well!

Tomorrow it's all about Moose::Manual::Classes and then next the world.

Wish me luck.

You'd think that finally after all these years of struggling with my own kids when they were little, now they are all grown up and independent, I could kick back in the backyard, relax and read a good book once in awhile.

No I guess not.

The only problem is now two new families have moved in next to us and behind us, making a total of five cranky screaming kids new to the scene.

The new generation of moms and dads don't appear to care that their little loved ones might be disturbing the neighbors with all their shouting and fighting and cussing.

When our kids were that age I felt so overly conscious about bugging the neighbors. Upon the slightest argument and/or raised voices, I was quick to bring them inside, where I would sternly warn them with a wagging forefinger that they better behave themselves or else. The ultimate threat of sending them upstairs to their rooms for the rest of the afternoon would make them pipe down for a bit.

Not so nowadays, no way. The kids are the bosses, the parents are the ones who must listen, and the poor neighborhood souls can just forget about any peace outside at all.

Well, that's not quite true.

After ten o'clock or so in the evening, when the awful kids have stopped sobbing and crying in bed and have finally fallen asleep, my one hour of peace can be spent just before the evening gets dark.

Ah what a relief it is, and boy how much I appreciate the perfect silence and harmony.

Interapy_Keizersgracht.jpg

The fine folks at Interapy including me have moved to a new office building in the heart of Amsterdam.

The location is ideal and the new premises is a big improvement over the previous situation. Also Keizersgracht is special not only because it is right next to one of the nicest canals in Amsterdam but it also has the name for special people and companies.

My department room is twice as big and this is the most important step to professionalizing the development program.

I'm not as lucky with the traveling time as I have to travel two more train stops (add seven minutes) in addition to the four extra tram stops and the five minute walk.

It's kind of funny how since I started living over here, that Amsterdam keeps tugging at me to come back and either live and/or work there, like a magnet.

Here's a short list of examples of times I've worked and/or played in Amsterdam:

  • Slotervaart Ziekenhuis when I first met Thea
  • American Discount Bookstore - Kalverstraat
  • Singel Canal - our 1st appartment
  • Achter de Kolenkit - our 2nd appartment
  • Uniface - Amsterdam Zuid-Oost
  • Demon ISP - Herengracht
  • TomTom - Oosterdoksstraat
  • Telfort - Amsterdam Zuid-Oost
  • Interapy - De Roeterstraat and Keizersgracht

This just can't be a simple coincidence. Maybe in my previous life I was some worldly merchantman during the Dutch Golden Age conducting my affairs in worldwide trade, residing in some fancy city dwelling in Amsterdam, married to a beautiful Dutch women with ten or more kids running around next to the canals.

| 3 Comments

Or perhaps better yet I should rephrase the title above and instead write: Is agile development conducive to Perl?

For the last ten years or so there's been a big rage about the benefits of agile software development and how much better this methodology is compared to good old Waterfall or RUP or Ruby on Rails or whatever.

I would like to claim that Perl is just as good if not better than any other programming language when it comes to going agile. I've used it often enough and it has resulted in successful products hitting deadlines and bringing in big bucks. Who ever told us that early-to-market is an impossible task?

Perhaps Perl is not ideal, but it's flexible enough. Perl fosters creativity in such a way as to bring about visible results very quickly. There are many ways of doing things, and these alternative can be compared, the good with the not so good and even the bad with the outright bad, when choosing the most viable direction to take. Perl means moving forward not backwards.

Is speed the most important? Sure. Should we keep quality in mind? Yes, of course. Is there enough time to test? You better or else. Should we demo even though it's not quite ready. Yes and yes.

Let's have a look at Scrum which is one way of being agile. Since I've had more experience there, I feel more comfortable discussing it in light of the Perl programming language.

Scrum's success is based on a number of important concepts including the following:

  • Describe requirements as user stories
  • Prioritize tasks by business value
  • Commit to short-term goals and go for it
  • Allow the team to do anything to accomplish the goal
  • Do not disturb development during each cycle
  • Develop quickly and pragmatically

  • Take part in daily stand-up meetings
  • Measure speed by iterative development cycles
  • Empower the development team to make any and all decisions
  • Embrace change because it will happen
  • Review and improve
  • Foster bleeding-edge technology that might break things
  • Accept delays as part of life and make them public
  • Tackle risks early and do not fear failure
  • Verify, rework and move forward
  • Be proud of what you create
  • Have a fun and relaxing time getting things done

I could go on and on explaining the fine art of doing Scrum within the wonderful world of Perl, but I believe I've said enough for the time being.

Hopefully my short discussion here has tickled enough people out there to make them think and reflect upon their own experiences. Enough so at least that they are inspired to leave comments of all kinds, foster even more discussion, defending and/or judging good old Perl as a agile way of doing things (or not).

So is Perl really conducive to agile development? I think so.

This morning I had the perfect birdie. There was not the slightest hesitation in my mind. Three shots in a row, each one straight at the flag.

My drive was a real screamer down the left side of the fairway. The ball easily cleared the sand trap and hit the down slope which meant an extra thirty yards easy.

The pitching wedge swept the surface of the grass and made solid contact with the ball launching it with a nice arch right down the smoke stack.

Finally while the short putt was not quite a gimme I scoped the lie from behind the pin and then to the side before giving the ball a nice run to the middle of the cup.

The birdie sounded real sweet when the ball hit the bottom of the cup.

Random entries

Here are some random entries that you might be interested in:

Recent Assets

  • blog-tweet.png
  • Interapy_Keizersgracht.jpg
  • Kiffin_200x200.png
  • kiffin_gish_tiled.jpg
  • rss.gif

Recent Comments

  • Long time no see: I remember them, as well. I remember Donald was my ...
    - Charles
  • Bridge to the moon: Yes it was a drawing and my older brother told me ...
    - jpmcfarlane
  • Bridge to the moon: Wow, that's quite a coincidence that we both sent ...
    - Kiffin
  • Bridge to the moon: Hello I was in my teens when Gemini 4 went up that ...
    - jpmcfarlane
  • Back to work: Congratulations Kiffin, I hope it is something you ...
    - KathleenC

Golf Handicap

Information

This personal weblog was started way back on July 21, 2001 which means that it is 7-21-2001 old.

So far this blog contains no less than 2518 entries and as many as 1877 comments.

Important events

Graduated from Stanford 6-5-1979 ago.

Kiffin Rockwell was shot down and killed 9-23-1916 ago.

Believe it or not but I am 10-11-1957 young.

First met Thea in Balestrand, Norway 6-14-1980 ago.

Began well-balanced and healthy life style 1-8-2013 ago.

My father passed away 10-20-2000 ago.

My mother passed away 3-27-2018 ago.

Started Gishtech 04-25-2016 ago.