<commit_before>/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ca.teamdave.letterman;

import edu.wpi.first.wpilibj.Joystick;

/**
 *
 * @author leighpauls
 */
public class XboxGamePad {
    private final Joystick mPad;
    
    public XboxGamePad(int port) {
        mPad = new Joystick(port);
    }

    private static final double DEADBAND_RADIUS = 0.15;
    private static double deadband(double jsValue) {
        if (Math.abs(jsValue) < DEADBAND_RADIUS) {
            return 0;
        }
        // re-linearize outside of the deadband
        jsValue -= DEADBAND_RADIUS * DaveUtils.sign(jsValue);
        jsValue *= (1.0 - DEADBAND_RADIUS);
        // TODO: should this value be squared for a shallower curve?
        return  jsValue;
    }
    
    public double getXLeft() {<commit_msg>Clean up the gamepad code<commit_after>/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ca.teamdave.letterman;

import edu.wpi.first.wpilibj.Joystick;

/**
 * Wrapper class for the xbox game pad as a joystick
 * @author leighpauls
 */
public class XboxGamePad {
    private final Joystick mPad;
    
    public XboxGamePad(int port) {
        mPad = new Joystick(port);
    }

    private static final double DEADBAND_RADIUS = 0.15;
    private static double deadband(double jsValue) {
        if (Math.abs(jsValue) < DEADBAND_RADIUS) {
            return 0;
        }
        // re-linearize outside of the deadband
        jsValue -= DEADBAND_RADIUS * DaveUtils.sign(jsValue);
        jsValue *= (1.0 - DEADBAND_RADIUS);
        // TODO: should this value be squared for a shallower curve?
        return jsValue;
    }
    
    public double getXLeft() {
{'fraction_non_alphanumeric': 0.08921513269339357, 'fraction_numerical': 0.006775832862789385, 'mean_word_length': 2.5019762845849804, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '5314030', 'n_tokens_mistral': 589, 'n_tokens_neox': 561, 'n_words': 166}