Month: May 2009

Sometimes positive thinking alone is not enough. In fact, overusing positive thinking in situations where it is not relevant let alone effective can just as easily back fire and make things worse.

Thoughts create moods which influence behavior and finally express themselves directly and/or indirectly as physical reactions. The body is connected to the mind and they communicate intimately with each other.

Just thinking positively may distract us and make us avoid the more important signals our bodies are trying to tell us: hey, something is wrong!

Let's say you have a problem and it is so frustrating that it is making you feel mad, letdown, depressed, irritable. By considering the situation from as many angles as possible, negative and neutral as well as positive, your thoughts are reformed to view things from a new perspective.

This reprocessing of mind can lead to new conclusions and solutions that make you realize that things aren't as bad as you thought, pushing depressing thoughts away and opening you for healing through change and improvement.

Mind over mood: the book and the website.
Here's a review I wrote about the book 'Perl Testing: A Developer's Notebook' by Ian Langworth & chromatic.

"Excellent overview and introduction to the art of testing Perl programs. This modestly-sized book covers a wide range of types of testing from the very simple Perl script to the more advanced web application. It's not only about writing tests but managing them as well and then making sure that your code can be distributed in a useful manner. I especially found the chapter about testing untestable code very insightful, where the use of mocking modules and mocking objects is essential. Have you ever needed to override live code by hacking deeply into their packages? Well, this book will help you out with this delicate matter and make you more confident with testing, testing and testing. Most people have an aversion to testing, but here you can get quickly up to speed and even enjoy the fine are of testing. There are many references to other CPAN modules which is useful to know about. Of course, any book authored by chromatic has to be worth the read."

O'Reilly books
Now that I've been stuck sitting across from the notorious foot tapper guy and recognize his face for future reference, I know who not to sit next to again while in the train.

Earphones blaring music, shoulders bouncing and the whole way home both his overgrown feet tapping loudly right next to mine.

A few times he shifted somewhat which resulted in direct hits to my toes, my grumpy glance not phasing him one bit.

Seek comfort when possible and make it so when the situation is temporarily otherwise, if you know what I mean. Humankind has much to offer. Each new episode is a learning experience while it lasts, so make the best of it.
I'm completely battered and bruised after one of lousiest rounds of golf yesterday.

The round started out just fine with a series of pars and bogies until the eighth where a massive drive went too far and landed in the bunker that no one should be able to reach in one shot. The ball lay just under the front lip, but I became greedy and thought I could hammer a good seven iron to the green. Of course, when I hit it the ball nicked the lip and skirted off to the right into the water hazard. I dropped my penalty shot and shanked the next one into the same water just a couple yards from the previous splash. Then I hacked an eight iron to the left of the green, chipped short and two putted for an amazing nine.

It didn't end there.

On the most difficult hole of the courser, which is a narrow par five dogleg to the left, I sliced my tee shot out of bounds. I topped my second shot and it rolled into the trees on the left. I attempted a low four iron through the trees, but of course hit the tree bulls-eye right in front of me and the ball bounced straight downwards between two thick roots. I hit another low four iron and this time it flew perfectly through the trees but hit the sand trap rake coming down and ricocheted into the sand. I caught the sand shot thinly and the ball flew over the green onto the cart path. To make a painful long story short, I ended up with a nine there also.

I felt like giving up golf altogether and either tossing my clubs into the nearby lake or giving them away to someone more deserving of this fine game than I. I felt like taking my clubs one by one and breaking the shafts across my knee. I felt like taking all of my golf balls and putting a torch to them. I felt like taking my favorite putter and wedging it into the side of my head.

However, after a good night of sleep has saved me again. The itch is coming back good and strong and the spirit of golf is consuming me again. Meaning that I'm going to give golf one more try this afternoon, just in case. Am I insane? Did that knock to my head with my favorite putter cause some kind of permanent damage? Can I afford losing so many balls again? What kind of addiction is this that hurts you so bad, completely destroys your sense of good worth, and then makes you keep coming back for more?

The sweet game of golf.
Kiffin_painting_dakkappel_1.jpg Kiffin_painting_dakkappel_2.jpg Kiffin_painting_dakkappel_3.jpg

What could be funner on a beautiful and sunny day than painting the dormer? In Dutch it's called a "dakkappel" which when translated literally means "roof kappel."

As you can see, this activity is not without risks considering the height and the occasional gust of wind which can surprise those unprepared for disaster.

By doing it myself, and perhaps risking a broken bone or two, I am saving us alot of money, so it's worth it.

3rd hole

Take for instance the third hole which is a short dogleg left par four downhill and a measly 275 meters long. This hole is enticingly short but very unpredictable if you happen to miss the middle of the fairway by more than ten meters.

With wind at my back I grabbed a four iron and hit a most perfect shot high into the air. The ball came down with a slight draw, barely clearing the left-hand fairway bunker, and took a mighty downhill bounce, rolling to within three meters of the green.

The flag was at the front, so this would mean an easy birdie. All I had to do was make a short chip over the bunker in front of the green letting the ball roll up to the hole. I was feeling pretty cocky (my biggest mistake).

This is what I did. Chipped fat into the sand trap. Shanked the ball out of the trap over the green to the right. Flubbed another chip barely onto the green. The putt made it barely halfway to the hole. Amazingly I made the longish put to save a grand six. Could not believe it but kept my cool.

Summary of this most painful hole: the first shot went to within fifteen feet of the flag, and then it took me five more shots to finish off in the hole.

One shot of 270 meters, and then the remaining 5 meters took me five shots, making it a lousy and very embarrassing double-bogey.

Yes, anything can happen in this game called golf, and that's why it remains for me a fantastic and challenging sport. So much of it is mental, no matter how fantastic you hit the ball.

All of a sudden I started receiving daily crontab email notifications from my web server with the following warning:

expiretable: Error opening "/dev/pf": No such file or directory

I checked my /etc/rc.conf and as expected it contained the following required lines:

$ vi /etc/rc.conf
pf_enable="YES"
pf_rules="/etc/pf.conf"
pflog_enable="YES"

So in theory everything should have started without any problems. Well, maybe not so just in case I fired off the following two commands:

$ kldload pf
$ /etc/rc.d/pf start
$ /etc/rc.d/pf status
No ALTQ support in kernel
ALTQ related functions disabled
Status: Enabled for 0 days 00:10:34           Debug: Urgent
...

Now working. If things go wrong again I'll have to investigate the problems better.

Just because you fall down doesn't mean you cannot pick yourself up and keep on going until you achieve your goal.

Determination is good. Getting there is even better.
| 2 Comments

Ever wondered how to quickly convert an array to a hash on the fly? Well here's one way to do it:

my %h = map { $_ => 1 } qw/one two three four/;

Feel free to come up with other perhaps more efficient and/or elegant and/or cryptic ways of doing this.

I need to concentrate on rotating better from the waist and not use my arms so much.

Since it was raining this afternoon, I decided just to hit a couple buckets of balls and try out a few slight variations on my swing.

Thinking "relax the arms and rotate the waist" was the perfect combination that helped me hit the ball sweeter and farther.

There are a million and one things about the golf swing that can and will go wrong if you try to think of them all at the same time.

Keep your head down or follow through or don't fall back or stand firmly on your feet or hold your head absolutely motionless over the ball or slow down your swing or imagine throwing your club at the flag or stand farther from the ball or stand closer to the ball or do the waggle twice when addressing the ball or keep your left arm straight or whatever.

Never ever try to remember more than one or at most two tips when trying to hit the ball at the same time.
My dog Luca loves to roll around on top of dead animals.

Take for example the days we walk along the waterway where a bunch of fishers have been spending the day.

Luca will sniff out the residue and if she's lucky she'll spot some dead fish which has been gutted and whose bones and scales have been left their in the sun to rot away.

Before I notice and can do anything about it, there she is rolling around upside down on top of the dead fish rubbing her back into it with much delight and wiggling.

The problem is that even though I wash her down when we get back home, the house stinks like a dead fish for a couple days.

They claim that this is normal dog behavior, a kind of instinct or throwback from the early days of wild dogs before they were domesticated. In order to survive, they would need to stalk and kill prey. In order to hide their own scent, they would roll around in many disgusting substances so that they could approach their prey undetected.

This sound kind of silly and I'm not so sure I believe it.

Why Dogs Love to Roll in Smelly Stuff
In the middle of the night, I woke up and I could not breath. No matter how hard I tried, I could not get my lungs to work. In desperation I tried and tried until I panicked and thought that I might even die then and there.

Why was my brain incapable of sending the proper signals to the muscles that control breathing? What was the cause of this nightmare obstruction? Why was this happening to me?

It must of lasted a couple minutes at least so it seemed. My ribcage muscles were sore and I'd pulled a muscle in my neck due to the effort.

When I woke in the morning I could still feel the soreness in my lungs and my neck is very stiff.

I'm glad I survived. Chalk up another interesting life experience.
As an experienced train commuter chalking up a couple more thousand kilometers every month between my hometown of Gouda and my work in Amsterdam, I've pretty much perfected the art of nodding off while sitting erect.

Sometimes it happens without me even realizing it, for example while reading a book or just staring out the window. Sometimes I even feel it coming and resist or just let it happen.

The amazing thing is that although I nod off in a kind of semi-hypnotic imaginary dream world, I remain erect and do not fall over. The bumps and jerking motions shift my body slightly to the left and to the right, but I never end up in the lap of the passenger across from me nor on the shoulder of the person next to me.

On occasion I dream of eating and wake up with my mouth open and my jaws biting up and down. Or if it is hot and I'm drinking a refreshing ice-cold substance.

I've trained my mind to sleep but to be alert at the same time. I do not know exactly how this mechanism works, it is like clockwork. Although the train stops along the way, I do not wake up or at least I believe that I am not awake until just the right moment: when the conductor announces Station Gouda! And when this announcement is not made or the public announcement system has short-circuited? I still wake up.

Thought I was being real clever by trying the following last act of pure desperation:

$SIG{__DIE__} = sub { print "Please don't let me die!\n"; };

Unfortunately those were my last gasping words before I was aborted and sent to who knows where.

"...I am talking to you by telephone from the Oval Room at the White House, and this certainly has to be the most historic telephone call ever made from the White House. I just can't tell you how proud we all are of what you have done. For every American this has to be the proudest day of our lives, and for people all over the world I am sure that they, too, join with Americans in recognizing what an immense feat this is. Because of what you have done the heavens have become a part of man's world, and as you talk to us from the Sea of Tranquility, it inspires us to redouble our efforts to bring peace and tranquility to earth..."

I was twelve years old and watched it all on our old-fashioned black and white television, feeling very proud and patriotic.

Screenshot-Padre 0.35.png

Padre - Perl Application Development and Refactoring Environment

Special thanks goes to Gabor Szabo for helping me out.

If like me you use Ubuntu, don't forget to read the download instructions very carefully and do the following:

$ apt-get install libwxgtk2.8-0 libwxgtk2.8-dev libwxbase2.8-dev libwxbase2.8-0 
$ apt-get install libmodule-build-perl libextutils-cbuilder-perl libmodule-pluggable-perl g++

Optionally, which was the case for me, you might also have to run:

$ sudo cpan -i Wx Alien::wxWidgets Padre

Then sit back, fire it up and enjoy:

$ padre
| 3 Comments

After hearing the good news Padre 0.34 released I've been giving it a go but with little success.

Despite claims on the download page, I've been struggling now for two whole evenings with very little luck.

$ sudo cpan -i Padre

Looks pretty innocent and straight forward doesn't it? Yeah right. A bit of a nightmare, which is really too bad. I was really excited to try it out and get involved myself.

You might also like to read Padre + Catalyst. See also Padre, the Perl IDE.

My golf instructor insists that I swing more from the trunk and keep the club blade perpendicular to the flag on follow through by holding my finish high in the air. Unfortunately over the previous year I've developed the bad habit of swinging from my wrists, limiting my follow through and yanking the ball to the left. This awkward movement has become so ingrained that it's going to take alot of effort and exercise to get rid out of my system.
When I die what happens to all that data I've been collecting and putting everywhere on the Internet? Does my information die with me, does it slowly fade away or does it live on forever?
| 6 Comments

Let's say that you need to check the validity of some input value. If it is found in a list of acceptable values then you continue otherwise you need to croak some error message.

For starters let's assume that the list of acceptable values is contained in the following array:

my @list = qw(email name telephone address);

Also don't forget that in order to be able to croak you need to include use Carp; in the file.

Here's the most straight forward way to do it:

sub func
{
    my $value = shift;
    my $found = 0;
    for my $next (@list)
    {
        if ($next eq $value)
        {
            $found++;
            last;
        }
    }
    croak "Invalid value '$value'" unless $found;
    ...
}

Here's another especially clever albeit slightly cryptic way to do it[1]:

sub func
{
    my $value = shift;
    { map { $_ => 1 } @list }->{$value}
        or croak "Invalid value '$value'";
    ...
}

Finally, if you are familiar with the List::MoreUtils module, then here's yet another way to do it:

use List::MoreUtils qw/any/;

sub func
{
    my $value = shift;
    croak "Invalid value '$value'";
        unless any { $value eq  $_ } @list
    ...
}

As you can see there are many correct ways to do it and probably many more.

[1] Perl Medic p. 122

| 2 Comments
About ten days ago, I ordered the book 'Perl Debugged' and I was pretty excited when the package arrived today, falling gently from the mail slot in the door and landing upside sown on the hallway mat.

At first I was a little surprised how thin it seemed, but still full of anticipation, I ripped the package open and yanked out the book.

It turned out to be a copy of 'Mijne erste Trompetenshule' some German music book for kids learning how to play the trumpet.

When you think about more closely, it makes sense that Perl and trumpet playing have alot more in common that you realize.

What a letdown, but kind of funny and ironic at the same time.
As far as I was concerned, my shoes were holding up just fine. However, my wife said they were falling apart and looked worse than awful.

While my view was that they would hold out just nicely for a few more months, she insisted that they needed immediate replacement.

I am undemanding and find attire less important, and she wants me to look nice and remain representative for my work.

So she urged me to go into town this morning and together we found a couple pair of brown shoes to keep me going at least another two years.

Once again I'm all set thanks to my wife's inspirational moods.
Today the weather was so nice that I decided to take Luca on a long and relaxing walk along the Reeuwijkse Plassen.

Just when I was ready to hop in the car, Sabien came downstairs with a sneaky smile on her face and asked:

"What's it like to take Luca on a walk now when in the beginning you really didn't want to have a dog in the house?"

A couple hours later, I returned home with my pants and coat splattered with mud, and I took Luca back to spray her down with the hose.
Why is it that whenever I try to grow a beard everyone bugs me endlessly about how awful it looks until I end up shaving it off in shame?

Comments like: don't get near me, you look like an old man, when are you going to get rid of it, haven't you shaved it off yet, oh god it looks awful, you could be a wino living on the street, ad infinitum.

If only they would be more patient and give me a couple more weeks, they'd be able to appreciate themselves what a full and glorious beard it would become.
| 1 Comment

Here's an easy one-liner which will automatically update all of the CPAN modules installed on your machine:

$ sudo perl -MCPAN -e 'CPAN::Shell->notest(install => CPAN::Shell->r)'

I always do it with sudo but you might not have to depending on your preferences.

Since waiting around for all of the tests to complete can be quite dull, I use notest() which might be considered risky by others.

Random entries

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

Recent Assets

  • Kiffin_painting_dakkappel_3.jpg
  • Kiffin_painting_dakkappel_2.jpg
  • Kiffin_painting_dakkappel_1.jpg
  • perl-logo.png
  • mysql-logo.png
  • freebsd-logo.png
  • Hole-3.png
  • Screenshot-Padre 0.35.png

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 2498 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.