<commit_before><!DOCTYPE html>
<html>
<head>
    <style type="text/css">
        html, body, #map-canvas { height: 100%; margin: 0; padding: 0;}
    </style>
    <style>
        html, body, #map-canvas {
            height: 100%;
            margin: 0px;
            padding: 0px
        }
        #panel {
            position: absolute;
            top: 5px;
            left: 50%;
            margin-left: -180px;
            z-index: 5;
            background-color: #fff;
            padding: 5px;
            border: 1px solid #999;
        }
    </style>
    <!--<script src="http://code.jquery.com/jquery.js"></script>-->
    <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=visualization"></script>
    <script>
        var map, pointarray, heatmap;
        var santosaLoc = new google.maps.LatLng(1.260535, 103.823860);
        var santosa = {location: santosaLoc, weight: 5};
        var santosa2 = {location: santosaLoc, weight: 1};
        /* Data points defined as a mixture of WeightedLocation and LatLng objects */
        var heatMapData = [
            santosa,
            new google.maps.LatLng(1.290270, 103.851959),
            {location: new google.maps.LatLng(1.270535, 103.843860), weight: 2}
        ];
        var heatMapData2 = [
            santosa2,
            new google.maps.LatLng(1.290270, 103.851959),
            {location: new google.maps.LatLng(1.270535, 103.843860), weight: 2}
        ];

        var singapore = new google.maps.LatLng(1.290270, 103.851959);

        function initialize() {
            var mapOptions = {
                zoom: 13,
                center: singapore,
                mapTypeId: google.maps.MapTypeId.SATELLITE
            };

            map = new google.maps.Map(document.getElementById('map-canvas'),
                    mapOptions);

            var pointArray = new google.maps.MVCArray(heatMapData);

            heatmap = new google.maps.visualization.HeatmapLayer({
                data: pointArray
            });

            heatmap.setMap(map);
        }

        function toggleHeatmap() {
            santosa.weight=1;
            heatmap.setMap(null);
            heatmap.data=new google.maps.MVCArray(heatMapData2);
            heatmap.setMap(map);
            //heatmap.setMap(heatmap.getMap() ? null : map);
        }

        function changeGradient() {
            var gradient = [
                'rgba(0, 255, 255, 0)',
                'rgba(0, 255, 255, 1)',
                'rgba(0, 191, 255, 1)',
                'rgba(0, 127, 255, 1)',
                'rgba(0, 63, 255, 1)',
                'rgba(0, 0, 255, 1)',
                'rgba(0, 0, 223, 1)',
                'rgba(0, 0, 191, 1)',
                'rgba(0, 0, 159, 1)',
                'rgba(0, 0, 127, 1)',
                'rgba(63, 0, 91, 1)',
                'rgba(127, 0, 63, 1)',
                'rgba(191, 0, 31, 1)',
                'rgba(255, 0, 0, 1)'
            ]
            heatmap.set('gradient', heatmap.get('gradient') ? null : gradient);
        }

        function changeRadius() {
            heatmap.set('radius', heatmap.get('radius') ? null : 20);
        }

        function changeOpacity() {
            heatmap.set('opacity', heatmap.get('opacity') ? null : 0.2);
        }

        google.maps.event.addDomListener(window, 'load', initialize);

    </script>
</head>

<body>
<div id="panel">
    <button onclick="toggleHeatmap()">Toggle Heatmap</button>
    <button onclick="changeGradient()">Change gradient</button>
    <button onclick="changeRadius()">Change radius</button>
    <button onclick="changeOpacity()">Change opacity</button>
</div>
<div id="map-canvas"></div>
</body>
</html>
<commit_msg>Press updateQueue to update the visualization of the queues.<commit_after><!DOCTYPE html>
<html>
<head>
    <style type="text/css">
        html, body, #map-canvas { height: 100%; margin: 0; padding: 0;}
    </style>
    <style>
        html, body, #map-canvas {
            height: 100%;
            margin: 0px;
            padding: 0px
        }
        #panel {
            position: absolute;
            top: 5px;
            left: 50%;
            margin-left: -180px;
            z-index: 5;
            background-color: #fff;
            padding: 5px;
            border: 1px solid #999;
        }
    </style>
    <script src="http://code.jquery.com/jquery.js"></script>
    <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=visualization"></script>
    <script>

        var map, pointarray, heatmap;
        var santosaLoc = new google.maps.LatLng(1.260535, 103.823860);
        var santosa2 = {location: santosaLoc, weight: 0.5};
        var lastObservation = 0;
        $.getJSON('/iot/queues?lastObservation=' +lastObservation, function(data) {

            console.log(data);
            santosa2.weight = data.size;
            lastObservation = lastObservation +1;

        });

        var santosa = {location: santosaLoc, weight: 5};

        /* Data points defined as a mixture of WeightedLocation and LatLng objects */
        var heatMapData = [
            santosa,
            new google.maps.LatLng(1.290270, 103.851959),
            {location: new google.maps.LatLng(1.270535, 103.843860), weight: 2}
        ];
        var heatMapData2 = [
            santosa2,
            new google.maps.LatLng(1.290270, 103.851959),
            {location: new google.maps.LatLng(1.270535, 103.843860), weight: 2}
        ];

        var singapore = new google.maps.LatLng(1.290270, 103.851959);

        function initialize() {
            var mapOptions = {
                zoom: 13,
                center: singapore,
                mapTypeId: google.maps.MapTypeId.SATELLITE
            };

            map = new google.maps.Map(document.getElementById('map-canvas'),
                    mapOptions);

            var pointArray = new google.maps.MVCArray(heatMapData);

            heatmap = new google.maps.visualization.HeatmapLayer({
                data: pointArray
            });

            heatmap.setMap(map);
        }

        function updateQueues() {
            $.getJSON('/iot/queues?lastObservation=' +lastObservation, function(data) {

                console.log(data);
                santosa2.weight = data.size;
                lastObservation = lastObservation +1;

            });
            // santosa.weight=1;
            heatmap.setMap(null);
            heatmap.data=new google.maps.MVCArray(heatMapData2);
            heatmap.setMap(map);
            //heatmap.setMap(heatmap.getMap() ? null : map);
        }

        function changeGradient() {
            var gradient = [
                'rgba(0, 255, 255, 0)',
                'rgba(0, 255, 255, 1)',
                'rgba(0, 191, 255, 1)',
                'rgba(0, 127, 255, 1)',
                'rgba(0, 63, 255, 1)',
                'rgba(0, 0, 255, 1)',
                'rgba(0, 0, 223, 1)',
                'rgba(0, 0, 191, 1)',
                'rgba(0, 0, 159, 1)',
                'rgba(0, 0, 127, 1)',
                'rgba(63, 0, 91, 1)',
                'rgba(127, 0, 63, 1)',
                'rgba(191, 0, 31, 1)',
                'rgba(255, 0, 0, 1)'
            ]
            heatmap.set('gradient', heatmap.get('gradient') ? null : gradient);
        }

        function changeRadius() {
            heatmap.set('radius', heatmap.get('radius') ? null : 20);
        }

        function changeOpacity() {
            heatmap.set('opacity', heatmap.get('opacity') ? null : 0.2);
        }

        google.maps.event.addDomListener(window, 'load', initialize);

    </script>
</head>

<body>
<div id="panel">
    <button onclick="updateQueues()">Update queues</button>
    <button onclick="changeGradient()">Change gradient</button>
    <button onclick="changeRadius()">Change radius</button>
    <button onclick="changeOpacity()">Change opacity</button>
</div>
<div id="map-canvas"></div>
</body>
</html>

{'fraction_non_alphanumeric': 0.14298289738430583, 'fraction_numerical': 0.05835010060362173, 'mean_word_length': 1.7023445463812437, 'pattern_counts': {'":': 0, '<': 62, '<?xml version=': 0, '>': 62, 'https://': 2, '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': '6799643', 'n_tokens_mistral': 2853, 'n_tokens_neox': 2404, 'n_words': 523}