<commit_before>//Copyright 2012-2013 <NAME> & <NAME>.  All rights reserved.  
//We plan to release our code under an open source license, probably GPL v3.

/***** SETUP *****/
var express = require('express'),
    swig = require('swig'),
    path = require('path'),
    repl = require('repl'),
    sys = require('sys'),
    persistence = require('persistencejs/persistence').persistence,
    persistenceStore = require('persistencejs/persistence.store.sqlite3'),
    persistenceSync = require('persistencejs/persistence.sync.server'),
    mime = require('mime'),
    url = require('url'),
    app = express();
    
var nodeUserGid = "ec2-user";
var nodeUserUid = "ec2-user";

var persistenceSession = function(req, res, next) {
    var end = res.end;

    req.conn = persistenceStore.getSession();
    res.end = function() {
      req.conn.close();
      end.apply(res, arguments);
    };
    req.conn.transaction(function(tx) {
        req.tx = tx;
        next();
      });
  };
  
function log(o) {
    sys.print(sys.inspect(o) + "\n");
}


/***** APP CONFIG *****/
app.set('port', process.env.PORT || 3000);
app.set('views', path.join(__dirname, 'views'));
app.engine('html', swig.renderFile);
app.set('view engine', 'html');
app.set('view cache', false);
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.json());
app.use(express.urlencoded());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.bodyParser());
app.use(express.static(__dirName));<commit_msg>setup backbone and express-public scaffolding<commit_after>//Copyright 2012-2013 <NAME> & <NAME>.  All rights reserved.  
//We plan to release our code under an open source license, probably GPL v3.

/***** SETUP *****/
var express = require('express'),
    swig = require('swig'),
    path = require('path'),
    repl = require('repl'),
    sys = require('sys'),
    persistence = require('persistencejs/persistence').persistence,
    persistenceStore = require('persistencejs/persistence.store.sqlite3'),
    persistenceSync = require('persistencejs/persistence.sync.server'),
    mime = require('mime'),
    url = require('url'),
    app = express();
    
var nodeUserGid = "ec2-user";
var nodeUserUid = "ec2-user";

var persistenceSession = function(req, res, next) {
    var end = res.end;

    req.conn = persistenceStore.getSession();
    res.end = function() {
      req.conn.close();
      end.apply(res, arguments);
    };
    req.conn.transaction(function(tx) {
        req.tx = tx;
        next();
      });
  };
  
function log(o) {
    sys.print(sys.inspect(o) + "\n");
}


/***** APP CONFIG *****/
app.set('port', process.env.PORT || 3000);
app.set('views', path.join(__dirname, 'views'));
app.engine('html', swig.renderFile);
app.set('view engine', 'html');
app.set('view cache', false);
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.json());
app.use(express.urlencoded());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.bodyParser());
app.use(express.static(path.join(__dirname, 'public')));
{'fraction_non_alphanumeric': 0.19166937845753335, 'fraction_numerical': 0.010413276928083305, 'mean_word_length': 3.958064516129032, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2292980', 'n_tokens_mistral': 1015, 'n_tokens_neox': 980, 'n_words': 200}