Thursday, April 21, 2005

Search history...

Started using Search History. Wonder how I got along without it till now!

Speaking of google they does use their adsense well. Try searching for Udi Manber and see the ads :)

Interesting...
"Just as the U.S. wants to see a strong and democratic Russia, we want to see a strong and democratic U.S. that acts in the international arena jointly with other states and with respect for international law,"

Wednesday, April 20, 2005

Random stuff

Too many are moving out of msft these days. minimsft documents a few of them ...

Noticed something very interesting - most of the Microsoft DEs worked at DEC sometime in their careers!

ACV has written a lot of cool humour stuff on his site

Saturday, April 16, 2005

Anagrams ....

You have dictionary words in a file. You are solving crosswords. You want to quickly find anagrams of a given word.
Perf requirements:
1. Load up time of a couple of seconds is acceptable (wordlist of ~50k which you can get from web)
2. Each anagram query should be fast say < 0.5 or 1 sec.

Here's how building the strucure would look in python. Reads like psuedo code but it works.. Pretty neat?

def sort(word):
l = list(word)
l.sort()
return "".join(l)

def anagrams(words):
ags = {}
for word in words:
sw = sort(word)
ags.setdefault(sw, []).append(word)

return dict([(x,y) for (x,y) in ags.iteritems() if len(y) > 1])

if __name__ == "__main__":
words = open("wordlist.txt").readlines()
words = [word.strip() for word in words]
rs = anagrams(words)
print len(rs)

If you think about it your first reaction would be - but it would be **so** slow :)). But you know what? It satisfies the requirements and takes a fraction of time to write than in C.

Thursday, April 14, 2005

Applying to MS US...

Here's a quick tip that I got from a friend who was having a hard time with the careers page. If you are from an applications company with a lot of java exp etc..., just go ahead choose ur title and location, type java in the search box and there you go :)...

Saturday, April 02, 2005

Analogies..

Been reading around quite a bit and one thing I have noticed is that most people like to talk about software development in terms of analogies. Some see it as painting, some see it as gardening, others view games as valid models for software projects (!).

So why is this the case? The person who is making the analogy does not know what he is talking about, the person who is reading does not know what the analogy is about, but it gives everyone a warm fuzzy feeling :) and an illusion of having understood something they have no clue about. It spares everyone from having to face everyday software development - with all its non-analogical realities :P