<commit_before><?php
ini_set('date.timezone', 'America/Denver');
require('../vendor/autoload.php');

function getData()
{
    $url = 'https://onedrive.live.com/download.aspx?cid=fa17e0833ee4a1bf&id=documents&resid=FA17E0833EE4A1BF%212406&authkey=!<KEY>';
    //$url = '../attendingDisc.xlsx';
    $data = file_get_contents($url);
    $dir = sys_get_temp_dir();
    $inputFileName = $dir.'/tmp.xls';
    file_put_contents($inputFileName, $data);
    $objPHPExcel = PHPExcel_IOFactory::load($inputFileName);

    $sheetData = $objPHPExcel->getActiveSheet()->toArray(null, true, true, true);
    $stats['accepted'] = $sheetData[2]['B'];
    $stats['last_update'] = date('M jS, g:ia', strtotime($sheetData[2]['C']));
    $stats['last_refresh'] = date('M jS, g:ia');
    $stats['maybe'] = $sheetData[3]['B'];
    $stats['declined'] = $sheetData[4]['B'];
    $stats['pending'] = $sheetData[5]['B'];
    $stats['people']['accepted'] = array();
    $stats['people']['maybe'] = array();
    $stats['people']['declined'] = array();
    for ($x = 8; $x <= count($sheetData); $x++) {
        if (!empty($sheetData[$x]['A'])) {
            $stats['people']['accepted'][] = $sheetData[$x]['A'];
        }
        if (!empty($sheetData[$x]['B'])) {
            $stats['people']['maybe'][] = $sheetData[$x]['B'];
        }
        if (!empty($sheetData[$x]['C'])) {
            $stats['people']['declined'][] = $sheetData[$x]['C'];
        }
    }
    $stats['people']['total'] = max(
        count($stats['people']['accepted']),
        count($stats['people']['maybe']),
        count($stats['people']['declined'])
    );
    return json_encode($stats);
}
$app = new Silex\Application();
$app['debug'] = true;

// Register the monolog logging service
$app->register(new Silex\Provider\MonologServiceProvider(), array(
  'monolog.logfile' => 'php://stderr',
));

// Our web handlers

$app->get('/ultimate', function () use ($app) {
    $app['monolog']->addDebug('logging output.');
    $html =<<<HTML
<html>
  <head>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <style>
    #hor-minimalist-a {
        font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
        font-size: 12px;
        background: #fff;
        width: 400px;
        padding: 3px;
        border-collapse: collapse;
        text-align: left;
        margin: 20px;
    }
    body {
        font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
        font-size: 12px;
    }
    </style>
    <script type="text/javascript">
        google.load("visualization", "1", {packages:["gauge"]});
        function drawChart(accepted) {

            var data = google.visualization.arrayToDataTable([
                ['Label', 'Value'],
                ['Accepted', accepted]
            ]);<commit_msg>more testing<commit_after><?php
ini_set('date.timezone', 'America/Denver');
require('../vendor/autoload.php');

function getData()
{
    $url = 'https://onedrive.live.com/download.aspx?cid=fa17e0833ee4a1bf&id=documents&resid=FA17E0833EE4A1BF%212406&authkey=!<KEY>';
    //$url = '../attendingDisc.xlsx';
    $data = file_get_contents($url);
    $dir = sys_get_temp_dir();
    $inputFileName = $dir.'/tmp.xls';
    file_put_contents($inputFileName, $data);
    $objPHPExcel = PHPExcel_IOFactory::load($inputFileName);

    $sheetData = $objPHPExcel->getActiveSheet()->toArray(null, true, true, true);
    $stats['accepted'] = $sheetData[2]['B'];
    $stats['last_update'] = date('M jS, g:ia', strtotime($sheetData[2]['C']));
    $stats['last_refresh'] = date('M jS, g:ia');
    $stats['maybe'] = $sheetData[3]['B'];
    $stats['declined'] = $sheetData[4]['B'];
    $stats['pending'] = $sheetData[5]['B'];
    $stats['people']['accepted'] = array();
    $stats['people']['maybe'] = array();
    $stats['people']['declined'] = array();
    for ($x = 8; $x <= count($sheetData); $x++) {
        if (!empty($sheetData[$x]['A'])) {
            $stats['people']['accepted'][] = $sheetData[$x]['A'];
        }
        if (!empty($sheetData[$x]['B'])) {
            $stats['people']['maybe'][] = $sheetData[$x]['B'];
        }
        if (!empty($sheetData[$x]['C'])) {
            $stats['people']['declined'][] = $sheetData[$x]['C'];
        }
    }
    $stats['people']['total'] = max(
        count($stats['people']['accepted']),
        count($stats['people']['maybe']),
        count($stats['people']['declined'])
    );
    return json_encode($stats);
}
$app = new Silex\Application();
$app['debug'] = true;

// Register the monolog logging service
$app->register(new Silex\Provider\MonologServiceProvider(), array(
  'monolog.logfile' => 'php://stderr',
));

// Our web handlers

$app->get('/ultimate', function () use ($app) {
    $app['monolog']->addDebug('logging output.');
    $html =<<<HTML
<!DOCTYPE html>
<html>
  <head>
  <title id="page_title">Novell Ultimate</title>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <style>
    #hor-minimalist-a {
        font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
        font-size: 12px;
        background: #fff;
        width: 400px;
        padding: 3px;
        border-collapse: collapse;
        text-align: left;
        margin: 20px;
    }
    body {
        font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
        font-size: 12px;
    }
    </style>
    <script type="text/javascript">
        google.load("visualization", "1", {packages:["gauge"]});
        function drawChart(accepted) {

            var data = google.visualization.arrayToDataTable([
                ['Label', 'Value'],
                ['Accepted', accepted]
            ]);
{'fraction_non_alphanumeric': 0.219399931810433, 'fraction_numerical': 0.014319809069212411, 'mean_word_length': 3.29502196193265, 'pattern_counts': {'":': 0, '<': 36, '<?xml version=': 0, '>': 38, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1593282', 'n_tokens_mistral': 2030, 'n_tokens_neox': 1940, 'n_words': 314}