NEW YORK (AP) — The gunman who fatally ambushed two New York City police officers in their squad car had a long criminal record, a hatred for police and the government and an apparent history of mental instability that included an attempt to hang himself a year ago, authorities said Sunday.