<commit_before>'use strict';

/**
 * @ngdoc function
 * @name devFlowApp.controller:MainCtrl
 * @description
 * # MainCtrl
 * Controller of the devFlowApp
 */
var myapp = angular.module('devFlowApp');

myapp.controller('MainCtrl', function ($scope, $firebase, $routeParams, $http) {
    $scope.results = [];
    $scope.searchOnClick = function () {
        var ref = new Firebase('https://devflow.firebaseio.com/users');
        var sync = $firebase(ref);
        $http.get('https://devflow.firebaseio.com/users.json')
        .success(function(data) {
        var hitCount = 0;
        $scope.results = [];
        var magic = new RegExp(".*"+$scope.query+".*");
            for (var key in data) {
                var obj = data[key];
                if (magic.test(obj.name)) {
                    ++hitCount;
                    $scope.results.push(obj.name);
                }
            }
            console.log($scope.results);
            if (hitCount > 0) {
                $scope.name="Found " + hitCount + " Users with that name";
            } else {
                $scope.name="Found no users by that name";
            }
        });
    };
  });<commit_msg>Magic works more<commit_after>'use strict';

/**
 * @ngdoc function
 * @name devFlowApp.controller:MainCtrl
 * @description
 * # MainCtrl
 * Controller of the devFlowApp
 */
var myapp = angular.module('devFlowApp');

myapp.controller('MainCtrl', function ($scope, $firebase, $routeParams, $http) {
    $scope.results = [];
    $scope.searchOnClick = function () {
        var ref = new Firebase('https://devflow.firebaseio.com/users');
        var sync = $firebase(ref);
        $http.get('https://devflow.firebaseio.com/users.json')
        .success(function(data) {
        var hitCount = 0;
        $scope.results = [];
        var magic = new RegExp(".*"+($scope.query.toLowerCase())+".*");
            for (var key in data) {
                var obj = data[key];
                if (magic.test( (obj.name.toLowerCase()) )) {
                    ++hitCount;
                    $scope.results.push(obj.name);
                }
            }
            if (hitCount > 0) {
                $scope.name="Found " + hitCount + " Users with that name";
            } else {
                $scope.name="Found no users by that name";
            }
        });
    };
  });
{'fraction_non_alphanumeric': 0.15358361774744028, 'fraction_numerical': 0.0017064846416382253, 'mean_word_length': 1.8253012048192772, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6695281', 'n_tokens_mistral': 695, 'n_tokens_neox': 677, 'n_words': 142}