<commit_before><?php
// Connect to local MySQL database
$mysqli = new mysqli($config['mysql']['host'], $config['mysql']['user'], $config['mysql']['password'], $config['mysql']['database']);
if ($mysqli->connect_errno) {
	echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
	die;
}
if ($debug) {
	echo $mysqli->host_info . "\n";
	echo 'Connected to MySQL'. "\n";
}

// We'll make sure all the tables we are expecting exist
// Build the devices table schema on the fly
$sql = 'CREATE TABLE IF NOT EXISTS devices ('
. ' mac_id varchar(32) NOT NULL, '
. ' mac_root varchar(32) NOT NULL, '
. ' class varchar(32) NOT NULL, '
. ' name varchar(512) NOT NULL, '
. ' type varchar(32) NOT NULL, '
. ' PRIMARY KEY (mac_id), '
. ' INDEX(mac_root));';
if ($debug) {echo $sql . "\n";}
if (!$mysqli->query($sql)) {die("Table creation failed: (" . $mysqli->errno . ") " . $mysqli->error);}
if ($debug) {echo 'devices table Exists'. "\n";}

// Build the class_description table schema on the fly
// stores the description of what a class ID stands for in english
$sql = 'CREATE TABLE IF NOT EXISTS class_description ('
. ' class varchar(32) NOT NULL, '
. ' short_major_type varchar(64) NOT NULL, '
. ' major_type varchar(128) NOT NULL, '
. ' service_class varchar(1024) NOT NULL, '
. ' device_type varchar(1014) NOT NULL, '
. ' PRIMARY KEY (class);';
if ($debug) {echo $sql . "\n";}
if (!$mysqli->query($sql)) {die("Table creation failed: (" . $mysqli->errno . ") " . $mysqli->error);}
if ($debug) {echo 'class_description table Exists'. "\n";}

// Build the device_scans table schema on the fly
$sql = 'CREATE TABLE IF NOT EXISTS device_scans ('
. ' mac_id varchar(32) NOT NULL, '
. ' collector_id varchar(32) NOT NULL, '
. ' seen int NOT NULL, '
. ' PRIMARY KEY (mac_id, device_id, seen), '
. ' INDEX(seen), INDEX(device_id));';
if ($debug) {echo $sql . "\n";}<commit_msg>Update my_sql.php<commit_after><?php
// Connect to local MySQL database
$mysqli = new mysqli($config['mysql']['host'], $config['mysql']['user'], $config['mysql']['password'], $config['mysql']['database']);
if ($mysqli->connect_errno) {
	echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
	die;
}
if ($debug) {
	echo $mysqli->host_info . "\n";
	echo 'Connected to MySQL'. "\n";
}

// We'll make sure all the tables we are expecting exist
// Build the devices table schema on the fly
$sql = 'CREATE TABLE IF NOT EXISTS devices ('
. ' mac_id varchar(32) NOT NULL, '
. ' mac_root varchar(32) NOT NULL, '
. ' class varchar(32) NOT NULL, '
. ' name varchar(512) NOT NULL, '
. ' type varchar(32) NOT NULL, '
. ' PRIMARY KEY (mac_id), '
. ' INDEX(mac_root));';
if ($debug) {echo $sql . "\n";}
if (!$mysqli->query($sql)) {die("Table creation failed: (" . $mysqli->errno . ") " . $mysqli->error);}
if ($debug) {echo 'devices table Exists'. "\n";}

// Build the class_description table schema on the fly
// stores the description of what a class ID stands for in english
$sql = 'CREATE TABLE IF NOT EXISTS class_description ('
. ' class varchar(32) NOT NULL, '
. ' short_major_type varchar(64) NOT NULL, '
. ' major_type varchar(128) NOT NULL, '
. ' service_class varchar(1024) NOT NULL, '
. ' device_type varchar(1014) NOT NULL, '
. ' PRIMARY KEY (class));';
if ($debug) {echo $sql . "\n";}
if (!$mysqli->query($sql)) {die("Table creation failed: (" . $mysqli->errno . ") " . $mysqli->error);}
if ($debug) {echo 'class_description table Exists'. "\n";}

// Build the device_scans table schema on the fly
$sql = 'CREATE TABLE IF NOT EXISTS device_scans ('
. ' mac_id varchar(32) NOT NULL, '
. ' collector_id varchar(32) NOT NULL, '
. ' seen int NOT NULL, '
. ' PRIMARY KEY (mac_id, device_id, seen), '
. ' INDEX(seen), INDEX(device_id));';
if ($debug) {echo $sql . "\n";}
{'fraction_non_alphanumeric': 0.1872206153037076, 'fraction_numerical': 0.015777018143570864, 'mean_word_length': 4.147496617050067, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '5646401', 'n_tokens_mistral': 1372, 'n_tokens_neox': 1292, 'n_words': 418}