Canada was jolted by a fatal hit-and-run attack on a soldier in Quebec on Monday and by the shooting death of a second soldier at the National War Memorial in Ottawa on Wednesday.