Hysteresis and nucleation in condensed matter