Dissipation Inequalities and Quadratic Constraints for Control, Optimization, and Learning