<commit_before>'use strict';

angular.module('demo', ['w11k.select', 'w11k.select.template']);

angular.module('demo').controller('DemoCtrl', function ($scope) {

  var amount = 10000;

  function randomText(length) {
    var text = '';
    var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0 1 2 3 4 5 6 7 8 9';

    for (var i = 0; i < length; i++) {
      text += possible.charAt(Math.floor(Math.random() * possible.length));
    }

    return text;
  }

  $scope.options = {
    data: []
  };

  $scope.selected = {
    data: []
  };

  function createOptions() {
    $scope.options.data = [];
//    for (var i = 1; i <= amount; i++) {
//      $scope.options.data.push({ label: randomText(i % 200), value: i });
//    }
    for (var i = 1; i <= amount; i++) {<commit_msg>docs(demo): improve performance of random text generation<commit_after>'use strict';

angular.module('demo', ['w11k.select', 'w11k.select.template']);

angular.module('demo').controller('DemoCtrl', function ($scope) {

  var amount = 10000;

  var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0 1 2 3 4 5 6 7 8 9';
  var chars = possible.split('');

  function randomText(length) {
    var text = '';

    for (var i = 0; i < length; i++) {
      text += chars[Math.floor(Math.random() * chars.length)];
    }

    return text;
  }

  $scope.options = {
    data: []
  };

  $scope.selected = {
    data: []
  };

  function createOptions() {
    $scope.options.data = [];
//    for (var i = 1; i <= amount; i++) {
//      $scope.options.data.push({ label: randomText(i % 200), value: i });
//    }
    for (var i = 1; i <= amount; i++) {
{'fraction_non_alphanumeric': 0.18198307134220074, 'fraction_numerical': 0.030229746070133012, 'mean_word_length': 2.9404761904761907, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7166527', 'n_tokens_mistral': 646, 'n_tokens_neox': 574, 'n_words': 145}