I am currently trying to teach myself to program, I first began to learn by writing in Python and watching the OpenCourseware lectures from MIT University. I recommend watching them as they are very useful and cover many of the fundamentals of programming in any language (link http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/video-lectures/).
I have more recently started learning Java as well. So far I have written a pong like game and am starting on a more difficult RNA sequencing program for my PhD.