<commit_before>extends layout

block content
  a(href="http://github.com/rpepato/thunderhunter")
    img(id="fork" src="https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png")
  #map.fullscreen
  #floatingdiv.transparentbackground
    #countdown.
      Time until next check:
    #lastUpdate.
      Last check:
    #lastFeatureCount.
      Last thunder count:
    #status.
      Current status: waiting   

  script(type="text/javascript").
    function qualityControlDescription(qualityControl) {
      return qualityControl == 0 ? "Good" :
                  qualityControl == 1 ? "Questionable" : "Bad";
    }
    $(document).ready(function() {

      function makePopup(feature, layer) {
        if (feature.properties) {
          var eventDate = moment({year: parseInt(feature.properties.year),
                                  month: parseInt(feature.properties.month) - 1,
                                  day: parseInt(feature.properties.day),
                                  hours: parseInt(feature.properties.utc_hour),
                                  minutes: parseInt(feature.properties.minute),
                                  seconds: parseInt(feature.properties.second)
                                  });
          layer.bindPopup("<b>Event Time (UTC): </b>" + eventDate.format("MM/DD/YYYY hh:mm:ss a") + "<br />" +
                          "<b>Major Ellipse Error: </b>" + feature.properties.major_elipse_error + " meters<br />" +
                          "<b>ATD Error: </b>" + feature.properties.atd_error + " microseconds<br />" + 
                          "<b>Quality Control: </b>" + qualityControlDescription(feature.properties.quality_control) + "<br />");
        }
      }

      var map = L.map('map').setView([-23.5489, -46.6388], 12);
      var layer = L.tileLayer('http://{s}.tiles.mapbox.com/v3/rpepato.ibeo7dfj/{z}/{x}/{y}.png', {
        attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>',
        maxZoom: 18
      }).addTo(map);
      var markers = new L.MarkerClusterGroup();

      var socket = io.connect();
      socket.on('thunderdata', function (data) {
        if (data) {
          var geojson = JSON.parse(data);
          var geojsonLayer = L.geoJson(geojson.features, {
            onEachFeature: makePopup
            });
          markers.clearLayers();
          markers.addLayer(geojsonLayer);
          map.fitBounds(markers.getBounds());
        }
      });

      socket.on('countdown', function(data) {
        if (data) {
          var hours = parseInt((data / 60));
          var minutes = parseInt((data % 60));
          if (hours < 10) { hours = "0" + hours; }
          if (minutes < 10) { minutes = "0" + minutes; }
          $("#countdown").text("Time until next check: " + hours + ":" + minutes);
        }
      });

      socket.on('lastupdate', function(data) {
        if (data) {
          $("#lastUpdate").text("Last check: " + moment.unix(data).format("DD/MM/YYYY HH:mm:ss"));
        }
      });

      socket.on('featurecount', function(data) {
        if (data) {
          $("#lastFeatureCount").text("Last thunder count: " + data);
        }
      });

      socket.on('changestatus', function(data) {
        if (data) {
          $("#status").text("Current status: " + data);
        }
      });

      map.addLayer(markers);
    });
    

<commit_msg>minor improvements<commit_after>extends layout

block content
  a(href="http://github.com/rpepato/thunderhunter")
    img(id="fork" src="https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png")
  #map.fullscreen
  #floatingdiv.transparentbackground
    #countdown.
      Time until next check:
    #lastUpdate.
      Last check:
    #lastFeatureCount.
      Last thunder count:
    #status.
      Current status: waiting   

  script(type="text/javascript").
    function qualityControlDescription(qualityControl) {
      return ["Good", "Questionable", "Bad"][qualityControl];
    }
    $(document).ready(function() {

      function makePopup(feature, layer) {
        if (feature.properties) {
          var eventDate = moment({year: parseInt(feature.properties.year),
                                  month: parseInt(feature.properties.month) - 1,
                                  day: parseInt(feature.properties.day),
                                  hours: parseInt(feature.properties.utc_hour),
                                  minutes: parseInt(feature.properties.minute),
                                  seconds: parseInt(feature.properties.second)
                                  });
          layer.bindPopup("<b>Event Time (UTC): </b>" + eventDate.format("MM/DD/YYYY hh:mm:ss a") + "<br />" +
                          "<b>Major Ellipse Error: </b>" + feature.properties.major_elipse_error + " meters<br />" +
                          "<b>ATD Error: </b>" + feature.properties.atd_error + " microseconds<br />" + 
                          "<b>Quality Control: </b>" + qualityControlDescription(feature.properties.quality_control) + "<br />");
        }
      }

      var map = L.map('map').setView([-23.5489, -46.6388], 12);
      var layer = L.tileLayer('http://{s}.tiles.mapbox.com/v3/rpepato.ibeo7dfj/{z}/{x}/{y}.png', {
        attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>',
        maxZoom: 18
      }).addTo(map);
      var markers = new L.MarkerClusterGroup();

      var socket = io.connect();
      socket.on('thunderdata', function (data) {
        if (data) {
          var geojson = JSON.parse(data);
          var geojsonLayer = L.geoJson(geojson.features, {
            onEachFeature: makePopup
            });
          markers.clearLayers();
          markers.addLayer(geojsonLayer);
          map.fitBounds(markers.getBounds());
        }
      });

      socket.on('countdown', function(data) {
        if (data) {
          var hours = parseInt((data / 60));
          var minutes = parseInt((data % 60));
          if (hours < 10) { hours = "0" + hours; }
          if (minutes < 10) { minutes = "0" + minutes; }
          $("#countdown").text("Time until next check: " + hours + ":" + minutes);
        }
      });

      socket.on('lastupdate', function(data) {
        if (data) {
          $("#lastUpdate").text("Last check: " + moment.unix(data).format("DD/MM/YYYY HH:mm:ss"));
        }
      });

      socket.on('featurecount', function(data) {
        if (data) {
          $("#lastFeatureCount").text("Last thunder count: " + data);
        }
      });

      socket.on('changestatus', function(data) {
        if (data) {
          $("#status").text("Current status: " + data);
        }
      });

      map.addLayer(markers);
    });
    


{'fraction_non_alphanumeric': 0.1511241186643608, 'fraction_numerical': 0.046827191698816016, 'mean_word_length': 2.1964285714285716, 'pattern_counts': {'":': 2, '<': 43, '<?xml version=': 0, '>': 39, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3989433', 'n_tokens_mistral': 2560, 'n_tokens_neox': 2334, 'n_words': 371}