<commit_before><?php

require("include/mysql_connect.php");
require("include/common_sql.php");

?>
<html>
  <head>
    <title>Is the signing server down?</title>
    <meta http-equiv="Refresh" content="600" />
    <style>
      a {text-decoration:none}
    </style>
  </head>
  <body>
    <?php show_log('RRT', 'RIM Runtime') ?><br />
    <hr>
    <?php show_log('RBB', 'RIM Blackberry Apps') ?><br />
    <hr>
    <?php show_log('RCR', 'RIM Crypto') ?><br />
    <hr>
    <?php show_log('RCC', 'Crypto Certicom') ?><br />
    <hr>
    <?php show_log('PBK', 'RDK/PBDT - BlackBerry 10') ?><br />
    <hr>
    Having trouble with code signing? See <a href="https://developer.blackberry.com/CodeSigningHelp">here</a> for common issues and <a href="https://developer.blackberry.com/CodeSigningHelp">Code Signing Support</a>.<br />
    Developer support( <a href="http://supportforums.blackberry.com/t5/Application-Platforms/ct-p/app_plat"><b>Forums</b></a> / <a href="http://twitter.com/BlackBerryDev"><b>@BlackBerryDev</b></a> / <b>1-877-255-2377</b> )<br />
    See <a href="https://www.blackberry.com/SignedKeys">here</a> for more information about BlackBerry <a href="https://www.blackberry.com/SignedKeys">Code Signing Keys</a>.
    <hr>
    <a href="http://twitter.com/SigningServer" title="@SigningServer"><img src="twitter_30.png"></a> <a href="https://github.com/hardisonbrewing/signingserver-com" title="Source on GitHub"><img src="github_30.png"></a> <a href="stats.sql" title="Download Database"><img src="sql_30.png"></a>
  </body>
</html>
<?php

function show_log($key, $name)
{
	$pbk = strcasecmp($key, 'pbk') == 0;
	
	$green = '#03C03C';
	$red = '#C23B22';
	$blue = '#009ACD';
	
	if ($pbk) {
		echo "<font size=\"5\"><b>$name</b></font> <font size=\"3\">(<font size=\"3\" color=\"$red\"><b>BETA</b></font>)</font>";
	} else {
		echo "<font size=\"5\"><b>$key - $name</b></font>";
	}
	
	$last_checkin = last_checkin($key);
	
	if (!$last_checkin['valid']) {
		echo "<br /><font size=\"6\" color=\"$red\"><b>0</b></font><font size=\"6\"> check-ins</font>";
		return;
	}
	
	echo "<font size=\"4\">";
	
	$results = results($key);
	
	if ($last_checkin['failures'] == 0)
	{
		$uptime = last_failure($key);
		if (!$uptime) $uptime = first_success($key);
		if ($uptime) {
			echo "<br />uptime( ";
			echo get_timestamp($uptime);
			echo " )";
		}
	}
	else
	{
		$downtime = last_success($key);
		if (!$downtime) $downtime = first_failure($key);
		if ($downtime) {
			echo "<br />downtime( ";
			echo "<font color=\"$red\">";
			echo get_timestamp($downtime);
			echo "</font> )";
		}
	}
	
	$success_day = $results['success_day'];
	$success_year = $results['success_year'];
	$success_year_start = $results['success_year_start'];
	
	echo "<br />health( ";
	$health_color = $success_day > 95 ? $green : $red;
	echo "<font color=\"$health_color\"><b>$success_day%</b></font> 1d / ";
	$health_color = $success_year > 95 ? $green : $red;
	echo "<font color=\"$health_color\"><b>$success_year%</b></font> ".$success_year_start." )";
	
	$overdue = $last_checkin['time_since'] >= 60 * 10;	
	<commit_msg>Update index.php<commit_after><?php

require("include/mysql_connect.php");
require("include/common_sql.php");

?>
<html>
  <head>
    <title>Is the signing server down?</title>
    <meta http-equiv="Refresh" content="600" />
    <style>
      a {text-decoration:none}
    </style>
  </head>
  <body>
    <?php show_log('RRT', 'RIM Runtime') ?><br />
    <hr>
    <?php show_log('RBB', 'RIM Blackberry Apps') ?><br />
    <hr>
    <?php show_log('RCR', 'RIM Crypto') ?><br />
    <hr>
    <?php show_log('RCC', 'Crypto Certicom') ?><br />
    <hr>
    <?php show_log('PBK', 'RDK/PBDT - BlackBerry 10') ?><br />
    <hr>
    Having trouble with code signing? See <a href="https://developer.blackberry.com/CodeSigningHelp">here</a> for common issues and <a href="https://developer.blackberry.com/CodeSigningHelp">Code Signing Support</a>.<br />
    Developer support( <a href="http://supportforums.blackberry.com/t5/Application-Platforms/ct-p/app_plat"><b>Forums</b></a> / <a href="http://twitter.com/BlackBerryDev"><b>@BlackBerryDev</b></a> / <b>1-877-255-2377</b> )<br />
    See <a href="https://www.blackberry.com/SignedKeys">here</a> for more information about BlackBerry <a href="https://www.blackberry.com/SignedKeys">Code Signing Keys</a>.
    <hr>
    <a href="http://twitter.com/SigningServer" title="@SigningServer"><img src="twitter_30.png"></a> <a href="https://github.com/martinmreed/signingserver-com" title="Source on GitHub"><img src="github_30.png"></a> <a href="stats.sql" title="Download Database"><img src="sql_30.png"></a>
  </body>
</html>
<?php

function show_log($key, $name)
{
	$pbk = strcasecmp($key, 'pbk') == 0;
	
	$green = '#03C03C';
	$red = '#C23B22';
	$blue = '#009ACD';
	
        if ($pbk) {
                echo "<font size=\"5\"><b>$name</b></font> <font size=\"3\">(<font size=\"3\" color=\"$red\"><b>beta</b></font> / non-bbid)</font>";
        } else {
                echo "<font size=\"5\"><b>$key - $name</b></font> <font size=\"3\">(non-bbid)</font>";
        }

        $last_checkin = last_checkin($key);
	
	if (!$last_checkin['valid']) {
		echo "<br /><font size=\"6\" color=\"$red\"><b>0</b></font><font size=\"6\"> check-ins</font>";
		return;
	}
	
	echo "<font size=\"4\">";
	
	$results = results($key);
        $success_year = $results['success_year'];
        $success_year_start = $results['success_year_start'];
	
	if ($last_checkin['failures'] == 0)
	{
		$uptime = last_failure($key);
		if (!$uptime) $uptime = first_success($key);
		if ($uptime) {
			echo "<br />uptime( ";
			echo get_timestamp($uptime);
		}
	}
	else
	{
		$downtime = last_success($key);
		if (!$downtime) $downtime = first_failure($key);
		if ($downtime) {
			echo "<br />downtime( ";
			echo "<font color=\"$red\">";
			echo get_timestamp($downtime);
			echo "</font>";
		}
	}
	
	if (!$uptime && !$downtime)
	{
		echo "<br />uptime( ";
	}
	else
	{
		echo " / ";
	}
	
	$health_color = $success_year > 95 ? $green : $red;
	echo "<font color=\"$health_color\"><b>$success_year%</b></font> ".$success_year_start." )";
	
	$overdue = $last_checkin['time_since'] >= 60 * 10;	
	
{'fraction_non_alphanumeric': 0.23270846800258566, 'fraction_numerical': 0.01680672268907563, 'mean_word_length': 3.8427230046948355, 'pattern_counts': {'":': 0, '<': 187, '<?xml version=': 0, '>': 190, 'https://': 10, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2577008', 'n_tokens_mistral': 2504, 'n_tokens_neox': 2311, 'n_words': 431}