Month: April 2009

| 0 Comments

By far the most efficient way to do a global in line replacement on an array is by using the following substitution one liner:

s/apples/oranges/ for @entries;

Why go through all of the trouble of using a for loop when you can impress your family and friends by doing it so much more elegantly?

| 0 Comments
The Enlightened Perl Organisation is sponsoring the Perl Iron Man Blogging Challenge.

So get off your lazy butts and start blogging now!
| 2 Comments

Often out of curiosity, and perhaps due to an acute case of extreme boredom, I like to see what is going on behind the scene, e.g. within the deepest internals of good old perl.

Take for example the number and type of perl modules being loaded from a single use statement.

Since I've been playing alot with Moose lately, I'll use that as an example.

Roll up sleeves, cross your finger and fire up a terminal session and enter the following command:

$ perl -e 'use Moose; print join("\n", sort keys %INC)'

Lo and behold you will see a list of seventy-seven or some appear before your eyes:

Moose does not export its sugar to the 'main' package.
AutoLoader.pm
B.pm
Carp.pm
Carp/Heavy.pm
Class/MOP.pm
Class/MOP/Attribute.pm
...
overload.pm
re.pm
strict.pm
vars.pm
warnings.pm
warnings/register.pm

If you try Catalyst instead of Moose, the list will be even longer (169).

So what am I trying to prove? Not much I guess except for the fact that perl allows you to acquire much interesting insight with it's wonderful world of one-liners.

(What does the very first line 'Moose does not export its sugar to the 'main' package.' really mean?)

See Perl Medic by Peter J. Scott for an excellent read.

| 0 Comments
Awhile ago I had a terrible case of the shanks. Lately things have been going better, although deep inside I still entertain a very subtle fear that it will bite me again.

This means that my rotation axis has shifted somewhat in compensation and I therefore pull many of my shots to the left. This is mostly the case for my medium and short irons, which were exactly the clubs with which I had earlier been plagued with an acute case of shanks.

My latest strategy is to take extra time lining up my stance better, reaching out to the ball more, and following through with a high finish.
| 0 Comments
Supreme self-confidence, temerity, an unreasonable or foolhardy contempt of danger or opposition, nerve, gall.

(I never knew that).
| 0 Comments

New job's coming along just fine. There's much new and interesting stuff to learn which keeps my old brain cells in shape. Being surrounded the whole day by psychologists in an academic environment takes a bit of getting used to though. Bridging the theoretical with real world technology is the name of the game, at least second to golf that is. Tomorrow morning early (7:50) I am off to shoot yet another course record.

| 0 Comments
Today is a nice day to get the ladder out, climb up to the roof and clean out all the rain gutters which have become pretty clogged up with leaves.

Last weekend I already did the right side of the house, and stopped because it turned out to be alot more work than I had expected.

This afternoon I will continue on the left side of the house and not stop until all of our rain gutters are freed of leaves and other gunk.

How to clean rain gutters.
| 0 Comments
I hate it when my Del-key keeps sticking.

Up near the top right hand corner of my keyboard the keys are a bit less sturdy because the CD bay is directly underneath and leaves little room for a sturdier padding.

This means that when I hit the Del-key, it feels hollower than the other keys and tends to stay stuck in the depressed state, popping up and making this slightly aggravating click after anywhere from a half second to five seconds later.

One might of expected better quality for a laptop this nice.
| 0 Comments

There's no better start on a beautiful sunny afternoon than having a birdie on the very first hole.

Unfortunately, I choked real bad on the second hole by attempting to cut the corner too closely on my approach shot, thereby barely nicking a tree branch (just barely) and then three putting.

The remaining seven holes were pretty average, although I must admit I was really smashing them drives way out there into the distance.

On the eighth hole, I landed my drive in the creek (too far), took a penalty drop, pulled an eight iron to the left and then chipped the ball in for an amazing par four.

Birdie, double-bogie (3-putt), par, par, bogie, par, bogie, par, bogie (3-putt) equals forty.

I need to practice more and get my game down more consistently, focusing on my short game.

img_4979.jpg
| 0 Comments

I am the happy owner of an ASUS X59SL-AP275C laptop which normally runs Ubuntu 8.10 (Intrepid Ibex) without a hitch.

Well, at least until I upgrade to a newer Linux kernel, for example today to 2.6.27-14-generic. When that happens, my wireless connection dies and I have to rebuild and reinstall the MadWifi Linux kernel driver for Wireless LAN devices with Atheros chipsets.

So in case anyone out there has the same problem and has pulling one's hair in frustration, I hope that this explanation will help.

First of all, make sure that this ethernet controller is installed:

$ lspci|grep Atheros

You should see something like this:

02:00.0 Ethernet controller: Atheros Communications Inc. AR242x 802.11abg Wireless PCI Express Adapter (rev 01)

The next step is very important: make sure that your Wifi switch is turned on. Mine is located on the left side of the laptop and switched towards me.

Now go to System > Administration > Hardware Drivers and make sure that support for 5xxx series of Atheros 802.11 wireless LAN cards is disabled. It should look something like this:

Screenshot-Hardware-Drivers.png

If it is not, then disable and reboot:

$ sudo reboot

Make sure that the relevant drivers are automatically loaded at boot by editing the /etc/modules system file:

$ sudo gedit /etc/modules

and ensure that the following lines are present:

ath_pci
ath_hal
wlan
wlan_scan_sta

Now make sure that these same drivers are NOT blacklisted, e.g. not present or commented out in the blacklist system file:

$ sudo gedit /etc/modprobe.d/blacklist

Disable ath0 and wifi0 just in case:

$ sudo ifconfig ath0 down
$ sudo ifconfig wifi0 down

The rest is down hill from here. If you don't already have it, grab the madwifi-hal-0.10.5.6 from the MadWifi repository:

$ svn checkout https://svn.madwifi-project.org/madwifi/branches/madwifi-hal-0.10.5.6 madwifi

If you are more daring, you can also grab the latest version from the trunk:

$ svn checkput https://svn.madwifi-project.org/madwifi/trunk madwifi

There are a couple of utility scripts to unload the drivers and clean up the environment just in case:

$ cd madwifi/scripts
$ sudo ./madwifi-unload 
$ sudo ./find-madwifi-modules.sh $(uname -r)
$ cd ..

Now it's time to build and install the driver the usual way:

$ sudo make unload
$ sudo make clean
$ sudo make
$ sudo make install

Load the module into the Linux kernel and enable:

$ sudo modprobe ath_pci
$ sudo ifconfig ath0 up

Display the wireless configuration:

$ iwconfig

You should see something similar to this:

lo        no wireless extensions.

eth0      no wireless extensions.

wifi0     no wireless extensions.

ath0      IEEE 802.11g  ESSID:"XXXXXXXXXXXXX"  Nickname:""
          Mode:Managed  Frequency:2.437 GHz  Access Point: 00:14:7F:8A:74:E3
          Bit Rate:6 Mb/s   Tx-Power:17 dBm   Sensitivity=1/1
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=21/70  Signal level=-74 dBm  Noise level=-95 dBm
          Rx invalid nwid:848  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

pan0      no wireless extensions.

Next enable scanning:

$ sudo modprobe wlan_scan_sta

And then display list of available wireless stations:

$  wlanconfig ath0 list scan

Which should provide a list similar to this:

SSID            BSSID              CHAN RATE  S:N   INT CAPS
XXXXXXXXXXX...  00:14:7f:8a:74:e3    6   54M 24:0   100 EP   WME
Nummer 5        00:12:17:60:50:c5   11   54M  9:0   100 EPs
Sitecom         00:0c:f6:3e:ea:1f   11   54M 13:0   100 Es   WME
Biesploos       00:11:50:8b:83:76   11   54M  4:0   100 EPs
...

If however the previous command results in an empty list, or something hasn't been working as expected, then simply reboot your laptop (and cross your fingers):

$ sudo reboot

If the Wifi is still not working then as a last resort you might want to try the following:

  • Make sure that the WiFi switch on the side of the laptop is turned on! In my case, the switch is on the left side and should be slid towards the front. Wait about ten seconds.
  • Hit the Fn-F2 combination key and wait a few seconds.

Hopefully now everything should be working just fine. If not then I'm sorry and wish you good luck searching further.

Keep searching.

| 0 Comments

If you happen to discover a directory which for some reason happens to be called '~' please do not and I repeat do not try to delete it by running the  'rm -rf ~' command.

Oops.

The correct (safest) way to do this is to fire up Nautilus file manager and remove the file via the graphical interface.

Next time make sure that you've made a recent backup of your home directory in case disaster strikes again.

| 0 Comments

This evening I upgraded my xfce4 desktop to use Linux 2.6.27-11-generic and the next time I rebooted my panels had completely disappeared.

The solution was to startup in terminal mode and run the following command:

$ mv ~/.config/xfce4 ~/.config/xfce4.backup

After another reboot, all is back to normal except for a couple small tweaks I have to make in order manually to restore my panels as they were.

| 0 Comments
Who are those unfortunate souls out there who are the most predisposed to depression?

Those who are excessively dependent on close personal relationships, a constant need for reassurance and support from others, as well as an inability to cope with stress.

Perfectionists who are not in touch with their inner feelings.

Those masking the truth with a fabricated world of thoughts and actions molded towards what one thinks other expect one to be instead of what one actually wants to be.

It's a dangerous world out there, so be very careful.
| 0 Comments
If you own an MSI Wind Notebook like I do, and the next time you fire it up there's no wireless connection available for some reason, don't forget to first make sure that the wireless card is enabled (duh).

Is the little green led second from the left lit? If not then you'll have to hit the Fn+F11 key.

Why waste two hours of your valuable evening searching everywhere and getting frustrated when the solution is right before your nose?

This is already the 3rd time it's happened to me and you'd think that I'd remember by now.
| 0 Comments
Since Perl is my favorite programming language, I've collected quite a number of books about Perl in the last few years.

Perl_books.jpg
The Perl section of my personal library.
| 0 Comments
What is the role of emotion in computer-mediated communication (CMC) and can online interaction be considered a more useful tool than face to face (F2F) interaction in treating certain psychological ailments?

Scientific experiments have concluded that there is no indication that CMC is a less emotional or less personally involving medium than F2F.

On the contrary, emotional communication online and offline is surprisingly similar, and if differences are found they show more frequent and explicit emotion communication in CMC than in F2F.

In fact for certain ailments like burn-out, depression, post-traumatic stress disorder (PTS) and mourning, online therapy has proven to be a very effective means of helping people cope and recover

Reference
| 0 Comments
Lately I've been able to spend much time in the evenings reading one book after the other. I can sit down in my simple reading chair feeling relaxed as my mind dives into and gets totally lost in one world or another. The large window behind provides ideal light until it get too dark in the evening at which time I can flick on the standing lamp to the right.

Reading_chair.jpg
This is my reading chair.

Random entries

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

Recent Assets

  • img_4979.jpg
  • Screenshot-Hardware-Drivers.png
  • Reading_chair.jpg
  • Perl_books.jpg

Recent Comments

  • 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
  • Buddha shrine: I keep Buddhas in my plants outside on the deck du ...
    - 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 2291 entries and as many as 1876 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.

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

My father passed away 10-20-2000 ago.

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