Spectral and pseudospectral methods for advection equations