NIR spectroscopy: a versatile technique for solving different problems