<commit_before>net = require('net');

server = net.createServer(function (socket) {

    console.log("Connection from: " + socket.remoteAddress);

    var testIndex = 0;

    var tests = ["1 + 1", "2 + 2", "3 - 4", "4 * 4", "9 / 0", "1000 / 2", "2 / 2", "432749865987634387946482736147362498712634 / 2"];
    var results = ["2" , "4", "-1" , "16", "ERROR", "500", "1", "ERROR"];

    var client_md5 = "";

    socket.on('data', function (data) {
       if(data.toString().startsWith("HELLO"))
       {
            var message = data.toString().substring(0, data.toString().indexOf("\n") + 1);
            console.log("HELLO message: "+ message);
            client_md5 = message.substring(5, data.toString().indexOf("\n"));
            console.log("Client MD5: " + client_md5);
            sendTest(socket, testIndex);

       }
       else if(data.toString().startsWith("RESULT"))
       {
            if(client_md5.length == 0)
            {
                socket.end();<commit_msg>Change server according to forum<commit_after>net = require('net');

server = net.createServer(function (socket) {

    console.log("Connection from: " + socket.remoteAddress);

    var testIndex = 0;

    var tests = ["1 + 1", 
		 "2 + 2",
		 "3 - 4",
		 "4 * 4",
		 "9 / 0", 
		 "1000 / 2",
		 "2 / 2",
		 "5 / 2",
		 "10 / 3",
		 "1255 / 1000"];
    var results = ["2.00", 
		   "4.00", 
		   "-1.00", 
  		   "16.00",
		   "ERROR",
		   "500.00",
		   "1.00",
		   "2.50",
		   "3.33",
		   "1.25"];

    var client_md5 = "";

    socket.on('data', function (data) {
       if(data.toString().startsWith("HELLO"))
       {
            var message = data.toString().substring(0, data.toString().indexOf("\n") + 1);
            console.log("HELLO message: "+ message);
            client_md5 = message.substring(5, data.toString().indexOf("\n"));
            console.log("Client MD5: " + client_md5);
            sendTest(socket, testIndex);

       }
       else if(data.toString().startsWith("RESULT"))
       {
            if(client_md5.length == 0)
            {
                socket.end();
{'fraction_non_alphanumeric': 0.1915506481036966, 'fraction_numerical': 0.071531445031205, 'mean_word_length': 2.0602055800293684, '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': '1278707', 'n_tokens_mistral': 805, 'n_tokens_neox': 682, 'n_words': 141}