Designing autonomous systems that can adapt to their environments is arguably one of the most important goals in computer science and engineering. In some cases the environment is too complex to be modeled, and the best is to take a robust approach: continuously optimize the system as it interacts with its environment. Online learning, a subfield of machine learning, provides the theoretical foundations to solve such problems. The course will provide an introduction to online learning, covering the basic techniques and ideas. We will also discuss its connections and applications to other areas of machine learning, as well as how the same techniques lead to efficient methods for large scale optimization.