Geovanny Villalba-Aleman, who stabbed a professor and two students at University of Waterloo, had a long history of suicide attempts, self-loathing and social isolation, a court was told Wednesday.