<commit_before>import BuildSystem = require('../../buildsystem/BuildSystem');
import Session = require('./Session');
import replication = require('./replication');
import express = require('express');
var app = express();
import socketio = require('socket.io');
import crypto = require('crypto');
app.use(express.static(__dirname + '/../'));

var server = app.listen(3000, "127.0.0.1", function () {
  var host = server.address().address;
  var port = server.address().port;

  console.info('IDE server is listening at http://%s:%s', host, port);
});
var io = socketio.listen(server);

io.on('connection', function(socket) {
  var info = replication.registerSocket(socket);
  socket.on('getsession', function(sessionid, cb) {
    if (!(/^\w+$/.test(sessionid))) {
      var hash = crypto.createHash('sha256');
      hash.update(sessionid);
      sessionid = hash.digest('hex');
    }
    var session = new Session(sessionid);
    console.info("New session:" + sessionid);
    cb(replication.encode(info, session));
  });
});

app.get('/file/:path', function(req, res) {
  console.info("file requested", req.params.path);
  res.download(req.params.path);
});

BuildSystem.core.Async.run(null, (p) => { client.init(p); });<commit_msg>remove my personal provider that shouldn't have made it in git<commit_after>import BuildSystem = require('../../buildsystem/BuildSystem');
import Session = require('./Session');
import replication = require('./replication');
import express = require('express');
var app = express();
import socketio = require('socket.io');
import crypto = require('crypto');
app.use(express.static(__dirname + '/../'));

var server = app.listen(3000, "127.0.0.1", function () {
  var host = server.address().address;
  var port = server.address().port;

  console.info('IDE server is listening at http://%s:%s', host, port);
});
var io = socketio.listen(server);

io.on('connection', function(socket) {
  var info = replication.registerSocket(socket);
  socket.on('getsession', function(sessionid, cb) {
    if (!(/^\w+$/.test(sessionid))) {
      var hash = crypto.createHash('sha256');
      hash.update(sessionid);
      sessionid = hash.digest('hex');
    }
    var session = new Session(sessionid);
    console.info("New session:" + sessionid);
    cb(replication.encode(info, session));
  });
});

app.get('/file/:path', function(req, res) {
  console.info("file requested", req.params.path);
  res.download(req.params.path);
});

{'fraction_non_alphanumeric': 0.19257445940432477, 'fraction_numerical': 0.010607915136678907, 'mean_word_length': 4.461024498886414, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3053605', 'n_tokens_mistral': 755, 'n_tokens_neox': 731, 'n_words': 165}