Sunday, April 27, 2008

Ubuntu Linux


The Latest release of the Linux distribution Ubuntu was released officially on April 4th, 2008. This version has been long anticipated. In my estimation, possibly since version 6.06, the previous version which promised long-term-support, a.k.a., LTS. LTS, according to Canonical, the company that markets and supports Ubuntu, simply means that you'll get support for at least five years on the server side and three on the desktop.

Ubuntu release cycles are every six months. The numbering (or versioning) method is quite interesting. The version is based on the year and month that the upgrade is officially released. The very first Ubuntu version was released in October, 2004. Therefore, the very first Ubuntu is versioned 4.10. The single digit year comes first, followed by a two digit month. The second one came on time, six months later in April, 2005. It's version number was 5.04. And so on.

Another interesting tidbit is the product name, or code name, assigned to each new version. The first Ubuntu (4.10) was code named Warty Warthog. The next one was Hoary Hedgehog. I just love it. Ubuntu users even use these names in discussing the product. Take a brief visit to the support pages of Ubuntu and you'll read sentences like, "...I'm trying to upgrade from Gutsy to Hardy and...," or, "... is it possible to use the same NIC drivers in Hardy that are supported in Feisty?"

Most vendors normally have code names, mainly used by the developers, for their products. Even stiff-upper-lipped Microsoft. Windows 95 was code-named Detroit. Windows 2000 didn't have a code name, but service pack 1 was called Asteroid. Windows XP - Whistler. Windows Vista - Longhorn.

I definitely prefer the creativity of Ubuntu names.

What makes Ubuntu really exciting for me is the fact that it's really trying hard to bridge a gap between commercial (and that might not be the right word) products and the Open Source world. When you pay for something, you expect it to work. The vendors supposedly put a lot of time polishing the product. Making it easy to install and use. Full of features, robust and supported when things ultimately go wrong. In the early days, Linux distributions required a lot of knowledge on how computers work. Installing Linux was an introduction to a computer science course. Over time, the user-friendliness of Linux has matured. Linux, especially Ubuntu, is comparable to Microsoft Windows in ease of installation. Ubuntu's not alone. Red Hat Enterprise, Fedora, SuSE Linux and Linspire are a few that come to mind immediately. When installing these products, it's no longer necessary to have an intimate knowledge of your hardware as was the case before.

But Linux distributions go further than Microsoft Windows when it comes to putting together a computer system. When you install Windows, all you get is a multimedia player (Windows Media Player), a couple of featureless text editors (notepad and wordpad), a rudimentary painting program (Microsoft Paint) and a few distractions such as games and system tools. From a users perspective, there's not much you can do yet. You need to spend a little bit more money. Purchase a full featured graphics program for editing those photos. A comprehensive office suite that includes spreadsheets (for those accountants), presentation packages and perhaps a better word processor that includes spell checking and complex formatting.

When you install a Linux distribution, you get a wealth of applications that make you immediately productive. The Gimp, for image manipulation, Open Office for business documents, sophisticated DVD tools, Internet applications and much more. With Ubuntu, you also get a system, second to none, for adding new software and keeping the system up to date. Even the task of moving from one version of the operating system to the next one is a simple upgrade using the same tool. That would be like updating Microsoft Windows XP to Vista by a simple visit to the Microsoft Update site. Unlikely.

I'm writing this on a Dell Latitude D620 notebook computer. It has 4GB of RAM and a 100GB disk. The wireless card has a broadcom chipset. The video card is an nVidia GForce 7300.

The laptop was purchased in March 2007 and as soon as Feisty Fawn (Ubuntu 7.04) was released it was relieved of the burden of Windows XP. I was never able to get the wireless networking part stabilised. Even though I used the ndiswrapper package, almost foolproof when it comes to Windows-only driver devices, the card was detected, would work, but was very unstable. Every other part of the system was excellent. I used Envy to install the nVidia video driver.

Six months later when Gutsy Gibbon (Ubuntu 7.10) was released I upgraded the system online. Keeping the same Windows XP drivers and the ndiswrapper package, wireless networking was absolutely stable. I could connect seamlessly from network to network with the excellent Network Manager application.

Upgrading Ubuntu has always been easy. Other than wireless connectivity, and sometimes problems with video and some USB devices, everything seems to work without additional effort. This was not the case in the early days of Linux since most hardware vendors really concentrated on providing support for Microsoft. In any case, this last upgrade (Gutsy 7.10 to Hardy Heron 8.04) wasn't very pleasant. Here's how it went.

As usual, my system notified me that there was an upgrade available. As in the past, I clicked the "Upgrade" button to start the process. A dialog window jumped to the front of the screen indicating that things were happening. Messages indicating that files were being fetched from the Internet, local settings were being altered and so on flooded the screen. But after a minute or so, everything stopped. The dialog window turned an unhealthy shade of gray and nothing seemed to be happening.

I tried to close it by clicking on the little button in the top-right corner with an "X" on it, but it wouldn't respond. I even launched the handy "xkill" program which normally destroys any Linux window application by clicking on it, but this didn't work. Eventually, I had to open a terminal window, find the program by using the "ps" command and then issue another command to get rid of it.

Oh, another nasty side-effect of this partial upgrade, and the subsequent murder of the frozen dialog window was that my system was left in a state of confusion. For some reason, it now thought that it was in the new version, however, there were still five-hundred programs that needed upgrading. I discovered the reason for this but I won't get into it here. It had to do with the way Ubuntu records the locations where it fetches updates to programs. They're called "repositories" in Ubuntu-speak.

After fixing the side-effect and attempting the upgrade a zillion times, I realised that I may have to, for the very first time, actually upgrade by installing from scratch. I've been so used to upgrading a system "intact," including Microsoft Windows, that the possibility of backing everything up, installing a fresh copy of an operating system, and then having to put everything back, was quite daunting. I had everything installed and configured exactly the way I wanted it and I would have to find all my software and try to remember every single tweak.

So I soldiered on. Jumped onto the Ubuntu forums and asked, no begged, for help. I finally found something that sounded promising. By killing the failed attempt at an upgrade, it was then possible to open a terminal and complete it manually. I know what you're thinking. This sounds very much like hacking, but as a true Linux aficionado, I knew that I wasn't doing anything that the operating system couldn't take. Microsoft Windows people would never dream of doing this. If an upgrade of Windows jammed in the middle, and by the grace of God the system was still usable, the only solution would be to salvage any work on the disk and reformat it.

I proceeded to hijack the installation and it completed six hours later. Fetching all the updated files from the Internet took a very long time. The video resolution was completely off. My screen is able to handle 1440 pixels across by 900 pixels down. The maximum resolution that I was getting was 800 by 600. This was because the video driver that had been installed by the upgrade was the wrong one. Getting a copy of the latest version of Envy (EnvyNG) seemed to install the driver, but still I could not fix the resolution problem. I thought I'd tried everything that I could but I've since learned that there was an additional solution that I could have tried. A solution that seems to be helping others with the same problem.

The wireless card was detected. Miraculously I didn't need to use the ndiswrapper package. I knew this since I had used the live-cd version of the upgrade to test my hardware. What was confusing is that in the live-cd, everything was perfect.

I started upgrading on Friday April 25th at about 10pm. I fought with the upgrade till I discovered the hijack work-around at about 3am at which time I went to sleep and allowed the upgrade to complete. When I woke up to go for my morning run at 7am, the upgrade still wasn't finished. It seemed to have completed sometime between 7am and when I got back at 8am. Between 8am and 10:30am I fought arduously with the video card.

At 10:30am EDT on Saturday April 26th, 2008, the date that will be remembered as the date the Toronto Transit Commission stranded commuters in downtown Toronto, I finally gave up and started backing up the documents on my system in preparation for a clean installation. By 12pm, my backups completed and intact, I bid goodbye to my (crippled) system, inserted the fresh CD of Ubuntu and began to wipe the system.

The entire installation took between forty and fifty minutes to complete. When the CD ejected from the drive and I rebooted into the brand new system, everything was good. The video even looked sharper, clearer than it did in the previous version. A few mouse clicks later, which were necessary to download the proprietary drivers for the wireless card, and I had full wireless connectivity. I pulled the Ethernet cable from the jack behind the laptop and enjoyed an unfettered surfing experience. Oh the joys of being able to move freely about and not worry about cables and other hindrances.

Hardy Heron is a must-have upgrade. I needed to download proprietary drivers also for the nVidia card, this is only because the desktop that I wanted needed full hardware acceleration capabilities of the video card which the Ubuntu provided one.

Hardy Heron installs a beta version of the Firefox web browser. At first I was sceptical about using beta software and wondered why a released version of an operating system would tolerate beta software. But after using it for the entire weekend, Firefox 3 is close to being a production release and feels more stable than it's version 2 parent. Firefox 2 was very unstable and notorious for freezing and destroying every Internet session that you were using.

The fact that Ubuntu provides a live-cd is an excellent method of testing your hardware for compatibility. This used to be the case in the Microsoft Windows world, however, the new version of Vista is extremely demanding on hardware, and even though it might install on a computer that was perfectly happy with Windows XP,

Saturday, December 08, 2007

Have a nice day

Have a nice day! Even wikipedia has an article, albeit only one sentence, on it. Why do people say this? The wikipedia article (http://en.wikipedia.org/wiki/Have_a_nice_day) claims that it's typically said by retail employees to customers, after a sale. I've heard it on a million answering machines. "Hello, I'm not here to take your call. Please leave me a message after the beep and I'll return your call as soon as I can. Have a nice day!"

It's a dry, toneless dismissal.

I guess we've all become retail employees. Even when we wish people a nice day, we really don't care whether they do or they don't. If they do, well and good. If they don't, well life sucks and it definitely sucks to be you. Bye bye is much better even though I've read somewhere that it was also used in the past to lull babies to sleep. Good-bye has been tainted by that TV show The Weakest Link. It sounds like an abrupt dismissal. A dry conclusion which would only serve after a terse unfulfilled encounter, like with the boss you don't like.

So is there a way to end a conversation without sounding plastic and distant. Without sounding dismissive, fatigued, bored and ready to split? I would guess that when a conversation has come to it's natural conclusion, all parties having run out of steam, nothing left to say then perhaps saying nothing is OK. But that wouldn't work. The importance of "have a nice day" is so that you can turn around and walk away, or put the phone down knowing that there'll be no additional sounds from the other end. Bye bye means, "I'm going to go now so you can safely stop talking."

I like "bye." It leaves no indication that I'm wishing you a pleasant after-conversation life. Nothing to say that I care about how the rest of your day proceeds. Nothing good, nothing bad. We're done here, let's move on.

So... have a nice day!

Thursday, December 06, 2007

Christmas Time

Twas the night before Christmas and all through the house, not a creature was stirring not even a mouse.

The year was 1964 and independence had finally come. December 12th, 1964 we would finally get rid of the British colonialists and have self rule. Meanwhile, south on the continent, racial discrimination would persist for another thirty years!

Etobicoke, Ontario, Canada. Thursday November 29th, 2007. A snowstorm hit southern Ontario. People woke up to find a nice thick three, to four, inch blanket of snow. I remember when I had to shovel. Those days are now behind me. I can now boast that I don't mind the snow.

Wednesday, December 5, 2007. In a crowded mall in Omaha, the Westwood Mall a 19-year old boy went on a shooting spree. Ended up killing eight people, six of them Mall employees and two of them customers. He started shooting in the Von Maur department store. News that has been gathered about him since indicates that he had left his parents home, or been kicked out, had recently split with his girlfriend and also just lost his job.

Last night, December 6, 2007, going home from work on a fairly crowded bus, there was this teenager, ears plugged in, obviously listening to rap music. 50 cent to be exact. It was that song "In da club." Well, oblivious to the fact that there were people all around him he was singing the song, albeit out of tune, and making a point to emphasise the expletives. People kept looking at him and shaking their heads from side to side, but nobody said anything. And it was a white kid to boot. A white kid. Do you know how ridiculous these white kids look trying to act black? And ghetto black at that. I know he didn't feel ashamed, so I felt his shame on his behalf.

So Marion Jones has admitted to taking drugs prior to the 2000 Olympics where she obviously shone. I knew that there was something fishy about her natural abilities. And to tell us that her coach started supplementing her in 1999 with, what she thought was, flaxseed oil. You can almost convince me now that Flo-Jo also wasn't juicing on something. We can't say positively that she wasn't getting assistance of the pharmaceutical persuasion, but it's hard to be so good and make it look so easy like she did in the 1988 Seoul Olympics. Triple gold medal winner. Died at the tender age of 38 of a heart seizure. So it's a good thing that Marion Jones was crying and whining about having lost our trust, but for me, she lost my trust when she was hanging out with C.J. Hunter and then Tim Montgomery (who was also caught juicing). It's funny that track and field sports are now forever tainted. The list of suspected and convicted juicers is long. Ben Johnson, Carl Lewis and Linford Christie have all been tainted. Then there's the current suite of sprinters. We won't name any names, but the times that these guys are running, and continually beating, are too amazing to be true.

Sunday, December 02, 2007

Birthday Greetings

Yes, it's my birthday today. 43 years and still alive, who would have thought? Given the dangerous lifestyle, risk taking, walking and running in the middle of the night in questionable neighbourhoods. We're lucky to be here.

But does this mean that we'll slow down and slide quietly into second base? (I hear that first base is passing 30, and second base is making it to 50, well actually I made that up). Time to get into fourth gear. Rev the engine and push onwards.

What special things do we plan for year 44? (Because it is year 44. The whole birthday thing is a misnomer. When you're born you are zero years old. On your first birthday, you turn 1 year old which means you have completed one year and so on your first birthday, you actually enter year two. And so on and so forth). Year 44, we plan to write a novel. 1 page a day, 365 days, should be a 365-page novel. Or perhaps, in four months, 2 pages a day, that will be, let's see thirty times four times two is 240. 240-pages.

So today will be a day of quiet reflection. Of stock taking. A day to look back but not go back. To contemplate on lessons learnt. To remember that we are not alone but our lives are intertwined with the lives of so many others. And that we make a difference in the words we speak. In the way we act and the things we do. We make a difference and add value if we care to.

So, happy birthday to me. Health, wealth, success and blessings for year 44 and for many more to come.

Thursday, May 03, 2007

Being Whole

Being an entire person, means not only taking care of your career. Your spiritual or mental well-being, but also taking care of your body - as best as you can. We, at least those of us living a Western life, are living in the leisure class. We can afford the luxury to dwell on higher, philosophical, issues without too much concern about basic survival. We can concern ourselves with getting to know our inner self. We can focus on advancing our careers in order to live a comfortable life. Worry free. With the nicest things that life has to offer at our fingertips.

Once our minds are happy with the things that we can see and touch around us, we can then move on to finding God. We satisfy our souls with the fact that we get a sense of joy knowing that we feel a sense of peace that comes from spiritual accomplishment. Our hearts stop aching because we haven't found joy in the new Mercedes Benz. That our children have grown up and left us and we are robbed of that daily contact.

But to be fully human, living on this earth, we must also stretch and strengthen our bodies. This shell that gives us the ability to move around, sense our environment and give us an identity. Without this shell, we would be different. If you are lucky enough to have the gifts of a fully functional frame, then, as you would with your mind and soul, an attempt, a reasonably serious one, at making your body strong will ultimately enrich your life.

As we grow older, and definitely as we enter the Western workforce, we neglect any pursuits of a physical nature. We slip into a sedentary lifestyle with the excuse that we are too busy, or it's too cold, or too hot, or too dangerous to do any form of exercise. The industries that surround us too emphasise that you don't need to exercise too much. Thirty minutes a day is all. What lies.

In fact, there's now a discord between physical health and looking healthy. Medical science has come a long way. We can now improve our bodies without ever having to walk a single mile. As soon as things look like they're falling out of place, we can run to the nearest doctor and ask for cosmetic adjustments. Then run to the nearest fashion boutique and wear the slimmest, most fashionable clothing to match the medically shaped body. In today's world, what you see is not always what is. This particular affliction of trying to look good affects Western women more than it does the men. Women are more prone to undergoing bouts of starvation, or butchering under the surgeon's knife than get on a treadmill.

We've come full circle. From a time when working the farm, or soldiering for our survival was a daily back-breaking occupation. We now slip quietly into our vehicles in the morning, and spend all day sitting down in front of a computer terminal. Knowledge workers, we call ourselves. No wonder we can't do anything when we have a chance to. The more inactive your muscles are, the less desire and ability they have to do anything. The stronger they are, the more they want to move and become active. Use it, or lose it. How true.

It's unreasonable to expect that a weak frame can contribute positively to a mental attitude that is sharp and astute. After all, that brain is housed in this sluggishly moving body. It's also unreasonable to expect that your mental health, your outlook, our view of life, can be at its peak when you feel lethargic and tired.

It's definitely terminal to spend an entire existence sitting in front of a computer day-after-day, week-after-week, month-after-month and expect good health. That is, unless you do something about it.

There are 24 hours in a day. We sleep for 7 or 8 of them. Of the remaining 16 (or 17) we normally work for 8. Of the remaining 8 we will spend time doing peripheral work. Commuting. Preparing things. If you have children, most of that time is spent parenting. However, it's not impossible to find at least 1 or 2 hours in a day for yourself.

Priorities. For most Western people, this amounts to trying to get the most leisure as possible. Whatever spare hours are found can be spent in maximising leisure time. Every activity that's done contributes towards depositing towards this leisure account. Work is now seen as effort that's not really necessarily a good thing. Work is what we do, so that we can acquire more leisure.

So, what amount of time should you spend making sure that your body keeps up with your mind? That you are as physically keen as your mind and your spirit is? That you can continue to look good and feel good too? There are limits imposed by age of course, but for the most part, most of the limitations are imposed by our minds. It's a reality that as we get older we slow down and physically become weaker. More prone to accidents and age related diseases. However, physical activity can continue all the way till you draw your last breath.

30 minutes, three times a week, is clearly not enough. It's the mantra of many fitness programs and is entire garbage. 30 minutes daily is slightly better, but it has to be a quality 30 minutes of high impact physical exercise. But I believe that 1 hour daily, should be the required minimum. At 1 hour, the atrophic consequence of sitting at a desk all day is more likely to be negated. As time goes on, fitness levels will rise to the point where additional minutes of exercise can be earned during the 8-hour work shift.

Priorities and Motivation are the two key ingredients. Making physical fitness a priority is a requirement. If it's not, it's easily relegated to fifth place where it never reaches the top of the list. Motivation is that thing inside you that makes you really want to do it without being coaxed. You have a deep inner feeling of anticipation and can't wait to get to your activity. Motivation is necessary if fitness is to become a life goal. But you also really have to enjoy what you are doing. Playing a sport is one way of getting active. For those of us with children, we always sign them up for this sport or that sport, neglecting to sign ourselves up for anything. Running is a great sport, but too many adults fear it with no justification at all except for the fact that they have never really been taught how to run. They are trying to learn to run by watching and trying to imitate. It's like a non-swimmer jumping into a pool and hoping that if they flail their arms about like an Olympic swimmer, they too will move through the water with the ease of a dolphin.

As you become active, so too will your body shape itself to accommodate your passion for sport. It probably won't be instantaneous. It might even take years, but at the end of it all, you can look proudly at what you sculpted and be proud. And definitely, like a blacksmith folds layers and layers of steel, putting the blade back into the fire and folding it again and again to make the finest sword, what you forge out of the fires of sweat and tears will ultimately be a beautiful thing. And that beauty will shine from the inside out, unlike the beauty forged from the surgeons knife, or from the latest shoes and dresses.

Like a former employer once told me just before they let me go... Go out there and take life on!"

Thursday, February 15, 2007

CSS Positioning IE vs Firefox/Mozilla

I've spent the past two days figuring out how to vertically align elements so that it would show up in Internet Explorer as well as Firefox. There are two methods that I'm going to post here, and they're not very pretty. But they've both worked.



In example 1, I had a set of images. Small images. I wanted to line them up vertically centered (middle) of a black strip. Here's what I wanted.




There are seven small images. I used the following CSS that worked for both IE7 and Firefox 2.0


#indexBanner {
clear: both;
width: 700px;
height: 90px;
margin: 0;
padding: 0;
line-height: 90px;
background-color: black;
text-align: center;
font-size: 90px;
}


That sets up the banner that's going to hold the images. It's 700 pixels wide and 90 pixels high. It has no margins and no padding. I've also coloured it black. Now the interesting things. The line that reads:


text-align: center;


will make sure that the images are placed in the center of that DIV. That's right. They won't be placed left-to-right as would be normal. This is because, I wanted extra black space at both ends equally, and not all of it on the right side. Got it?


The next two lines that read:


line-height: 90px;
font-size: 90px;


are there to make IE happy. Basically, I have no text in that DIV, therefore IE will not align the images to the middle of the DIV. It will align them at the top. If I had text, this would be a different issue since I could use a vertical-align: middle; statement to align the text properly to the middle of the DIV and then the image would behave properly.


It's an IE thing.


Since the default font is about 10pt, the image ends up at the top. So, I made the height of a line of text equal to the height of the DIV. In addition, I made the font size the height of the DIV. Now IE will correctly align the image to the middle (vertically) of the DIV.


But we're not done yet, the images will still align to the top since we haven't told them to go to the middle, vertically. So we have a couple more things to do. We use the following to adjust the image positioning.


*>#indexBanner {
font-size: 12pt;
}


This fixes the problem with the font for other browsers. IE doesn't understand the *> directive, so it will ignore this line completely. And then:


#indexBanner img {
margin: 0 -15px;
padding: 0;
vertical-align: middle;
}


What this does is allow the image to align vertically. The vertical-align directive only works for inline elements, not block elements. The margin for each image is moved because IE has a habit of padding extra pixels around images. And removing the padding is a good precaution.


*>#indexBanner img {
margin: 0 -1px;
}


This last directive will fix margins for other browsers (Firefox). Even though the additional space that the browser puts is little, (about 2 pixels around which means 4 pixels between pictures) they look better when they're spaced tighter.


So, in your HTML, you just put img tags for each image between the div with an ID of indexBanner.



Here's the second solution...


I actually tried to replicate this in a different case. Here's the effect that I wanted.




In this example, you see a very simple, and common, web layout. We have a logo at the top left of a bar that could potentially contain some interesting image and a menu directly below it. Creating the backdrop is easy. It's positioning the LOGO, to the left and vertically in the middle that's problematic between browsers. Here's the CSS I used to make this work in IE7 and Firefox 2.x

#header {
clear: both;
width: 650px;
height: 77px;
margin: 0;
padding: 0;
background: url('greenmarbly.jpg') repeat;
line-height: 77px;
font-size: 70px;
}

I'm sure you noticed the IE fix with the line-height and the font-size. Notice that the font-size is not the exact same height as the DIV that I'll create. I found that If I made the font-size the same width as the DIV, the DIV would actually grow bigger than 77 pixels. And only by experimenting with the font-size did I arrive at this size. Here's where the vertical alignment instructions are:

#header img {
margin-left: 20px;
vertical-align: middle;
}

Notice that the image will push itself 20 pixels away from the left margin. In Firefox, this would have worked with setting a padding width also, but IE won't respect it. And finally, the fix for the font size:

*>#header {
font-size: 10pt;
}

IE will ignore this instruction since it doesn't understand it. All other browsers will override the 70 pixel font size we gave this element earlier. And this code works for both IE and Firefox.

A couple of final points. The vertical-align instruction only works for inline elements. It does not work for block elements that's why we had to modify the img tag. Secondly, it helps if you have text in the DIV. If you have text, some of the IE work arounds are not necessary. Remember, images align themselves to text. So if there's no text, then the browser is free to do whatever it wants. So I actually cheated a bit. I put some text in the HTML in order for Firefox (which wouldn't obey these rules) to work properly. The HTML looks like this:

<div id="header">
<img src="myLogo" />
</div>

Notice the non-breaking space that I put at the end of the image declaration. This non-breaking space will be aligned properly vertically centered by Firefox and so the image will be aligned in the middle of it.

It's a strange world. I wish I didn't care about all these subtleties.

Monday, February 12, 2007

The Prayer

Dear God, I thank you that you have given me over forty years of life. I thank you for your graciousness and good health that I have been able to enjoy, and continue to enjoy. Most of all, I thank you for the loving company of good people. People who have cared for me all my life without whom I would not be able to enjoy living and continuing to learn.

Lord, I have not been the most gracious of people. In fact, I normally don't notice that you are there walking beside me. I care too much for my own pleasures and have a tendency to hurt others. Despite all this, you continue to love and watch over me and my family. No matter what the issues are and no matter how far I try to stray, you are always willing to pick me up when I fall.

Lord, I thank you for my wife and children. You alone know that I really don't deserve them and perhaps they don't deserve me. But you chose to give them to me. Perhaps this was your way of making sure that I was watched over and taken care of.

I acknowledge your presence and your wonder. I believe that you have always been there for me and continue to ensure that I don't make decisions that are too disastrous for me. For this I can never be thankful enough.

I ask that you continue to take care of me and watch over me. I know that I will continue to waver, but I understand your commitment to me and bow down to your authority over me. I also ask even more that you watch and take care of my loving wife and children. That they may never be distressed or know pain. I know that on this earthly world, that is almost an impossibility, but I would graciously ask that you teach them to understand what it is and how to deal with it. That they may emulate their mother in compassion and fortitude. That they may grow into adults who will contribute to the wealth of mankind and leave this world a better place than they found it.

In Jesus' name, your loving son who died for us all I pray.

Amen.

Wednesday, December 06, 2006

Option Globetrotter GPRS/EDGE/WiFi (Combo) modem in Linux


First a brief, well not-so-brief, rant.

I recently moved back to Kenya to very miserable Internet conditions. Actually, not miserable, simply disatrously unbearable. The costs of Internet access in this country are triple what I used to pay in Canada with the added misery of poor speed and intermittent connections. There's no such thing as a stable connection in this part of the world with any provider.

Most people here use dial-up Internet. Something I last saw in the mid-nineties. The last time I spoke to an Internet Service Provider in Canada I was complaining about not getting the 2 MBit speed that they were promising. I was benchmarking my performance religeously. Now, I'm very happy for a stable connection that will last more than an hour at anything close to 100 KBits!

My ISP is Safaricom. The largest mobile subscriber in Kenya. They made a profit of over 12 billion Kenya Shillings (roughly $200,000,000 CAD at current exchange rates $1 = KShs 60) this year (2006). Kenyans are phone and text message crazy. For a poor country, Kenyans spend a lot of money talking on phones. I don't have the statistics, but I'm sure the average Kenyan will spend at least 2,000 shillings ($33) per month on their pre-paid phone service. This, in a country where the average person (excluding farm workers) lives on about $1,000 per year. It's blatingly unfair for the developed countries to take advantage of such an obvious weakness. It's tantamount to a fee for breathing.

In any case, Safaricom doesn't gouge too badly. To get a relatively usable connection, and I say usable loosely, you need to cough up roughly 10,000 shillings a month. Say $170 bucks for comparison. This connection may give you 64 Kbps or 128 Kbps depending on the ISP, the time of year, the mood of the salesperson and the stock price of Kenya Breweries. Safaricom uses it's GPRS/GSM network to provide wireless connectivity. Naturally, depending on where you are, you will get different access speeds, but in the best of places, you might get better than 64Kbps. The specs on the access card are great I guess it's Safaricom's network that's jammed. The fact that it's wireless is great. This means that you can take your laptop on the road and work quietly in the open fields. Other ISP's have the odassity to ask for 20,000 shillings a month, or 30,000 shillings for 128 Kbps. There's even one (who will remain nameless) that I called and told me that their dedicated line access, for up to 128 Kbps was 56,000 shillings a month. Can you believe that. I had to ask twice since I thought that I had misheard. But nope. I heard right. They went on to let me know that most of their clients are corporate who have demanding uptime requirements so they have a 99.5% uptime guarantee. I suspect though, if you read in between the lines of the Service Level Agreement (SLA), you'll find that they are "not responsible for incidents beyond their control, like 'lack of electricity,' or 'third-party technical failure,' or 'shifting of the polar ice cap.'" An SLA in this country is a joke!

Anyways, I have an Option EDGE/GPRS/GSM/WLAN Combo Card of the Globetrotter family. You can check out it's specifications at: http://www.option.com/products/edge_spec.shtml. If your laptop has a free PCMCIA slot, then this is a great card. One thing you'll notice, and this should come as no surprise to the Linux folk, is that the manufacturer only supports Windows. There are some "press releases" about Linux, but you'll have to register your card (assuming you got it directly from Option) and ask their technical support crew for the Linux scripts.

But we who live in the Linux world walk dangerously. We fear no hardware manufacturer. No obscurely constructed microcode is a challenge. No statement from the Iron Tower of money (I believe they live in Redmond) will deter us from doing what we want.

And what we really want to do is surf wirelessly with this card.

Now that the rant's over, here's what I did to get my Linux box to work with this card.

I had to install Windows XP to check out the card since there's very little documentation out there on how to set up the serial card. To the discredit of Linux and it's prophets, so much writing about Linux is terribly unreadable. Even the simplest discussions on how to install it start very promising but soon plunge into the world of technobabble, leaving many who would otherwise try it running back to the warm womb of that other bloated software. I checked out a number of sites. The most promising one on this card is: http://www.pharscape.org/. There's a forum there on this card specifically but it seems that most people have been able to get the card to work, but nobody has really documented it properly. It also seems, and this is typical of Linux users, that everyone has very different problems. One person will be able to install it on their RedHat installation without any problems. Another person will fail at installation. A third will install, but the card will hang after five minutes. And so on.

My luck with this card finally came to fruition when I ran into a script/program called "comgt." It used to be called "gcom." Using that script, together with bits and pieces of advice from the forum and the Internet, I have a card that's relatively stable. It hangs from time to time, very sporadically, but I have been able to use it on very many occasions for more than 2 hours. I haven't tested over 2 hours, but even in Windows, from time to time, I found that it would hang and I would have to disconnect. I believe that the configuration that I have right now is stable enough for publishing!

My laptop is:

IBM ThinkPad T20
Pentium III, 700 Mhz, 512 MB RAM, 40 GB
CD-RW/DVD combo drive

Fedora Core 5
Linux kernel 2.6.15
KDE 3.5.1
gcc 4.1.0

Connecting is a THREE stage process. I use three programs to make the connection. They are:

  • minicom (communications program)

  • comgt (Globetrotter communications program)

  • Kppp (KDE's ppp configurator/dialer)


That's all you need. And you'll fire them up and use them in that sequence.

Special Note: If you don't know where your globetrotter device is, see the end of this document. You'll need to know where it is!

For the rest of these steps, I'll assume that the globetrotter modem is a serial modem at /dev/ttyS1. That's actually my configuration.

minicom
Firstly, there's a problem with the Globetrotter card working at high speeds, i.e., 100,000. It can, but it needs a fix. So the first step is to fire up minicom and run a simple command. Start minicom with the following command:

minicom /dev/ttyS1

You may get some warnings/errors when minicom launches. They are safe to ignore. Then type in the following:

AT+CFUN=1

You'll get a message saying that the request was completed successfully. On my machine, the following message is displayed:

*MRDY: 4
OK

Now, quit minicom WITHOUT resetting the modem. To do this in minicom, you have to click on the following key sequences.

Ctrl+A, Q

Now onto the next step...

comgt
If you don't have comgt installed you'll need to download it from sourceforge. You can get it at the following URL, http://sourceforge...../ Once you download it, extract it, compile it and install it. To do all of that you'll have to make sure you have a C compiler installed. Mine is gcc version 4.1.0 and it works. To compile and install the software, you'll find a file in the package you downloaded named COMPILING.

Once you've got comgt installed, run the following two commands.

comgt -d /dev/ttyS1 GTEDGE
comgt -d /dev/ttyS1

After the first step, there will be no response from the system. Your command prompt will come back. After the second step, if your globetrotter modem has a SIM that has a PIN enabled, you'll be prompted for the PIN by the program. If that happens, type it in and press the enter key.

You should register successfully. If you don't something went wrong. Just go over the steps again. You might need to eject the card, re-insert it and try again but you should get a successful registration with your ISP... like I did.

Kppp
The final step is to use ppp to create an Internet connection. Assuming you're using KDE, launch kppp. It's under the "Internet" menu item. If you're not the super user (root) you will be asked to provide root's password. Type it in and continue.

There are two things you need to do in Kppp. You need to create an account and you also need to create a modem device. Do the following.

Click the "Configure..." button.

There are four tabs along the top. Make sure that the "Accounts" tab is selected and click "New..."

There are a number of tabs along the top of the next dialog make sure the "Dial" tab is selected. Type in any "Connection name." For example, the name of your Internet Service Provider. Click on the "Add..." button to type in a Phone number.

Select "PAP/CHAP" as the Authentication method.

For callback type, select "none." This should be the default.

Everything else should be a default on that tab so click on OK.

Next click on the Modem tab. Click on "New" to create a new modem device. Give the new modem any name. Select the right device for your modem. In my case it's /dev/ttyS1. Select Hardware [CRTSCTS] flow control. Select a connection speed of 230,400. Verify that "Use lock file" is checked. Finally, increase the Modem timeout to 120 seconds.

Save the configuration by clicking on OK.

Close the Kppp configuration window by clicking on OK.

You can now connect to the Internet. Type in your "Login ID:" and "Password" and click "Connect" If you selected "Show log window" in the Kppp connect window, a second window will appear and show you what's going on during the connection process.

That's pretty much all I have to offer. The method above works for me. I'm able to get a connection and it's fairly steady. I do get dropped from time to time, not very frequently, but it happens. I'm still trying to solve that but for now, whenever I get dumped off the Internet, I reconnect by ejecting the card and re-inserting it. I have a script that does all of the above for me.

If you have any additional information regarding these random disconnects, I'd be happy to hear from you.

Tuesday, June 13, 2006

Mac OSX vs Linux/FreeBSD

A few years ago, (sometime in 2002/2003), Apple Computers released the latest version of their Mac operating system. The Apple mac is a favourite platform for the artsy, graphics types. I really can't tell why because the availability of good software for that platform is difficult to find. In any case, the latest Mac is very different under the hood from previous versions. The engine is now Unix based. The name of the code that runs the new Mac platform is darwin which is based on FreeBSD and tries to maintain compatibility.

What made the new version of the operating system
historic was that it was a completely new product. Not an upgrade of version 9, but a version built from scratch. The new Mac OSX was based on a free BSD version of Unix, namely FreeBSD.

For the most part, people don't care much about operating systems, other than when they obstruct productivity. An operating system should make it easy to manage programs and files. It should allow programs to play fairly together and manage resources so that things run smoothly without too much hassle. Most Mac people don't know what's going on in their computers so when things go wrong, and inevitably they do, all they can really do is switch everything off, sigh, and then turn everything back on again, hoping that the ghost would have died with the lack of electricity. Windows people do the same thing.

The new Macs are actually a treat for Unix people to use. In fact, Apple has released a server version of the operating system. This is new. The old Mac OS was nowhere near a server class machine. Now the operating system, because it's based on FreeBSD, a mature server operating system to begin with, has entered into the server world in full maturity. Unlike Windows that has grown painfully into a server operating system, causing many a system administrator grief and indigestion, the Mac didn't even have to go through puberty.

What a waste though. Giving this much power, to a group of users whose main purpose is to draw pretty pictures and organise pictures of family vacations or pets is regrettable. It's almost like giving that retired ninety year-old a La
mborghini so that they can drive a block or two to do some grocery shopping. The latest version "Leopard" is a real treat with features that make working with the desktop much easier. I predicted that the ease of use of the desktop would become the primary feature that would make any operating system attractive. Right now, it's difficult to say who's winning between the new Mac and Linux systems with compiz/beryl. More about Linux later, or perhaps in another article.

So, what makes the Mac usable? The reason I predicted that improvements in the desktop would determine usability is because, as prices for disk drives dropped, and portable storage devices like USB keys became in rampant use, then the tendency to save everything followed next. The clear desk policy that some organisations have for their office environment obviously cannot work for the electronic desktop. So, after a few years in an organisation, a lot of stuff get accumulated. All this stuff has interesting sounding names like file01.doc, file03.doc, dog_pictures.jpg, house.txt and so on and so forth. Traditionally, to find anything, you needed to make sure that you used a good naming
convention. If the name you gave your file was not descriptive enough then you'd have to open each and every file to view its contents. In the old DOS world, this was impossible to do and many of us still name our files as though we were limited to an eight character file name.

So now the electronic desktop is cluttered with so many files; documents, pictures, emails, web links and everything we think is precious and don't want to lose. When it comes to finding anything, our best friend nowadays is the search button.

The Mac has made finding files an easy thing to do. Rather than list names for you, the new spotlight application shows you the contents in a
very easy to view format. You can flip through documents in a folder much faster than reading the name and trying to figure out what exactly you were thinking when you made up that name. In addition to this, it has a quick format to organise your desktop so that clutter is reduced. As I write this, I have approximately one hundred icons on my desktop. Some of them are important. Folders with stuff that I'm supposedly working on. Others are documents that I downloaded from the web which I have the intention of reading, but really don't want to keep after I've digested the content. Others are waiting to be classified and moved. While others still are waiting to be backed up and then removed from the system permanently. I'm a busy guy, seemingly.

The new Mac also provides you with multiple desktops.
Like me, once you open applications, you never really close them. You just minimize them for later use. I've found this especially useful with Firefox. This application seems to take a long time to launch and has personality issues. The multiple desktop idea is a good one. Someone once asked me when I'd use multiple desktops. A good question. I actually had to think about it for a while before replying. Well, normally I like to keep my email open all day. I don't want to close it. In addition to that, I normally open more than one web browser window so that I can look things up on the Internet and not have to close the window. So, I keep those regular applications open on one desktop. Then on a different desktop, if I'm working on a document, I'll open it there and work on it there. Since I'm a Linux desktop user, I will have more than one console window open. It's helpful if you are looking up help in one command (man pages) and run the actual script in a second window. So I have a lot of windows open at the same time.

If you use Microsoft Windows, organising open windows can be a nightmare. As soon as the taskbar (along the bottom normally) starts filling up with those little buttons, the names of the open applications become illegible and you have to hover your mouse over each and every one of them in order to see what's open. In Windows, as in Linux, I prefer to use the Alt+Tab key sequence to see what's open and move from application to application. In the Mac, you can now open up a number of desktops and organise your work into more logical areas. You don't have to open everything in one single desktop.

I believe that the Linux solution to the desktop clutt
er and ultimately the search for document problems is also quite elegant. A desktop manager that I use is called compiz. It can be found at http://www.compiz-fusion.org/. It is highly configurable, but the setting that I like the most is the desktop cube. With the desktop cube, you can spin the cube around. Here's a picture with the cube rotating.


What do you think? Pretty cool stuff. You can arrange your applications along any of the four sides, not the top or bottom (which would have been nice). To see your applications, you can spin the cube. Amazingly, if you're playing a video while the cube is spinning, the video continues to play, so if you have a transparent cube, you can watch the video from the back!

In addition to this view, you can also see all your desktops horizontally across the screen as in the following image:

In this image, you can see all the desktops and you can drag applications from one desktop to another. I've configured my computer so that when I move my mouse to the top-left corner of the screen, I switch to this view automatically. In addition to this view, I can see all my windows on a single desktop. On my system, I've configured the F10 key for this functionality. On pressing F10, all the open applications are collected and arranged so that I can pick the one that I want. If I click on an application that's currently on a different desktop, my cube spins around and takes me to the correct desktop.

One of the things that I don't like about the new Macs is that the file system is no longer case sensitive. You have to remember this if you're building web applications for that platform. You have to remember that you can't just move an application to Linux where this case sensitivity is enforced. While being lax about it on a Mac, your application might break in Linux. Windows doesn't care either. I wonder if this was a good decision.

So in conclusion, the Mac has come a long way. It's internals are much more interesting than the desktop. The latest version makes working with many documents easier. The spotlight program makes searching for documents a breeze. You can now search by actually flipping through and viewing contents. It's not the same as an icon view, but a real display of the actual document allowing you to page through it. Linux doesn't have an application like this, and Windows is even further behind. The desktop, though clean, still needs more candy. Running a plain desktop on such a beautiful and powerful machine is really sad. Linux runs on poor hardware, but even with the demands of compiz, the desktop is quite beautiful.

That's all for now. I'll get into some PHP discussions next.

Sunday, May 21, 2006

Running for life, the runner's life

Americans, and that includes Canadians, eh, are health crazy, but you couldn't tell by looking at them. Fitness and health is reserved for a select few, the majority of Canadians, including Americans, duh, are extremely unhealthy. What's up with that?

It's the attitude towards health, coupled with an increasingly sedentary lifestyle, topped off by marketing hypnosis. Marketing lies. So even though it looks as if the majority of us want to live healthy strong lives, we just don't have the will power to do what it takes. We're looking for a shortcut to making our lives healthier and there's an industry out there that's willing to provide all the suggestions we are willing to try, for a price, that is.

I don't ever remember when I actually became interested in exercise. It was probably back in University, watching my waistline grow daily and wondering why I was feeling tired all the time. High school fitness programs were more like a military experience. Nothing I really like to remember except for a few sports that I really enjoyed. However, moving out of the externally managed world of high school, to an independent lifestyle in University, the choice of whether or not to exercise was an easy one.

At the beginning, it was swimming. I was on the high school swim team and so I would go to the campus pool whenever I felt a bit lethargic. However, as studies took precedence, I found that going to the pool was a long and involving journey. There was a lot of planning to do just to get to the pool for a few laps. So, as expected, swimming happened less and less. The waist got bigger and bigger and finally, it really didn't feel all that good going to the pool. I think that I finally became conscious of my body.

So I switched to squash. I'd played a bit in high school and so I knew the rules. I found players who were willing to go to the squash courts a few days a week and that kept me motivated. Once you made an appointment at the squash courts, you could not back off. Leaving someone high and dry waiting for a partner would have been a serious crime. So, gradually, my strength built up and I found myself playing squash about two to three times a week. Swimming started again and I was back to at least five full days of exercise.

Those were the days of youth. The body responded by becoming tighter and stronger. A friend of mine suggested that we go for runs up Mount Royal (yes, I forgot to mention that this was in Montreal). So we started jogging a few days a week and my hatred of running started to abate. I found that I could actually run, with a partner, or without, and not die of exhaustion or shame. High school running was not the same. High school running was a painful nightmare. Imagine, going to a Kenyan high school where most of the kids are excellent runners. Whenever we had cross country running, I would cringe. I couldn't run a few meters before starting to gasp. In hindsight, I think that I was just psychologically defeated. I knew long beforehand that I would be last and this permeated into my core, right down to my muscles.

And so it was during a Friday night drinking episode at the graduate's campus pub that a friend, more like an acquaintance, told me that they were going to run a marathon that Sunday. We talked about running for a while and he told me that he'd been training for months. I was buzzed somewhat, and I looked at this guy. Kinda stocky with more like a body builder's image. So I told this guy, that if he could run and finish a marathon, definitely I could. I felt strong and confident. I could could go clubbing and dance for hours on end. Not just lazy floor movements, but energetic total body dancing. On top of that, I was doing at least three squash games weekly, each game lasting no less than thirty minutes. If you haven't played squash, 30 minutes is a lot of time especially for a high paced game.

So this guy said, there's absolutely no way that I could get up on Sunday, run 42.2 kilometers without having trained at all. There was absolutely no way at all. That's all it took to get me into my first Montreal Marathon. Hung over, I went to register the next day. There was a half-marathon and a full marathon. I took the full thing. Got my bib, some freebies and my t-shirt.

That was the hardest race in my life. Actually, the first half was nothing and I took of like it was an actual race. But by the time I got to 30K, I was in serious pain. I believe I stopped a couple of times. My sneakers were not real running shoes and my knees were in pain. But I finished, crossing the line at 4 hours 30 minutes or so. My friend who'd challenged me, finished in 4 hours 50 minutes. I beat him. He could not believe it. Even though he'd trained for months, it didn't matter. I still finished ahead.

Later that evening, I thought about it. Running for over four hours continuously. I actually did it. My feet were really sore, in fact I could barely walk. The shoes that I was wearing were not running shoes and I could feel sharp pangs of pain in my heels each time I took a step. So I decided to get my feet checked out at the hospital. I took myself to the emergency room at the Royal Victoria Hospital (on Dr. Penfield Street) in Montreal. They took x-rays and found nothing. No fractures, the feet were fine. So I hobbled about for a few days just waiting till the pain subsided, and eventually it did. It took about two weeks, but after that I was out and about again. I hadn't realised what I had done until much later. Talking to people, watching news on TV or reading newspaper articles about how difficult it is to run a marathon. Good think I didn't read those articles before the race because I went into it blindly thinking it was just another afternoon jog.

I've been running now for about twenty years. I'm 42 as I write this, and that first race, almost twenty years ago I still remember fondly, though the memory of the actual pain is forgotten. There have been good and bad races. I ran an excellent 3:08 in Ottawa in the late eighties. I'm not an elite runner, but in that race, I passed the half-marathon mark in just over one hour. That's elite pace. I must have really died on the back stretch. In any case, I always get to the finish line. Exhausted but elated. It's a wonderful feeling that I can still push my body that far and come out on top.

Training for running has always eluded me. I like the thought of training and when I'm at the best of my form, I can really enjoy it. I love going out for a run in the early morning, or in the late evening after work. Having children, it's a difficult job to juggle everything, but with a bit of determination, you can find that time at the end of the day to get out and run. Running in Canada has it's trials. Minus thirty (for the Americans, that's about minus twenty-two farenheit) temperatures make it difficult in the winter. Winter running is an art in itself and can only be enjoyed if you have the right equipment. The right warm clothing, hats, gloves and, of course, shoes. Not just regular warm clothes, but real winter running gear. Once you have the right gear and the right attitude, getting outside is just a matter of will power. I learned to run late in life. My running season would end summarily in mid October. As soon as the weather started getting too cold for t-shirts, I would hang up my running shoes and wait for the next year. A running buddy got me out of this habit. Took me to the running room store in Mississauga and I decked myself in warm pants a dry-weave running shirt and a wind breaker. Once I started running in winter, I actually found it quite enjoyable. You don't see too many of us running in winter. Only the die-hard runners stay outside all year and they're a really fun group.

But apart from the winter running gear, I've discovered that in order to enjoy running, you really have to make it a part of your life. Much like eating and sleeping. It's something that you have to love doing. Not just like doing because you think you'll get some health benefits from it (and you will) but something inside you must want to get out there and push your body a little bit further. Like I said earlier in this post, I was never a good runner growing up. I was a lousy runner and hated it with a passion. Thinking about running almost made me sick. Somewhere I convinced myself that I needed to get some exercise and I started to jog in university (Waterloo... then McGill). I never really liked it. And many times I'd quit for weeks, even months. But I kept pushing and trying. I didn't know how to run properly and I didn't know that there was a running technique. That you could actually learn to run. My technique for running was quite simple back then. Change into sneakers, shorts and a t-shirt and then get moving. One leg after another, shuffling along sometimes. There was no thought to drinking water, having a quick snack or even taking care of my health by having good rest.

Partying was still the order of the day and Fridays and Saturdays were innevitably spend outside. This party attitude lessened when the children arrived, but the parties were now indoors. A consumate workaholic and computer addict, I barely slept more than four or five hours, which was fine to begin with, but as a runner, barely adequate. Because of that haphazard training, or lack of training, becoming better was simply impossible. I got to a specific point in my running and got stuck there. It was alike an equilibrium point between my health and my lack of discipline. The Ottawa run of 3:08 had become my greatest achievement ever, and it looked like I would never get into that form again. I had settled into runs of between 3:20 and 3:30.

Throughout all of this, I've learned a couple of things. No great revelations, actually quite obvious to even people who don't run. Here they are:

1) Eat well, sleep well.
This is a tricky one. Eat well means that you need to give your body wholesome foods that will provide you with the energy you need to run. You need to eat protein to keep your muscles in good shape. Running is hard business, and you can imagine the wear-and-tear that your legs undergo. It's important to make sure that you eat foods (your favourite foods) that are rich in protein. In addition to protein, you need to eat a lot of carbohydrates. Yes, despite all the diet fads about reduced carbohydrate diets, this one's not for you. Even if you are a casual runner, eat some carbs to give you the energy you need to maintain a happy, enjoyable run. Keep alcohol and coffee to the minimum. They are both dehydrators and they don't allow your body to refresh itself during rest periods. Water is your best bet or low-sugar juice. Fresh vegetables should be at every meal. Some running magazines propose that you should graze all day. This means, instead of having three-square-meals you have many smaller meals. I've practiced this for a number of years and I can say that it works wonders. The main problem that I find with three-square-meals is that each meal fills you up significantly. At the end of the meal, your body is challenged to digest a large quantity of food, most of which you really don't need immediately. If the next meal is a few hours away, your body saves up the excess food and as your next meal approaches, you begin to get hungry again since you haven't had any food for a few hours. Your body is good at storing food that it doesn't need and it's very poor at fetching it when the time comes. The easiest way to replenish your stock is to eat more. So when your next meal arrives, you're really hungry so you eat a lot more. When you graze, you eat smaller portions and more of them. You might eat every two hours but nothing really significant. At the end of the day, you might have eaten close to the equivalent of the three-square-meals, though I doubt it, but you were never hungry during th day. Your body repairs itself while you sleep. Therefore you need to give your body enough time to repair and build muscle tissue. When you are well rested, you will be able to build strength faster. When you feel weak and tired, it's a sign that you are probably pushing yourself too hard and you need some time to rest. Take a day or a few days to give your body the rest it needs. How much rest is enough? Well that differs with each person. There's a rule of thumb that says eight hours of sleep a night is required. Some people that I know do very well with six. I've settled on six-and-a-half hours myself. The extra thirty minutes do make a difference for me and I've found that if I don't compromise this rule, I am a happier person in the morning.

2) Train wisely.
This means that you do different types of exercise. Run, because that's your passion. Swim if you have a chance. Do some sit-ups, push-ups and weight training, because they'll make you stronger. Walk a lot to keep the leg muscles warm and limber. Having good core muscles is essential to running well. Your gut and hip area must be exercised very well. When you're running, you can hold your stomach muscles tight and breathe from the core. This takes a while to get used to but you will strengthen your abdominals even while you're running. Sit-ups have never been a favourite of mine. I prefer to do crunches since they're better on my lower back. However, I find that sit-ups with a medicine ball work well. I try to do about 100 each morning when I wake up as well as 100 crunches. Then I'm off to work. I normally run in the evening and depending on the type of run, I'll get back and do about 50 crunches after the run. No, I don't have rock-hard abs, but I'm working on them. This is a project in progress. Train wisely. If you go to the running room's web site (http://www.runningroom.com) you'll meet an amazing personality, John Stanton. He's the founder of The Running Room. His story is quite amazing and it's proof that anyone can run. He is a marathon runner trainer and says that there are three types of running that a marathon runner should do in order to get ready for that long 42.2 Km run. Regular daily runs at about 70% effort. Then speed training, or as the swedes call it, fartlek training. In this type of training, during your run, you burst into speed at 100% effort for short, medium and long periods. At each end of the burst, you take a rest running slower till you are ready for the next burst. Speed training will build up endurance, pushing your body beyond what it is normally used to. Finally, every marathon runner must do a really long run as part of the training. Some runners take this very seriously and on some of the long runs actually complete a marathon distance. The longest I've ever done on a long run is about 30 K. The point of all this is to do many different activities. Run, swim, bike and even when you're running, don't do the same type of running. Sometimes do a short run, with many sprints. This may last only 30 minutes and you're done. Sometimes do a long run, very slowly with walking breaks. This may last two or three hours.

3) Make running a part of your life.
This means don't see it as a chore that needs to be done. Enjoy it. Just like eating and spending time with loved ones, running should become one of those activities you just can't wait to get out and do. This takes time to achieve. Like I said earlier on. Running didn't come easily for me. It wasn't a gift that I was blessed with. I actually suffered immensely to get to the point that I'm at now. But I can attest to the fact that with perseverance, you can arrive at the same place. Running is not easy. However, once I'm changed into my running gear and I step outside, I'm not afraid anymore. I know my body well and how far it can go. I know that even when I'm bonked out, I can still get back home. I know that it's not a shame to walk when you're really tired. I know that I'll have good days and bad days and that when I get back home from a really bad run I shouldn't beat myself up for it. However, the freedom I feel from being in motion far outweighs any negatives that I feel. I'm in flight and I feel good. Even in the depth of winter when I have to dress up to the tee, I still feel great being outside. And when I'm back indoors, resting, my mind is clear and my body thanks me for trying my best.

Running for life is just that. A lifestyle that includes a diet of running as a regular, daily activity. It won't be easy. Like many diets, you have to forgo certain foods. You have to be strong enough to keep to the things that will make you a healthier person. So with running, there are days where you have to take your medicine. You'll have to dress up, get outside and just do it. I believe after doing it long enough, your body will stop fighting it and will join you in celebrating the outdoors. I don't know when this happened for me, but eventually it did. I don't wake up every day and dash outside. There are still days that are very tiring. But one thing that I've found out is that it's much better to be out there than inside. It's much better to hear your feet click back and forth and your breath in unison, than sit in front of the TV or slouch on a couch.

Sometime in the mid 1990's I injured my knees. It was a hard lesson in doing too much. I could barely walk let alone run and for a few years tried all kinds of remedies, including bandaging the knees and taking an unhealthy amount of Tylenol. The runs were atrocious and the more I tried to run, the worse my knees became. I could barely cross a road if the light was about to change from green to amber. I'd wait till the lights changed then cross the street. Crossing in the middle of the street was risky business. I went to see my doctor who took some x-rays and could see nothing really wrong except for a bit of wear around the cartilage. No fractures or bones crushing each other. The pain actually felt like my knee bones were rubbing against each other. My doctor then told me about Glucosamine Sulphate. He had been giving Glucosamine to his dog who was old and getting some arthritis and he noticed that the dog's friskiness and energy was picking up. He said that I should try it, but it's a slow worker. Glucosamine is an ingredient of cartilage. Your body builds it naturally, but as you get older, your ability to manufacture Glucosamine decreases. So, sometime between 1995 and 1997 I started to take Glucosamine. It took a long time. A very long time. But sometime around 2000, I started to feel better. In fact, towards the end of 1999, I began to jog again. I had gained a hundred and one pounds and could literally feel my weight when I moved. Not good at all. So when I actually felt that my legs could take it, I began to jog. The exercise was as difficult as when I first started. When I first started running though, I was in my twenties and my only problem was weight. Now in the mid-thirties, I had knee and weight problems including issues with age. But nonetheless, I persevered. And I struggled to get out, not every day, but frequently enough. And slowly, week-by-week, month-by-month, I got leaner and better. That's how you do it, slowly and surely. Like the tortoise and the hare.

Our North American society demands instant gratification. We want it now, actually yesterday. We aren't willing to wait for anything. Money, we want it now. Health, we want it now. Fame and success, we wanted that yesterday. The fitness industry has made a ton of money by promising goals that are difficult to achieve. "Attain absolute fitness by only exercising three times a week for only twenty minutes," the ads scream. If I'd found out that secret, I probably would never have become a runner and enjoyed the benefits of running. A good thing it doesn't work. There are fitness clubs galore in many cities in our countries. Diet books abound in many book stores. But there are also many painful stories of defeat. Why do we buy into these scams, and scams they are. There's no other word for them. There's little proof that exercising for twenty minutes, three times a week, while eating anything you like will do you any good. There's absolutely no way you can get better.

While I was learning to run, I was still trying to keep my old lifestyle. Running was something I did on the side, not a core activity. Not a central part of my life. When I decided that everything that I did would focus on getting me to run better, I saw that many of the things I was doing would have to go. The partying would have to slow down. Sleep would have to take priority over watching late night movies. Eating well would have to take precedence over quaffing down steaks and pizzas. The sacrifice seemed overwhelming, but in practice, it wasn't that bad. I was just scared of change. It's just another life changing moment, and I wasn't willing to step into it. So I started slowly. I made sure that I was outside daily. If not for a good strong run, for a pleasantly light jog. I found out that even on days that I wasn't feeling 100%, I could at least muster enough energy to run comfortably. Sometimes it would take 2K to shift from fatigue to relaxed running.

I started writing this months ago. It's become a journal since I now run 20K daily without issue. I've learnt that the mileage increase is not damaging. I used to get lower back pain from a weak core, especially weak abs. I still don't do a lot of core strengthening, not as much as I should be doing, but the pain's gone and my core looks better. It could be a whole lot better still. So at 120K to 140K a week, I think that I have definitely improved. I read somewhere that long runs, the Sunday long run, can lead to an increase in speed. Even for middle and shorter distance runners. There are coaches who put their runners through long runs. Something to do with aerobic and anaerobic muscles. Fast twitch versus slow twitch muscles. As a runner, you need to develop both muscle types. Fast twitch allow you to adjust to different running conditions anaerobically such as quick uphill climbs or sudden requirements for speed. Slow twitch, aerobic muscles, allow you to run greater distances and take longer to fatigue. Both types are required for long and short races.

It's time to publish this and move on to something else. Perhaps a topic that's shorter, and less boring. Running isn't boring. It's great when you know how to do it properly. In any case, check out the following links: http://www.runningroom.com, http://www.runnersworld.com and http://www.coolrunning.com.

Wednesday, May 17, 2006

What is a thought?


What is a thought? Are you having one now? What is the difference between a thought and, say, a feeling, sensory input, a perception?

Monday, May 15, 2006

African Culture


I read a very interesting article by Dr. Karega-Munene. It was titled, "Aspects of Sharing amongst Africans." In it, he discusses changes that have taken place, particularly in Kenya, regarding how Africans view and value the community. This article was originally published by Wajibu, a journal published in Nairobi. Wajibu's theme is: A Journal of Social and Religious Concern. I have also been able to locate the article on Wajibu's website so I encourage you to take a look: http://web.peacelink.it/wajibu/14_issue/p1.html.

I agree with everything Dr. Karega-Munene says and it's part of a bigger problem where we're loosing our culture. There's another article, "In Search of an African Identity," by Constantine M. Mwikamba. Even though the topic is complex, the article is very readable and discusses the decline of African Culture. One very important issue, tied to Dr. Karega-Munene's article, has to do with the differences between African Culture and Western Culture. Our, African, culture is one where the individual is part of a collective, part of nature, part of the community and part of the family. The distinction between "I" and "them" is very blurred and "I" does not exist without "them." Your culture is a product of the society that brings you up and the environment in which you exist. You are trained to become part of the collective and participate unselfishly with your community, respecting everyone and everything around you. In contrast, Western Culture is all about "I." The individual can separate themselves from family or community and determine how they will deal with each type of relationship separately. The individual is "free" to select when and how to interact with each group and can refuse to commune if they feel the relationship does not satisfy a particular individual need.

Dr. Karega-Munene's article is even more specific, discussing how African's perceive materialism. We used to give unselfishly. We don't any more. He gives concrete examples where he has seen this in his own experience. In fact, he goes on to give instances where this has been corrupted. Where even those with monetary ability, will actually ask friends, family and even strangers for more money, through "harambees," and hoard what they have amassed.

There's a collection of these essays in a publication by Wajibu called "Social and Religious Concerns of East Africa, ISBN: 9966-7082-0-0." A very good read for all but for Africans in particular.

Friday, May 12, 2006

Life as a computer programmer


So you want to write computer programs for a living? Is it for the intellectual curiosity? Challenge? Few jobs will keep you constantly motiviated and intellectually challenged than a thinker's job. Writing's fun and challenging as well, but writing software in today's world is actually very difficult.

So, I'm trying to learn python. Yep, an interesting name for a programming language which I understand comes from the Monty Python series and not the slithering reptile. Until I started doing work in Linux, I didn't know how hugely popular this programming language was. Most of my life being spent in C/C++ code, and now PHP, you become quite arrogant and think that there's nothing else out there to compare with.

But python's quite popular. There are volumes on the subject and some major applications written entirely in python. So in the next few weeks, I'm going to post some python tutorials. Not the typical Hello World! stuff, but some good material.

See you around.

Taking responsibility


You are singularly responsible for the things you do and the things you say. Our actions are intertwined with the words we speak, affecting those that hear them, or those that read them. It is said that our lives are all connected and that there exists an unconscious experience that develops from our connections with each other.

We're not all good. Some of us are bad, really bad. Some of us are mildly bad and some of us seem invisible. Like the music in a movie, they form the background around which our lives revolve. But the music is still important. It allows you to experience the movie in a richer, more fulfilling way.

From the time we are born, we begin to affect everyone around us. We continue on through life trying to justify exactly why it is we are here. What is the purpose of all this? Why the struggle, or the numb existence? Are we just passengers and who's driving this train anyway?

King Solomon in Ecclesiastes declares that all is vain, futile. Existence is nothing more than futile being. What do we get at the end of the journey? How are we to enjoy the spoils of our labour? Even though it seems futile, it does end up in a positive note, telling us all to respect our neighbour and to enjoy the sweat that comes from labouring.

So I guess one must continue to be strong, educated, hard working and kind. Spending time to enjoy relationships and taking care of the gifts that they've been granted, because, after all, those things will all come to pass, and the talents you have today will expire.

Be good.

Wednesday, May 10, 2006

The Epic Story


I'm thinking of writing the epic novel. A grand and very moving story about stuff that just moves you. Ok, that didn't sound right, but you get the picture. They'd be strong, bold heroes. Muscular people who are not afraid and rush towards danger like a kid running towards an ice cream truck. Gorgeous, flawless women whose sole purpose is to tempt and stoke the carnal desires of the male audience.

The plot might be something like this. The time is a gazillion BC, long before anyone knew about religeon or any organised, behavioral authority. Success was determined by the ability to conquer and survive. People aligned themselves with the strong who could do anything to expand their sphere of influence. They were kings, no, in fact they were Gods.

So, on the tiny village, somewhere in south Arabia, lived a village under the protection of the mightly overlord Ghahz. That's nice. I like the name Ghahz. He was a mighty, mighty lord from a line of mighty, mighty lords. His father before him had ruled the land with fear and bloodshed. In fact, his father had told him that the only way to keep obedience was to make sure that there was bloodshed in the memory of the people by killing at least one noble person each and every month.

In the village lived a family. A typical south Arabian family. A man and his harem of women (say six to seven) and a few sons and daughters. This man could dip his wick in different honey pots each day of the week. What a life... but I digress.

One of the sons, innocent in his youthfulness, didn't understand the hierarchy. The order that was imposed on them. When Ghahz sent a soldier to come to their home and take his father for execution, he was completely devastated and resolved that he would exact revenge when the time was right. Of course, it didn't help that he was only five years old at the time and would have to grow up. The fact that he may forget the incident when he was mature enough or that Ghahz would be dead isn't an issue in at this part of the plot.

So the son, let's call him Ahmad, grows up to be a handsome, strong, skilled man. His many skills include combat fighting, gymnastics and, of course, horse riding. Horse riding, a noble and much loved sport in south Arabia.

When Ahmad is sixteen years old, he is told by his mother (one of the six or seven concubines of his late father) that he was betrothed to be married to a local girl. The girl's name is Latifah. It's now the right time to get married.

Even though Ahmad has gone through a number of his brother's and sister's weddings, all of them arranged at birth, he's still surprised that this was not mentioned to him till now. Anyway, he knows Latifah since they attend the same school and is not dissapointed. She's really hot and in fact Ahmad cannot believe his luck. He's actually wondering how Latifah is taking the news at her home.

However, Ghahz is looking for fresh kill, so he decided to visit the home of Ahmad again to look for another victim. He's told by spies that Ahmad (now quite popular in the village) could be an appropriate candidate for execution. Ghahz decides not to kill the young boy, but to kill his betrothed spouse instead.

As you can imagine, this absolutely tears the young Ahmad into pieces. He goes insane and curses the name of Ghahz and his whole line. In a fit of anger, he kills Ghahz's messenger and manages to escape town.

Back in the village, Ghahz has really lost it. He orders the death of each of Ahmad's family members till Ahmad is found. He thinks that they've squirreled him off someplace safe. On day one, they execute Ahmad's mother. On day two they execute the oldest concubine, and so on and so forth.

This continues for a whole week till the news reaches Ahmad who decides to return home to face the consequences of his actions. He is immediately imprisoned and an execution date is set.

Now here's the part of the story where things get a bit strange. In the prison, he hooks up with a nubian slave, Mustafa, who also yearns to get out of prison. They plan and plot an escape and manage to execute it successfully. This is the part in the book where I need to be careful about not insulting my readers. They'll know a good escape when they read one. I was thinking of getting Mustafa to make friends with one of the guards who they can later coax into helping them. Perhaps a guard with homosexual tendencies who could be tempted... no, I don't think that I can describe that sort of thing successfully. I'll be railed out by the homo-rights community and shunned. My book will be burnt and censored.

So, they're out, but still angry. Now they have to make sure that they can get to Ghahz and kill him. They will have to capture him and take him somewhere where they can inflict the pain of all the people Ghahz has killed on him. Perhaps by cutting off pieces of his flesh, stripping them off carefully and then searing the open wounds with salty water. Pulling off his teeth and filing the open nerves with splintered wood. Maybe even pulling off each toe nail and then mashing each toe flat with a cast iron sledge hammer. Ideas aplenty.

So, by some ingenuity, they are able to make it into the home of Ghahz. They find him sleeping with four of his favourite concubines (perhaps I can describe the Ghahz evening scene the night before for the single and starving) and manage to whisk him away.

But they run into a complication. All of a sudden, Mustafa does not want to participate in the wanton killing. He actually wants to make Ghahz repent and send him back, perhaps to do good (violins playing). Ahmad cannot believe this. Now he's caught between fighting the man who helped him escape from prison, to kill his enemy. The man who killed his father. Denied him of a parent.

Ghahz, arrogant as ever, does not wimper or beg for his life. This really irks Ahmad because he knows that his father cried out loud for his life and begged to be spared. Ghahz had laughed out loud even when Ahmad's father had soiled himself in humiliation and pain.

But Mustafa agrees to let Ahmad have some revenge as long as he lets Ghahz live so Ahmad tortures him to impotence thereby stopping the bloodline. This is probably too late since Ghahz had a harem full of women who have provided him with plenty offspring so far.

The story continues when they let Ghahz go back to his palace where he immediately sends forces out to look for Ahmad and Mustafa. Of course, they catch up with the unfortunate two and return them to the palace where they will be summarily put to death in the most shameful way.

Such is life. Winners always win, even though it's never fair.