<commit_before>// Initalizes map
var mymap = L.map('mapid').setView([51.505, -0.09], 13);

// Sets the default view of the map
mymap.setView(new L.LatLng(38.1711269, -97.5383369), 5);

// Sets the tile layer from Mapbox
L.tileLayer('https://api.mapbox.com/styles/v1/brandonyates/cj5tvlwng020z2qr7ws0ylg1o/tiles/256/{z}/{x}/{y}?access_token=<KEY>', {
  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: 10,
  id: 'mapbox.streets'
}).addTo(mymap);

// Sets a sample circle in Castle Rock
L.circle([39.376089, -104.853487], {
  color: 'red',
  fillColor: '#f03',
  fillOpacity: 0.5,
  radius: 500
}).addTo(mymap);

var lastUpdated = null;

// Displays the points data provided.
function displayPoints(data) {
  console.log('Displaying day-tah points');
  for (var i = 0; i < data.length; i++) {
    L.circle([data[i].ll[0], data[i].ll[1]], {
      color: data[i].color,
      fillColor: data[i].color,
      fillOpacity: 0.5,
      radius: 500
    }).addTo(mymap);
  }
}

// Updates map with latest real time data
function updateMap() {
$.ajax({
  type: 'GET',
  url: '/rest/live/read?lastupdated=' + lastUpdated,
  success: function( result ) {
    console.log(result);
    lastUpdated = result.lastUpdated;
    displayPoints(result);
  },
  dataType: 'json'
});
}

setInterval(updateMap(), 10);<commit_msg>Only submit lastupdated parameter if it exsits<commit_after>// Initalizes map
var mymap = L.map('mapid').setView([51.505, -0.09], 13);

// Sets the default view of the map
mymap.setView(new L.LatLng(38.1711269, -97.5383369), 5);

// Sets the tile layer from Mapbox
L.tileLayer('https://api.mapbox.com/styles/v1/brandonyates/cj5tvlwng020z2qr7ws0ylg1o/tiles/256/{z}/{x}/{y}?access_token=<KEY>', {
  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: 10,
  id: 'mapbox.streets'
}).addTo(mymap);

// Sets a sample circle in Castle Rock
L.circle([39.376089, -104.853487], {
  color: 'red',
  fillColor: '#f03',
  fillOpacity: 0.5,
  radius: 500
}).addTo(mymap);

var lastUpdated = null;

// Displays the points data provided.
function displayPoints(data) {
  console.log('Displaying day-tah points');
  for (var i = 0; i < data.length; i++) {
    L.circle([data[i].ll[0], data[i].ll[1]], {
      color: data[i].color,
      fillColor: data[i].color,
      fillOpacity: 0.5,
      radius: 500
    }).addTo(mymap);
  }
}

// Updates map with latest real time data
function updateMap() {
  var lastUpdatedString = '';
  if (lastUpdated == null) {
    lastUpdatedString = '?lastupdated=' + lastUpdated;
  }

$.ajax({
  type: 'GET',
  url: '/rest/live/read' + lastUpdatedString,
  success: function( result ) {
    console.log(result);
    lastUpdated = result.lastUpdated;
    displayPoints(result);
  },
  dataType: 'json'
});
}

setInterval(updateMap(), 10);
{'fraction_non_alphanumeric': 0.18459069020866772, 'fraction_numerical': 0.0507223113964687, 'mean_word_length': 3.861154446177847, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 17, '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': '159957', 'n_tokens_mistral': 1281, 'n_tokens_neox': 1178, 'n_words': 251}