This judge gave a no-nonsense speech that left troubled teens in tears