Federal judge admits misconduct and apology