<commit_before>/*
======================
JavaScript for AJAX request.
Gets and handles JSON data from the server.


Virtuaaliluonto 3.11.2017
======================
*/


// Points to a table class in HTML
var dataContainer = document.getElementById("datatable");

// Request & receive JSON Data
var pageRequest = new XMLHttpRequest();
pageRequest.open('GET', 'sensor_data.json');
pageRequest.onload = function() {
	
	// Save JSON data to a variable
	var mySensorData = JSON.parse(pageRequest.responseText);
	// Call the renderTest function and pass it to mySensorData variable
	renderData(mySensorData);
};

// Send the request
pageRequest.send();


// Add HTML to the page. Array of objects is accessed with "data".
function renderData(data) {
	
	var htmlString = "";


	if (data.length > 0) {

		for (i = 0; i < data.length; i++) {
		<commit_msg>Update main.js<commit_after>/*
======================
JavaScript for AJAX request.
Gets and handles JSON data from the server.


Virtuaaliluonto 3.11.2017
======================
*/


// Points to a table class in HTML
var dataContainer = document.getElementById("datatable");

// Request & receive JSON Data
var pageRequest = new XMLHttpRequest();
pageRequest.open('GET', 'sensor_data.json');
pageRequest.onload = function() {
	
	// Save JSON data to a variable
	var mySensorData = JSON.parse(pageRequest.responseText);
	// Call the renderTest function and pass it to mySensorData variable
	renderData(mySensorData);
};

// Send the request

/*
function proxy()
{
  pageRequest.send();
}

setInterval( proxy, 10000 ); // last arg is in milliseconds


*/


pageRequest.send();


// Add HTML to the page. Array of objects is accessed with "data".
function renderData(data) {
	
	var htmlString = "";


	if (data.length > 0) {

		for (i = 0; i < data.length; i++) {
		
{'fraction_non_alphanumeric': 0.15949227373068434, 'fraction_numerical': 0.012693156732891833, 'mean_word_length': 4.022160664819944, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '738714', 'n_tokens_mistral': 579, 'n_tokens_neox': 525, 'n_words': 184}