<commit_before>'use strict';
angular.module('cloudoptingApp').filter('startFrom', function() {
    return function(input, start) {
        start = +start; //parse to int
        return input.slice(start);
    }
});

angular.module('cloudoptingApp')
    .controller('CatalogController', function (SERVICE, $scope, $log, $state, ApplicationService, localStorageService) {
        //, ApplicationService
        //TODO: Change applicationListUnpaginated to applicationList once it is developed properly
        $scope.applicationList = null;

        var callback = function(applications) {
            $scope.applicationList = applications.content;
            pagination();

            for (var app in $scope.applicationList) {
                $scope.applicationList[app].applicationImage = "http://placehold.it/200x180";
            }
        };

        ApplicationService.findAllUnpaginated(callback);

        $scope.detail = function(application){
            //Save the current application
            localStorageService.set(SERVICE.STORAGE.CURRENT_APP, application);
            //Go to the detail of the applicaiton.
            $state.go('detail');
        };

        //PAGINATION
        $scope.currentPage = 0;
        $scope.pageSize = 4;

        var pagination = function(){
            $scope.totalItems = $scope.applicationList.length;

            $scope.numberOfPages = function(){
                return Math.ceil($scope.totalItems/$scope.pageSize);
            };
            $scope.nextDisable = function(){
                return $scope.currentPage >= $scope.totalItems/$scope.pageSize - 1;
            };


            $scope.setPage = function (pageNo) {
                $scope.currentPage = pageNo;
            };

            $scope.pageChanged = function() {
                $log.log('Page changed to: ' + $scope.currentPage);
            };


            //$scope.bigTotalItems = 175;
            //$scope.bigCurrentPage = 1;
        }
    }
);<commit_msg>Randomize images from applications till we have real images.<commit_after>'use strict';
angular.module('cloudoptingApp').filter('startFrom', function() {
    return function(input, start) {
        start = +start; //parse to int
        return input.slice(start);
    }
});

angular.module('cloudoptingApp')
    .controller('CatalogController', function (SERVICE, $scope, $log, $state, ApplicationService, localStorageService) {
        //, ApplicationService
        //TODO: Change applicationListUnpaginated to applicationList once it is developed properly
        $scope.applicationList = null;

        var callback = function(applications) {
            $scope.applicationList = applications.content;
            pagination();

            for (var app in $scope.applicationList) {
                var random=Math.random();
                $scope.applicationList[app].applicationImage = "http://placehold.it/200x180";
                if(random<=0.33) $scope.applicationList[app].applicationImage = "http://www.i2space.com/img/mobile_inner.jpg";
                if(random>0.33 && random<0.66) $scope.applicationList[app].applicationImage = "http://kksoft.in/Images/Mobile-Application-Development.png";
                if(random>0.66) $scope.applicationList[app].applicationImage = "http://community.nagra.com/images/nagra/icons/framework.jpg";

            }
        };

        ApplicationService.findAllUnpaginated(callback);

        $scope.detail = function(application){
            //Save the current application
            localStorageService.set(SERVICE.STORAGE.CURRENT_APP, application);
            //Go to the detail of the applicaiton.
            $state.go('detail');
        };

        //PAGINATION
        $scope.currentPage = 0;
        $scope.pageSize = 4;

        var pagination = function(){
            $scope.totalItems = $scope.applicationList.length;

            $scope.numberOfPages = function(){
                return Math.ceil($scope.totalItems/$scope.pageSize);
            };
            $scope.nextDisable = function(){
                return $scope.currentPage >= $scope.totalItems/$scope.pageSize - 1;
            };


            $scope.setPage = function (pageNo) {
                $scope.currentPage = pageNo;
            };

            $scope.pageChanged = function() {
                $log.log('Page changed to: ' + $scope.currentPage);
            };


            //$scope.bigTotalItems = 175;
            //$scope.bigCurrentPage = 1;
        }
    }
);
{'fraction_non_alphanumeric': 0.12235346556719412, 'fraction_numerical': 0.00869177624247827, 'mean_word_length': 2.10803324099723, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5155921', 'n_tokens_mistral': 1213, 'n_tokens_neox': 1149, 'n_words': 222}