<commit_before><!DOCTYPE html>
<html>
<head>
<title>Tech Comm on a Map</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />

<style>
  html, body, #map-canvas {
    height: 100%;
    margin: 0px;
    padding: 0px
  }

  .controls {
    margin-top: 16px;
    border: 1px solid transparent;
    border-radius: 2px 0 0 2px;
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    height: 32px;
    outline: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  }

   #branding {
    font-family: Roboto;
    font-size: 13px;
    font-weight: 300;
    color: #fff;
    background-color: #4d90fe;
    padding: 5px 11px 0px 11px;
  }

  #place-search {
    background-color: #fff;
    padding: 0 11px 0 13px;
    width: 400px;
    font-family: Roboto;
    font-size: 15px;
    font-weight: 300;
    text-overflow: ellipsis;
  }

  #place-search:focus {
    border-color: #4d90fe;
    margin-left: -1px;
    padding-left: 14px;  /* Regular padding-left + 1. */
    width: 401px;
  }

  .pac-container {
    font-family: Roboto;
  }

  #type-selector {
    color: #fff;
    background-color: #4d90fe;
    padding: 5px 11px 0px 11px;
  }

  #type-selector label {
    font-family: Roboto;
    font-size: 13px;
    font-weight: 300;
  }

  .infowindow {
    font-family: Roboto;
    border: 1px solid transparent;
    border-radius: 2px 0 0 2px;
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    outline: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  }

  #infowindow h2 {
    font-family: Roboto;
    font-size: 15px;
    font-weight: 500;
  }
</style>

<!-- Load the Google Maps JavaScript API -->
<script type="text/javascript"
  src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCwWekcCNrI7bXKrGY4kOUWQjQGImf2lzc&sensor=false&libraries=places">
</script>

<!-- Set up the map and UI controls -->
<script type="text/javascript">
  var DATA_SERVICE_URL = "https://script.google.com/macros/s/AKfycbx75GBiRRl9qUyNMCH-BtDbOc4-g0WZSgCnqhvi6YvhCxYpJ1kJ/exec?jsonp=callback";
  var map;
  var icon;
  var techCommItems = [];
  var infoWindow = new google.maps.InfoWindow();
  var userZoom = 2;
  var markerClicked = false;

  // This function is called after the page has loaded, to set up the map
  function initializeMap() {
    map = new google.maps.Map(document.getElementById("map-canvas"), {
      center: {lat: 10.367178, lng: 16.998713},
      zoom: 2
    });

    // Insert a script element into the document header, to get
    // the tech comm data from a Google Docs spreadsheet.
    var scriptElement = document.createElement('script');
    scriptElement.src = DATA_SERVICE_URL;
    document.getElementsByTagName('head')[0].appendChild(scriptElement);

    // Add the search box and data type selectors to the UI.
    var input = /** @type {HTMLInputElement} */(
      document.getElementById('place-search'));

    var types = document.getElementById('type-selector');
    var branding = document.getElementById('branding');
    map.controls[google.maps.ControlPosition.TOP_LEFT].push(branding);
    map.controls[google.maps.ControlPosition.TOP_LEFT].push(types);
    map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);

    var autocomplete = new google.maps.places.Autocomplete(input);

    // When the user searches for and selects a place, zoom in and add a marker.
    var searchMarker = new google.maps.Marker({
      map: map,
      visible: false,
    });

    autocomplete.addListener('place_changed', function() {
      searchMarker.setVisible(false);
      var place = autocomplete.getPlace();
      if (!place.geometry) {
        return;
      }

      // If the place has a geometry, then show it on the map.
      if (place.geometry.viewport) {
        map.fitBounds(place.geometry.viewport);
      } else {
        map.setCenter(place.geometry.location);
        map.setZoom(17);
      }
      searchMarker.setIcon(/** @type {google.maps.Icon} */({
        url: place.icon,
        size: new google.maps.Size(71, 71),
        origin: new google.maps.Point(0, 0),
        anchor: new google.maps.Point(17, 34),
        scaledSize: new google.maps.Size(35, 35)
      }));
      searchMarker.setPosition(place.geometry.location);
      searchMarker.setVisible(true);
    });
  }

  // Get the data from the tech comm spreadsheet.
  function callback(data) {
    // Get the spreadsheet rows one by one.
    // First row contains headings, so start the index at 1 not 0.
    for (var i = 1; i < data.length; i++) {
      addTechCommItem({
        type: data[i][0],
        name: data[i][1],
        description: data[i][2],
        website: data[i][3],
        startdate: data[i][4],
        enddate: data[i][5],
        address: data[i][6],
        location: new google.maps.LatLng(data[i][7], data[i][8]),
        marker: null
      });
    }
  }

  // Set up markers for tech com items
  function addTechCommItem(itemInfo) {
    //Style a marker based on type of tech comm item.
    switch (itemInfo.type) {
      case 'Conference':
        icon = {
          path: google.maps.SymbolPath.CIRCLE,
          fillColor: '#c077f1',
          fillOpacity: 1,
          strokeColor: '#a347e1',
          strokeWeight: 3,
          scale: 10
        };
        break;
      case 'Society':
        icon = {
          path: google.maps.SymbolPath.CIRCLE,
          fillColor: '#f6bb2e',
          fillOpacity: 1,
          strokeColor: '#ee7b0c',
          strokeWeight: 3,
          scale: 10
        };
        break;
      default:
        icon = {
          path: google.maps.SymbolPath.CIRCLE,
          fillColor: '#017cff',
          fillOpacity: 1,
          strokeColor: '#0000ff',
          strokeWeight: 3,
          scale: 10
        };
    }

    // Create a marker.
    var marker = new google.maps.Marker({
      position: itemInfo.location,
      icon: icon,
      map: map
    });

    // Show an info window when the user clicks the marker.
    marker.addListener('click', handleClick);

    // Show an info window when the mouse hovers the marker.
    marker.addListener('mouseover', handleHover);

    // Close the info window when the mouse leaves the marker.
    marker.addListener('mouseout', closeInfoWindow);

    // Add the item to the array of items.
    itemInfo.marker = marker;
    techCommItems.push(itemInfo);
  }

  // Create a popup window containing the tech comm info.
  function createInfoWindow(marker) {
    infoWindow.setPosition(marker.getPosition());
    infoWindow.setContent('No information found');
    for (var i = 0; i < techCommItems.length; i++) {
      if (techCommItems[i].marker == marker) {
        var content = '<div id="infowindow" class="infowindow">' +
            '<h2>' + techCommItems[i].name + '</h2>' +
            '<p><em>' + techCommItems[i].type + '</em>';
        if (techCommItems[i].website != '') {
          content = content + '  (' + techCommItems[i].website + ')';
        }
        content = content + '</p>' +
          '<p>' + techCommItems[i].description + '</p>';
        if (techCommItems[i].startdate != '') {
          content = content + '<p>' + techCommItems[i].startdate;
        }
        if (techCommItems[i].enddate != '') {
          content = content + ' - ' + techCommItems[i].enddate;
        }

        content = content + '</p>' + '<p>' + techCommItems[i].address +
          '</p>' + '</div>';

        infoWindow.setContent(content);
      }
    }
  }

  // On hover over marker, show the popup window.
  function handleHover() {
    // Create info window
    createInfoWindow(this);

    // Open the info window.
    infoWindow.open(map, this);
  }

  // On click of marker, show the popup window and zoom in.
  function handleClick() {
    if (markerClicked) {
      // This is the second click, so zoom back to user's previous zoom level.
      map.setZoom(userZoom);
      markerClicked = false;
    }
    else {
      // This is the first click, so show the popup window and zoom in.
      createInfoWindow(this);
  
      // Zoom in before opening the info window.
      // If the user has already zoomed in beyond our preferred zoom,
      // leave their zoom setting untouched.
      userZoom = map.getZoom();
      if (userZoom < 14) {
        map.setZoom(14);
        map.setCenter(this.getPosition());
      }
  
      // Open the info window.
      infoWindow.open(map, this);
      markerClicked = true;
    }
  }

  // Close the popup window, if it was opened on hover.
  function closeInfoWindow() {
    if (!markerClicked) {
      infoWindow.close();
    }
  }

  // Respond to change in conference selector.
  function hideShowConferences(checkBox) {
    if (checkBox.checked) {
      showTechCommItems('Conference');
    } else {
      hideTechCommItems('Conference');
    }
  }

  // Respond to change in society selector.
  function hideShowSocieties(checkBox) {<commit_msg>Defined some constants for zoom values.<commit_after><!DOCTYPE html>
<html>
<head>
<title>Tech Comm on a Map</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />

<style>
  html, body, #map-canvas {
    height: 100%;
    margin: 0px;
    padding: 0px
  }

  .controls {
    margin-top: 16px;
    border: 1px solid transparent;
    border-radius: 2px 0 0 2px;
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    height: 32px;
    outline: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  }

   #branding {
    font-family: Roboto;
    font-size: 13px;
    font-weight: 300;
    color: #fff;
    background-color: #4d90fe;
    padding: 5px 11px 0px 11px;
  }

  #place-search {
    background-color: #fff;
    padding: 0 11px 0 13px;
    width: 400px;
    font-family: Roboto;
    font-size: 15px;
    font-weight: 300;
    text-overflow: ellipsis;
  }

  #place-search:focus {
    border-color: #4d90fe;
    margin-left: -1px;
    padding-left: 14px;  /* Regular padding-left + 1. */
    width: 401px;
  }

  .pac-container {
    font-family: Roboto;
  }

  #type-selector {
    color: #fff;
    background-color: #4d90fe;
    padding: 5px 11px 0px 11px;
  }

  #type-selector label {
    font-family: Roboto;
    font-size: 13px;
    font-weight: 300;
  }

  .infowindow {
    font-family: Roboto;
    border: 1px solid transparent;
    border-radius: 2px 0 0 2px;
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    outline: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  }

  #infowindow h2 {
    font-family: Roboto;
    font-size: 15px;
    font-weight: 500;
  }
</style>

<!-- Load the Google Maps JavaScript API -->
<script type="text/javascript"
  src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCwWekcCNrI7bXKrGY4kOUWQjQGImf2lzc&sensor=false&libraries=places">
</script>

<!-- Set up the map and UI controls -->
<script type="text/javascript">
  var DATA_SERVICE_URL = "https://script.google.com/macros/s/AKfycbx75GBiRRl9qUyNMCH-BtDbOc4-g0WZSgCnqhvi6YvhCxYpJ1kJ/exec?jsonp=callback";
  var DEFAULT_ZOOM = 2;
  var AUTO_ZOOM = 14;
  var map;
  var icon;
  var techCommItems = [];
  var infoWindow = new google.maps.InfoWindow();
  var userZoom = DEFAULT_ZOOM;
  var markerClicked = false;

  // This function is called after the page has loaded, to set up the map
  function initializeMap() {
    map = new google.maps.Map(document.getElementById("map-canvas"), {
      center: {lat: 10.367178, lng: 16.998713},
      zoom: DEFAULT_ZOOM
    });

    // Insert a script element into the document header, to get
    // the tech comm data from a Google Docs spreadsheet.
    var scriptElement = document.createElement('script');
    scriptElement.src = DATA_SERVICE_URL;
    document.getElementsByTagName('head')[0].appendChild(scriptElement);

    // Add the search box and data type selectors to the UI.
    var input = /** @type {HTMLInputElement} */(
      document.getElementById('place-search'));

    var types = document.getElementById('type-selector');
    var branding = document.getElementById('branding');
    map.controls[google.maps.ControlPosition.TOP_LEFT].push(branding);
    map.controls[google.maps.ControlPosition.TOP_LEFT].push(types);
    map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);

    var autocomplete = new google.maps.places.Autocomplete(input);

    // When the user searches for and selects a place, zoom in and add a marker.
    var searchMarker = new google.maps.Marker({
      map: map,
      visible: false,
    });

    autocomplete.addListener('place_changed', function() {
      searchMarker.setVisible(false);
      var place = autocomplete.getPlace();
      if (!place.geometry) {
        return;
      }

      // If the place has a geometry, then show it on the map.
      if (place.geometry.viewport) {
        map.fitBounds(place.geometry.viewport);
      } else {
        map.setCenter(place.geometry.location);
        map.setZoom(AUTO_ZOOM);
      }
      searchMarker.setIcon(/** @type {google.maps.Icon} */({
        url: place.icon,
        size: new google.maps.Size(71, 71),
        origin: new google.maps.Point(0, 0),
        anchor: new google.maps.Point(17, 34),
        scaledSize: new google.maps.Size(35, 35)
      }));
      searchMarker.setPosition(place.geometry.location);
      searchMarker.setVisible(true);
    });
  }

  // Get the data from the tech comm spreadsheet.
  function callback(data) {
    // Get the spreadsheet rows one by one.
    // First row contains headings, so start the index at 1 not 0.
    for (var i = 1; i < data.length; i++) {
      addTechCommItem({
        type: data[i][0],
        name: data[i][1],
        description: data[i][2],
        website: data[i][3],
        startdate: data[i][4],
        enddate: data[i][5],
        address: data[i][6],
        location: new google.maps.LatLng(data[i][7], data[i][8]),
        marker: null
      });
    }
  }

  // Set up markers for tech com items
  function addTechCommItem(itemInfo) {
    //Style a marker based on type of tech comm item.
    switch (itemInfo.type) {
      case 'Conference':
        icon = {
          path: google.maps.SymbolPath.CIRCLE,
          fillColor: '#c077f1',
          fillOpacity: 1,
          strokeColor: '#a347e1',
          strokeWeight: 3,
          scale: 10
        };
        break;
      case 'Society':
        icon = {
          path: google.maps.SymbolPath.CIRCLE,
          fillColor: '#f6bb2e',
          fillOpacity: 1,
          strokeColor: '#ee7b0c',
          strokeWeight: 3,
          scale: 10
        };
        break;
      default:
        icon = {
          path: google.maps.SymbolPath.CIRCLE,
          fillColor: '#017cff',
          fillOpacity: 1,
          strokeColor: '#0000ff',
          strokeWeight: 3,
          scale: 10
        };
    }

    // Create a marker.
    var marker = new google.maps.Marker({
      position: itemInfo.location,
      icon: icon,
      map: map
    });

    // Show an info window when the user clicks the marker.
    marker.addListener('click', handleClick);

    // Show an info window when the mouse hovers the marker.
    marker.addListener('mouseover', handleHover);

    // Close the info window when the mouse leaves the marker.
    marker.addListener('mouseout', closeInfoWindow);

    // Add the item to the array of items.
    itemInfo.marker = marker;
    techCommItems.push(itemInfo);
  }

  // Create a popup window containing the tech comm info.
  function createInfoWindow(marker) {
    infoWindow.setPosition(marker.getPosition());
    infoWindow.setContent('No information found');
    for (var i = 0; i < techCommItems.length; i++) {
      if (techCommItems[i].marker == marker) {
        var content = '<div id="infowindow" class="infowindow">' +
            '<h2>' + techCommItems[i].name + '</h2>' +
            '<p><em>' + techCommItems[i].type + '</em>';
        if (techCommItems[i].website != '') {
          content = content + '  (' + techCommItems[i].website + ')';
        }
        content = content + '</p>' +
          '<p>' + techCommItems[i].description + '</p>';
        if (techCommItems[i].startdate != '') {
          content = content + '<p>' + techCommItems[i].startdate;
        }
        if (techCommItems[i].enddate != '') {
          content = content + ' - ' + techCommItems[i].enddate;
        }

        content = content + '</p>' + '<p>' + techCommItems[i].address +
          '</p>' + '</div>';

        infoWindow.setContent(content);
      }
    }
  }

  // On hover over marker, show the popup window.
  function handleHover() {
    // Create info window
    createInfoWindow(this);

    // Open the info window.
    infoWindow.open(map, this);
  }

  // On click of marker, show the popup window and zoom in.
  function handleClick() {
    if (markerClicked) {
      // This is the second click, so zoom back to user's previous zoom level.
      map.setZoom(userZoom);
      markerClicked = false;
    }
    else {
      // This is the first click, so show the popup window and zoom in.
      createInfoWindow(this);
  
      // Zoom in before opening the info window.
      // If the user has already zoomed in beyond our automatic zoom,
      // leave their zoom setting untouched.
      userZoom = map.getZoom();
      if (userZoom < AUTO_ZOOM) {
        map.setZoom(AUTO_ZOOM);
        map.setCenter(this.getPosition());
      }
  
      // Open the info window.
      infoWindow.open(map, this);
      markerClicked = true;
    }
  }

  // Close the popup window, if it was opened on hover.
  function closeInfoWindow() {
    if (!markerClicked) {
      infoWindow.close();
    }
  }

  // Respond to change in conference selector.
  function hideShowConferences(checkBox) {
    if (checkBox.checked) {
      showTechCommItems('Conference');
    } else {
      hideTechCommItems('Conference');
    }
  }

  // Respond to change in society selector.
  function hideShowSocieties(checkBox) {
{'fraction_non_alphanumeric': 0.12976757210865303, 'fraction_numerical': 0.02100252030243629, 'mean_word_length': 2.4200344761539934, 'pattern_counts': {'":': 0, '<': 63, '<?xml version=': 0, '>': 57, 'https://': 4, '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': '2695393', 'n_tokens_mistral': 6078, 'n_tokens_neox': 5665, 'n_words': 1479}