示例#1
0
文件: index.php 项目: Harry27PL/si
function test(Neuron $neuron)
{
    $neuronResult = [];
    for ($x = MIN; $x <= MAX; $x += STEP) {
        $neuronResult[] = [$x, $neuron->border($x)];
    }
    $dots = [];
    foreach (getTestData() as $testData) {
        $dots[$testData->getExpectedResult()][] = [$testData->getData()[0], $testData->getData()[1]];
    }
    ?>

        <div class="graphs">
            <div class="graph2d" style="width:600px; height: 300px"
                    data-data="<?php 
    echo json_encode($neuronResult);
    ?>
"
                    data-dots="<?php 
    echo htmlspecialchars(json_encode($dots), ENT_QUOTES, 'UTF-8');
    ?>
"></div>
        </div>
        <script>draw()</script>

    <?php 
}
示例#2
0
function getTestDataForMore($max = 10)
{
    $data = getTestData();
    for ($i = 0; $i < count($data); $i++) {
        $data[$i]['total'] = $data[$i]['english'] + $data[$i]['math'];
        $data[$i]['detail'] = 'something more...';
    }
    return $data;
}
 public function index()
 {
     // $this->show('<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: "微软雅黑"; color: #333;font-size:24px} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px } a,a:hover,{color:blue;}</style><div style="padding: 24px 48px;"> <h1>:)</h1><p>Hello <b>ThinkPHP</b>!</p><br/>版本 V{$Think.version}</div><script type="text/javascript" src="http://ad.topthink.com/Public/static/client.js"></script><thinkad id="ad_55e75dfae343f5a1"></thinkad><script type="text/javascript" src="http://tajs.qq.com/stats?sId=9347272" charset="UTF-8"></script>','utf-8');
     echo 'URL_MODEL ' . C("URL_MODEL");
     echo '<hr>';
     echo "<a href=\"" . U('index') . "\">" . U('index');
     echo '<hr>';
     echo "<a href=\"" . U('/User/index') . "\">" . U('User/index');
     echo '<hr>';
     $this->ajaxReturn(getTestData(), 'json');
 }
示例#4
0
        }

        if ($fnBody) {
            $sortFn = create_function('$a,$b', $fnBody);
            usort($ary, $sortFn);
        }
    }

}

//To create grid exporting instant.
$gridHandler = new GridServerHandler();

$type = getParameter('exportType');
//to get the data from data base. //
$data1 = getTestData();

//echo "come here";
if ($gridHandler->sortInfo) {
    //echo "sortinfo:true<br>";
    $sortOrder = $gridHandler->sortInfo[0]["sortOrder"];
    //echo var_dump($gridHandler->sortInfo[0]);
    if ($sortOrder != "defaultsort") {
        $comp_field = $gridHandler->sortInfo[0]["columnId"];
        //echo "sortOrder:". $comp_field;
        //echo $comp_field . " " . $sortOrder . "\n";
        //usort($data1, "mycompare");
        Utility::orderBy($data1, $comp_field . " " . $sortOrder);
    }
}