Saturday, May 21, 2011

A note on Passive Aggression

This is the most difficult of all emotions that one could deal with; actually one can never deal with it but succumb. Often in our upbringing, we would have faced this. I know that parents do not know want their children to make any mistakes and suffer, but at times they do go beyond what is necessary and end up feeding them with a lot of negative thoughts and confuse them. By doing so, ever so cleverly, they ensure that their children follow/avoid following a particular path in their lives. This is perfect example for the saying, "Too much of anything is good for nothing!".

Of-course, parents are showing their affection this way, but I guess children are much better off, taking life as it comes. This need not apply only to the parent-child relationship; it is ubiquitous in any old-young, senior-junior relationship that one comes across. People should save their advices when the individual is actually looking for some. Otherwise, the younger ones should be left to do things on their own!.

This is certainly one thing that I will have etched in my mind forever!.

Sunday, May 15, 2011

Something on the Soundex Algorithm

The idea as such amazed me, when I first heard about this. I was rather under-estimating the power of Perl community, thinking that it is an obsolete piece of technology, before I got to know about the existence of some very good modules like Text::Soundex in Perl. Still, Perl is widely used hmm... Perl 6 will at-least have some takers.

Coming back to the Soundex, it is quite an interesting idea to think of ways to index words based on how they are pronounced. It is quite intuitive. Whenever we hear a new word, we try to spell it out based on the sound and based on our knowledge of the language, in that way idea is intuitive.

More importantly, it cuts the barriers of language apart. It unifies all the searches and therefore it is something special. However, it could be used only in limited places. Catalogues(Library/business) could have some soundex defined over them that can simplify the search. Basically, one can say that soundex algorithm can be used to index words more than anything else.

http://creativyst.com/Doc/Articles/SoundEx1/SoundEx1.htm I found this link to have good information about the Soundex algorithm. More importantly, it provides the implementation of the algorithm in several language. Free Source Code!.... Have fun!

Monday, April 25, 2011

Perl hashes - effective way of iterating through the hashes

I came across this very useful link about iterating through the perl hashes. http://www.perlhowto.com/iterate_through_a_hash. All the while, I thought that I was doing pretty good with iterating through the perl hashes, untill I saw this link. It seems that best way to iterate is to use each and not the other paradigm listed in the link.

I am posting this, just to give myself a reminder, and also a note for the perl-programmers, who have overlooked this aspect. Time to do some code-refactoring/optimisation.

Sunday, April 24, 2011

The Social Network Conundrum


It seems that no one in facebook/twitter does not want to hear about the pains in others lives. Only the messages with positive connotations is percolating the masses and is gaining in popularity; which is a good sign. However, I was wondering whether this is a good sign which is when I remembered the goodness the positive vibes can bring to your life. By spreading such messages, be it inspirational quotes or post/tweet about someone being happy and all, the positive energy is made to float all along the web. Sometimes, especially when I am low, I wonder if people are even faking these posts, saying that they are happy. This thought is cynical as it is, I already know that, but still one has to agree to the fact that once in a while, people do slip in such posts, just to get attention. All in all, it is a good-sign that social network is having such a good influence in our lives, because that is where we seem to be spending a lot of time at.

PS: The reason for the title: I wanted to use the word conundrum somewhere, so I chose it; ofcourse BBT is a big inspiration for choosing this word. Still not sure whether it is the right word to use here, though.

Friday, April 15, 2011

Perl CPAN - install cpan modules easily

I managed to install a new perl module on my Snow leopard. Till now, I was of the opinion that installing perl modules is a tedious task. Thanks to CPAN, that I was proved wrong.

All I had to do was type $> cpan on the terminal.

This command took me to a special cpan shell. In that shell i installed Text::Soundex module, just by saying

(notice the new cpan prompt here)
cpan>  install Text::Soundex
done!

It is so easy and does not take a lot of time. On a side-note, Soundex is the algorithm by Donald E Knuth (Don) that will index names based on the phonetics of it. The idea is startling and is wrought with many possibilities. It would be interesting to explore the algorithm and I would try to add more details to the algorithm in my next post.

FTR: I am using perl 5.10.0 that came pre-installed with my snow-leopard. Not sure whether cpan takes care of perl version dependencies.