Discrete dipole approximation for calculating extinction and Raman intensities for small particles with arbitrary shapes