Gaussian Adaptation as a unifying framework for continuous black-box optimization and adaptive Monte Carlo sampling