コード例 #1
0
// assume lang.csv in name order
if (isset($HTTP_GET_VARS['calc']) && strlen($HTTP_GET_VARS['calc']) && strlen($HTTP_GET_VARS['calc']) <= 9) {
    $X = $HTTP_GET_VARS['calc'];
    if (ereg("^[a-z]+\$", $X) && $X == 'reset') {
        $Action = $X;
    }
}
if (!isset($Action)) {
    $Action = 'calculate';
}
$Page =& new Template(LIB_PATH);
$Body =& new Template(LIB_PATH);
$S = '';
$PageId = 'boxplot';
require_once LIB_PATH . 'lib_boxplot.php';
$mark = MarkTime('u64q/');
$mark = $mark . ' Q6600';
$Title = 'Fastest programming language';
$Body->set('Title', $Title);
$TemplateName = 'fastest.tpl.php';
$About =& new Template(ABOUT_PATH);
$AboutTemplateName = 'fastest-about.tpl.php';
$About->set('DataSet', $DataSet);
$SLangs = SelectedLangs($Langs, $Action, $HTTP_GET_VARS);
if (!file_exists(ABOUT_PATH . $AboutTemplateName)) {
    $AboutTemplateName = 'blank-about.tpl.php';
}
$Body->set('DataSet', $DataSet);
$metaRobots = '<meta name="robots" content="all" /><meta name="revisit" content="4 days" />';
$MetaKeywords = '<meta name="description" content="Find out which programming language has the fastest benchmark programs (' . PLATFORM_NAME . ') &amp; how your favorite language compares." />';
$faqUrl = CORE_SITE . 'help.php';
コード例 #2
0
ファイル: pipelines.php プロジェクト: pmolfese/nidb
function CreatePipelineGraph($g)
{
    //return;
    MarkTime("CreatePipelineGraph({$g})");
    $dotfile = tempnam("/tmp", 'DOTDOT');
    $pngfile = tempnam("/tmp", 'DOTPNG');
    $d[] = "digraph G {";
    $sqlstring = "select * from pipelines where pipeline_group = '{$g}'";
    $result = MySQLiQuery($sqlstring, __FILE__, __LINE__);
    while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
        $pipelinename = $row['pipeline_name'];
        $deps = $row['pipeline_dependency'];
        $groupids = $row['pipeline_groupid'];
        if ($deps != '') {
            $sqlstringA = "select * from pipelines where pipeline_id in ({$deps})";
            $resultA = MySQLiQuery($sqlstringA, __FILE__, __LINE__);
            while ($rowA = mysqli_fetch_array($resultA, MYSQLI_ASSOC)) {
                $depname = $rowA['pipeline_name'];
                $d[] = " \"{$depname}\" -> \"{$pipelinename}\";";
            }
        }
        if ($groupids != '') {
            $sqlstringA = "select * from groups where group_id in ({$groupids})";
            $resultA = MySQLiQuery($sqlstringA, __FILE__, __LINE__);
            while ($rowA = mysqli_fetch_array($resultA, MYSQLI_ASSOC)) {
                $groupname = $rowA['group_name'];
                $d[] = " \"{$groupname}\" -> \"{$pipelinename}\";";
                $d[] = " \"{$groupname}\" [shape=box,style=filled,color=\"lightblue\"];";
            }
        }
    }
    $d[] = "}";
    $d = array_unique($d);
    $dot = implode("\n", $d);
    file_put_contents($dotfile, $dot);
    $systemstring = "dot -Tpng {$dotfile} -o {$pngfile}";
    exec($systemstring);
    //echo $dot;
    $imdata = base64_encode(file_get_contents($pngfile));
    return $imdata;
}
コード例 #3
0
        $Mark = 'late 2007';
    } elseif (SITE_NAME == 'gp4') {
        $Mark = 'mid 2008';
    } else {
        $mtime = filemtime($PathRoot . DATA_PATH . 'data.csv');
        $Mark = gmdate("d M Y", $mtime);
    }
    return $Mark;
}
// DATA ///////////////////////////////////////////
list($Incl, $Excl) = WhiteListInEx();
$Tests = WhiteListUnique('test.csv', $Incl);
// assume test.csv in name order
$Langs = WhiteListUnique('lang.csv', $Incl);
// assume lang.csv in name order
$mark = MarkTime();
$mark = $mark . ' ' . SITE_NAME;
$MetaKeywords = '';
$faqUrl = CORE_SITE . 'help.php';
$bannerUrl = CORE_SITE;
// PAGES ///////////////////////////////////////////////////
$Page =& new Template(LIB_PATH);
$Body =& new Template(LIB_PATH);
$PageId = 'summarydata';
$Title = 'Summary Data';
$TemplateName = 'summarydata.tpl.php';
$Title = $Title . ' - Full Data';
$mark = $mark . ' n';
$Body->set('DataSet', 'ndata');
$Body->set('Data', DataRows(DATA_PATH . 'ndata.csv', $Tests, $Langs, $Incl, $Excl));
$Body->set('Title', $Title);
コード例 #4
0
ファイル: shapes.php プロジェクト: bennett000/benchmarksgame
    }
    return array($shapes, $medians);
}
function MarkTime($PathRoot = '')
{
    $mtime = filemtime($PathRoot . DATA_PATH . 'data.csv');
    $Mark = gmdate("d M Y", $mtime);
    return $Mark;
}
// DATA ///////////////////////////////////////////
list($Incl, $Excl) = WhiteListInEx();
$Tests = WhiteListUnique('test.csv', $Incl);
// assume test.csv in name order
$Langs = WhiteListUnique('lang.csv', $Incl);
// assume lang.csv in name order
$mark = MarkTime() . ' ' . SITE_NAME;
$DataSet = 'data';
$MetaKeywords = '';
// PAGES ///////////////////////////////////////////////////
$Page =& new Template(LIB_PATH);
$Body =& new Template(LIB_PATH);
$PageId = 'shapes';
$Title = 'Code-used Time-used Shapes';
$Body->set('Title', $Title);
$TemplateName = 'shapes.tpl.php';
$About =& new Template(ABOUT_PATH);
$AboutTemplateName = 'shapes-about.tpl.php';
if (!file_exists(ABOUT_PATH . $AboutTemplateName)) {
    $AboutTemplateName = 'blank-about.tpl.php';
}
$Body->set('DataSet', $DataSet);