<commit_before><?php 
// Detect if request was sent from JQuery or not
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
		
	include dirname(__FILE__).'/Configs/config.php';
	include CRYPTO_TRADER_HUB_ROOT.DIRECTORY_SEPARATOR.'autoload.php';
	\CryptoTraderHub\Core\Database::initialize(DATABASE_INI);
	$timestamp = $_GET['timestamp'];
	$result  = \CryptoTraderHub\Core\Database::getArray("SELECT timestamp, price, volume FROM ".\CryptoTraderHub\Core\Database::getDB().".bitstamp_order_book WHERE `timestamp` = (SELECT `timestamp` FROM ".\CryptoTraderHub\Core\Database::getDB().".bitstamp_order_book WHERE `timestamp` > '{$timestamp}' LIMIT 1) AND volume < 1000");
	$response = Array('timestamp' => $result[0]['timestamp'], 'data_set' => $result);
	echo json_encode($response);
	exit();
}
?>

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		
		<title>Bitstamp Order Book Visualizer</title>
		
		<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
		<!--[if lt IE 9]>
			<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
		<![endif]-->
		
		<!--[if gte IE 9]>
		  <style type="text/css">
		    .gradient {
		       filter: none;
		    }
		  </style>
		<![endif]-->		
		
		<style></style>
		
		<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>	
		<script src="https://cdnjs.cloudflare.com/ajax/libs/canvasjs/1.7.0/jquery.canvasjs.min.js"></script>	
		<script type="text/javascript">
			
			window.onload = function () {

		      	var dps = [];   //dataPoints. 
		
		      	var chart = new CanvasJS.Chart("chartContainer",{
		      		title :{
		      			text: "Order Book Data"
		      		},
		      		axisX: {						
		      			title: "Price"
		      		},
		      		axisY: {						
		      			title: "Volume"
		      		},
		      		data: [{
		      			type: "scatter",
		      			dataPoints : dps
		      		}]
		      	});
		
		      	chart.render();
		      	var xVal = dps.length + 1;
		      	var yVal = 15;	
		      	var updateInterval = 1000;
		      	var timestamp = "1977-01-01 00:00:00";
		
		      	var updateChart = function () {	      	
		      		
		      		$.ajax({
					  	url: "/",
					  	context: document.body,
					  	dataType: 'json',
					  	data: {'timestamp':timestamp}
					}).done(function(data) {
						timestamp = data.timestamp;
						dps.length = 0;
						$.each(data.data_set, function( index, value ) {
						  	dps.push({x:parseFloat(value.price),y:parseFloat(value.volume)});
						});					
			      		chart.render();
					});		      	
		      				
				};

				setInterval(function(){updateChart()}, updateInterval); 
			}		
		</script>

	</head>
	<body>	
		
		<div id="chartContainer" style="height: 850px; width:100%;"></div>
		
	</body>
</html>
<commit_msg>Formatting.<commit_after><?php 
// Detect if request was sent from JQuery or not
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
		
	include dirname(__FILE__).'/Configs/config.php';
	include CRYPTO_TRADER_HUB_ROOT.DIRECTORY_SEPARATOR.'autoload.php';
	\CryptoTraderHub\Core\Database::initialize(DATABASE_INI);
	$timestamp = $_GET['timestamp'];
	$result  = \CryptoTraderHub\Core\Database::getArray("SELECT timestamp, price, volume FROM ".\CryptoTraderHub\Core\Database::getDB().".bitstamp_order_book WHERE `timestamp` = (SELECT `timestamp` FROM ".\CryptoTraderHub\Core\Database::getDB().".bitstamp_order_book WHERE `timestamp` > '{$timestamp}' LIMIT 1) AND volume < 1000");
	$response = Array('timestamp' => $result[0]['timestamp'], 'data_set' => $result);
	echo json_encode($response);
	exit();
}
?>

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		
		<title>Bitstamp Order Book Visualizer</title>
		
		<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
		<!--[if lt IE 9]>
			<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
		<![endif]-->
		
		<!--[if gte IE 9]>
		  <style type="text/css">
		    .gradient {
		       filter: none;
		    }
		  </style>
		<![endif]-->		
		
		<style></style>
		
		<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>	
		<script src="https://cdnjs.cloudflare.com/ajax/libs/canvasjs/1.7.0/jquery.canvasjs.min.js"></script>	
		<script type="text/javascript">
			
			window.onload = function () {

		      	var dps = [];   //dataPoints. 
		
		      	var chart = new CanvasJS.Chart("chartContainer",{
		      		title :{
		      			text: "Order Book Data"
		      		},
		      		axisX: {						
		      			title: "Price"
		      		},
		      		axisY: {						
		      			title: "Volume"
		      		},
		      		data: [{
		      			type: "scatter",
		      			dataPoints : dps
		      		}]
		      	});
		
		      	chart.render();
		      	var xVal = dps.length + 1;
		      	var yVal = 15;	
		      	var updateInterval = 1000;
		      	var timestamp = "1977-01-01 00:00:00";
		
		      	var updateChart = function () {	      	
		      		
		      		$.ajax({
					  	url: "/",
					  	context: document.body,
					  	dataType: 'json',
					  	data: {'timestamp':timestamp}
					}).done(function(data) {
						timestamp = data.timestamp;
						dps.length = 0;
						$.each(data.data_set, function( index, value ) {
						  	dps.push({x:parseFloat(value.price),y:parseFloat(value.volume)});
						});					
			      		chart.render();
					});		      	
		      				
				};

				setInterval(function(){updateChart()}, updateInterval); 
			}		
		</script>

	</head>
	<body>			
		<div id="chartContainer" style="height: 850px; width:100%;"></div>		
	</body>
</html>

{'fraction_non_alphanumeric': 0.16357706831445246, 'fraction_numerical': 0.01682114658427738, 'mean_word_length': 2.1193790149892933, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 69, 'https://': 4, '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': '9467', 'n_tokens_mistral': 2481, 'n_tokens_neox': 1945, 'n_words': 334}