<commit_before><hr>
<div class='row'>
<button id='refresh' class='btn btn-info'>
	<span class='glyphicon glyphicon-refresh' aria-hidden='true'></span>
	Refresh data set from server
</button>
<button id='use-file' class='btn btn-info'>
	<span class='glyphicon glyphicon-level-up' aria-hidden='true'></span>
	Load data set from file
</button>
<button id='reset-miners' class='btn btn-danger'>
	<span class='glyphicon glyphicon-hand-down' aria-hidden='true'></span>
	Reset miners
</button>
<button id='train-decision-tree' class='shortcut-train btn btn-success'>
    <span class='glyphicon glyphicon-wrench' aria-hidden='true'></span>
    Train classifier
</button>
<button id='train-outlier' class='shortcut-train btn btn-success'>
    <span class='glyphicon glyphicon-wrench' aria-hidden='true'></span>
    Train anomaly detector
</button>
<button id='build-models' class='shortcut-train btn btn-success'>
	<span class='glyphicon glyphicon-wrench' aria-hidden='true'></span>
	Build student models
</button>
<button id='help-settings' class='shortcut-train btn btn-success'>
	<span class='glyphicon glyphicon-question-sign' aria-hidden='true'><span>
	Help
</button>
</div>
<br>
<br>
<div class="form-group" id='train-set-div'>
    <label for="exampleInputFile">File input</label>
    <input type="file" id="train-set">
</div>
<div id='settings-div'>
<blockquote id='instructions'>
	<p>Steps: 1: Reduce time frame if needed. 2: Group data sets by attribute. 3: Normalize vectors by attribute.</p>
	<footer>The time frame reducing has to be the first step.</footer>
</blockquote>
<div id='time-div'>
	<input id='start-time' placeholder='start time filter'>
	<input id='end-time' placeholder='end time filter'>
</div>
<div class='well' id='group-by'></div>
<!--<div class='well' id='normalize'></div>-->
<div class='well' id='attributes'></div>
<div id='data-source-div' class='well'>
	<h4>Data source</h4>
	<br>
	<br>
	<div id='uui-wrap'>
		<img id='uui' class='data-source-img' src='images/uui.png'>
		<p id='uui-desc'>Unified User Interface</p>
	</div>
	<div id='brainstorm-wrap'>
		<img id='brainstorm' class='data-source-img' src='images/brainstorming.jpg'>
		<p id='brainstorm-desc'>Brainstorming</p>
	</div>
	<div id='print-wrap'>
		<img id='print' class='data-source-img' src='images/printer.jpg'>
		<p id='print-dec'>3D printing</p>
	</div>
	<div id='programming-wrap'>
		<img id='snap' class='data-source-img' src='images/programming.jpg'>
		<p id='programming-desc'>Programming with Snap</p>
	</div>
</div><!--
	<label id='data-source-label'>
		Data source:
    	<select id='data-source-select'>
        	<option value='uui'>UUI</option>
        	<option value='snap'>Programming</option>
        	<option value='print'>3D printing</option>
        	<option value='brainstorm'>Brainstorming</option>
    	</select>
    </label>-->
    <div id='data-set-table'></div>
    <canvas id='charts-radar'></canvas>
	<canvas id='charts-line'></canvas>
</div>

<script>

	$('#settings-div').hide();
	$('.shortcut-train').hide();
	$('#instructions').hide();
	
	$('#help-settings').on('click', function(event) {
	
		$('#instructions').toggle();
	
	});

	if (window && window.process && window.process.type) {
	
		$('#refresh').hide();
		$('#data-source-div').hide();

	}
	
	$('.data-source-img').on('click', function(event) {
	
		//console.log(event.target.id);
		
		var value = event.target.id;
		
		window.sessionStorage.setItem('dataSource', analysisObjects.dataFetchUrls[value]);
        window.sessionStorage.setItem('notifySource', analysisObjects.notifyUrls[value]);
         
        resetMiners();
         
       	analysisObjects.miners.resetDatasets();
         
        window.sessionStorage.setItem('lastId', 0);
         
        $('#refresh').click();
	
	});

	var trigger = false;
    /*
     $('#data-source-select').on('change', function(event) {
       
        var value = $(this).val();
         
        window.sessionStorage.setItem('dataSource', analysisObjects.dataFetchUrls[value]);
        window.sessionStorage.setItem('notifySource', analysisObjects.notifyUrls[value]);
         
        resetMiners();
         
       	analysisObjects.miners.resetDatasets();
         
        window.sessionStorage.setItem('lastId', 0);
         
        $('#refresh').click();
        
    });
	*/
	$('#train-set').on('change', function(event) {
	
		parseTrainSet(event);
		
		$('.shortcut-train').show();
	
	});
	
	$('#refresh').on('click', function(event) {
	
		showLoader();
	
		var lastId = window.sessionStorage.getItem('lastId') ? parseInt(window.sessionStorage.getItem('lastId')) + 1: 0;

		var url = window.sessionStorage.getItem('dataSource');	
        
		var http = new HTTP(url, 'POST');
		
		var data = 'sessionId=' + window.sessionStorage.getItem('sessionId') +
			'&lastId=' + lastId;
        
        //console.log(data);
		
		http.fetchDataSet(data, function(response) {
		
			var dataset = JSON.parse(response);
            
            //console.log(dataset);
			
			if (dataset.length > 0) {<commit_msg>changed the destinations of the apis<commit_after><hr>
<div class='row'>
<button id='refresh' class='btn btn-info'>
	<span class='glyphicon glyphicon-refresh' aria-hidden='true'></span>
	Refresh data set from server
</button>
<button id='use-file' class='btn btn-info'>
	<span class='glyphicon glyphicon-level-up' aria-hidden='true'></span>
	Load data set from file
</button>
<button id='reset-miners' class='btn btn-danger'>
	<span class='glyphicon glyphicon-hand-down' aria-hidden='true'></span>
	Reset miners
</button>
<button id='train-decision-tree' class='shortcut-train btn btn-success'>
    <span class='glyphicon glyphicon-wrench' aria-hidden='true'></span>
    Train classifier
</button>
<button id='train-outlier' class='shortcut-train btn btn-success'>
    <span class='glyphicon glyphicon-wrench' aria-hidden='true'></span>
    Train anomaly detector
</button>
<button id='build-models' class='shortcut-train btn btn-success'>
	<span class='glyphicon glyphicon-wrench' aria-hidden='true'></span>
	Build student models
</button>
<button id='help-settings' class='shortcut-train btn btn-success'>
	<span class='glyphicon glyphicon-question-sign' aria-hidden='true'><span>
	Help
</button>
</div>
<br>
<br>
<div class="form-group" id='train-set-div'>
    <label for="exampleInputFile">File input</label>
    <input type="file" id="train-set">
</div>
<div id='settings-div'>
<blockquote id='instructions'>
	<p>Steps: 1: Reduce time frame if needed. 2: Group data sets by attribute. 3: Normalize vectors by attribute.</p>
	<footer>The time frame reducing has to be the first step.</footer>
</blockquote>
<div id='time-div'>
	<input id='start-time' placeholder='start time filter'>
	<input id='end-time' placeholder='end time filter'>
</div>
<div class='well' id='group-by'></div>
<!--<div class='well' id='normalize'></div>-->
<div class='well' id='attributes'></div>
<div id='data-source-div' class='well'>
	<h4>Data source</h4>
	<br>
	<br>
	<div id='uui-wrap'>
		<img id='uui' class='data-source-img' src='images/uui.png'>
		<p id='uui-desc'>Unified User Interface</p>
	</div>
	<div id='brainstorm-wrap'>
		<img id='brainstorm' class='data-source-img' src='images/brainstorming.jpg'>
		<p id='brainstorm-desc'>Ideation</p>
	</div>
	<div id='print-wrap'>
		<img id='print' class='data-source-img' src='images/printer.jpg'>
		<p id='print-dec'>Search for ideas</p>
	</div>
	<div id='programming-wrap'>
		<img id='snap' class='data-source-img' src='images/programming.jpg'>
		<p id='programming-desc'>Programming</p>
	</div>
</div><!--
	<label id='data-source-label'>
		Data source:
    	<select id='data-source-select'>
        	<option value='uui'>UUI</option>
        	<option value='snap'>Programming</option>
        	<option value='print'>3D printing</option>
        	<option value='brainstorm'>Brainstorming</option>
    	</select>
    </label>-->
    <div id='data-set-table'></div>
    <canvas id='charts-radar'></canvas>
	<canvas id='charts-line'></canvas>
</div>

<script>

	$('#settings-div').hide();
	$('.shortcut-train').hide();
	$('#instructions').hide();
	
	$('#help-settings').on('click', function(event) {
	
		$('#instructions').toggle();
	
	});

	if (window && window.process && window.process.type) {
	
		$('#refresh').hide();
		$('#data-source-div').hide();

	}
	
	$('.data-source-img').on('click', function(event) {
	
		//console.log(event.target.id);
		
		var value = event.target.id;
		
		window.sessionStorage.setItem('dataSource', analysisObjects.dataFetchUrls[value]);
        window.sessionStorage.setItem('notifySource', analysisObjects.notifyUrls[value]);
         
        resetMiners();
         
       	analysisObjects.miners.resetDatasets();
         
        window.sessionStorage.setItem('lastId', 0);
         
        $('#refresh').click();
	
	});

	var trigger = false;
    /*
     $('#data-source-select').on('change', function(event) {
       
        var value = $(this).val();
         
        window.sessionStorage.setItem('dataSource', analysisObjects.dataFetchUrls[value]);
        window.sessionStorage.setItem('notifySource', analysisObjects.notifyUrls[value]);
         
        resetMiners();
         
       	analysisObjects.miners.resetDatasets();
         
        window.sessionStorage.setItem('lastId', 0);
         
        $('#refresh').click();
        
    });
	*/
	$('#train-set').on('change', function(event) {
	
		parseTrainSet(event);
		
		$('.shortcut-train').show();
	
	});
	
	$('#refresh').on('click', function(event) {
	
		showLoader();
	
		var lastId = window.sessionStorage.getItem('lastId') ? parseInt(window.sessionStorage.getItem('lastId')) + 1: 0;

		var url = window.sessionStorage.getItem('dataSource');	
        
		var http = new HTTP(url, 'POST');
		
		var data = 'sessionId=' + window.sessionStorage.getItem('sessionId') +
			'&lastId=' + lastId;
        
        //console.log(data);
		
		http.fetchDataSet(data, function(response) {
		
			//console.log(response);
		
			var dataset = JSON.parse(response);
			
			var temp = [];
			
			for (var i = 0; i < dataset.length; i++) {
			
				var obj = JSON.parse(dataset[i].data);
				
				temp.push(obj);
			
			}
			
			dataset = temp;
            
            console.log(dataset);
			
			if (dataset.length > 0) {
{'fraction_non_alphanumeric': 0.190879035394788, 'fraction_numerical': 0.002333722287047841, 'mean_word_length': 3.6942035600182566, 'pattern_counts': {'":': 0, '<': 210, '<?xml version=': 0, '>': 211, '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': '83213', 'n_tokens_mistral': 3597, 'n_tokens_neox': 3369, 'n_words': 648}