<commit_before>var path              = require("path");
var express           = require("express");
var assetbuilder      = require("asset_builder");
var socketio          = require("socket.io");
var AsyncRunner       = require("async_runner");
var app               = require(path.join(__dirname, "config", "app"));
var db                = require(path.join(app.root, "config", "database"));
var socketRoutes      = require(path.join(app.root, "app", "socket_routes"));
var httpRoutes        = require(path.join(app.root, "app", "http_routes"));
var emberPreprocessor = require(path.join(app.root, "app", "lib", "preprocessors", "ember_preprocessor"));
var Itunes             = require(path.join(app.root, "app", "lib", "application_interfaces", "itunes"));
var Spotify            = require(path.join(app.root, "app", "lib", "application_interfaces", "spotify"));

function initExpress() {
  var server = express.createServer();
  server.configure(function() {
    this.use(express.errorHandler({
      showStack: true,
      dumpExceptions: true
    }));
    this.use(assetbuilder.middleware);
    this.use(express.static(path.join(app.root, "public")));
    this.use(express.bodyParser());
    this.use(express.methodOverride());
    this.use(express.cookieParser());
    this.use(express.router(httpRoutes));
    this.set("views", path.join("app", "views"));
    this.set("view engine", "jade");
    this.set("view options", {layout: false });
  });

  assetbuilder.registerViewHelpers(server);
  assetbuilder.registerPreprocessor(emberPreprocessor);
  assetbuilder.configure({
    env: app.env
  });

  console.log("app running on " + app.port + " in " + app.env);
  server.listen(app.port);
  return server;
};

function initSockets(server) {
  var io = socketio.listen(server);
  io.configure(function () {
    io.set("transports", ["websocket"]);
    io.disable("log");
  });
  socketRoutes(io);
};

// Initialize database before booting app
db.open(function(error) {
  if (error) throw error;
  runner = new AsyncRunner(function() {
    initSockets(initExpress());
  });
  runner.run({}, [
    function(element, hollaback) {
      Itunes.launch(hollaback);
    },
    function(element, hollaback) {
      Spotify.launch(hollaback);
    }
  ]);
});<commit_msg>Launch airfoil on boot<commit_after>var path              = require("path");
var express           = require("express");
var assetbuilder      = require("asset_builder");
var socketio          = require("socket.io");
var AsyncRunner       = require("async_runner");
var app               = require(path.join(__dirname, "config", "app"));
var db                = require(path.join(app.root, "config", "database"));
var socketRoutes      = require(path.join(app.root, "app", "socket_routes"));
var httpRoutes        = require(path.join(app.root, "app", "http_routes"));
var emberPreprocessor = require(path.join(app.root, "app", "lib", "preprocessors", "ember_preprocessor"));
var Itunes             = require(path.join(app.root, "app", "lib", "application_interfaces", "itunes"));
var Spotify            = require(path.join(app.root, "app", "lib", "application_interfaces", "spotify"));
var Airfoil            = require(path.join(app.root, "app", "lib", "application_interfaces", "airfoil"));

function initExpress() {
  var server = express.createServer();
  server.configure(function() {
    this.use(express.errorHandler({
      showStack: true,
      dumpExceptions: true
    }));
    this.use(assetbuilder.middleware);
    this.use(express.static(path.join(app.root, "public")));
    this.use(express.bodyParser());
    this.use(express.methodOverride());
    this.use(express.cookieParser());
    this.use(express.router(httpRoutes));
    this.set("views", path.join("app", "views"));
    this.set("view engine", "jade");
    this.set("view options", {layout: false });
  });

  assetbuilder.registerViewHelpers(server);
  assetbuilder.registerPreprocessor(emberPreprocessor);
  assetbuilder.configure({
    env: app.env
  });

  console.log("app running on " + app.port + " in " + app.env);
  server.listen(app.port);
  return server;
};

function initSockets(server) {
  var io = socketio.listen(server);
  io.configure(function () {
    io.set("transports", ["websocket"]);
    io.disable("log");
  });
  socketRoutes(io);
};

// Initialize database before booting app
db.open(function(error) {
  if (error) throw error;
  runner = new AsyncRunner(function() {
    initSockets(initExpress());
  });
  runner.run({}, [
    function(element, hollaback) {
      Itunes.launch(hollaback);
    },
    function(element, hollaback) {
      Spotify.launch(hollaback);
    },
    function(elemnt, hollaback) {
      Airfoil.launch(hollaback);
    }
  ]);
});
{'fraction_non_alphanumeric': 0.17015873015873015, 'fraction_numerical': 0.0, 'mean_word_length': 3.730730730730731, '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': '7398456', 'n_tokens_mistral': 1472, 'n_tokens_neox': 1468, 'n_words': 271}