Stochastic calculus, martingales, and their applications