High-energy x-ray diffraction from surfaces and nanoparticles