  In recent developments, a general approach for solving Riemann--Hilbert
problems numerically has been developed. We review this numerical framework,
and apply it to the calculation of orthogonal polynomials on the real line.
Combining this numerical algorithm with an approach to compute Fredholm
determinants, we are able to calculate level densities and gap statistics for
general finite-dimensional unitary ensembles. We also include a description of
how to compute the Hastings--McLeod solution of the homogeneous Painlev\'e II
equation.
