Stochastic Optimization Methods in Finance and Energy