Effect of fs/ps laser pulsewidth on ablation of metals and silicon in air and liquids, and on their nanoparticle yields