I always use kind of code repositories for my work. I do NOT start with an empty page writing a program. Instead, I try to find example code that works and then adjust it to my purposes. It takes a long time to write something from scratch - you have to remember every detail about APIs etc. Take something that works and change it.
David Flanagen, Java by Example. The best java examples in source I have found. Need to know how to create a file or write to a socket? Go there. All examples are downloadable from his web site.
Linux source tree. Download and install a linux source tree with kernel and utility source. There is plenty of C code to browse and search.