<commit_before><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="https://code.jquery.com/jquery-1.11.3.min.js" type="text/javascript" charset="utf-8"></script>
<script src="http://js.api.here.com/se/2.5.4/jsl.js" type="text/javascript" charset="utf-8"></script>

<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">

<style type="text/css">
    html {
        overflow:hidden;
    }

    body {
        margin: 0;
        padding: 0;
        position: absolute;
        overflow:hidden;
        width: 100%;
        height: 100%;
    }

    #mapContainer {
        width: 100%;
        height: 100%;
        left: 0;
        top: 0;
        position: absolute;
    }
</style>
</head>
<body>
    <div id="mapContainer"></div>
    <script type="text/javascript">
        function iconByType(type) {
            // 0 - unknow, 1  - glass, 2 - construction, 3 - car on lane, 4 - bike crash
            switch (type) {
                case 1: return "glass.png";
                case 2: return "closure.png";
                case 3: return "parking.png";
            }

            return "unknown.png";
        }

        nokia.Settings.set("app_id", "");
        nokia.Settings.set("app_code", "");
        var map = new nokia.maps.map.Display(document.getElementById("mapContainer"),
            {
                zoomLevel: 13,
                center: [52.526768, 13.393261], // Berlin
                components: [
                    new nokia.maps.map.component.Behavior(),
                    new nokia.maps.map.component.ZoomBar(),
                    new nokia.maps.map.component.ScaleBar()
                ]
            }
        );

        var issueUrl = "http://localhost:8080/hazard/issue/new/15700324b410fee6e51389d698f378b7357bc249?cmd=get&since=0";
        $.getJSON(issueUrl).done(function(data) {
            console.log("Issue", data);
            var orange = new nokia.maps.util.Brush({ color: "#ffa500"});
            var red = new nokia.maps.util.Brush({ color: "#ff0000"});
            $.each(data.issues, function(i, item) {
                var issueIcon = new nokia.maps.map.Marker(
                    new nokia.maps.geo.Coordinate(item.latitude, item.longitude),
                    {
                        title: "marker",
                        visibility: true,
                        itemId: item.id,
                        icon: "img/" + (item.severity === 1 ? "orange" : "red") + "/" + iconByType(item.type),
                    }
                );
                map.objects.add(issueIcon);
            });
        }).fail(function(error) {
            console.log("Issue failure", error);
        });

        var watchUrl = "http://localhost:8080/hazard/watch/last/15700324b410fee6e51389d698f378b7357bc249";
        $.getJSON(watchUrl).done(function(data) {
            console.log("Watch", data);
            map.objects.add(new nokia.maps.map.Marker(
             new nokia.maps.geo.Coordinate(data.latitude, data.longitude),
                {
                    title: "Watch",
                    visibility: true,
                    icon: "img/watch.png"
                }
            ))
        }).fail(function(error) {
                console.log("Watch failure", error);
        });
    </script>
</body>
</html><commit_msg>Autoupdate map on every 5 second tick.<commit_after><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="https://code.jquery.com/jquery-1.11.3.min.js" type="text/javascript" charset="utf-8"></script>
<script src="http://js.api.here.com/se/2.5.4/jsl.js" type="text/javascript" charset="utf-8"></script>

<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">

<style type="text/css">
    html {
        overflow:hidden;
    }

    body {
        margin: 0;
        padding: 0;
        position: absolute;
        overflow:hidden;
        width: 100%;
        height: 100%;
    }

    #mapContainer {
        width: 100%;
        height: 100%;
        left: 0;
        top: 0;
        position: absolute;
    }
</style>
</head>
<body>
    <div id="mapContainer"></div>
    <script type="text/javascript">
        function iconByType(type) {
            // 0 - unknow, 1  - glass, 2 - construction, 3 - car on lane, 4 - bike crash
            switch (type) {
                case 1: return "glass.png";
                case 2: return "closure.png";
                case 3: return "parking.png";
            }

            return "unknown.png";
        }

        nokia.Settings.set("app_id", "");
        nokia.Settings.set("app_code", "");
        var map = new nokia.maps.map.Display(document.getElementById("mapContainer"),
            {
                zoomLevel: 13,
                center: [52.526768, 13.393261], // Berlin
                components: [
                    new nokia.maps.map.component.Behavior(),
                    new nokia.maps.map.component.ZoomBar(),
                    new nokia.maps.map.component.ScaleBar()
                ]
            }
        );

        var mapObjects = [];

        function update() {
            mapObjects.forEach(function(object) {
                map.objects.remove(object);
            });
            mapObjects = [];

            var issueUrl = "http://localhost:8080/hazard/issue/new/15700324b410fee6e51389d698f378b7357bc249?cmd=get&since=0";
            $.getJSON(issueUrl).done(function(data) {
                var orange = new nokia.maps.util.Brush({ color: "#ffa500"});
                var red = new nokia.maps.util.Brush({ color: "#ff0000"});
                $.each(data.issues, function(i, item) {
                    var issueIcon = new nokia.maps.map.Marker(
                        new nokia.maps.geo.Coordinate(item.latitude, item.longitude),
                        {
                            title: "marker",
                            visibility: true,
                            itemId: item.id,
                            icon: "img/" + (item.severity === 1 ? "orange" : "red") + "/" + iconByType(item.type),
                        }
                    );
                    map.objects.add(issueIcon);
                    mapObjects.push(issueIcon);
                });
            }).fail(function(error) {
                console.log("Issue failure", error);
            });

            var watchUrl = "http://localhost:8080/hazard/watch/last/15700324b410fee6e51389d698f378b7357bc249";
            $.getJSON(watchUrl).done(function(data) {
                var watchIcon = new nokia.maps.map.Marker(
                    new nokia.maps.geo.Coordinate(data.latitude, data.longitude),
                    {
                        title: "Watch",
                        visibility: true,
                        icon: "img/watch.png"
                    }
                );
                map.objects.add(watchIcon);
                mapObjects.push(watchIcon);
            }).fail(function(error) {
                    console.log("Watch failure", error);
            });
        }

        window.setInterval(update, 5000);
    </script>
</body>
</html>
{'fraction_non_alphanumeric': 0.1438534117325311, 'fraction_numerical': 0.03869820866949268, 'mean_word_length': 1.5211995863495347, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, 'xml': 2}, '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': '6154676', 'n_tokens_mistral': 2410, 'n_tokens_neox': 2086, 'n_words': 371}