<commit_before>'use strict';

angular.module('MyApp.controllers')
.value('BASE_URL', 'https://noticeapp.firebaseio.com/')
.controller('DashboardCtrl', function($firebase, $scope, Auth, md5, $ionicModal, User, $http) {
    var noticeRef = new Firebase('https://trynotice.firebaseio.com/notifications');
    $scope.notifications = $firebase(noticeRef);  	
    
    $scope.email = Auth.currentUser.email;
    $scope.message = '';
    $scope.activityName = '';
    $scope.isStudent = /([\._a-zA-Z0-9-]+@<EMAIL>)/.test($scope.email);
    
    $http.get(User.getSubscriptions())
    .success(function(data) {
        if(data == null) {
            $scope.subscriptions = [{ id: 1, name: 'Math Team', color: '#43cee6', isChecked: false },
            { id: 2, name: 'Basketball', color: '#4a87ee', isChecked: false },	
            { id: 3, name: 'Horticulture Club', color: '#ef4e3a', isChecked: false },		
            { id: 4, name: 'Science Olympiad', color: '#8a6de9', isChecked: false }];
        }

        else {
            $scope.subscriptions = data;
            console.log(data);
        }
    });

    $scope.gravatarURL = 'http://www.gravatar.com/avatar/' + md5.createHash($scope.email); 
    
    $scope.manage = function() {
        User.manageSubscriptions($scope.subscriptions);
    };
    
    $scope.postNotification = function(message, tag, color) {
        $scope.notifications.$add({message: message, createdBy: $scope.email, gravatarURL: $scope.gravatarURL, dateCreated: Date.now(), tag: tag, color: color});
  	    $scope.message = null;
    };

    $scope.getGravatar = function(md5) {
        return 'http://www.gravatar.com/avatar/' + notifications.md5;
    };
    
    $ionicModal.fromTemplateUrl('templates/modal.html', {
        scope: $scope
    }).then(function(modal) {
        $scope.modal = modal;
    });
    
    $scope.filterSubscriptions(tagName, index) {
        if($scope.subscriptions[index].tagName) {<commit_msg>Update dashboard-controller.js<commit_after>'use strict';

angular.module('MyApp.controllers')
.value('BASE_URL', 'https://noticeapp.firebaseio.com/')
.controller('DashboardCtrl', function($firebase, $scope, Auth, md5, $ionicModal, User, $http) {
    var noticeRef = new Firebase('https://trynotice.firebaseio.com/notifications');
    $scope.notifications = $firebase(noticeRef);  	
    
    $scope.email = Auth.currentUser.email;
    $scope.message = '';
    $scope.activityName = '';
    $scope.isStudent = /([\._a-zA-Z0-9-]+@students.d211.org)/.test($scope.email);
    
    $http.get(User.getSubscriptions())
    .success(function(data) {
        if(data == null) {
            $scope.subscriptions = [{ id: 1, name: 'Math Team', color: '#43cee6', isChecked: false },
            { id: 2, name: 'Basketball', color: '#4a87ee', isChecked: false },	
            { id: 3, name: 'Horticulture Club', color: '#ef4e3a', isChecked: false },		
            { id: 4, name: 'Science Olympiad', color: '#8a6de9', isChecked: false }];
        }

        else {
            $scope.subscriptions = data;
            console.log(data);
        }
    });

    $scope.gravatarURL = 'http://www.gravatar.com/avatar/' + md5.createHash($scope.email); 
    
    $scope.manage = function() {
        User.manageSubscriptions($scope.subscriptions);
    };
    
    $scope.postNotification = function(message, tag, color) {
        $scope.notifications.$add({message: message, createdBy: $scope.email, gravatarURL: $scope.gravatarURL, dateCreated: Date.now(), tag: tag, color: color});
  	    $scope.message = null;
    };

    $scope.getGravatar = function(md5) {
        return 'http://www.gravatar.com/avatar/' + notifications.md5;
    };
    
    $ionicModal.fromTemplateUrl('templates/modal.html', {
        scope: $scope
    }).then(function(modal) {
        $scope.modal = modal;
    });
    
    $scope.filterSubscriptions = function(tagName, index) {
        if($scope.subscriptions[index].tagName) {
{'fraction_non_alphanumeric': 0.17098577235772358, 'fraction_numerical': 0.011432926829268292, 'mean_word_length': 2.8826429980276136, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, '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': '351644', 'n_tokens_mistral': 1320, 'n_tokens_neox': 1274, 'n_words': 216}