<commit_before>var db_name = 'gbook';

var app = angular.module("CouchApp", [ "CornerCouch" ]);

function ctrlGBook1($scope, $filter, cornercouch) {
    $scope.server = cornercouch();

    // I think
    $scope.server.session().success(function(data) {
       if ( $scope.server.userCtx && $scope.server.userCtx.name ) {
          $scope.showInfo = true;
          $scope.getInfos();
       }
    });

    $scope.gbookdb = $scope.server.getDB(db_name);
    $scope.gbookdb.getInfo();
    $scope.newentry = $scope.gbookdb.newDoc();
    $scope.gbookdb.query("test", "utc_only", {
        include_docs: true,
        descending: true,
        limit: 8
    });


    $scope.isAuthenticated = function() {
       var ret = false;
       if ($scope.server.userCtx == undefined) {
          $scope.server.session();
       }
       // still need to check it as session only sets on success.
       if ( $scope.server.userCtx && $scope.server.userCtx.name ) {
          ret = true;
       }

       return ret;
    };

    $scope.changes = $scope.gbookdb.changeSource();

    if( $scope.changes != null )
    {
       var changeListener = function(event) {
          $scope.$apply(function() {
             $scope.gbookdb.queryRefresh();
          });
       };
       $scope.changes.addEventListener('message', changeListener);
    }
<commit_msg>Apparently the design document name was wrong<commit_after>var db_name = 'gbook';

var app = angular.module("CouchApp", [ "CornerCouch" ]);

function ctrlGBook1($scope, $filter, cornercouch) {
    $scope.server = cornercouch();

    // I think
    $scope.server.session().success(function(data) {
       if ( $scope.server.userCtx && $scope.server.userCtx.name ) {
          $scope.showInfo = true;
          $scope.getInfos();
       }
    });

    $scope.gbookdb = $scope.server.getDB(db_name);
    $scope.gbookdb.getInfo();
    $scope.newentry = $scope.gbookdb.newDoc();
    $scope.gbookdb.query("example-angular-cornercouch", "utc_only", {
        include_docs: true,
        descending: true,
        limit: 8
    });


    $scope.isAuthenticated = function() {
       var ret = false;
       if ($scope.server.userCtx == undefined) {
          $scope.server.session();
       }
       // still need to check it as session only sets on success.
       if ( $scope.server.userCtx && $scope.server.userCtx.name ) {
          ret = true;
       }

       return ret;
    };

    $scope.changes = $scope.gbookdb.changeSource();

    if( $scope.changes != null )
    {
       var changeListener = function(event) {
          $scope.$apply(function() {
             $scope.gbookdb.queryRefresh();
          });
       };
       $scope.changes.addEventListener('message', changeListener);
    }

{'fraction_non_alphanumeric': 0.15012815818381545, 'fraction_numerical': 0.0014646649578908824, 'mean_word_length': 2.2718562874251496, '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': '1512086', 'n_tokens_mistral': 871, 'n_tokens_neox': 862, 'n_words': 154}