<commit_before>'use strict';

angular.module('websiteApp')
    .controller('MagCtrl', function($scope, News) {
        function shuffle(o) { //v1.0
            for (var j, x, i = o.length; i; j = Math.floor(Math.random() *
                i), x = o[--i], o[i] = o[j], o[j] = x);
            return o;
        };

        $scope.page = 1;
        $scope.loadPage = function(number) {
            News.getMagNews(function(news) {
                $scope.page = number;
                $scope.news = news;
                $scope.randFirstNews = shuffle(news.slice(0, 5));

            }, null, number);
        };
        $scope.loadPage($scope.page);
    });<commit_msg>Added list of recent news to mag page.<commit_after>'use strict';

angular.module('websiteApp')
    .controller('MagCtrl', function($scope, News) {
        function shuffle(o) { //v1.0
            for (var j, x, i = o.length; i; j = Math.floor(Math.random() *
                i), x = o[--i], o[i] = o[j], o[j] = x);
            return o;
        };

        $scope.latestNews = [];
        News.getNews(function(set1) {
            News.getNews(function(set2) {
                $scope.latestNews = set1.concat(set2);
            }, null, 2);
        }, null, 1);

        $scope.page = 1;
        $scope.loadPage = function(number) {
            News.getMagNews(function(news) {
                $scope.page = number;
                $scope.news = news;
                $scope.randFirstNews = shuffle(news.slice(0, 5));

            }, null, number);
        };
        $scope.loadPage($scope.page);
    });
{'fraction_non_alphanumeric': 0.1652892561983471, 'fraction_numerical': 0.010171646535282899, 'mean_word_length': 1.6453781512605041, 'pattern_counts': {'":': 0, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6486701', 'n_tokens_mistral': 515, 'n_tokens_neox': 488, 'n_words': 100}