<commit_before>package org.erhsroboticsclub.robo2013.utilities;

import edu.wpi.first.wpilibj.DriverStationLCD;
import edu.wpi.first.wpilibj.Timer;

/**
 *
 * This class uses the DriverStationLCD class to post messages to the driver
 * station It uses an array of strings to make the driver station lcd more like
 * a console
 *
 * @author Michael
 */
public class Messenger {

    private DriverStationLCD driverLCD;
    private String msg[];
    private final String EMPTY_SPACE = "                             ";
    private final int MAX_MESSAGE_LENGTH = 20;
    private final DriverStationLCD.Line[] LINE = {DriverStationLCD.Line.kUser1,
                                                  DriverStationLCD.Line.kUser2, 
                                                  DriverStationLCD.Line.kUser3, 
                                                  DriverStationLCD.Line.kUser4,
                                                  DriverStationLCD.Line.kUser5,
                                                  DriverStationLCD.Line.kUser6};

    public Messenger() {
        driverLCD = DriverStationLCD.getInstance();
        msg = new String[6];
        for (int i = 0; i < 6; i++) {
            msg[i] = " ";
        }
    }

    /**
     * Moves up all lines like a scrolling console
     */
    private void moveUp() {
        for (int i = msg.length - 1; i > 0; i--) {
            msg[i] = msg[i - 1];
        }
    }

    /**
     * Writes _msg to the driver station and wraps around long strings
     *
     * @param line The line to write to
     * @param _msg The message to write
     */
    private void write(DriverStationLCD.Line line, String _msg) {
        if (_msg.length() > MAX_MESSAGE_LENGTH) {
            msg[0] = _msg.substring(0, MAX_MESSAGE_LENGTH);
            driverLCD.println(line, 1, msg[0]);
            _msg = _msg.substring(MAX_MESSAGE_LENGTH);

            this.printLn(_msg);
        } else {
            driverLCD.println(line, 1, _msg);
        }
    }

    /**
     * Clears the DriverStation LCD
     */
    public final void clearConsole() {
        for (int i = 0; i < 6; i++) {
            msg[i] = EMPTY_SPACE;
        }
        for (int i = 0; i < 6; i++) {
            write(LINE[i], msg[5 - i]);
        }
    }

    /**
     * Prints a message to a specific line on the Driver Station LCD
     *
     * @param s The String to be printed on the Driver Station
     * @param line The line to print the message to
     */
    public void printOnLn(String s, DriverStationLCD.Line line) {
        driverLCD.println(line, 1, EMPTY_SPACE);
        driverLCD.println(line, 1, s);
        driverLCD.updateLCD();
    }
<commit_msg>fixing clear console<commit_after>package org.erhsroboticsclub.robo2013.utilities;

import edu.wpi.first.wpilibj.DriverStationLCD;
import edu.wpi.first.wpilibj.Timer;

/**
 *
 * This class uses the DriverStationLCD class to post messages to the driver
 * station It uses an array of strings to make the driver station lcd more like
 * a console
 *
 * @author Michael
 */
public class Messenger {

    private DriverStationLCD driverLCD;
    private String msg[];
    private final String EMPTY_SPACE = "                             ";
    private final int MAX_MESSAGE_LENGTH = 20;
    private final DriverStationLCD.Line[] LINE = {DriverStationLCD.Line.kUser1,
                                                  DriverStationLCD.Line.kUser2, 
                                                  DriverStationLCD.Line.kUser3, 
                                                  DriverStationLCD.Line.kUser4,
                                                  DriverStationLCD.Line.kUser5,
                                                  DriverStationLCD.Line.kUser6};

    public Messenger() {
        driverLCD = DriverStationLCD.getInstance();
        msg = new String[6];
        for (int i = 0; i < 6; i++) {
            msg[i] = " ";
        }
    }

    /**
     * Moves up all lines like a scrolling console
     */
    private void moveUp() {
        for (int i = msg.length - 1; i > 0; i--) {
            msg[i] = msg[i - 1];
        }
    }

    /**
     * Writes _msg to the driver station and wraps around long strings
     *
     * @param line The line to write to
     * @param _msg The message to write
     */
    private void write(DriverStationLCD.Line line, String _msg) {
        if (_msg.length() > MAX_MESSAGE_LENGTH) {
            msg[0] = _msg.substring(0, MAX_MESSAGE_LENGTH);
            driverLCD.println(line, 1, msg[0]);
            _msg = _msg.substring(MAX_MESSAGE_LENGTH);

            this.printLn(_msg);
        } else {
            driverLCD.println(line, 1, _msg);
        }
    }

    /**
     * Clears the DriverStation LCD
     */
    public final void clearConsole() {
        for (int i = 0; i < 6; i++) {
            driverLCD.println(LINE[i], 1, EMPTY_SPACE);
        }
        driverLCD.updateLCD();
    }

    /**
     * Prints a message to a specific line on the Driver Station LCD
     *
     * @param s The String to be printed on the Driver Station
     * @param line The line to print the message to
     */
    public void printOnLn(String s, DriverStationLCD.Line line) {
        driverLCD.println(line, 1, EMPTY_SPACE);
        driverLCD.println(line, 1, s);
        driverLCD.updateLCD();
    }

{'fraction_non_alphanumeric': 0.09417293233082706, 'fraction_numerical': 0.010902255639097745, 'mean_word_length': 1.634158415841584, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4041558', 'n_tokens_mistral': 1565, 'n_tokens_neox': 1507, 'n_words': 434}