This is one way to preset your calorie intake. Remember, put it in writing. Written plans carry more weight than just making mental plans. Exercise is the second key. In fact regular exercise is the single best predictor of long term success in weight maintenance.
Sedentary behavior is a major problem and one of the main causes of rising obesity.
30 min of exercise per day is key. Those who can do at least 2000 calories of exercise per week have the best chance of not gaining weight. Motivation is the last, but most important key. Important when you begin a diet, and it remains most important in the long run. Motivation is very individual.