Stendhal, 1783-1842