Krugle is a combination code search engine and developer community. It crawls some 80,000 open source projects in dozens of different programming languages, and even allows searchers to look at code snippets from any of Safari's online programming books
I tried this search engine by trying to find a code snippet for Random and the query returns with 206958 matching files. Surely it will took a while to decide which code i should use, but it's worthed rather than having to implement new code for something which has been implemented by other people. When you want to have a similar function as the other, why bother to reinvent the wheel? It's more efficient to use other's work (don't forget to include the author's name as a credit) and surely it's not wasting time to code again.
Linux.Com : Krugle offers code search engine for open source, with open source