Try this: do sport! Lot of sport! Outside, at home, you choose... then a shower (cold, to increase your body temperature), and go directly to bed. Your bedroom should be 18-20°C max.
Try not to think... keep your brain as empty as possible!

Don't think about programming! ^^
I fall asleep with talkshow on radio! It works very well for me.
And a last thing: SEX IS GOOD FOR YOUR PROBLEM !! lol 9_9 9_9