<commit_before><html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport">
		   <script type="text/javascript" src="/js/socket.io.js"></script>
		   <script type="text/javascript" src="/js/virtualjoystick.js"></script>
  
		<style>
		body {
			overflow	: hidden;
			padding		: 0;
			margin		: 0;
			background-color: #BBB;
		}
		#info {
			position	: absolute;
			top		: 0px;
			width		: 100%;
			padding		: 5px;
			text-align	: center;
		}
		#info a {
			color		: #66F;
			text-decoration	: none;
		}
		#info a:hover {
			text-decoration	: underline;
		}
		#container {
			width		: 250px;
			height		: 250px;
			overflow	: hidden;
			padding		: 5px;
			margin		: 5px;
			border-width: 2px;
			border-style: dashed; 
			-webkit-user-select	: none;
			-moz-user-select	: none;
		}
		</style>
	</head>
	<body>
		<div id="container" onmouseup="mouseUp()" onmousedown="mouseDown()"></div>
		<div id="info">
			
			<span id="result"></span>
		</div> 

		<script>
			var prevX, prevY;
				var joystick	= new VirtualJoystick({
				container	: document.getElementById('container'),
				mouseSupport	: true,
			});
			var socket = io();
			console.log("touchscreen is", VirtualJoystick.touchScreenAvailable() ? "available" : "not available");
	
			
			
			
			setInterval(function(){
				if (joystick.deltaX() !=0 || joystick.deltaY() !=0){
					socket.emit('move', 100 * joystick.deltaX()/250, - 100 * joystick.deltaY()/250);				
				}
				var outputEl	= document.getElementById('result');
				outputEl.innerHTML	= '<b>Result:</b> '
					+ ' dx:'+ 100 * joystick.deltaX()/250
					+ ' dy:'+  100* joystick.deltaY()/250
					+ (joystick.right()	? ' right'	: '')
					+ (joystick.up()	? ' up'		: '')
					+ (joystick.left()	? ' left'	: '')
					+ (joystick.down()	? ' down' 	: '')	
			}, 1/30 * 1000);
			
	
			function mouseDown() {
				document.getElementById("container").style.color = "red";
				
			}
		
			function mouseUp() {
			    document.getElementById("container").style.color = "black";
			    socket.emit('move', 0, 0);			
			}
		
		</script>
	</body>
</html><commit_msg>Joystick now works incrementally<commit_after><html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport">
		   <script type="text/javascript" src="/js/socket.io.js"></script>
		   <script type="text/javascript" src="/js/virtualjoystick.js"></script>

		<style>
		body {
			overflow	: hidden;
			padding		: 0;
			margin		: 0;
			background-color: #BBB;
		}
		#info {
			position	: absolute;
			top		: 0px;
			width		: 100%;
			padding		: 5px;
			text-align	: center;
		}
		#info a {
			color		: #66F;
			text-decoration	: none;
		}
		#info a:hover {
			text-decoration	: underline;
		}
		#container {
			width		: 250px;
			height		: 250px;
			overflow	: hidden;
			padding		: 5px;
			margin		: 5px;
			border-width: 2px;
			border-style: dashed;
			-webkit-user-select	: none;
			-moz-user-select	: none;
		}
		</style>
	</head>
	<body>
		<div id="container" onmouseup="mouseUp()" onmousedown="mouseDown()"></div>
		<div id="info">

			<span id="result"></span>
		</div>

		<script>
				var dX = 0, dY = 0;
				var maxX = 100; maxY = 100;
				var prevX, prevY;
				var gain = 0.1;
				var joystick	= new VirtualJoystick({
				container	: document.getElementById('container'),
				mouseSupport	: true,
			});
			var socket = io();
			console.log("touchscreen is", VirtualJoystick.touchScreenAvailable() ? "available" : "not available");

			setInterval(function(){
				if (joystick.deltaX() !=0 || joystick.deltaY() !=0){
					dX = dX + gain * joystick.deltaX();
					dY = dY + gain * joystick.deltaY();

					if (dX >= maxX) {
						dX = maxX;
					}
					if ( dX <= -maxX) {
						dX = -maxX;
					}

					if (dY >= maxY) {
						dY = maxY;
					}
					if (dY <= -maxY) {
						dY = -maxY;
					}

					socket.emit('move',dX, dY);
				}
				var outputEl	= document.getElementById('result');
				outputEl.innerHTML	= '<b>Result:</b> '
					+ ' dx:'+ parseFloat(Math.round(dX * 100) / 100).toFixed(2)
					+ ' dy:'+ parseFloat(Math.round(dY * 100) / 100).toFixed(2)
					+ (joystick.right()	? ' right'	: '')
					+ (joystick.up()	? ' up'		: '')
					+ (joystick.left()	? ' left'	: '')
					+ (joystick.down()	? ' down' 	: '')
			}, 1/30 * 1000);


			function mouseDown() {
				document.getElementById("container").style.color = "red";

			}

			function mouseUp() {
			    document.getElementById("container").style.color = "black";
			    socket.emit('move', 0, 0);
			}

		</script>
	</body>
</html>
{'fraction_non_alphanumeric': 0.18327759197324414, 'fraction_numerical': 0.024080267558528427, 'mean_word_length': 2.5518606492478226, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 53, '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': '4195398', 'n_tokens_mistral': 2199, 'n_tokens_neox': 1666, 'n_words': 324}