<commit_before><?php
header('Content-Type: application/json');
$con=mysqli_connect("localhost","root","raspberry","weather");
$column_name = $_GET["col"];
$time_from = $_GET["from"];
$time_to = $_GET["to"];

$select_template = "SELECT %s, UNIX_TIMESTAMP(CREATED) as UNIX_TIME FROM WEATHER_MEASUREMENT WHERE CREATED >= FROM_UNIXTIME(%s) AND CREATED <= FROM_UNIXTIME(%s);";
$select_query = sprintf($select_template, $column_name, $time_from, $time_to);
// Check connection
if (mysqli_connect_errno()) {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

$result = mysqli_query($con, $select_query);

$rows = array();

while($row = mysqli_fetch_array($result)) {
	$time_unix = floatval($row['UNIX_TIME']) * 1000; //flot needs it in milliseconds
	$rows[] = array( $time_unix, floatval($row[$column_name]) );
}

echo json_encode($rows);

mysqli_close($con);
?><commit_msg>tidy up<commit_after><?php
header('Content-Type: application/json');
$con=mysqli_connect("localhost","root","raspberry","weather");
$column_name = $_GET["col"];
$time_from = $_GET["from"];
$time_to = $_GET["to"];

$select_template = "SELECT %s, UNIX_TIMESTAMP(CREATED) as UNIX_TIME FROM WEATHER_MEASUREMENT WHERE CREATED >= FROM_UNIXTIME(%s) AND CREATED <= FROM_UNIXTIME(%s);";
$select_query = sprintf($select_template, $column_name, $time_from, $time_to);

// Check connection
if (mysqli_connect_errno()) {
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

$result = mysqli_query($con, $select_query);

$rows = array();

while($row = mysqli_fetch_array($result)) {
    $time_unix = floatval($row['UNIX_TIME']) * 1000; //flot needs it in milliseconds
    $rows[] = array( $time_unix, floatval($row[$column_name]) );
}

echo json_encode($rows);

mysqli_close($con);
?>
{'fraction_non_alphanumeric': 0.18089315997738836, 'fraction_numerical': 0.0045223289994347085, 'mean_word_length': 7.388625592417061, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1125466', 'n_tokens_mistral': 654, 'n_tokens_neox': 631, 'n_words': 125}