<commit_before>/*
 * eve-live Application
 */

// Load global configuration
var config = require('./config');

// Load deps
var express = require('express'),
  routes = require('./routes'),
  http = require('http'),
  path = require('path'),
  zmq = require('zmq'),
  zlib = require('zlib'),
  colors = require('colors'),
  zmqSocket = zmq.socket('sub');

var app = express();

// Main DB
var prices = {};

// Stats
var messagesTotal = 0;
var messagesOrders = 0;
var dataUpdated = 0;

// Block STDOUT?
var outBlocked = false;

/*
 * Express Setup
 */

app.configure(function() {
  app.set('port', process.env.PORT || config.port);
  app.set('views', __dirname + '/views');
  app.set('view engine', 'jade');
  app.use(express.compress());
  app.use(express.favicon());
  app.use(express.logger(config.expressLoggingLevel));
  app.use(express.bodyParser());
  app.use(express.methodOverride());
  app.use(app.router);
  app.use(express.static(path.join(__dirname, 'public')));
});

app.configure('development', function() {
  app.use(express.errorHandler());
});

app.get('/', routes.index);

// Return market snapshot of this system
app.get('/snapshot/:system/', function(req, res) {

  var response = JSON.stringify(prices[req.params.system]);
  if(response === undefined) {
    response = '{error: "No data for this system. Is the ID correct?"}';
  }

  res.write(response);
  res.end();
});

// Return market snapshot of that type in this system
app.get('/snapshot/:system/:type/', function(req, res) {

  var resopnse = "";

  // Error handling
  try {
    response = JSON.stringify(prices[req.params.system][req.params.type]);
  } catch (err) {
    response = '{error: "No data for that system. Is the systemID correct?"}';
  }

  if(response === undefined) {
    response = '{error: "No data for that type in this system. Is the typeID correct?"}';
  }

  res.write(response);
  res.end();
});

/*
 *  WebSockets
 */

var server = app.listen(app.get('port'));
var io = require('socket.io').listen(server);
io.set('log level', 1);
<commit_msg>Fixed typo<commit_after>/*
 * eve-live Application
 */

// Load global configuration
var config = require('./config');

// Load deps
var express = require('express'),
  routes = require('./routes'),
  http = require('http'),
  path = require('path'),
  zmq = require('zmq'),
  zlib = require('zlib'),
  colors = require('colors'),
  zmqSocket = zmq.socket('sub');

var app = express();

// Main DB
var prices = {};

// Stats
var messagesTotal = 0;
var messagesOrders = 0;
var dataUpdated = 0;

// Block STDOUT?
var outBlocked = false;

/*
 * Express Setup
 */

app.configure(function() {
  app.set('port', process.env.PORT || config.port);
  app.set('views', __dirname + '/views');
  app.set('view engine', 'jade');
  app.use(express.compress());
  app.use(express.favicon());
  app.use(express.logger(config.expressLoggingLevel));
  app.use(express.bodyParser());
  app.use(express.methodOverride());
  app.use(app.router);
  app.use(express.static(path.join(__dirname, 'public')));
});

app.configure('development', function() {
  app.use(express.errorHandler());
});

app.get('/', routes.index);

// Return market snapshot of this system
app.get('/snapshot/:system/', function(req, res) {

  var response = JSON.stringify(prices[req.params.system]);
  if(response === undefined) {
    response = '{error: "No data for this system. Is the ID correct?"}';
  }

  res.write(response);
  res.end();
});

// Return market snapshot of that type in this system
app.get('/snapshot/:system/:type/', function(req, res) {

  var response = "";

  // Error handling
  try {
    response = JSON.stringify(prices[req.params.system][req.params.type]);
  } catch (err) {
    response = '{error: "No data for that system. Is the systemID correct?"}';
  }

  if(response === undefined) {
    response = '{error: "No data for that type in this system. Is the typeID correct?"}';
  }

  res.write(response);
  res.end();
});

/*
 *  WebSockets
 */

var server = app.listen(app.get('port'));
var io = require('socket.io').listen(server);
io.set('log level', 1);

{'fraction_non_alphanumeric': 0.18968467367391836, 'fraction_numerical': 0.001955512099731117, 'mean_word_length': 3.8947368421052633, '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': '686870', 'n_tokens_mistral': 1350, 'n_tokens_neox': 1335, 'n_words': 325}