Electronic structures and spectra of cyanoethylene derivatives