<commit_before><!DOCTYPE html>
<html>
<meta charset="utf-8">
    <head>
        <style>
        .edges {
          fill: none;
          stroke: #00c;
        }

        #thissvg {
            position:absolute;
            left:0;
            top:0;
            z-index: 50;
        }

        #map-canvas {
            position:absolute;
            left:0;
            top:0;
            z-index: 30;
        }

        #control {
            position: absolute;
            width: 310px;
            right: 50px;
            top: 50px;
            padding: 10px;
            margin: 0px;
            z-index:9999;
           /*# background-color: #EEEEEE;*/
            /*border: solid #646464 1px;*/
        }

        </style>
        <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.7/semantic.min.css">
        <script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyC7nuVovjQYfAQdMIcf0XcPTtOEqIfEnBY&v=3.exp&sensor=false"></script>
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
        <script src="http://d3js.org/d3.v3.min.js"></script>
        <script src="http://d3js.org/queue.v1.min.js"></script>
        <script>

            var mapOptions = {
                center: {lat: 46.70, lng: 8.13},
                zoom: 8,
                zoomControl:false,
                streetViewControl: false,
                scrollwheel: false,
                navigationControl: false,
                mapTypeControl: false,
                scaleControl: false,
                draggable: false,
                styles: [{"featureType":"all","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"administrative","elementType":"labels.text.fill","stylers":[{"color":"#444444"}]},{"featureType":"administrative.country","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"administrative.country","elementType":"geometry.stroke","stylers":[{"lightness":"12"}]},{"featureType":"administrative.country","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"administrative.province","elementType":"all","stylers":[{"visibility":"on"},{"lightness":"-100"},{"saturation":"-100"},{"weight":"1.00"}]},{"featureType":"administrative.province","elementType":"geometry","stylers":[{"visibility":"off"}]},{"featureType":"administrative.province","elementType":"geometry.fill","stylers":[{"visibility":"simplified"}]},{"featureType":"administrative.locality","elementType":"all","stylers":[{"visibility":"off"},{"hue":"#ff0000"},{"saturation":"-82"},{"lightness":"5"},{"gamma":"4.71"}]},{"featureType":"administrative.locality","elementType":"labels","stylers":[{"visibility":"off"},{"weight":"0.01"}]},{"featureType":"administrative.neighborhood","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"landscape","elementType":"all","stylers":[{"hue":"#ff0000"},{"visibility":"off"}]},{"featureType":"landscape","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"landscape.man_made","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"landscape.natural","elementType":"geometry","stylers":[{"visibility":"off"}]},{"featureType":"landscape.natural.landcover","elementType":"all","stylers":[{"visibility":"on"}]},{"featureType":"landscape.natural.landcover","elementType":"geometry","stylers":[{"visibility":"off"}]},{"featureType":"landscape.natural.landcover","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"landscape.natural.terrain","elementType":"all","stylers":[{"visibility":"on"}]},{"featureType":"landscape.natural.terrain","elementType":"geometry","stylers":[{"visibility":"on"},{"lightness":"30"},{"saturation":"-100"}]},{"featureType":"landscape.natural.terrain","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"poi","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"all","stylers":[{"saturation":-100},{"lightness":45},{"visibility":"off"}]},{"featureType":"road","elementType":"geometry","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"road.highway","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"road.arterial","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"all","stylers":[{"color":"#46bcec"},{"visibility":"on"}]},{"featureType":"water","elementType":"geometry","stylers":[{"visibility":"on"},{"lightness":"10"}]},{"featureType":"water","elementType":"labels","stylers":[{"visibility":"off"}]}]
            }


            var width = 1000,
                height = 800,
            globalOverlay = null,
            map = null;
            var url = 'http://localhost:8080/edges/';

            var projection;
            var path;
            var g_;

            var edges;
            var segments;
            var date;
            var intervalMin = 15;
            var baseRefreshRate = 1.8;
            var refreshRate = baseRefreshRate;
            var minSpeed = intervalMin*60;
            var speed = minSpeed;


            var blue = "#91cf60";
            var red = "#fc8d59";


            function init_map() {

                width = $(window).width();
                height = $(window).height();

                jQuery('#map-canvas').width(width);
                jQuery('#map-canvas').height(height);

                console.log(width)

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

                var edgesback = new google.maps.Data();
                var border = new google.maps.Data();

                border.loadGeoJson('http://localhost:8080/switzerland/');
                border.setMap(map);
                border.setStyle({
                    strokeColor: "#757575",
                    fillOpacity: 0.6,
                    strokeWeight:0.5,
                    fillColor:  "white",
                })
            }

            function init_edges(){
                projection=projection=d3.geo.mercator()
                    .scale(40.5 * Math.pow(2, map.getZoom()))
                    .translate([0,0]);

                path = d3.geo.path().projection(projection);
        
                g_=     d3.select('#thissvg')
                    .attr("width", width)
                    .attr("height", height)
                    .append("g")
                    .attr("class", "edges")
                    .attr("id","pathgroup")
            }

            var startDate = new Date();
            startDate.setSeconds(0);
            startDate.setMinutes(0);
            startDate.setMonth(0, 30);

            var endDate = new Date();
            endDate.setSeconds(0);
            endDate.setMinutes(59);
            endDate.setHours(23);
            endDate.setMonth(1, 5);

            
            function initialize() {
                init_map();             
                init_edges();

                date = new Date(startDate)
       
                function ready(error, us) {
                    console.log(us);
                    g_.selectAll("path")
                        .data(us.features)
                        .enter().append("path")
                        .attr("d", path);

                    var centerPixel = projection([map.getCenter().lng(), map.getCenter().lat()]);
                    var translate = [(width / 2 - centerPixel[0]), (height / 2 - centerPixel[1])];
                    d3.select("#pathgroup").attr("transform", "translate(" + translate + ")scale(1)");

                    segments = getNextSegments();
                    window.setTimeout(update, refreshRate * 1000);
                }

                queue()
                    .defer(d3.json, url)
                    .await(ready);
                 
            }

            function onSpeedChange(opt) {
                refreshRate = baseRefreshRate / parseInt(opt.value);
            }


            function update() {
                window.setTimeout(update, refreshRate * 1000);
                date.setSeconds(date.getSeconds() + speed);
                date.setSeconds(0);
               
                if (date.getTime() > endDate.getTime()){
                    date = new Date(startDate)
                }
                // date.setMinutes(parseInt(date.getMinutes()/intervalMin)*intervalMin);
                getNextSegments();

                document.getElementById("time").innerText = date.getHours() + ":" + date.getMinutes();
                document.getElementById("date").innerText = date.toDateString();
            }

            function onSuccess(data) {
                segments = fromJson(data);
                updateEdges()
            }

            function onError() {
               console.log("Something went wrong.");
            }


            function getNextSegments() {
                var dateAsString = date.toISOString().substring(0, 16);
                getJSON("http://localhost:8080/occupancy/"+intervalMin+"/"+ dateAsString, onSuccess, onError);
            }
            var maxValue = 1;
            function fromJson(json) {
                var segments = {};
                maxValue = 0
                for(var key in json) {
                    if (json.hasOwnProperty(key)) {<commit_msg>Fix displayed time<commit_after><!DOCTYPE html>
<html>
<meta charset="utf-8">
    <head>
        <style>
        .edges {
          fill: none;
          stroke: #00c;
        }

        #thissvg {
            position:absolute;
            left:0;
            top:0;
            z-index: 50;
        }

        #map-canvas {
            position:absolute;
            left:0;
            top:0;
            z-index: 30;
        }

        #control {
            position: absolute;
            width: 310px;
            right: 50px;
            top: 50px;
            padding: 10px;
            margin: 0px;
            z-index:9999;
           /*# background-color: #EEEEEE;*/
            /*border: solid #646464 1px;*/
        }

        </style>
        <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.7/semantic.min.css">
        <script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyC7nuVovjQYfAQdMIcf0XcPTtOEqIfEnBY&v=3.exp&sensor=false"></script>
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
        <script src="http://d3js.org/d3.v3.min.js"></script>
        <script src="http://d3js.org/queue.v1.min.js"></script>
        <script>

            var mapOptions = {
                center: {lat: 46.70, lng: 8.13},
                zoom: 8,
                zoomControl: false,
                streetViewControl: false,
                scrollwheel: false,
                navigationControl: false,
                mapTypeControl: false,
                scaleControl: false,
                draggable: false,
                styles: [{"featureType":"all","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"administrative","elementType":"labels.text.fill","stylers":[{"color":"#444444"}]},{"featureType":"administrative.country","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"administrative.country","elementType":"geometry.stroke","stylers":[{"lightness":"12"}]},{"featureType":"administrative.country","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"administrative.province","elementType":"all","stylers":[{"visibility":"on"},{"lightness":"-100"},{"saturation":"-100"},{"weight":"1.00"}]},{"featureType":"administrative.province","elementType":"geometry","stylers":[{"visibility":"off"}]},{"featureType":"administrative.province","elementType":"geometry.fill","stylers":[{"visibility":"simplified"}]},{"featureType":"administrative.locality","elementType":"all","stylers":[{"visibility":"off"},{"hue":"#ff0000"},{"saturation":"-82"},{"lightness":"5"},{"gamma":"4.71"}]},{"featureType":"administrative.locality","elementType":"labels","stylers":[{"visibility":"off"},{"weight":"0.01"}]},{"featureType":"administrative.neighborhood","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"landscape","elementType":"all","stylers":[{"hue":"#ff0000"},{"visibility":"off"}]},{"featureType":"landscape","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"landscape.man_made","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"landscape.natural","elementType":"geometry","stylers":[{"visibility":"off"}]},{"featureType":"landscape.natural.landcover","elementType":"all","stylers":[{"visibility":"on"}]},{"featureType":"landscape.natural.landcover","elementType":"geometry","stylers":[{"visibility":"off"}]},{"featureType":"landscape.natural.landcover","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"landscape.natural.terrain","elementType":"all","stylers":[{"visibility":"on"}]},{"featureType":"landscape.natural.terrain","elementType":"geometry","stylers":[{"visibility":"on"},{"lightness":"30"},{"saturation":"-100"}]},{"featureType":"landscape.natural.terrain","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"poi","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"all","stylers":[{"saturation":-100},{"lightness":45},{"visibility":"off"}]},{"featureType":"road","elementType":"geometry","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"road.highway","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"road.arterial","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"all","stylers":[{"color":"#46bcec"},{"visibility":"on"}]},{"featureType":"water","elementType":"geometry","stylers":[{"visibility":"on"},{"lightness":"10"}]},{"featureType":"water","elementType":"labels","stylers":[{"visibility":"off"}]}]
            };


            var width = 1000,
                height = 800,
            globalOverlay = null,
            map = null;
            var url = 'http://localhost:8080/edges/';

            var projection;
            var path;
            var g_;

            var edges;
            var segments;
            var date;
            var intervalMin = 15;
            var baseRefreshRate = 1.8;
            var refreshRate = baseRefreshRate;
            var minSpeed = intervalMin*60;
            var speed = minSpeed;


            var blue = "#91cf60";
            var red = "#fc8d59";


            function init_map() {

                width = $(window).width();
                height = $(window).height();

                jQuery('#map-canvas').width(width);
                jQuery('#map-canvas').height(height);

                console.log(width)

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

                var edgesback = new google.maps.Data();
                var border = new google.maps.Data();

                border.loadGeoJson('http://localhost:8080/switzerland/');
                border.setMap(map);
                border.setStyle({
                    strokeColor: "#757575",
                    fillOpacity: 0.6,
                    strokeWeight:0.5,
                    fillColor:  "white"
                })
            }

            function init_edges(){
                projection=projection=d3.geo.mercator()
                    .scale(40.5 * Math.pow(2, map.getZoom()))
                    .translate([0,0]);

                path = d3.geo.path().projection(projection);
        
                g_=     d3.select('#thissvg')
                    .attr("width", width)
                    .attr("height", height)
                    .append("g")
                    .attr("class", "edges")
                    .attr("id","pathgroup")
            }

            var startDate = new Date();
            startDate.setSeconds(0);
            startDate.setMinutes(0);
            startDate.setMonth(0, 30);

            var endDate = new Date();
            endDate.setSeconds(0);
            endDate.setMinutes(59);
            endDate.setHours(23);
            endDate.setMonth(1, 5);

            
            function initialize() {
                init_map();             
                init_edges();

                date = new Date(startDate);
       
                function ready(error, us) {
                    console.log(us);
                    g_.selectAll("path")
                        .data(us.features)
                        .enter().append("path")
                        .attr("d", path);

                    var centerPixel = projection([map.getCenter().lng(), map.getCenter().lat()]);
                    var translate = [(width / 2 - centerPixel[0]), (height / 2 - centerPixel[1])];
                    d3.select("#pathgroup").attr("transform", "translate(" + translate + ")scale(1)");

                    segments = getNextSegments();
                    window.setTimeout(update, refreshRate * 1000);
                    document.getElementById("time").innerText = dateToHHMMTime(date);
                    document.getElementById("date").innerText = date.toDateString();
                }

                queue()
                    .defer(d3.json, url)
                    .await(ready);
                 
            }

            function onSpeedChange(opt) {
                refreshRate = baseRefreshRate / parseInt(opt.value);
            }


            function update() {
                window.setTimeout(update, refreshRate * 1000);
                date.setSeconds(date.getSeconds() + speed);
                date.setSeconds(0);
               
                if (date.getTime() > endDate.getTime()){
                    date = new Date(startDate)
                }
                // date.setMinutes(parseInt(date.getMinutes()/intervalMin)*intervalMin);
                getNextSegments();

                document.getElementById("time").innerText = dateToHHMMTime(date);
                document.getElementById("date").innerText = date.toDateString();
            }
            function dateToHHMMTime(date) {
                var hours = date.getHours();
                if(hours < 10) {
                    hours = "0" + hours;
                }
                var minutes = date.getMinutes();

                if(minutes < 10) {
                    minutes = "0" + minutes;
                }

                return hours + ":" + minutes;
                }

            function onSuccess(data) {
                segments = fromJson(data);
                updateEdges()
            }

            function onError() {
               console.log("Something went wrong.");
            }


            function getNextSegments() {
                var dateAsString = date.toISOString().substring(0, 16);
                getJSON("http://localhost:8080/occupancy/"+intervalMin+"/"+ dateAsString, onSuccess, onError);
            }
            var maxValue = 1;
            function fromJson(json) {
                var segments = {};
                maxValue = 0
                for(var key in json) {
                    if (json.hasOwnProperty(key)) {
{'fraction_non_alphanumeric': 0.1832189168573608, 'fraction_numerical': 0.019221967963386728, 'mean_word_length': 2.15311848645182, 'pattern_counts': {'":': 280, '<': 37, '<?xml version=': 0, '>': 37, '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': '6017592', 'n_tokens_mistral': 5762, 'n_tokens_neox': 5167, 'n_words': 621}