<commit_before>
'use strict';

angular.module('photowallWebApp')
  .controller('WallCtrl', [
    '$scope',
    '$routeParams',
    'services.rest',
    'services.socket',
    '$timeout',
    function ($scope, $routeParams, rest, socket, $timeout) {

      // Fetch photos - first 4?
      $scope.wallID   = undefined;
      $scope.wallName = $routeParams.wallName;
      $scope.activePhotos = []; // Photos that are shown on wall
      $scope.inactivePhotos = []; // Photos not shown on wall
      var numMaxActivePhotos = 40; // Maximal number of active photos


      rest.getWall($scope.wallName,
        // Callback
        function(wallObject) {
          console.log("dobio wall id: " + wallObject.data.id);
          $scope.wallID = wallObject.data.id;
        },
        // Error
        function(data) {
          console.log("error: getWallID()");
        }
      );

      rest.getPhotos($scope.wallName, 
        // Callback
        function(photosObject) {
          var photos = photosObject.data;
          $scope.activePhotos =   photos.slice(0, numMaxActivePhotos);
          $scope.inactivePhotos = photos.slice(numMaxActivePhotos);
        },
        // Error
        function(data) {
          console.log("error: getPhotos()");
        }
      );

      socket.registerListener(function(msg) {
        $scope.$apply(function() {
          // Check id - if matches, push to photos array
          if (msg.data.wallId === $scope.wallID) {
            // move one from active to inactive photos and push new to active
            $scope.inactivePhotos.push($scope.activePhotos[0]);
            $scope.activePhotos[0] = msg.data;
          }    

        });
      });

      var getRandom = function(upperBound) {
        return Math.floor(Math.random() * upperBound);
      };

      // Each 3 seconds, swap one photo from inactive photos with one from active photos
      var swapRandomPhoto = function() {<commit_msg>wrong wall name handle<commit_after>
'use strict';

angular.module('photowallWebApp')
  .controller('WallCtrl', [
    '$scope',
    '$routeParams',
    'services.rest',
    'services.socket',
    '$timeout',
    '$location',
    function ($scope, $routeParams, rest, socket, $timeout, $location) {

      // Fetch photos - first 4?
      $scope.wallID   = undefined;
      $scope.wallName = $routeParams.wallName;
      $scope.activePhotos = []; // Photos that are shown on wall
      $scope.inactivePhotos = []; // Photos not shown on wall
      var numMaxActivePhotos = 40; // Maximal number of active photos


      rest.getWall($scope.wallName,
        // Callback
        function(wallObject) {
          console.log("dobio wall id: " + wallObject.data.id);
          $scope.wallID = wallObject.data.id;

          rest.getPhotos($scope.wallName, 
            // Callback
            function(photosObject) {
              var photos = photosObject.data;
              $scope.activePhotos =   photos.slice(0, numMaxActivePhotos);
              $scope.inactivePhotos = photos.slice(numMaxActivePhotos);
            },
            // Error
            function(data) {
              console.log("error: getPhotos()");
            });
        },
        // Error
        function(data) {
          // Go to home if
          $location.url('/');
        }
      );

      socket.registerListener(function(msg) {
        $scope.$apply(function() {
          // Check id - if matches, push to photos array
          if (msg.data.wallId === $scope.wallID) {
            // move one from active to inactive photos and push new to active
            $scope.inactivePhotos.push($scope.activePhotos[0]);
            $scope.activePhotos[0] = msg.data;
          }    

        });
      });

      var getRandom = function(upperBound) {
        return Math.floor(Math.random() * upperBound);
      };

      // Each 3 seconds, swap one photo from inactive photos with one from active photos
      var swapRandomPhoto = function() {
{'fraction_non_alphanumeric': 0.1259464916708733, 'fraction_numerical': 0.0035335689045936395, 'mean_word_length': 1.9796992481203008, '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': '7565173', 'n_tokens_mistral': 1144, 'n_tokens_neox': 1084, 'n_words': 256}