<commit_before>/* global app:true, io:false */

var socket;
var myname;
var block_id;
var blockData;
var ledData;
var ledTime;
var imageData;
var imageTime;
var timeline;

(function() {
  'use strict';
  
  //var blockdata = [];
  //var qs = new Querystring();
  //var block_id = qs.get("myBlock");

  socket = io.connect();
  socket.on('connect', function(){
  	socket.emit('/replay/#join');
  });
  
  socket.on('/replay/#postdata', function(data){
  	blockData = [];
	ledData = [];
	ledTime = [];
	blockData.push(data[0]); // time
	blockData.push(data[1]); // owner
	blockData.push(data[2]); // experiment id
	blockData.push(data[3]); // pattern id
	
	// image dir = 172.16.17.32:3001/blockid/
	
	for (var i=0;i<data[4].length/2;i++)
	{
	  ledData.push(data[4][i*2]);
	  ledTime.push(Math.round(parseInt(data[4][i*2+1])/100)*100);
	}
	
	var br = document.createElement("br");
	var info_p=document.createElement("p");
	var info_node_0=document.createTextNode("Block ID: "+block_id+"<br>");
	var info_node_1=document.createTextNode("Block Start Time: "+data[0]+"<br>");
	var info_node_2=document.createTextNode("Owner : "+data[1]+"<br>");
	var info_node_3=document.createTextNode("Experiment : experiment id "+data[2]+"<br>");
	var info_node_4=document.createTextNode("Pattern : "+ (data[3] == 0 ? "Freeform Experiment" : "pattern id "+data[3])+"<br>");
	info_p.appendChild(info_node_0);
	info_p.appendChild(br);
	info_p.appendChild(info_node_1);
	info_p.appendChild(br);
	info_p.appendChild(info_node_2);
	info_p.appendChild(br);
	info_p.appendChild(info_node_3);
	info_p.appendChild(br);
	info_p.appendChild(info_node_4);

	var info_box_div = document.getElementById('info_box');
	info_box_div.appendChild(info_p);		
	
	console.log(ledData);
	console.log(ledData.length);<commit_msg>layout<commit_after>/* global app:true, io:false */

var socket;
var myname;
var block_id;
var blockData;
var ledData;
var ledTime;
var imageData;
var imageTime;
var timeline;

(function() {
  'use strict';
  
  //var blockdata = [];
  //var qs = new Querystring();
  //var block_id = qs.get("myBlock");

  socket = io.connect();
  socket.on('connect', function(){
  	socket.emit('/replay/#join');
  });
  
  socket.on('/replay/#postdata', function(data){
  	blockData = [];
	ledData = [];
	ledTime = [];
	blockData.push(data[0]); // time
	blockData.push(data[1]); // owner
	blockData.push(data[2]); // experiment id
	blockData.push(data[3]); // pattern id
	
	// image dir = 172.16.17.32:3001/blockid/
	
	for (var i=0;i<data[4].length/2;i++)
	{
	  ledData.push(data[4][i*2]);
	  ledTime.push(Math.round(parseInt(data[4][i*2+1])/100)*100);
	}
	
	var br = document.createElement("br");
	var info_p_0 = document.createElement("p");
	var info_node_0 = document.createTextNode("Block ID: "+block_id);
	var info_p_1 = document.createElement("p");
	var info_node_1 = document.createTextNode("Block Start Time: "+data[0]);
	var info_p_2 = document.createElement("p");
	var info_node_2 = document.createTextNode("Owner : "+data[1]);
	var info_p_3 = document.createElement("p");
	var info_node_3 = document.createTextNode("Experiment : experiment id "+data[2]);
	var info_p_4 = document.createElement("p");
	var info_node_4 = document.createTextNode("Pattern : "+ (data[3] == 0 ? "Freeform Experiment" : "pattern id "+data[3]));
	info_p_0.appendChild(info_node_0);
	info_p_1.appendChild(info_node_1);
	info_p_2.appendChild(info_node_2);
	info_p_3.appendChild(info_node_3);
	info_p_4.appendChild(info_node_4);

	var info_box_div = document.getElementById('info_box');
	info_box_div.appendChild(info_p_0);
	info_box_div.appendChild(info_p_1);
	info_box_div.appendChild(info_p_2);
	info_box_div.appendChild(info_p_3);
	info_box_div.appendChild(info_p_4);
	
	console.log(ledData);
	console.log(ledData.length);
{'fraction_non_alphanumeric': 0.1790058170280275, 'fraction_numerical': 0.028820729772607086, 'mean_word_length': 5.379426644182125, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '1064672', 'n_tokens_mistral': 1473, 'n_tokens_neox': 1415, 'n_words': 233}