All pretty good advice. However, if you find yourself out with friends and almost all you do is think about your project, work on your project. My girlfriend was dragging me out to parties, weddings, her family's house, etc. All I did was think about my project.
We've since separated. Things are working out far better now for my programming schedule. Unfortunately, no more sex.
Socialize, but not for the sake of it. Also, some people are for the late nights, some aren't. Just remember to keep tabs on your health. And I mean that more in the mental sense.