There is a very clever service now available for programmers called Codefetch. You basically select the programming language you’re interested in, type in a keyword or two, and it searches through code samples from current and in-print books that are freely available for download.
No ads or anything, just great search results for programmers.
The angle? All of the code samples come with prominent links to the books they come from. Buy one of the books (and sooner or later you’re bound to) and Codefetch gets a small percentage through the booksellers affiliate programs.