Brilliance of Haskell

Haskell is brilliant because a Caesar cipher is just one line.
 encode shift msg = map (chr . (+ shift) . ord) msg

Brilliant…

Humility

Attempting to write a bubbleSort in Haskell from scratch is a lesson in humility. I used to underestimate/devalue the point of a
Fulltime formal CS degree.. Now i realize, my fallacy..
Infact, i am now convinced that the best interview exercise would be to time how long one takes to code bubbleSort in a new language given in the interview..:-P

P.S: Am new to Haskell.

bestfeatures opencv library

Hi,
   I was sorting wallpapers(of hot girls <wink>) and got tired of doing it manually. Thought i will see if some opencv helps.
So far found a function that extracts BestFeatures.
Wrote up a python script to extract best features and create cropped images of the features for all pictures in a given folder.
Here’s the code: https://github.com/anandjeyahar/Miscellaneous/blob/master/opencv_GoodFeatures.py**

** — Not very thoroughly tested though..

Beautiful Haskell

The beauty of haskell is it’s similarity to math. It is a fucking brilliant language to learn(especially, if you used to love math.)
As for practical problems and solutions, there are so many haskell packages, that i doubt it is impossible. But how the clean the code results,
i don’t know.* I would love to see clean code, but have’nt seen much of high level packages yet, and haven’t done enough development either.
But i heard lots of praise. And am eager to go for more haskell. Taking the effort to get yesod installed and running on annoying ubuntu.

*- Have just gone past recursion** chapter in Learn you a haskell for good.
**- Can’t help but wonder if recursion being called hard is specific to European/American culture. Personally, i find multiple sequences of
   and/or annoying rather than recursive. (i.e: hard to understand when reading code.)

Linux sata disk detection

The unpredictability of sata disk devices naming in the linux kernel is bloody pissing off… No idea when and how it works…..Damn… and thanks to lvm+uuid..

UPDATE 24-May-2013: Turned out i was just stupid and blind. problem no.1 : using /dev/sdx’s in /etc/fstab instead of uuids. problem no.2: changing the boot sequence set in BIOS

python defaultdict implementation profile output

Hi,
    i was just reading old classes vs new style classes (http://www.python.org/download/releases/2.2.3/descrintro/)
and saw that Guido was saying the key in list implementation of defaultdict would be slower.
sure it made sense. but just wanted to see how much differnce it would make. i hadn’t used cProfile anywher yet.. so got it done and here it goes no surprise. the in keys implementation is slower for medium -big dictionaries… Here are the results on github(https://github.com/anandjeyahar/python-dict-profiler)