  It is explained how to find the de~Rham decomposition of a Riemannian
manifold and the Wu decomposition of a Lorentzian manifold. For that it is
enough to find parallel symmetric bilinear forms on the manifold, and do some
linear algebra. This result will allow to compute the connected holonomy group
of an arbitrary Riemannian or Lorentzian manifold.
