<commit_before><?php
require_once ('session.php');
require_once ('shared.php');


if(isset($_GET['ajaxBurn'])){
	$numToBurn = $_GET['ajaxBurn'];
	$burnt = 0;
	$burnErrors = array();
	
	global $mySforceConnection;
	
	for($b = 0; $b < $numToBurn; $b++){
		try{
			$mySforceConnection->getServerTimestamp();
			$burnt++;
		} catch (Exception $ex){
			$burnErrors[] = $ex->getMessage();
		}
	}
	
	if($burnt > 0){
		$successMessage = "Burnt " . $burnt . " API call";
		$successMessage .= $burnt > 1 ? 's' : '';
		show_info($successMessage);
	} else {
		$burnErrors = array_merge(array("No API calls were burnt."),$burnErrors);
	}
	
	if(is_array($burnErrors) && count($burnErrors)>0) {
		show_error($burnErrors);
	}	
		
	exit;
}

require_once ('header.php');
?>


<script type="text/javascript">
<!--
 function checkEnter(e){ //e is event object passed from function invocation
     var characterCode; //literal character code will be stored in this variable
     
     if(e && e.which){ //if which property of event object is supported (NN4)
         characterCode = e.which; //character code is contained in NN4's which property
     } else{
         characterCode = event.keyCode; //character code is contained in IE's keyCode property
     }
     
     if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
         return true;
     } else{
         return false;
     }
     
 }

 // Get the HTTP Object
 function getHTTPObject(){
	 if (window.ActiveXObject) {
		return new ActiveXObject("Microsoft.XMLHTTP");
	 } else if (window.XMLHttpRequest){ 
	 	return new XMLHttpRequest();
	 } else {
		 alert("Your browser does not support AJAX.");
		 return null;
	 }
 }

function ajaxBurn(){
	var ajax = getHTTPObject();

	if(ajax != null){
		ajax.open("GET", "<?php $_SERVER[PHP_SELF] ?>?ajaxBurn=" + document.getElementById('burnNumOfCalls').value, true);
		ajax.send(null);
		document.getElementById('burnResults').innerHTML = "";
		document.getElementById('burnStatus').innerHTML = "<img src='images/wait16trans.gif'/>&nbsp; Burning...";
		ajax.onreadystatechange = function handleAjaxBurnResponse(){
			if(ajax.readyState == 4){
				document.getElementById('burnStatus').innerHTML = "";
				document.getElementById('burnResults').innerHTML = ajax.responseText;
			}
		};
	} else {
		document.getElementById('burnStatus').innerHTML = "Unknown AJAX error";
	}
}


	
//-->
</script>

<?php 
if(isset($infos)) show_info($infos);
if(isset($errors)) show_error($errors); 
?>

<form name='afterburner'>
<table border='0'>
	
	
	<tr>
		<td align='right'><label for='burnNumOfCalls'>Number of Calls to Burn: &nbsp;</label></td>
		<td colspan='2'><input type='text' id='burnNumOfCalls' name='burnNumOfCalls' size='45' onKeyPress='if(checkEnter(event)){ajaxBurn(); return false;}'/></td>
	</tr><commit_msg>little more room for burn and trace							<commit_after><?php
require_once ('session.php');
require_once ('shared.php');


if(isset($_GET['ajaxBurn'])){
	$numToBurn = $_GET['ajaxBurn'];
	$burnt = 0;
	$burnErrors = array();
	
	global $mySforceConnection;
	
	for($b = 0; $b < $numToBurn; $b++){
		try{
			$mySforceConnection->getServerTimestamp();
			$burnt++;
		} catch (Exception $ex){
			$burnErrors[] = $ex->getMessage();
		}
	}
	
	if($burnt > 0){
		$successMessage = "Burnt " . $burnt . " API call";
		$successMessage .= $burnt > 1 ? 's' : '';
		show_info($successMessage);
	} else {
		$burnErrors = array_merge(array("No API calls were burnt."),$burnErrors);
	}
	
	if(is_array($burnErrors) && count($burnErrors)>0) {
		show_error($burnErrors);
	}	
		
	exit;
}

require_once ('header.php');
?>


<script type="text/javascript">
<!--
 function checkEnter(e){ //e is event object passed from function invocation
     var characterCode; //literal character code will be stored in this variable
     
     if(e && e.which){ //if which property of event object is supported (NN4)
         characterCode = e.which; //character code is contained in NN4's which property
     } else{
         characterCode = event.keyCode; //character code is contained in IE's keyCode property
     }
     
     if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
         return true;
     } else{
         return false;
     }
     
 }

 // Get the HTTP Object
 function getHTTPObject(){
	 if (window.ActiveXObject) {
		return new ActiveXObject("Microsoft.XMLHTTP");
	 } else if (window.XMLHttpRequest){ 
	 	return new XMLHttpRequest();
	 } else {
		 alert("Your browser does not support AJAX.");
		 return null;
	 }
 }

function ajaxBurn(){
	var ajax = getHTTPObject();

	if(ajax != null){
		ajax.open("GET", "<?php $_SERVER[PHP_SELF] ?>?ajaxBurn=" + document.getElementById('burnNumOfCalls').value, true);
		ajax.send(null);
		document.getElementById('burnResults').innerHTML = "";
		document.getElementById('burnStatus').innerHTML = "<img src='images/wait16trans.gif'/>&nbsp; Burning...";
		ajax.onreadystatechange = function handleAjaxBurnResponse(){
			if(ajax.readyState == 4){
				document.getElementById('burnStatus').innerHTML = "";
				document.getElementById('burnResults').innerHTML = ajax.responseText;
			}
		};
	} else {
		document.getElementById('burnStatus').innerHTML = "Unknown AJAX error";
	}
}


	
//-->
</script>

<?php 
if(isset($infos)) show_info($infos);
if(isset($errors)) show_error($errors); 
?>
<p/>
<form name='afterburner'>
<table border='0'>
	
	
	<tr>
		<td align='right'><label for='burnNumOfCalls'>Number of Calls to Burn: &nbsp;</label></td>
		<td colspan='2'><input type='text' id='burnNumOfCalls' name='burnNumOfCalls' size='45' onKeyPress='if(checkEnter(event)){ajaxBurn(); return false;}'/></td>
	</tr>
{'fraction_non_alphanumeric': 0.16675452468810403, 'fraction_numerical': 0.0063257775434897206, 'mean_word_length': 3.97117903930131, 'pattern_counts': {'":': 0, '<': 42, '<?xml version=': 0, '>': 50, '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': '189235', 'n_tokens_mistral': 1987, 'n_tokens_neox': 1790, 'n_words': 433}