Drug addict who punched two-year-old had violent upbringing – Judge