<commit_before>package com.endovectors.uta.hardware;

import com.endovectors.uta.centralcontroller.MasterController;
import com.endovectors.uta.presentation.button.ButtonStatesEnum;
import com.endovectors.uta.processing.MoveInterface;

import java.util.ArrayList;
import java.util.Observable;

/**
 * Created by asham_000 on 7/20/2015.
 */
public class HardwareRequestHandler extends Observable implements Runnable, HardwareRequestHandlerInterface {

    UsbComm usbComm;
    MasterController masterController;
    ArrayList<MoveInterface> moves;

    public HardwareRequestHandler (MasterController masterController){
        usbComm = new UsbComm();
        this.masterController = masterController;
        usbComm.connect();
    }

    public void run(){
        try {
            moves = masterController.getMoves();
            String string = ""; 
            //do hardwaresy stuff
            for (int i = 0; i < moves.size(); i++)
            {
            	String s[] = moves.get(i).toString().split("(,)");
            	string = string + s[0] + "/" + 0 + "/" + s[1] +  "/" + 1 + "/";
            }
            usbComm.instruction(string);
            setChanged();
            notifyObservers(ButtonStatesEnum.PLAY_STATE); //this is how you notify central controller when move is complete or other data
        }
        catch(Exception e){
            System.out.println(e);
        }
    }


    public void makeMove(){
    }
}<commit_msg>hardware<commit_after>package com.endovectors.uta.hardware;

import com.endovectors.uta.centralcontroller.MasterController;
import com.endovectors.uta.presentation.button.ButtonStatesEnum;
import com.endovectors.uta.processing.MoveInterface;

import java.util.ArrayList;
import java.util.Observable;

/**
 * Created by asham_000 on 7/20/2015.
 */
public class HardwareRequestHandler extends Observable implements Runnable, HardwareRequestHandlerInterface {

    UsbComm usbComm;
    MasterController masterController;
    ArrayList<MoveInterface> moves;

    public HardwareRequestHandler (MasterController masterController){
        usbComm = new UsbComm();
        this.masterController = masterController;
        usbComm.connect();
    }

    public void run(){
        try {
            moves = masterController.getMoves();
            String string = ""; 
            //do hardwaresy stuff
            for (int i = 0; i < moves.size(); i++)
            {
                Move move = (Move) moves.get(i);
            	//String s[] = moves.get(i).toString().split("(,)");
            	string = string + move.getFrom() + "/" + 0 + "/" + move.getTo() +  "/" + 1 + "/";
                if (move.getCapturePiece() > -1){
                    string = string + move.getCapturePiece() + "/" + 0 "/" + "32" + "/" + 1 + "/";
                }
            }
            usbComm.instruction(string);
            setChanged();
            notifyObservers(ButtonStatesEnum.PLAY_STATE); //this is how you notify central controller when move is complete or other data
        }
        catch(Exception e){
            System.out.println(e);
        }
    }


    public void makeMove(){
    }
}
{'fraction_non_alphanumeric': 0.11738437001594897, 'fraction_numerical': 0.010526315789473684, 'mean_word_length': 2.3185185185185184, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3959632', 'n_tokens_mistral': 890, 'n_tokens_neox': 845, 'n_words': 195}