Optimal and Adaptive Online Learning