<commit_before>var send = function(){
    var addr = $("#addr option:selected").val();
    var cmd = $("#cmd option:selected").val();
    var del = $('#del').val();
    var bri = $('#bri').val();
    var rgb = $('#rgb').val();
    var tout = $('#tout').val();

    R = hexToR(rgb);
    G = hexToG(rgb);
    B = hexToB(rgb);

    rgb = R+','+G+','+B;
    run(addr,cmd,del,bri,rgb,tout);
}

var run = function(addr, cmd, del, bri, rgb, tout) {
    var getCmd = "../lights/lights_cmd.php?cmd=" + cmd + "&del=" + del + "&bri="
            + bri + "&rgb=" + rgb + "&tout=" + tout+ '&addr="' + addr+'"';
    console.log('sending command');
    $.get(getCmd, function(d){
        console.log(d);
    });
}

var pTimeout = 0;

var party = function(){
   run('00 00 00 00 00 00 FF FF','P','50','30','255,100,0','0');

   $.get('../sounds/sound_cmd.php?name=eyemix.mp3');

   clearTimeout(pTimeout);
   pTimeout = setTimeout(function(){
        run('00 00 00 00 00 00 FF FF','G','800','30','255,100,0','0');

        pTimeout = setTimeout(function(){
            run('00 00 00 00 00 00 FF FF','D','40','30','255,100,0','0');
        },15000);
   },15000);
}

function hexToR(h) {return parseInt((cutHex(h)).substring(0,2),16)}
function hexToG(h) {return parseInt((cutHex(h)).substring(2,4),16)}
function hexToB(h) {return parseInt((cutHex(h)).substring(4,6),16)}
function cutHex(h) {return (h.charAt(0)=="#") ? h.substring(1,7):h}<commit_msg>fixing bugs<commit_after>var send = function(){
    var addr = $("#addr option:selected").val();
    var cmd = $("#cmd option:selected").val();
    var del = $('#del').val();
    var bri = $('#bri').val();
    var rgb = $('#rgb').val();
    var tout = $('#tout').val();

    R = hexToR(rgb);
    G = hexToG(rgb);
    B = hexToB(rgb);

    rgb = R+','+G+','+B;
    run(addr,cmd,del,bri,rgb,tout);
}

var run = function(addr, cmd, del, bri, rgb, tout) {
    var getCmd = "../lights/lights_cmd.php?cmd=" + cmd + "&del=" + del + "&bri="
            + bri + "&rgb=" + rgb + "&tout=" + tout+ '&addr="' + addr+'"';
    console.log('sending command');
    $.get(getCmd, function(d){
        console.log(d);
    });
}

var pTimeout = 0;

var party = function(){
   var bri = '30'
   run('00 00 00 00 00 00 FF FF','P','50',bri,'255,100,0','0');

   $.get('../sounds/sound_cmd.php?name=eyemix.mp3');

   clearTimeout(pTimeout);
   pTimeout = setTimeout(function(){
        run('00 00 00 00 00 00 FF FF','G','800',bri,'255,100,0','0');

        pTimeout = setTimeout(function(){
            run('00 00 00 00 00 00 FF FF','D','40',bri,'255,100,0','0');
        },15000);
   },15000);
}

function hexToR(h) {return parseInt((cutHex(h)).substring(0,2),16)}
function hexToG(h) {return parseInt((cutHex(h)).substring(2,4),16)}
function hexToB(h) {return parseInt((cutHex(h)).substring(4,6),16)}
function cutHex(h) {return (h.charAt(0)=="#") ? h.substring(1,7):h}
{'fraction_non_alphanumeric': 0.24852276677094196, 'fraction_numerical': 0.0681265206812652, 'mean_word_length': 3.546603475513428, 'pattern_counts': {'":': 0, '<': 3, '<?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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2599715', 'n_tokens_mistral': 1233, 'n_tokens_neox': 1080, 'n_words': 231}