<commit_before>var preContestControllers = angular.module('preContestControllers', []);

preContestControllers.controller('MainCtrl', ['$scope', '$http', '$timeout',
    function ($scope, $http, $timeout, $window) {
      function sync () {
        $http.get('api/v1/updates').success(function (data) {
          if ($scope.rawTime < parseInt(data['remaining_time'])) {
            $window.location.reload();
          }
          $scope.rawTime = data['remaining_time'];
          $scope.remainingTime = moment($scope.rawTime);
        });
        $timeout(sync, 5000);
        for (i = 1000; i <= 4000; i += 1000) {
          $timeout(tick, i);
        }
      }

      function tick () {
        $scope.rawTime -= 1;
        if ($scope.rawTime < 0) {
          $window.location.reload();
        } else {
          $scope.remainingTime = moment($scope.rawTime);
        }
      }

      sync();
    }]);

preContestControllers.controller('HomeCtrl', ['$scope', '$http',
    function ($scope, $http) {
    }]);


var contestControllers = angular.module('contestControllers', []);
var probIds = [];

contestControllers.controller('MainCtrl', ['$scope', '$http', '$timeout', '$rootScope',
    function ($scope, $http, $timeout, $window) {
      $http.get('api/v1/metadata').success(function (data) {
        $scope.probIds = probIds = data['prob_ids'];
        $scope.probContents = data['prob_contents'];
      });

      function sync () {
        $http.get('api/v1/updates').success(function (data) {
          $scope.rawTime = data['remaining_time'];
          $scope.scoreboard = data['scoreboard'];
          $scope.clarifications = data['clarifications'];
          $scope.remainingTime = moment($scope.rawTime);
        });
        $timeout(sync, 5000);
        for (i = 1000; i <= 4000; i += 1000) {
          if ($scope.rawTime > 0) {
            $timeout(tick, i);
          }
        }
      }

      function tick () {
        $scope.rawTime -= 1;
        if ($scope.rawTime >= 0) {
          $scope.remainingTime = moment($scope.rawTime);
        }
      }

      sync();
    }]);

contestControllers.controller('HomeCtrl', ['$scope', '$http',
    function ($scope, $http) {
    }]);

contestControllers.controller('ProblemCtrl', ['$scope', '$http', '$rootScope', '$window', '$cookies',
    function ($scope, $http, $rootScope, $window, $cookies) {
      var tabClasses;
        
      function initTabs() {
        tabClasses = ["","","",""];
      }
      
      $scope.getTabClass = function (tabNum) {
        return tabClasses[tabNum];
      };
      
      $scope.getTabPaneClass = function (tabNum) {
        return "tab-pane " + tabClasses[tabNum];
      }<commit_msg>fix potential issue with more than 4 tabs<commit_after>var preContestControllers = angular.module('preContestControllers', []);

preContestControllers.controller('MainCtrl', ['$scope', '$http', '$timeout',
    function ($scope, $http, $timeout, $window) {
      function sync () {
        $http.get('api/v1/updates').success(function (data) {
          if ($scope.rawTime < parseInt(data['remaining_time'])) {
            $window.location.reload();
          }
          $scope.rawTime = data['remaining_time'];
          $scope.remainingTime = moment($scope.rawTime);
        });
        $timeout(sync, 5000);
        for (i = 1000; i <= 4000; i += 1000) {
          $timeout(tick, i);
        }
      }

      function tick () {
        $scope.rawTime -= 1;
        if ($scope.rawTime < 0) {
          $window.location.reload();
        } else {
          $scope.remainingTime = moment($scope.rawTime);
        }
      }

      sync();
    }]);

preContestControllers.controller('HomeCtrl', ['$scope', '$http',
    function ($scope, $http) {
    }]);


var contestControllers = angular.module('contestControllers', []);
var probIds = [];

contestControllers.controller('MainCtrl', ['$scope', '$http', '$timeout', '$rootScope',
    function ($scope, $http, $timeout, $window) {
      $http.get('api/v1/metadata').success(function (data) {
        $scope.probIds = probIds = data['prob_ids'];
        $scope.probContents = data['prob_contents'];
      });

      function sync () {
        $http.get('api/v1/updates').success(function (data) {
          $scope.rawTime = data['remaining_time'];
          $scope.scoreboard = data['scoreboard'];
          $scope.clarifications = data['clarifications'];
          $scope.remainingTime = moment($scope.rawTime);
        });
        $timeout(sync, 5000);
        for (i = 1000; i <= 4000; i += 1000) {
          if ($scope.rawTime > 0) {
            $timeout(tick, i);
          }
        }
      }

      function tick () {
        $scope.rawTime -= 1;
        if ($scope.rawTime >= 0) {
          $scope.remainingTime = moment($scope.rawTime);
        }
      }

      sync();
    }]);

contestControllers.controller('HomeCtrl', ['$scope', '$http',
    function ($scope, $http) {
    }]);

contestControllers.controller('ProblemCtrl', ['$scope', '$http', '$rootScope', '$window', '$cookies',
    function ($scope, $http, $rootScope, $window, $cookies) {
      var tabClasses;
        
      function initTabs() {
        tabClasses = [];
        for (probId in probIds) {
          tabClasses.push("");
        }
      }
      
      $scope.getTabClass = function (tabNum) {
        return tabClasses[tabNum];
      };
      
      $scope.getTabPaneClass = function (tabNum) {
        return "tab-pane " + tabClasses[tabNum];
      }
{'fraction_non_alphanumeric': 0.17452485380116958, 'fraction_numerical': 0.014802631578947368, 'mean_word_length': 2.3371951219512197, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 0, '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': '4406828', 'n_tokens_mistral': 1736, 'n_tokens_neox': 1664, 'n_words': 302}