Harmonic generation in gases and plasmas by picosecond and femtosecond laser sources