Diffraction at the nanoscale. Nanocrystals, defective & amorphous materials