<commit_before>/**
 * Created by yash on 3/3/16.
 */
$(document).ready(function() {

    var dps = []; // dataPoints

    var chart = new CanvasJS.Chart("chart1",{
        title :{
            text: "Live Temperature vs Time Graph "
        },
        axisX: {
            title: "Time (Seconds)"
        },
        axisY: {
            title: "Temperature (Celsius)"
        },
        data: [{
            type: "line",
            dataPoints: dps
        }]
    });

    var xVal = 0;
    var yVal = 0;
    var updateInterval = 1000;
    var dataLength = 50; // number of dataPoints visible at any point

    var updateChart = function (count) {
        count = count || 1;
        // count is number of times loop runs to generate random dataPoints.

        //for (var j = 0; j < count; j++) {
        //    yVal = yVal +  Math.round(5 + Math.random() *(-5-5));
        //    dps.push({
        //        x: xVal,
        //        y: yVal
        //    });
        //    xVal++;
        //};

        $.get( base+"data/get_temp/", function( data ) {

            //alert( data);
            dps.push({
                        x: xVal,
                        y: data
                    });
            if (dps.length > dataLength)
            {
                dps.shift();
            }
            chart.render();
            xVal++;
        });


    };

    // generates first set of dataPoints
    updateChart(dataLength);

    // update chart after specified time.
    setInterval(function(){updateChart()}, updateInterval);

    $.simpleWeather({
        location: 'Santa Clara,CA',
        woeid: '',
        unit: 'f',
        success: function(weather) {
            html = '<h2><i class="icon-'+weather.code+'"></i> '+weather.temp+'&deg;'+weather.units.temp+'</h2>';
            html += '<ul><li>'+weather.city+', '+weather.region+'</li>';
            html += '<li class="currently">'+weather.currently+'</li>';
            html += '<li>'+weather.wind.direction+' '+weather.wind.speed+' '+weather.units.speed+'</li></ul>';

            $("#weather-box").html(html);
        },
        error: function(error) {
            $("#weather").html('<p>'+error+'</p>');
        }
    });


});<commit_msg>current_value<commit_after>/**
 * Created by yash on 3/3/16.
 */
$(document).ready(function() {

    var dps = []; // dataPoints

    var chart = new CanvasJS.Chart("chart1",{
        title :{
            text: "Live Temperature vs Time Graph "
        },
        axisX: {
            title: "Time (Seconds)"
        },
        axisY: {
            title: "Temperature (Celsius)"
        },
        data: [{
            type: "line",
            dataPoints: dps
        }]
    });

    var xVal = 0;
    var yVal = 0;
    var updateInterval = 1000;
    var dataLength = 50; // number of dataPoints visible at any point

    var updateChart = function (count) {
        count = count || 1;
        // count is number of times loop runs to generate random dataPoints.

        //for (var j = 0; j < count; j++) {
        //    yVal = yVal +  Math.round(5 + Math.random() *(-5-5));
        //    dps.push({
        //        x: xVal,
        //        y: yVal
        //    });
        //    xVal++;
        //};

        //$.get( base+"data/get_temp/", function( data ) {
        //
        //    //alert( data);
        //
        //});

        $.ajax(
            {
                url: base+"data/get_temp/",
                success: function(data, status)
                {
                    if (status == 'success')
                    {
                        dps.push({
                            x: xVal,
                            y: data
                        });
                        if (dps.length > dataLength)
                        {
                            dps.shift();
                        }
                        chart.render();
                        xVal++;
                    }
                },
                error: function(xhr, desc, err)
                {
                    console.log(xhr);
                    console.log(desc);
                    console.log(err);
                }
            }
        )


    };

    // generates first set of dataPoints
    updateChart(dataLength);

    // update chart after specified time.
    setInterval(function(){updateChart()}, updateInterval);

    $.simpleWeather({
        location: 'Santa Clara,CA',
        woeid: '',
        unit: 'f',
        success: function(weather) {
            html = '<h2><i class="icon-'+weather.code+'"></i> '+weather.temp+'&deg;'+weather.units.temp+'</h2>';
            html += '<ul><li>'+weather.city+', '+weather.region+'</li>';
            html += '<li class="currently">'+weather.currently+'</li>';
            html += '<li>'+weather.wind.direction+' '+weather.wind.speed+' '+weather.units.speed+'</li></ul>';

            $("#weather-box").html(html);
        },
        error: function(error) {
            $("#weather").html('<p>'+error+'</p>');
        }
    });


});
{'fraction_non_alphanumeric': 0.16497512437810946, 'fraction_numerical': 0.007960199004975124, 'mean_word_length': 1.2528014343343792, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, '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': '872523', 'n_tokens_mistral': 1510, 'n_tokens_neox': 1407, 'n_words': 308}