<commit_before>/*
	p5.serialserver.js
*/

var wss = null;
var serialPort = null;
var clients = [];

var start = function () { 

	var SERVER_PORT = 8081;

	var WebSocketServer = require('ws').Server;
	wss = new WebSocketServer({port: SERVER_PORT});

	var SerialPort = require("serialport");
	//var serialPort = null;

	wss.on('connection', function(ws) {
		// We have a connection
		//console.log("New Connection");
		clients.push(ws);

		ws.sendit = function(toSend) {

			var dataToSend = JSON.stringify(toSend);
			console.log("sendit: " + dataToSend + " to " + clients.length + " clients");

			try {
				for (var c = 0; c < clients.length; c++) {
					clients[c].send(dataToSend);
				}
			} catch (e) {
				//console.log("Error Sending: " + e);
			}
		}<commit_msg>Commented out verbose console.log<commit_after>/*
	p5.serialserver.js
*/

var wss = null;
var serialPort = null;
var clients = [];

var start = function () { 

	var SERVER_PORT = 8081;

	var WebSocketServer = require('ws').Server;
	wss = new WebSocketServer({port: SERVER_PORT});

	var SerialPort = require("serialport");
	//var serialPort = null;

	wss.on('connection', function(ws) {
		// We have a connection
		//console.log("New Connection");
		clients.push(ws);

		ws.sendit = function(toSend) {

			var dataToSend = JSON.stringify(toSend);
			//console.log("sendit: " + dataToSend + " to " + clients.length + " clients");

			try {
				for (var c = 0; c < clients.length; c++) {
					clients[c].send(dataToSend);
				}
			} catch (e) {
				//console.log("Error Sending: " + e);
			}
		}
{'fraction_non_alphanumeric': 0.16709346991037133, 'fraction_numerical': 0.0076824583866837385, 'mean_word_length': 3.258855585831063, 'pattern_counts': {'":': 0, '<': 5, '<?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': '873052', 'n_tokens_mistral': 627, 'n_tokens_neox': 544, 'n_words': 127}