A New York judge has agreed it was improper to have spoken to media during an anti-violence demonstration as a related criminal case played out, as was his request for a moment of silence while presiding over another matter involving two police officers who were struck by gunfire.