<commit_before><!DOCTYPE html>
<html>
  <head>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <script src="//code.jquery.com/jquery-1.12.0.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="<KEY>" crossorigin="anonymous"></script>

  </head>
  <body>
    <div class="container">
      <div class="row" style="height: 100px">
      </div>
      <div class="row">
        <div class="col-md-12">
          <div class="api-key-container">
            <label for="api-key">Your API Key</label>
            <div class="input-group">
              <input type="text" class="form-control" placeholder="API key" id="api-key" value="<KEY>">
              <span class="input-group-btn">
                <button class="btn btn-primary" id="get-zones">Get A List of Zones</button>
              </span>
            </div>
          </div>
        </div>
      </div>
      <div>
        <ul id="key-error-list">
        </ul>
      </div>
      <div class="container" id="zone-list-container">
        <hr>
      </div>
    </div>
    <script>
     $( document ).ready(function () {
       // saturday notes -- ditch the progress bar?  That would simplify things quite a bit
       // instead, show a "time remaining" amount.

       // -- model

       var globalAppState = {
         authKey: "",
         personId: "",
         deviceList: [],
         errorLib: {
           keyLengthError: "<li> Valid keys are 36 characters in size, including dashes. </li>",
           durationError: "<li> Duration must be between 0 and 180 minutes. </li>"
         },
       }

       // -- update
       function getId (object) {
         return object.id;
       }

       function getName (object) {
         return object.name;
       }

       function getZones (object) {
         return object.zones;
       }

       function getImg (object) {
         return object.imageUrl;
       }

       function updateTimeRemaining (zoneId, time) {
         $("#time-remaining-" + zoneId).text(time);
       }

       function startUpdates(zoneId) {
         var currentId = setInterval (function () {
           const domTimeRemaining = $("#time-remaining-" + zoneId).text() - 1;
           // console.log("interval number", domTimeRemaining);
           if(domTimeRemaining <= 0) {
             clearInterval(currentId);
           }
           updateTimeRemaining(zoneId, domTimeRemaining); 
         }, 60000)
       }
       
       function makeBtnEvent(zone, btnId) {
         const zoneId = getId(zone);
         return function (event) {

           const tmpDuration = (btnId == 'btn-on-') ? 60 * Number($("#duration-" + zoneId).val()) : 0;

           if (tmpDuration < 0 || tmpDuration > (180 * 60) ) {
             $("#error-" + zoneId).append(globalAppState.errorLib['durationError']);
             $("#error-" + zoneId).addClass("alert alert-danger");
           }
           else {
            $("#error-" + zoneId).html("");
            $("#error-" + zoneId).removeClass("alert alert-danger");

             updateTimeRemaining(zoneId, (tmpDuration/60).toFixed(0));
             $.ajax({
               method: "PUT",
               url: "https://api.rach.io/1/public/zone/start",
               data: "{id : " + zoneId + ", duration : " + tmpDuration + "}",
               success: function (res) {
                 startUpdates(zoneId);
                 updateTimeRemaining(zoneId, (tmpDuration/60).toFixed(0));
               }
             });
           }
         }
       }<commit_msg>Fixed off by 1 in counter<commit_after><!DOCTYPE html>
<html>
  <head>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <script src="//code.jquery.com/jquery-1.12.0.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="<KEY>" crossorigin="anonymous"></script>

  </head>
  <body>
    <div class="container">
      <div class="row" style="height: 100px">
      </div>
      <div class="row">
        <div class="col-md-12">
          <div class="api-key-container">
            <label for="api-key">Your API Key</label>
            <div class="input-group">
              <input type="text" class="form-control" placeholder="API key" id="api-key" value="<KEY>">
              <span class="input-group-btn">
                <button class="btn btn-primary" id="get-zones">Get A List of Zones</button>
              </span>
            </div>
          </div>
        </div>
      </div>
      <div>
        <ul id="key-error-list">
        </ul>
      </div>
      <div class="container" id="zone-list-container">
        <hr>
      </div>
    </div>
    <script>
     $( document ).ready(function () {
       // saturday notes -- ditch the progress bar?  That would simplify things quite a bit
       // instead, show a "time remaining" amount.

       // -- model

       var globalAppState = {
         authKey: "",
         personId: "",
         deviceList: [],
         errorLib: {
           keyLengthError: "<li> Valid keys are 36 characters in size, including dashes. </li>",
           durationError: "<li> Duration must be between 0 and 180 minutes. </li>"
         },
       }

       // -- update
       function getId (object) {
         return object.id;
       }

       function getName (object) {
         return object.name;
       }

       function getZones (object) {
         return object.zones;
       }

       function getImg (object) {
         return object.imageUrl;
       }

       function updateTimeRemaining (zoneId, time) {
         $("#time-remaining-" + zoneId).text(time);
       }

       function startUpdates(zoneId) {
         var currentId = setInterval (function () {
           const domTimeRemaining = $("#time-remaining-" + zoneId).text() - 1;
           // console.log("interval number", domTimeRemaining);
           updateTimeRemaining(zoneId, domTimeRemaining); 
           if(domTimeRemaining <= 0) {
             clearInterval(currentId);
           }
         }, 60000)
       }
       
       function makeBtnEvent(zone, btnId) {
         const zoneId = getId(zone);
         return function (event) {

           const tmpDuration = (btnId == 'btn-on-') ? 60 * Number($("#duration-" + zoneId).val()) : 0;

           if (tmpDuration < 0 || tmpDuration > (180 * 60) ) {
             $("#error-" + zoneId).append(globalAppState.errorLib['durationError']);
             $("#error-" + zoneId).addClass("alert alert-danger");
           }
           else {
            $("#error-" + zoneId).html("");
            $("#error-" + zoneId).removeClass("alert alert-danger");

             updateTimeRemaining(zoneId, (tmpDuration/60).toFixed(0));
             $.ajax({
               method: "PUT",
               url: "https://api.rach.io/1/public/zone/start",
               data: "{id : " + zoneId + ", duration : " + tmpDuration + "}",
               success: function (res) {
                 startUpdates(zoneId);
                 updateTimeRemaining(zoneId, (tmpDuration/60).toFixed(0));
               }
             });
           }
         }
       }
{'fraction_non_alphanumeric': 0.15509518477043674, 'fraction_numerical': 0.011618141097424413, 'mean_word_length': 1.760819165378671, 'pattern_counts': {'":': 0, '<': 93, '<?xml version=': 0, '>': 91, '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': '1003167', 'n_tokens_mistral': 2139, 'n_tokens_neox': 2034, 'n_words': 441}