Through the Looking Glass

This was the fortune output on my machine just a few moments ago. Why do I relate to this so much?

“No program is perfect,”
They said with a shrug.
“The customer’s happy–
What’s one little bug?”

But he was determined,            Then change two, then three more,
The others went home.              As year followed year.
He dug out the flow chart         And strangers would comment,
Deserted, alone.                          “Is that guy still here?”

Night passed into morning.      He died at the console
The room was cluttered            Of hunger and thirst
With core dumps, source listings.    Next day he was buried
“I’m close,” he muttered.            Face down, nine edge first.

Chain smoking, cold coffee,    And his wife through her tears
Logic, deduction.                        Accepted his fate.
“I’ve got it!” he cried,                 Said “He’s not really gone,
“Just change one instruction.”  He’s just working late.”
        — The Perfect Programmer

How many of you folks have spent countless nights wide awake either programming, testing or debugging? And cursing like a champion the whole time. I actually have lost count. It always starts like this – One bug, and once you catch it, you review the code again and then, you somehow feel that a certain function is called in the shittiest way possible. One thing leads to another and by the time you are finished, you realize an hour had passed by since you had begun, but it’s the next day! But the feeling you get once the issue is solved is something that is much more satisfying than an explosive orgasm! Not to forget the obligatory cursing, celebrating the conquest and partying with a hot coffee and a cigarette. 😀 Reminds me of the following picture relating the number of curses with code quality.

Absolute Truth!

It’s another perk of being single after getting your ass dumped by your ex in Starbucks after three years without any explanation (Had to rub it in, sorry. Feb 9th would be the first anniversary of the Starbucks core dump). You don’t give a damn about when you go home and can spend a major part of every Saturday in a comic book shop arguing for DC against Marvel fanboys and party when you feel like it! Awesome, I say!

By the way, have you guys slacked off while programming? I have. My excuse has always been the classic, “Code is compiling” and I am waiting for it to be finished. Although, most of time, it was true. Just wanted to remember that again.

I have to stay out of the way

Alright, I have slacked off too long. Back to some pf testing on OpenBSD-Current with another slacker.

Stderr – zsh

Zsh is a great shell that simplifies a lot of tasks and brings in a ton of features (if you intend to use a load of modules and shell functions that is). For instance, the live command coloring capability is pretty awesome. The following post is just a simple illustration of a simple, single line added to my .zshrc and what it does.

When you type in a wrong command, the shell will throw a stderr command not found. The output would be the same color as the foreground color that you use on your terminal (The command color is red here because of live command highlighting – More on this at the end of the post). Like this:

Stderr - Default

But, wouldn’t it be nice to color the output as well? I want my colors man. See what I mean?

Stderr - Colored

All I had to do was add a line in my .zshrc on my BSD boxes.

Line in .zshrc

It should be self-explanatory I guess. Here’s the entry again for you Ctrl+C, Ctrl+V ‘ers.

exec 2>>( while read X; do print "\e[91m${X}\e[0m" > /dev/tty; done & )

With live command coloring, colored stderr is repetitive though. Since, typing a wrong command would automatically let the command stand out in red, indicating that it is not a proper command. But if you don’t want live syntax highlighting, the above feature would be of use.

Book List 2011 – Special Entry: Go Rin No Sho

Miyamoto Musashi

If you don’t know about Miyamoto Musashi, then there is no reason to live! He was a rōnin, a samurai warrior without a master. He is renowned for his swordsmanship and numerous battles with other warriors. It is absolutely fascinating to read about his life and the way he went about conquering others with his strategy and skill. Anyone with even a marginal interest in martial arts must read about Musashi and his teachings.

Go Rin No Sho or as it is famously known as The Book of Five Rings is not just a book about martial arts or the technique of the sword. It is a book about strategy and tactics. Musashi talks about his early life and then expands on his self learning. He talks about strategy being the key element of the warrior mindset. Various aspects of strategy are presented in the five books, Ground, Water, Fire, Wind and Void. Each book talks about the preparation of the warrior and emphasizes strategic thinking, timing  etc.

Go Rin No Sho - The Book of Five Rings

I have read this book earlier. But I read it again last year, so thought of mentioning.

Overall, this is a book that you would consider as one of the most important books in your book collection. Give it a shot and see for yourself. This book is used extensively in business as well, since the strategic aspects discussed can be used in any form of profession. Besides, it is Miyamoto freaking Musashi we are talking about.

If you go to Japan, you would see the full extent of his influence. There have been multiple movies made on his life and his popularity is still intact. A fantastic documentary about Musashi aired on the History Channel sometime back. It gives you a quick introduction about the man and why his teachings are extremely valuable even today. It was hosted by Mark Dacascos. It is a must see. The full 88 minutes doc is available on youtube and am ebedding the video right here. Credit goes to ProcoTopoLoco.

I loved the documentary.