Spectral and pseudospectral methods for unbounded domains