  A sharp upper bound for the maximum integer not belonging to an ideal of a
numerical semigroup is given and the ideals attaining this bound are
characterized. Then the result is used, through the so-called Feng-Rao numbers,
to bound the generalized Hamming weights of algebraic-geometry codes. This is
further developed for Hermitian codes and the codes on one of the
Garcia-Stichtenoth towers, as well as for some more general families.
