From: <pan...@us...> - 2008-12-10 17:34:21
|
Revision: 442 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=442&view=rev Author: panzaboi Date: 2008-12-10 17:34:11 +0000 (Wed, 10 Dec 2008) Log Message: ----------- Added Contests Added support for teams Added support for Virtual Contests and Team Contests Fixed XML structure to support the new tester Modified Paths: -------------- website/application/modules/acm/controllers/ArchieveController.php website/application/modules/acm/models/Archieve.php website/application/modules/acm/models/Form/Login.php website/application/modules/acm/views/scripts/tester/entry.phtml website/application/modules/acm/views/scripts/tester/submits.phtml website/other/dq.sql website/other/todo.txt Added Paths: ----------- website/application/modules/acm/controllers/ContestController.php website/application/modules/acm/models/Contest.php website/application/modules/acm/views/scripts/contest/ website/application/modules/acm/views/scripts/contest/contest.phtml website/application/modules/acm/views/scripts/contest/entry.phtml website/application/modules/acm/views/scripts/contest/incontest.phtml website/application/modules/acm/views/scripts/contest/index.phtml website/application/modules/acm/views/scripts/contest/notrun.phtml website/application/modules/acm/views/scripts/contest/problemset.phtml website/application/modules/acm/views/scripts/contest/registered.phtml website/application/modules/acm/views/scripts/contest/result.phtml website/application/modules/acm/views/scripts/contest/results.phtml website/application/modules/acm/views/scripts/contest/view.phtml website/other/submits/6 website/other/submits/7 website/other/submits/8 website/other/submits/9 Modified: website/application/modules/acm/controllers/ArchieveController.php =================================================================== --- website/application/modules/acm/controllers/ArchieveController.php 2008-12-10 00:41:43 UTC (rev 441) +++ website/application/modules/acm/controllers/ArchieveController.php 2008-12-10 17:34:11 UTC (rev 442) @@ -10,7 +10,7 @@ public function viewAction() { $id = $this->_getParam('id'); - $problem = $this->_model->get($id); + $problem = $this->_model->getChallenge($id); if (!$problem) return $this->_forward('index', null, null, $this->_getAllParams() + array('message' => 'noProblem')); Added: website/application/modules/acm/controllers/ContestController.php =================================================================== --- website/application/modules/acm/controllers/ContestController.php (rev 0) +++ website/application/modules/acm/controllers/ContestController.php 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1,134 @@ +<?php + +class Acm_ContestController extends Ostacium_Controller_Action +{ + public function indexAction() + { + $this->view->contests = $this->_model->getContests(); + } + + public function registerAction() + { + $contestid = $this->_getParam('contestid'); + + if (!$this->_model->isContestRunning($contestid)) + { + return $this->render('notrun'); + } + + if ($this->_model->isInContest($contestid)) + { + return $this->render('incontest'); + } + + $this->_model->registerUser($contestid); + + return $this->render('registered'); + } + + public function viewAction() + { + $id = $this->_getParam('id'); + $contestid = $this->_getParam('contestid'); + + $problem = $this->_model->getChallenge($id, $contestid); + + if (!$problem) + return $this->_forward('problemset', null, null, $this->_getAllParams() + array('message' => 'noProblem')); + + $this->view->assign($problem); + } + + public function problemsetAction() + { + $contestid = $this->_getParam('contestid'); + + // check if user is in this contest + + $this->view->challenges = $this->_model->getChallenges($contestid); + } + + public function submitAction() + { + $contestid = $this->_getParam('contestid'); + + if (!$this->_model->isContestRunning($contestid)) + { + return $this->render('notrun'); + } + + $this->_helper->getHelper('viewRenderer')->setNoRender(true); + + $form = new Form_Submit(); + + $this->view->dojo()->addOnLoad('function(){ changeEditor('.$form->type->getValue().'); }'); + + echo $form; + } + + public function uploadAction() + { + $this->_helper->getHelper('viewRenderer')->setNoRender(true); + $form = new Form_Submit(); + + if (!$this->getRequest()->isPost()) + { + return $this->_forward('submit', null, null, $this->_getAllParams()); + } + + if ($_POST['type'] == 0) + { + $form->code->setRequired(true); + } + elseif ($_POST['type'] == 1) + { + $form->codefile->setRequired(true); + } + + $result = $form->isValid($this->getRequest()->getPost()); + $this->view->dojo()->addOnLoad('function(){ changeEditor('.$form->type->getValue().'); }'); + + if ($form->type->getValue() == 0) + { + $form->code->setRequired(false); + } + elseif ($form->type->getValue() == 1) + { + $form->codefile->setRequired(false); + } + + if (!$result) + { + echo $form; + return; + } + + $values = $form->getValues(); + $values += $this->_getAllParams(); + $id = $this->_model->addSubmit($values); + + if ($id === false) + { + if ($values['type'] == 1) + unlink($form->codefile->getFileName()); + + return $this->render('notrun'); + } + + if ($values['type'] == 0) + { + file_put_contents(Application::getDocRoot().'/other/submits/'.$id, $values['code']); + } + elseif ($values['type'] == 1) + { + rename($form->codefile->getFileName(), Application::getDocRoot().'/other/submits/'.$id); + } + } + + public function resultsAction() + { + $contestid = $this->_getParam('contestid'); + + $this->view->submits = $this->_model->getSubmits($contestid); + } +} \ No newline at end of file Modified: website/application/modules/acm/models/Archieve.php =================================================================== --- website/application/modules/acm/models/Archieve.php 2008-12-10 00:41:43 UTC (rev 441) +++ website/application/modules/acm/models/Archieve.php 2008-12-10 17:34:11 UTC (rev 442) @@ -14,7 +14,7 @@ return $submits->getAll(); } - public function get($id) + public function getChallenge($id) { $challenges = new Challenges(); return $challenges->get($id); @@ -23,6 +23,7 @@ public function addSubmit($values) { $data = array( + 'contestid' => 0, 'username' => Zend_Auth::getInstance()->getStorage()->read()->username, 'challengeid' => (int)$values['id'], 'codelangid' => $values['languageid'], @@ -30,8 +31,9 @@ 'when' => time() ); - $challenges = new Challenges(); - $challenges->update(array('tries' => 'tries + 1'), $this->_db->quoteInto('id = ?', $data['challengeid'])); + //$challenges = new Challenges(); + //$challenges->update(array('tries' => 'tries + 1'), $this->_db->quoteInto('id = ?', $data['challengeid'])); + // move this to the page, where we recieve data from Tester, add tries and accepts there. $submits = new Submits(); return $submits->insert($data); @@ -45,22 +47,22 @@ public function get($id) { - return $this->selectLang(array('name', 'description'))->where($this->_name.'.id = ?', $id)->query()->fetch(); + return $this->selectLang(array('name', 'description'))->where('challenges.id = ? AND enabled = 1', $id)->query()->fetch(); } public function getAll() { - return $this->selectLang(array('name', 'description'))->where('enabled = ?', 1)->query()->fetchAll(); + return $this->selectLang(array('name', 'description'))->where('challenges.enabled = 1')->query()->fetchAll(); } } class Submits extends Ostacium_Db_Table { - protected $_name = 'archieve_submits'; + protected $_name = 'submits'; protected $_primary = 'id'; public function getAll() { - return $this->select()->from($this)->setIntegrityCheck(false)->joinLeft('code_languages', 'code_languages.id = archieve_submits.codelangid', array('codelang' => 'name'))->order('id DESC')->query()->fetchAll(); + return $this->select()->from($this)->setIntegrityCheck(false)->joinLeft('code_languages', 'code_languages.id = submits.codelangid', array('codelang' => 'name'))->where('contestid = 0')->order('submits.id DESC')->query()->fetchAll(); } } \ No newline at end of file Added: website/application/modules/acm/models/Contest.php =================================================================== --- website/application/modules/acm/models/Contest.php (rev 0) +++ website/application/modules/acm/models/Contest.php 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1,165 @@ +<?php + +class Contest extends Ostacium_Model +{ + public function getContests() + { + $contests = new Contests(); + return $contests->getAll(); + } + + public function registerUser($id) + { + $username = Zend_Auth::getInstance()->getStorage()->read()->username; + + $ca = new ContestsApplicants(); + $ca->insert(array('username' => $username, 'contestid' => $id)); + + return true; + } + + public function isContestRunning($contestid) + { + $contest = new Contests(); + return $contest->isRunning($contestid); + } + + public function isInContest($contestid) + { + $username = Zend_Auth::getInstance()->getStorage()->read()->username; + $contest = new Contests(); + + return $contest->isInContest($contestid, $username); + } + + public function getChallenges($contestid) + { + $challenges = new Challenges(); + return $challenges->getAll($contestid); + } + + public function getChallenge($id, $contestid) + { + $challenges = new Challenges(); + return $challenges->get($id, $contestid); + } + + public function addSubmit($values) + { + $data = array( + 'contestid' => $values['contestid'], + 'username' => Zend_Auth::getInstance()->getStorage()->read()->username, + 'challengeid' => (int)$values['id'], + 'codelangid' => $values['languageid'], + 'firsttest' => $values['firsttest'], + 'when' => time() + ); + + $contest = new Contests(); + + if ($contest->isRunning($values['contestid'])) + { + $submits = new Submits(); + return $submits->insert($data); + } + else + return false; + } + + public function getSubmits($contestid) + { + $submits = new Submits(); + return $submits->getAll($contestid); + } +} + +class Challenges extends Ostacium_Db_Table +{ + protected $_name = 'challenges'; + protected $_primary = 'id'; + + public function getAll($contestid) + { + return $this->selectLang(array('name', 'description')) + ->joinLeft(array('c' => 'contests'), $this->getAdapter()->quoteInto('c.id = ? AND c.start <= UNIX_TIMESTAMP() AND c.end > UNIX_TIMESTAMP()', $contestid), array()) + ->joinLeft(array('cc' => 'contests_challenges'), 'cc.contestid = c.id', 'contestid') + ->where('challenges.id = cc.challengeid') + ->query()->fetchAll(); + } + + public function get($id, $contestid) + { + return $this->selectLang(array('name', 'description')) + ->joinLeft(array('c' => 'contests'), $this->getAdapter()->quoteInto('c.id = ? AND c.start <= UNIX_TIMESTAMP() AND c.end > UNIX_TIMESTAMP()', $contestid), array()) + ->joinLeft(array('cc' => 'contests_challenges'), $this->getAdapter()->quoteInto('cc.contestid = c.id AND cc.challengeid = ?', $id), 'contestid') + ->where('challenges.id = cc.challengeid') + ->query()->fetch(); + } +} + +class Submits extends Ostacium_Db_Table +{ + protected $_name = 'submits'; + protected $_primary = 'id'; + + public function getAll($contestid) + { + return $this->select()->setIntegrityCheck(false) + ->from($this) + ->joinLeft('code_languages', 'code_languages.id = submits.codelangid', array('codelang' => 'name')) + ->joinLeft(array('c' => 'contests'), $this->getAdapter()->quoteInto('c.id = ?', $contestid), array()) + ->where('submits.contestid = c.id')->order('submits.id DESC') + ->query()->fetchAll(); + } +} + +class Contests extends Ostacium_Db_Table +{ + protected $_name = 'contests'; + protected $_primary = 'id'; + + public function isRunning($contestid) + { + $id = $this->select()->from($this, 'id') + ->where('id = ? AND start <= UNIX_TIMESTAMP() AND end >= UNIX_TIMESTAMP() AND enabled = 1', $contestid) + ->query()->fetchColumn('id'); + + if ($id && $id == $contestid) + return true; + else + return false; + } + + public function getAll() + { + return $this->selectLang(array('name', 'description')) + ->where('enabled = 1 AND start <= UNIX_TIMESTAMP() AND end > UNIX_TIMESTAMP()') + ->query()->fetchAll(); + } + + public function isInContest($contestid, $username) + { + $id = $this->select()->setIntegrityCheck(false) + ->from(array('c' => $this->_name), 'id') + ->joinInner(array('a' => 'contests_applicants'), 'c.id=a.contestid', array()) + ->where('c.id = ?', $contestid) + ->where('a.username = ?', $username) + ->query()->fetchColumn('username'); + + if ($id && $id == $contestid) return true; + else return false; + } +} + +class ContestsApplicants extends Ostacium_Db_Table +{ + protected $_name = 'contests_applicants'; + protected $_primary = array('contestid', 'username'); +} + + +class Users extends Ostacium_Db_Table +{ + protected $_name = 'users'; + protected $_primaty = 'username'; +} \ No newline at end of file Modified: website/application/modules/acm/models/Form/Login.php =================================================================== --- website/application/modules/acm/models/Form/Login.php 2008-12-10 00:41:43 UTC (rev 441) +++ website/application/modules/acm/models/Form/Login.php 2008-12-10 17:34:11 UTC (rev 442) @@ -18,7 +18,7 @@ $translate = Zend_Registry::get('Zend_Translate'); $router = Zend_Controller_Front::getInstance()->getRouter(); - $this->setAction($router->assemble(array('action' => 'login'), null)); + $this->setAction($router->assemble(array('action' => 'login', 'controller' => 'index'), null)); $this->setMethod('post'); $this->setName('loginform'); Property changes on: website/application/modules/acm/views/scripts/contest ___________________________________________________________________ Added: tsvn:logminsize + 5 Added: website/application/modules/acm/views/scripts/contest/contest.phtml =================================================================== --- website/application/modules/acm/views/scripts/contest/contest.phtml (rev 0) +++ website/application/modules/acm/views/scripts/contest/contest.phtml 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1,7 @@ +<tr> + <td align="center"><?= $this->id ?></td> + <td align="center"><?= $this->name ?></td> + <td align="center"><?= $this->date($this->start, "d.m.Y H:i:s") ?></td> + <td align="center"><?= $this->date($this->end, "d.m.Y H:i:s") ?></td> + <td align="center"><a href="<?= $this->url(array('action' => 'register', 'contestid' => $this->id), null) ?>"><?= $this->translate('register') ?></a></td> +</tr> \ No newline at end of file Added: website/application/modules/acm/views/scripts/contest/entry.phtml =================================================================== --- website/application/modules/acm/views/scripts/contest/entry.phtml (rev 0) +++ website/application/modules/acm/views/scripts/contest/entry.phtml 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1,14 @@ +<tr bgcolor="#f4f3f8" align="middle"> + <td style="border-left: 0px none; border-right: 1px solid rgb(196, 196, 219);"> + <a href="<?= $this->url( array('action' => 'view', 'contest' => $this->contestid, 'id' => $this->id), null) ?>"><?= $this->id ?></a> + </td> + + <td align="left" style="border-left: 0px none; border-right: 1px solid rgb(196, 196, 219);"> + <a href="<?= $this->url( array('action' => 'view', 'contest' => $this->contestid, 'id' => $this->id), null) ?>"><?= $this->name ?></a> + </td> + + <td style="border-left: 0px none; border-right: 0px solid rgb(196, 196, 219);"> + <a href="<?= $this->url( array('action' => 'submit', 'contest' => $this->contestid, 'id' => $this->id), null) ?>"><img height="17" width="22" alt="Здати" title="Здати" src="images/b_find.gif"/></a> + <a href="<?= $this->url( array('action' => 'status', 'contest' => $this->contestid, 'id' => $this->id), null) ?>"><img height="17" width="22" alt="Показати як здають" src="images/probstatus.png"/> + </td> +</tr> \ No newline at end of file Added: website/application/modules/acm/views/scripts/contest/incontest.phtml =================================================================== --- website/application/modules/acm/views/scripts/contest/incontest.phtml (rev 0) +++ website/application/modules/acm/views/scripts/contest/incontest.phtml 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1 @@ +You are already in this contest \ No newline at end of file Added: website/application/modules/acm/views/scripts/contest/index.phtml =================================================================== --- website/application/modules/acm/views/scripts/contest/index.phtml (rev 0) +++ website/application/modules/acm/views/scripts/contest/index.phtml 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1,10 @@ +<table cellspacing="1" cellpadding="8" border="0" width="100%"><tbody><tr><td width="100%" valign="top" class="name"> + +<table cellspacing="0" cellpadding="0" border="0" width="100%"><tbody><tr><td bgcolor="#d0d4de" width="4" class="name"> + +<img height="18" width="4" src="http://web.archive.org/web/20070323032706/http://acm.lviv.ua/"/></td> + +<td nowrap="" bgcolor="#122a5b" width="*" class="name"> <font color="#d4d0e2"><b><small>Набiр контестів</small></b><small/></font></td><td nowrap="" bgcolor="#122a5b" align="right" class="name"> <font color="#d4d0e2"><b><small> 05:26 23 березня 2007 року </small></b><small/></font></td></tr></tbody></table> <table width="60%" cellspacing="0" cellpadding="0" border="0" summary="" align="center"><tbody><tr><td bgcolor="#f4f3f8" align="middle" colspan="14"><b>Архів контестів</b></td></tr><tr bgcolor="#e1e1e1" align="middle"> +<th>Номер</th><th>Назва</th><th>Початок</th><th>Кінець</th><th>Зареєструватись</th></tr> +<?= $this->partialLoop('contest/contest.phtml', $this->contests) ?> +</table><br/></td></tr></table> \ No newline at end of file Added: website/application/modules/acm/views/scripts/contest/notrun.phtml =================================================================== --- website/application/modules/acm/views/scripts/contest/notrun.phtml (rev 0) +++ website/application/modules/acm/views/scripts/contest/notrun.phtml 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1 @@ +The contest is not running at the moment \ No newline at end of file Added: website/application/modules/acm/views/scripts/contest/problemset.phtml =================================================================== --- website/application/modules/acm/views/scripts/contest/problemset.phtml (rev 0) +++ website/application/modules/acm/views/scripts/contest/problemset.phtml 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1,10 @@ +<table cellspacing="1" cellpadding="8" border="0" width="100%"><tbody><tr><td width="100%" valign="top" class="name"> + +<table cellspacing="0" cellpadding="0" border="0" width="100%"><tbody><tr><td bgcolor="#d0d4de" width="4" class="name"> + +<img height="18" width="4" src="http://web.archive.org/web/20070323032706/http://acm.lviv.ua/"/></td> + +<td nowrap="" bgcolor="#122a5b" width="*" class="name"> <font color="#d4d0e2"><b><small>Набiр задач</small></b><small/></font></td><td nowrap="" bgcolor="#122a5b" align="right" class="name"> <font color="#d4d0e2"><b><small> 05:26 23 березня 2007 року </small></b><small/></font></td></tr></tbody></table> <table cellspacing="0" cellpadding="0" border="0" summary="" align="center"><tbody><tr><td bgcolor="#f4f3f8" align="middle" colspan="14"><b>Архів задач</b></td></tr><tr><td bgcolor="#c4c4db" colspan="20"><img height="1" width="1" src="http://web.archive.org/web/20070323032706/http://acm.lviv.ua/" alt=""/></td></tr><tr bgcolor="#e1e1e1" align="middle"> +<th width="70">Задача</th><th align="left" width="270"> Назва</th><th align="middle" width="70">Дії</th></tr><tr><td height="1" bgcolor="#c4c4db" colspan="20"><img height="1" width="1" src="http://web.archive.org/web/20070323032706/http://acm.lviv.ua/" alt=""/></td></tr> +<?= $this->partialLoop('contest/entry.phtml', $this->challenges) ?> +</table><br/></td></tr></table> \ No newline at end of file Added: website/application/modules/acm/views/scripts/contest/registered.phtml =================================================================== --- website/application/modules/acm/views/scripts/contest/registered.phtml (rev 0) +++ website/application/modules/acm/views/scripts/contest/registered.phtml 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1 @@ +You have successfully registered for contest \ No newline at end of file Added: website/application/modules/acm/views/scripts/contest/result.phtml =================================================================== --- website/application/modules/acm/views/scripts/contest/result.phtml (rev 0) +++ website/application/modules/acm/views/scripts/contest/result.phtml 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1,10 @@ +<tr> + <td align="center"><?= $this->id ?></td> + <td align="center"><?= $this->date($this->when) ?></td> + <td align="center"><?= $this->username ?></td> + <td align="center"><a href="<?= $this->url( array('action' => 'view', 'id' => $this->challengeid), null) ?>"><?= $this->challengeid ?></a></td> + <td align="center"><?= $this->codelang ?></td> + <td align="center"><?= $this->state($this->state) ?></td> + <td align="center"><?= ($this->tests == 0 ? '-' : $this->tests) ?></td> + <td align="center"><?= ($this->runtime == 0 ? '-' : $this->runtime) ?>/<?= ($this->memory == 0 ? '-' : $this->memory) ?></td> +</tr> \ No newline at end of file Added: website/application/modules/acm/views/scripts/contest/results.phtml =================================================================== --- website/application/modules/acm/views/scripts/contest/results.phtml (rev 0) +++ website/application/modules/acm/views/scripts/contest/results.phtml 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1,33 @@ +<table cellspacing="1" cellpadding="8" border="0" width="100%"><tbody><tr><td width="100%" valign="top" class="name"> + +<table cellspacing="0" cellpadding="0" border="0" width="100%"> +<tbody> +<tr> +<td nowrap="" bgcolor="#122a5b" width="*" class="name"> +<font color="#d4d0e2"><b><small>Набiр задач</small></b><small/></font> +</td> +<td nowrap="" bgcolor="#122a5b" align="right" class="name"> +<font color="#d4d0e2"><b><small> 05:26 23 березня 2007 року </small></b><small/></font> +</td> +</tr> +</tbody> +</table> + +<table cellspacing="0" cellpadding="0" border="0" summary="" align="center" width="80%"> +<tbody> +<tr><td bgcolor="#f4f3f8" align="middle" colspan="14"><b>Архів задач</b></td></tr> +<tr bgcolor="#e1e1e1" align="middle"> +<th>ID</th> +<th>Дата</th> +<th>Логін</th> +<th>Задача</th> +<th>Мова</th> +<th>Стан</th> +<th>Тест</th> +<th>Час/Пам'ять</th> +</tr> + +<?= $this->partialLoop('archieve/result.phtml', $this->submits) ?> +</table> + +</td></tr></table> \ No newline at end of file Added: website/application/modules/acm/views/scripts/contest/view.phtml =================================================================== --- website/application/modules/acm/views/scripts/contest/view.phtml (rev 0) +++ website/application/modules/acm/views/scripts/contest/view.phtml 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1,12 @@ +<h2 align="center"><?= $this->id.' - '.$this->name ?></h2> +<div align="center"> + <?= $this->translate('timelimit') ?>: <?= $this->measure("Time", $this->timelimit, Zend_Measure_Time::MILLISECOND, Zend_Measure_Time::SECOND, 0 ) ?><br /> + <?= $this->translate('memorylimit') ?>: <?= $this->measure("Binary", $this->memorylimit, Zend_Measure_Binary::BYTE, Zend_Measure_Binary::KILOBYTE ) ?><br /> + <?= $this->translate('outputlimit') ?>: <?= $this->measure("Binary", $this->outputlimit, Zend_Measure_Binary::BYTE, Zend_Measure_Binary::KILOBYTE ) ?><br /> +</div> +<br /> +<p><?= $this->description ?></p> + +<div> + <a href="<?= $this->url(array('action' => 'submit', 'contest' => $this->contestid, 'id' => $this->id), null) ?>"><?= $this->translate('submit') ?></a> +</div> \ No newline at end of file Modified: website/application/modules/acm/views/scripts/tester/entry.phtml =================================================================== --- website/application/modules/acm/views/scripts/tester/entry.phtml 2008-12-10 00:41:43 UTC (rev 441) +++ website/application/modules/acm/views/scripts/tester/entry.phtml 2008-12-10 17:34:11 UTC (rev 442) @@ -1,3 +1,6 @@ -<entry id="<?= $this->id ?>" problemid="<?= $this->challengeid ?>" language="<?= $this->codelang ?>"> -<?= htmlentities(file_get_contents(Application::getDocRoot().'/other/submits/'.$this->id)) ?> -</entry> \ No newline at end of file +<submit> + <id><?= $this->id ?></id> + <sourceCode><?= htmlentities(file_get_contents(Application::getDocRoot().'/other/submits/'.$this->id)) ?></sourceCode> + <language><?= $this->codelangid ?></language> + <problem><?= $this->challengeid ?></problem> +</submit> \ No newline at end of file Modified: website/application/modules/acm/views/scripts/tester/submits.phtml =================================================================== --- website/application/modules/acm/views/scripts/tester/submits.phtml 2008-12-10 00:41:43 UTC (rev 441) +++ website/application/modules/acm/views/scripts/tester/submits.phtml 2008-12-10 17:34:11 UTC (rev 442) @@ -1,4 +1,4 @@ <?= '<?xml version="1.0" encoding="UTF-8"?>' ?> -<entries> +<submitList> <?= $this->partialLoop('tester/entry.phtml', $this->submits) ?> -</entries> \ No newline at end of file +</submitList> \ No newline at end of file Modified: website/other/dq.sql =================================================================== --- website/other/dq.sql 2008-12-10 00:41:43 UTC (rev 441) +++ website/other/dq.sql 2008-12-10 17:34:11 UTC (rev 442) @@ -3,7 +3,7 @@ -- http://www.phpmyadmin.net -- -- Host: localhost --- Generation Time: Dec 07, 2008 at 11:51 PM +-- Generation Time: Dec 10, 2008 at 07:16 PM -- Server version: 5.0.51 -- PHP Version: 5.2.6 @@ -22,34 +22,6 @@ -- -------------------------------------------------------- -- --- Table structure for table `archieve_submits` --- - -CREATE TABLE IF NOT EXISTS `archieve_submits` ( - `id` int(11) NOT NULL auto_increment, - `username` varchar(50) NOT NULL, - `challengeid` int(11) NOT NULL, - `codelangid` int(11) NOT NULL, - `state` int(11) NOT NULL default '0', - `tests` int(11) NOT NULL default '0', - `firsttest` tinyint(1) NOT NULL, - `runtime` double NOT NULL default '0', - `memory` int(11) NOT NULL default '0', - `when` int(11) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; - --- --- Dumping data for table `archieve_submits` --- - -INSERT INTO `archieve_submits` (`id`, `username`, `challengeid`, `codelangid`, `state`, `tests`, `firsttest`, `runtime`, `memory`, `when`) VALUES -(3, 'tester', 1000, 1, 1, 100, 0, 1002, 1001, 1228664380), -(5, 'panza', 1000, 1, 0, 0, 1, 0, 0, 1228685834); - --- -------------------------------------------------------- - --- -- Table structure for table `challenges` -- @@ -277,7 +249,7 @@ `langcode` varchar(2) NOT NULL, `name` varchar(200) NOT NULL, `description` text NOT NULL, - PRIMARY KEY (`id`) + PRIMARY KEY (`id`,`langcode`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- @@ -520,21 +492,45 @@ CREATE TABLE IF NOT EXISTS `contests` ( `id` int(11) NOT NULL auto_increment, - `name` varchar(50) NOT NULL, - `description` varchar(100) NOT NULL, `start` int(11) NOT NULL, `end` int(11) NOT NULL, + `enabled` tinyint(1) NOT NULL default '0', + `virtual` tinyint(1) NOT NULL default '0', + `team` tinyint(1) NOT NULL default '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; -- -- Dumping data for table `contests` -- +INSERT INTO `contests` (`id`, `start`, `end`, `enabled`, `virtual`, `team`) VALUES +(1, 228766000, 2147483647, 1, 0, 0); -- -------------------------------------------------------- -- +-- Table structure for table `contests_applicants` +-- + +CREATE TABLE IF NOT EXISTS `contests_applicants` ( + `contestid` int(11) NOT NULL, + `username` varchar(50) NOT NULL, + PRIMARY KEY (`contestid`,`username`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `contests_applicants` +-- + +INSERT INTO `contests_applicants` (`contestid`, `username`) VALUES +(0, 'panza'), +(1, 'admin'), +(1, 'panza'); + +-- -------------------------------------------------------- + +-- -- Table structure for table `contests_challenges` -- @@ -548,10 +544,72 @@ -- Dumping data for table `contests_challenges` -- +INSERT INTO `contests_challenges` (`contestid`, `challengeid`) VALUES +(1, 1000), +(1, 1001); -- -------------------------------------------------------- -- +-- Table structure for table `contests_lang` +-- + +CREATE TABLE IF NOT EXISTS `contests_lang` ( + `id` int(11) NOT NULL, + `langcode` varchar(2) NOT NULL, + `name` varchar(200) NOT NULL, + `description` text NOT NULL, + PRIMARY KEY (`id`,`langcode`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `contests_lang` +-- + +INSERT INTO `contests_lang` (`id`, `langcode`, `name`, `description`) VALUES +(1, 'uk', 'Тестовий Контест', 'Тестовий Контест'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `contests_results` +-- + +CREATE TABLE IF NOT EXISTS `contests_results` ( + `contestid` int(11) NOT NULL, + `username` varchar(50) NOT NULL, + `challengeid` int(11) NOT NULL, + `tries` int(11) NOT NULL, + `penalty` int(11) NOT NULL, + `accepted` tinyint(1) NOT NULL, + PRIMARY KEY (`contestid`,`username`,`challengeid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `contests_results` +-- + + +-- -------------------------------------------------------- + +-- +-- Table structure for table `contests_teams` +-- + +CREATE TABLE IF NOT EXISTS `contests_teams` ( + `contestid` int(11) NOT NULL, + `teamid` int(11) NOT NULL, + PRIMARY KEY (`contestid`,`teamid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `contests_teams` +-- + + +-- -------------------------------------------------------- + +-- -- Table structure for table `languages` -- @@ -583,12 +641,117 @@ `message` text NOT NULL, `ip` varchar(15) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=105 ; -- -- Dumping data for table `log` -- +INSERT INTO `log` (`id`, `when`, `username`, `type`, `message`, `ip`) VALUES +(1, 1228687021, 'panza', 'NOTICE', 'runtime: 0.402740955353; totalqueries: 5; totalqueriestime: 0.000763177871704', '127.0.0.1'), +(2, 1228687062, 'panza', 'ERR', 'Type:EXCEPTION_NO_ACTION\nTrace:#0 D:\\server\\library\\Zend\\Controller\\Plugin\\Broker.php(309): Ostacium_Controller_Plugin_ErrorHandler->preDispatch(Object(Ostacium_Controller_Request_Http))\n#1 D:\\server\\library\\Zend\\Controller\\Front.php(921): Zend_Controller_Plugin_Broker->preDispatch(Object(Ostacium_Controller_Request_Http))\n#2 D:\\server\\library\\Application.php(51): Zend_Controller_Front->dispatch()\n#3 D:\\server\\httpdocs\\index.php(13): Application->bootstrap()\n#4 {main}', '127.0.0.1'), +(3, 1228687062, 'panza', 'NOTICE', 'runtime: 0.268155813217; totalqueries: 6; totalqueriestime: 0.000887155532837', '127.0.0.1'), +(4, 1228687077, 'panza', 'ERR', 'Type:EXCEPTION_NOTALLOWED\nTrace:#0 D:\\server\\library\\Zend\\Controller\\Plugin\\Broker.php(309): Ostacium_Controller_Plugin_ErrorHandler->preDispatch(Object(Ostacium_Controller_Request_Http))\n#1 D:\\server\\library\\Zend\\Controller\\Front.php(921): Zend_Controller_Plugin_Broker->preDispatch(Object(Ostacium_Controller_Request_Http))\n#2 D:\\server\\library\\Application.php(51): Zend_Controller_Front->dispatch()\n#3 D:\\server\\httpdocs\\index.php(13): Application->bootstrap()\n#4 {main}', '127.0.0.1'), +(5, 1228687077, 'panza', 'NOTICE', 'runtime: 0.255424976349; totalqueries: 6; totalqueriestime: 0.00112795829773', '127.0.0.1'), +(6, 1228687081, 'panza', 'ERR', 'Type:EXCEPTION_NO_ACTION\nTrace:#0 D:\\server\\library\\Zend\\Controller\\Plugin\\Broker.php(309): Ostacium_Controller_Plugin_ErrorHandler->preDispatch(Object(Ostacium_Controller_Request_Http))\n#1 D:\\server\\library\\Zend\\Controller\\Front.php(921): Zend_Controller_Plugin_Broker->preDispatch(Object(Ostacium_Controller_Request_Http))\n#2 D:\\server\\library\\Application.php(51): Zend_Controller_Front->dispatch()\n#3 D:\\server\\httpdocs\\index.php(13): Application->bootstrap()\n#4 {main}', '127.0.0.1'), +(7, 1228687081, 'panza', 'NOTICE', 'runtime: 0.252156019211; totalqueries: 6; totalqueriestime: 0.000904083251953', '127.0.0.1'), +(8, 1228687083, 'panza', 'NOTICE', 'runtime: 0.352587938309; totalqueries: 5; totalqueriestime: 0.000739097595215', '127.0.0.1'), +(9, 1228687087, 'tester', 'NOTICE', 'runtime: 0.35676407814; totalqueries: 5; totalqueriestime: 0.000777006149292', '127.0.0.1'), +(10, 1228687681, 'tester', 'NOTICE', 'runtime: 0.251905918121; totalqueries: 5; totalqueriestime: 0.000739097595215', '127.0.0.1'), +(11, 1228687683, 'tester', 'NOTICE', 'runtime: 0.451593875885; totalqueries: 6; totalqueriestime: 0.00546813011169', '127.0.0.1'), +(12, 1228688210, 'tester', 'NOTICE', 'runtime: 0.375689983368; totalqueries: 5; totalqueriestime: 0.000783920288086', '127.0.0.1'), +(13, 1228688221, 'tester', 'NOTICE', 'runtime: 0.354820966721; totalqueries: 5; totalqueriestime: 0.000791072845459', '127.0.0.1'), +(14, 1228688276, 'guest', 'NOTICE', 'runtime: 0.353997945786; totalqueries: 5; totalqueriestime: 0.000945568084717', '127.0.0.1'), +(15, 1228688289, 'guest', 'NOTICE', 'runtime: 0.363173961639; totalqueries: 5; totalqueriestime: 0.00074315071106', '127.0.0.1'), +(16, 1228688308, 'guest', 'NOTICE', 'runtime: 0.364115953445; totalqueries: 5; totalqueriestime: 0.000854730606079', '127.0.0.1'), +(17, 1228741301, 'guest', 'NOTICE', 'runtime: 1.43999099731; totalqueries: 6; totalqueriestime: 0.0433101654053', '127.0.0.1'), +(18, 1228741346, 'guest', 'ERR', 'Type:EXCEPTION_NO_CONTROLLER\nTrace:#0 D:\\server\\library\\Zend\\Controller\\Plugin\\Broker.php(309): Ostacium_Controller_Plugin_ErrorHandler->preDispatch(Object(Ostacium_Controller_Request_Http))\n#1 D:\\server\\library\\Zend\\Controller\\Front.php(921): Zend_Controller_Plugin_Broker->preDispatch(Object(Ostacium_Controller_Request_Http))\n#2 D:\\server\\library\\Application.php(51): Zend_Controller_Front->dispatch()\n#3 D:\\server\\httpdocs\\index.php(13): Application->bootstrap()\n#4 {main}', '127.0.0.1'), +(19, 1228741346, 'guest', 'NOTICE', 'runtime: 0.302864074707; totalqueries: 6; totalqueriestime: 0.000945806503296', '127.0.0.1'), +(20, 1228741349, 'guest', 'ERR', 'Type:EXCEPTION_NO_CONTROLLER\nTrace:#0 D:\\server\\library\\Zend\\Controller\\Plugin\\Broker.php(309): Ostacium_Controller_Plugin_ErrorHandler->preDispatch(Object(Ostacium_Controller_Request_Http))\n#1 D:\\server\\library\\Zend\\Controller\\Front.php(921): Zend_Controller_Plugin_Broker->preDispatch(Object(Ostacium_Controller_Request_Http))\n#2 D:\\server\\library\\Application.php(51): Zend_Controller_Front->dispatch()\n#3 D:\\server\\httpdocs\\index.php(13): Application->bootstrap()\n#4 {main}', '127.0.0.1'), +(21, 1228741349, 'guest', 'NOTICE', 'runtime: 0.254481077194; totalqueries: 6; totalqueriestime: 0.000924110412598', '127.0.0.1'), +(22, 1228741719, 'guest', 'NOTICE', 'runtime: 0.322642087936; totalqueries: 6; totalqueriestime: 0.00111651420593', '127.0.0.1'), +(23, 1228745567, 'guest', 'NOTICE', 'runtime: 1.22641611099; totalqueries: 6; totalqueriestime: 0.000978708267212', '127.0.0.1'), +(24, 1228745669, 'guest', 'NOTICE', 'runtime: 0.473080158234; totalqueries: 6; totalqueriestime: 0.00102496147156', '127.0.0.1'), +(25, 1228766766, 'guest', 'NOTICE', 'runtime: 0.910779953003; totalqueries: 5; totalqueriestime: 0.000758409500122', '127.0.0.1'), +(26, 1228766773, 'guest', 'NOTICE', 'runtime: 0.377062082291; totalqueries: 5; totalqueriestime: 0.000734090805054', '127.0.0.1'), +(27, 1228766780, 'admin', 'NOTICE', 'runtime: 0.344890117645; totalqueries: 5; totalqueriestime: 0.000730991363525', '127.0.0.1'), +(28, 1228766909, 'admin', 'NOTICE', 'runtime: 0.286052942276; totalqueries: 6; totalqueriestime: 0.00117993354797', '127.0.0.1'), +(29, 1228767005, 'admin', 'NOTICE', 'runtime: 0.249300956726; totalqueries: 6; totalqueriestime: 0.00116324424744', '127.0.0.1'), +(30, 1228767091, 'admin', 'NOTICE', 'runtime: 0.268568992615; totalqueries: 6; totalqueriestime: 0.00105500221252', '127.0.0.1'), +(31, 1228767258, 'admin', 'NOTICE', 'runtime: 0.26207113266; totalqueries: 6; totalqueriestime: 0.00106501579285', '127.0.0.1'), +(32, 1228767334, 'admin', 'NOTICE', 'runtime: 0.275465011597; totalqueries: 6; totalqueriestime: 0.00116205215454', '127.0.0.1'), +(33, 1228767360, 'admin', 'NOTICE', 'runtime: 0.423779964447; totalqueries: 6; totalqueriestime: 0.00103998184204', '127.0.0.1'), +(34, 1228767377, 'admin', 'NOTICE', 'runtime: 0.297820091248; totalqueries: 6; totalqueriestime: 0.00109577178955', '127.0.0.1'), +(35, 1228767424, 'admin', 'NOTICE', 'runtime: 0.332688093185; totalqueries: 6; totalqueriestime: 0.00102591514587', '127.0.0.1'), +(36, 1228767434, 'admin', 'NOTICE', 'runtime: 0.297483921051; totalqueries: 6; totalqueriestime: 0.00101661682129', '127.0.0.1'), +(37, 1228767933, 'admin', 'NOTICE', 'runtime: 0.311790943146; totalqueries: 6; totalqueriestime: 0.00101613998413', '127.0.0.1'), +(38, 1228767948, 'admin', 'NOTICE', 'runtime: 0.275632143021; totalqueries: 6; totalqueriestime: 0.000970840454102', '127.0.0.1'), +(39, 1228767974, 'admin', 'NOTICE', 'runtime: 0.283143997192; totalqueries: 6; totalqueriestime: 0.000986099243164', '127.0.0.1'), +(40, 1228768018, 'admin', 'NOTICE', 'runtime: 0.272602081299; totalqueries: 6; totalqueriestime: 0.00103712081909', '127.0.0.1'), +(41, 1228768043, 'admin', 'NOTICE', 'runtime: 0.257270097733; totalqueries: 6; totalqueriestime: 0.00101089477539', '127.0.0.1'), +(42, 1228768049, 'admin', 'ERR', 'Type:EXCEPTION_NO_ACTION\nTrace:#0 D:\\server\\library\\Zend\\Controller\\Plugin\\Broker.php(309): Ostacium_Controller_Plugin_ErrorHandler->preDispatch(Object(Ostacium_Controller_Request_Http))\n#1 D:\\server\\library\\Zend\\Controller\\Front.php(921): Zend_Controller_Plugin_Broker->preDispatch(Object(Ostacium_Controller_Request_Http))\n#2 D:\\server\\library\\Application.php(51): Zend_Controller_Front->dispatch()\n#3 D:\\server\\httpdocs\\index.php(13): Application->bootstrap()\n#4 {main}', '127.0.0.1'), +(43, 1228768049, 'admin', 'NOTICE', 'runtime: 0.269228935242; totalqueries: 6; totalqueriestime: 0.000887870788574', '127.0.0.1'), +(44, 1228768867, 'admin', 'NOTICE', 'runtime: 0.231039047241; totalqueries: 6; totalqueriestime: 0.000965118408203', '127.0.0.1'), +(45, 1228768896, 'admin', 'NOTICE', 'runtime: 0.437469005585; totalqueries: 6; totalqueriestime: 0.00623726844788', '127.0.0.1'), +(46, 1228768902, 'admin', 'NOTICE', 'runtime: 0.251997947693; totalqueries: 6; totalqueriestime: 0.00103378295898', '127.0.0.1'), +(47, 1228770333, 'admin', 'NOTICE', 'runtime: 0.264349937439; totalqueries: 6; totalqueriestime: 0.00107169151306', '127.0.0.1'), +(48, 1228770367, 'admin', 'NOTICE', 'runtime: 0.241730928421; totalqueries: 6; totalqueriestime: 0.00105619430542', '127.0.0.1'), +(49, 1228770407, 'admin', 'NOTICE', 'runtime: 0.25093793869; totalqueries: 6; totalqueriestime: 0.00124430656433', '127.0.0.1'), +(50, 1228770465, 'admin', 'NOTICE', 'runtime: 0.269231081009; totalqueries: 6; totalqueriestime: 0.00140309333801', '127.0.0.1'), +(51, 1228770715, 'admin', 'NOTICE', 'runtime: 0.262792110443; totalqueries: 6; totalqueriestime: 0.00123476982117', '127.0.0.1'), +(52, 1228771020, 'admin', 'NOTICE', 'runtime: 0.300353050232; totalqueries: 6; totalqueriestime: 0.00111222267151', '127.0.0.1'), +(53, 1228771033, 'admin', 'ERR', 'Type:EXCEPTION_NO_ACTION\nTrace:#0 D:\\server\\library\\Zend\\Controller\\Plugin\\Broker.php(309): Ostacium_Controller_Plugin_ErrorHandler->preDispatch(Object(Ostacium_Controller_Request_Http))\n#1 D:\\server\\library\\Zend\\Controller\\Front.php(921): Zend_Controller_Plugin_Broker->preDispatch(Object(Ostacium_Controller_Request_Http))\n#2 D:\\server\\library\\Application.php(51): Zend_Controller_Front->dispatch()\n#3 D:\\server\\httpdocs\\index.php(13): Application->bootstrap()\n#4 {main}', '127.0.0.1'), +(54, 1228771033, 'admin', 'NOTICE', 'runtime: 0.234899997711; totalqueries: 6; totalqueriestime: 0.00088906288147', '127.0.0.1'), +(55, 1228771053, 'admin', 'NOTICE', 'runtime: 0.714066982269; totalqueries: 6; totalqueriestime: 0.00090503692627', '127.0.0.1'), +(56, 1228771484, 'admin', 'NOTICE', 'runtime: 0.465132951736; totalqueries: 7; totalqueriestime: 0.00111651420593', '127.0.0.1'), +(57, 1228771529, 'admin', 'NOTICE', 'runtime: 0.298429965973; totalqueries: 6; totalqueriestime: 0.00111413002014', '127.0.0.1'), +(58, 1228771563, 'admin', 'NOTICE', 'runtime: 0.302327156067; totalqueries: 6; totalqueriestime: 0.00112509727478', '127.0.0.1'), +(59, 1228771785, 'admin', 'NOTICE', 'runtime: 0.284492015839; totalqueries: 6; totalqueriestime: 0.0012526512146', '127.0.0.1'), +(60, 1228826180, 'admin', 'NOTICE', 'runtime: 13.5730581284; totalqueries: 6; totalqueriestime: 0.00137305259705', '127.0.0.1'), +(61, 1228826199, 'admin', 'ERR', 'Type:EXCEPTION_NO_CONTROLLER\nTrace:#0 D:\\server\\library\\Zend\\Controller\\Plugin\\Broker.php(309): Ostacium_Controller_Plugin_ErrorHandler->preDispatch(Object(Ostacium_Controller_Request_Http))\n#1 D:\\server\\library\\Zend\\Controller\\Front.php(921): Zend_Controller_Plugin_Broker->preDispatch(Object(Ostacium_Controller_Request_Http))\n#2 D:\\server\\library\\Application.php(51): Zend_Controller_Front->dispatch()\n#3 D:\\server\\httpdocs\\index.php(13): Application->bootstrap()\n#4 {main}', '127.0.0.1'), +(62, 1228826199, 'admin', 'NOTICE', 'runtime: 0.783575057983; totalqueries: 6; totalqueriestime: 0.000910758972168', '127.0.0.1'), +(63, 1228826201, 'admin', 'ERR', 'Type:EXCEPTION_NO_CONTROLLER\nTrace:#0 D:\\server\\library\\Zend\\Controller\\Plugin\\Broker.php(309): Ostacium_Controller_Plugin_ErrorHandler->preDispatch(Object(Ostacium_Controller_Request_Http))\n#1 D:\\server\\library\\Zend\\Controller\\Front.php(921): Zend_Controller_Plugin_Broker->preDispatch(Object(Ostacium_Controller_Request_Http))\n#2 D:\\server\\library\\Application.php(51): Zend_Controller_Front->dispatch()\n#3 D:\\server\\httpdocs\\index.php(13): Application->bootstrap()\n#4 {main}', '127.0.0.1'), +(64, 1228826201, 'admin', 'NOTICE', 'runtime: 0.235674142838; totalqueries: 6; totalqueriestime: 0.00092077255249', '127.0.0.1'), +(65, 1228843063, 'admin', 'NOTICE', 'runtime: 0.402568101883; totalqueries: 6; totalqueriestime: 0.00116920471191', '127.0.0.1'), +(66, 1228843086, 'admin', 'NOTICE', 'runtime: 0.260549068451; totalqueries: 6; totalqueriestime: 0.00125503540039', '127.0.0.1'), +(67, 1228843598, 'admin', 'NOTICE', 'runtime: 0.280871152878; totalqueries: 6; totalqueriestime: 0.00107192993164', '127.0.0.1'), +(68, 1228843602, 'admin', 'NOTICE', 'runtime: 0.274296045303; totalqueries: 6; totalqueriestime: 0.00107288360596', '127.0.0.1'), +(69, 1228843606, 'admin', 'NOTICE', 'runtime: 0.405455112457; totalqueries: 6; totalqueriestime: 0.00119829177856', '127.0.0.1'), +(70, 1228843619, 'admin', 'NOTICE', 'runtime: 0.31596493721; totalqueries: 6; totalqueriestime: 0.00110936164856', '127.0.0.1'), +(71, 1228844705, 'admin', 'NOTICE', 'runtime: 0.395545959473; totalqueries: 6; totalqueriestime: 0.00116276741028', '127.0.0.1'), +(72, 1228844717, 'admin', 'NOTICE', 'runtime: 0.314126968384; totalqueries: 6; totalqueriestime: 0.00121402740479', '127.0.0.1'), +(73, 1228844720, 'admin', 'NOTICE', 'runtime: 0.27409696579; totalqueries: 6; totalqueriestime: 0.00108957290649', '127.0.0.1'), +(74, 1228844724, 'admin', 'NOTICE', 'runtime: 0.29937005043; totalqueries: 6; totalqueriestime: 0.00117301940918', '127.0.0.1'), +(75, 1228849580, 'admin', 'NOTICE', 'runtime: 0.350373983383; totalqueries: 6; totalqueriestime: 0.00121092796326', '127.0.0.1'), +(76, 1228849582, 'admin', 'NOTICE', 'runtime: 0.32250213623; totalqueries: 6; totalqueriestime: 0.00111365318298', '127.0.0.1'), +(77, 1228849585, 'admin', 'NOTICE', 'runtime: 0.283563137054; totalqueries: 6; totalqueriestime: 0.00141477584839', '127.0.0.1'), +(78, 1228849587, 'admin', 'NOTICE', 'runtime: 1.00412106514; totalqueries: 6; totalqueriestime: 0.00116395950317', '127.0.0.1'), +(79, 1228849587, 'admin', 'NOTICE', 'runtime: 1.16452503204; totalqueries: 6; totalqueriestime: 0.000949621200562', '127.0.0.1'), +(80, 1228849594, 'admin', 'NOTICE', 'runtime: 0.435815095901; totalqueries: 7; totalqueriestime: 0.00116896629333', '127.0.0.1'), +(81, 1228849677, 'admin', 'NOTICE', 'runtime: 0.318450927734; totalqueries: 6; totalqueriestime: 0.00130677223206', '127.0.0.1'), +(82, 1228849750, 'admin', 'NOTICE', 'runtime: 0.407657146454; totalqueries: 7; totalqueriestime: 0.00122785568237', '127.0.0.1'), +(83, 1228849778, 'admin', 'NOTICE', 'runtime: 0.414417028427; totalqueries: 7; totalqueriestime: 0.00116395950317', '127.0.0.1'), +(84, 1228849789, 'admin', 'NOTICE', 'runtime: 0.319971084595; totalqueries: 6; totalqueriestime: 0.00115609169006', '127.0.0.1'), +(85, 1228849961, 'admin', 'NOTICE', 'runtime: 0.32728600502; totalqueries: 6; totalqueriestime: 0.00110483169556', '127.0.0.1'), +(86, 1228850462, 'admin', 'NOTICE', 'runtime: 0.33651804924; totalqueries: 6; totalqueriestime: 0.00116801261902', '127.0.0.1'), +(87, 1228850649, 'admin', 'NOTICE', 'runtime: 0.328559160233; totalqueries: 6; totalqueriestime: 0.00132656097412', '127.0.0.1'), +(88, 1228850917, 'admin', 'NOTICE', 'runtime: 0.306250095367; totalqueries: 6; totalqueriestime: 0.00110626220703', '127.0.0.1'), +(89, 1228857665, 'admin', 'NOTICE', 'runtime: 1.30937600136; totalqueries: 6; totalqueriestime: 0.00122904777527', '127.0.0.1'), +(90, 1228857669, 'admin', 'NOTICE', 'runtime: 0.324778079987; totalqueries: 6; totalqueriestime: 0.00106501579285', '127.0.0.1'), +(91, 1228922920, 'guest', 'NOTICE', 'runtime: 4.43998098373; totalqueries: 5; totalqueriestime: 0.0010986328125', '127.0.0.1'), +(92, 1228927133, 'guest', 'ERR', 'Type:EXCEPTION_NO_ACTION\nTrace:#0 D:\\server\\library\\Zend\\Controller\\Plugin\\Broker.php(309): Ostacium_Controller_Plugin_ErrorHandler->preDispatch(Object(Ostacium_Controller_Request_Http))\n#1 D:\\server\\library\\Zend\\Controller\\Front.php(921): Zend_Controller_Plugin_Broker->preDispatch(Object(Ostacium_Controller_Request_Http))\n#2 D:\\server\\library\\Application.php(51): Zend_Controller_Front->dispatch()\n#3 D:\\server\\httpdocs\\index.php(13): Application->bootstrap()\n#4 {main}', '127.0.0.1'), +(93, 1228927133, 'guest', 'NOTICE', 'runtime: 0.472977161407; totalqueries: 6; totalqueriestime: 0.00107407569885', '127.0.0.1'), +(94, 1228927141, 'guest', 'NOTICE', 'runtime: 0.385906934738; totalqueries: 5; totalqueriestime: 0.000811100006104', '127.0.0.1'), +(95, 1228927146, 'guest', 'NOTICE', 'runtime: 0.364606142044; totalqueries: 5; totalqueriestime: 0.000753879547119', '127.0.0.1'), +(96, 1228927151, 'guest', 'ERR', 'Type:EXCEPTION_NO_ACTION\nTrace:#0 D:\\server\\library\\Zend\\Controller\\Plugin\\Broker.php(309): Ostacium_Controller_Plugin_ErrorHandler->preDispatch(Object(Ostacium_Controller_Request_Http))\n#1 D:\\server\\library\\Zend\\Controller\\Front.php(921): Zend_Controller_Plugin_Broker->preDispatch(Object(Ostacium_Controller_Request_Http))\n#2 D:\\server\\library\\Application.php(51): Zend_Controller_Front->dispatch()\n#3 D:\\server\\httpdocs\\index.php(13): Application->bootstrap()\n#4 {main}', '127.0.0.1'), +(97, 1228927151, 'guest', 'NOTICE', 'runtime: 0.259967088699; totalqueries: 6; totalqueriestime: 0.000933170318604', '127.0.0.1'), +(98, 1228927190, 'guest', 'NOTICE', 'runtime: 0.358453035355; totalqueries: 5; totalqueriestime: 0.000750780105591', '127.0.0.1'), +(99, 1228927196, 'panza', 'NOTICE', 'runtime: 0.361056089401; totalqueries: 5; totalqueriestime: 0.00078010559082', '127.0.0.1'), +(100, 1228927202, 'panza', 'NOTICE', 'runtime: 0.644073009491; totalqueries: 6; totalqueriestime: 0.0622811317444', '127.0.0.1'), +(101, 1228927206, 'panza', 'NOTICE', 'runtime: 0.314320087433; totalqueries: 6; totalqueriestime: 0.00124430656433', '127.0.0.1'), +(102, 1228927213, 'panza', 'NOTICE', 'runtime: 0.276901006699; totalqueries: 6; totalqueriestime: 0.00113844871521', '127.0.0.1'), +(103, 1228927238, 'panza', 'NOTICE', 'runtime: 0.278286933899; totalqueries: 6; totalqueriestime: 0.00106000900269', '127.0.0.1'), +(104, 1228928996, 'panza', 'NOTICE', 'runtime: 0.269110202789; totalqueries: 7; totalqueriestime: 0.00115633010864', '127.0.0.1'); -- -------------------------------------------------------- @@ -614,6 +777,7 @@ (1, 5), (1, 6), (1, 8), +(2, 9), (4, 7); -- -------------------------------------------------------- @@ -627,7 +791,7 @@ `controller` varchar(50) NOT NULL, `action` varchar(50) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ; -- -- Dumping data for table `resources` @@ -641,7 +805,8 @@ (5, 'acm:index', '*'), (6, 'acm:archieve', '*'), (7, 'acm:tester', '*'), -(8, 'acm:user', '*'); +(8, 'acm:user', '*'), +(9, 'acm:contest', '*'); -- -------------------------------------------------------- @@ -686,6 +851,76 @@ -- -------------------------------------------------------- -- +-- Table structure for table `submits` +-- + +CREATE TABLE IF NOT EXISTS `submits` ( + `id` int(11) NOT NULL auto_increment, + `contestid` int(11) NOT NULL default '0', + `username` varchar(50) NOT NULL, + `challengeid` int(11) NOT NULL, + `codelangid` int(11) NOT NULL, + `state` int(11) NOT NULL default '0', + `tests` int(11) NOT NULL default '0', + `firsttest` tinyint(1) NOT NULL, + `runtime` double NOT NULL default '0', + `memory` int(11) NOT NULL default '0', + `when` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ; + +-- +-- Dumping data for table `submits` +-- + +INSERT INTO `submits` (`id`, `contestid`, `username`, `challengeid`, `codelangid`, `state`, `tests`, `firsttest`, `runtime`, `memory`, `when`) VALUES +(3, 0, 'tester', 1000, 1, 1, 100, 0, 1002, 1001, 1228664380), +(5, 0, 'panza', 1000, 1, 1, 100, 1, 1000, 1000, 1228685834), +(6, 1, 'admin', 1000, 1, 0, 0, 0, 0, 0, 1228771484), +(9, 1, 'admin', 1000, 1, 0, 0, 0, 0, 0, 1228849778); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `teams` +-- + +CREATE TABLE IF NOT EXISTS `teams` ( + `id` int(11) NOT NULL, + `name` varchar(100) NOT NULL, + `captain` varchar(50) NOT NULL, + `trainer` varchar(100) NOT NULL, + `contests` int(11) NOT NULL, + `tries` int(11) NOT NULL, + `accepted` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `teams` +-- + + +-- -------------------------------------------------------- + +-- +-- Table structure for table `teams_members` +-- + +CREATE TABLE IF NOT EXISTS `teams_members` ( + `teamid` int(11) NOT NULL, + `username` varchar(50) NOT NULL, + PRIMARY KEY (`teamid`,`username`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `teams_members` +-- + + +-- -------------------------------------------------------- + +-- -- Table structure for table `users` -- @@ -710,7 +945,7 @@ INSERT INTO `users` (`username`, `password`, `email`, `registered`, `online`, `posts`, `roleid`, `activated`, `banned`, `ip`) VALUES ('admin', 'e2a7106f1cc8bb1e1318df70aa0a3540', 'ad...@os...', 1223066421, 1223066447, 0, 2, NULL, 0, '192.168.1.7'), -('tester', 'e2a7106f1cc8bb1e1318df70aa0a3540', 'te...@os...', 1228663658, 0, 0, 4, NULL, 0, ''), +('tester', 'e2a7106f1cc8bb1e1318df70aa0a3540', 'te...@os...', 1228663658, 1228927008, 0, 4, NULL, 0, ''), ('panza', 'e2a7106f1cc8bb1e1318df70aa0a3540', 'pa...@os...', 1228684723, 1228684723, 0, 2, NULL, 0, '127.0.0.1'); -- -------------------------------------------------------- @@ -723,7 +958,7 @@ `username` varchar(50) NOT NULL, `name` varchar(50) NOT NULL, `surname` varchar(50) NOT NULL, - `study` varchar(50) NOT NULL, + `study` varchar(50) default NULL, `birthday` int(11) NOT NULL, `aim` varchar(50) default NULL, `icq` varchar(50) default NULL, @@ -747,8 +982,8 @@ INSERT INTO `usersdetails` (`username`, `name`, `surname`, `study`, `birthday`, `aim`, `icq`, `msn`, `skype`, `yahoo`, `web`, `topcoder`, `timus`, `timeoffset`, `codelangid`, `language`, `tshirtsize`, `hideemail`) VALUES ('admin', 'Igor', 'Petrovich', 'LNU PMI-21', 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '+2', 1, 'en', 'small', 0), -('tester', 'Tester', 'Tester', '', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', 1, 'en', '', 1), -('panza', 'Igor', 'Petrovich', 'LNU', 1988, '', '', 'pan...@ho...', '', '', 'http://www.panzaboi.com/', '', '', '+2', 1, 'uk', 'L', 0); +('tester', 'Tester', 'Tester', NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', 1, 'en', '', 1), +('panza', 'Igor', 'Petrovich', 'LNU', 1988, NULL, NULL, 'pan...@ho...', NULL, NULL, 'http://www.panzaboi.com/', NULL, NULL, '+2', 1, 'uk', 'L', 0); -- -------------------------------------------------------- @@ -760,6 +995,8 @@ `username` varchar(50) NOT NULL, `archieve_tries` int(11) NOT NULL default '0', `archieve_accepts` int(11) NOT NULL default '0', + `contest_tries` int(11) NOT NULL default '0', + `contest_accepts` int(11) NOT NULL default '0', PRIMARY KEY (`username`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; @@ -767,7 +1004,7 @@ -- Dumping data for table `usersstats` -- -INSERT INTO `usersstats` (`username`, `archieve_tries`, `archieve_accepts`) VALUES -('admin', 0, 0), -('tester', 0, 0), -('panza', 0, 0); +INSERT INTO `usersstats` (`username`, `archieve_tries`, `archieve_accepts`, `contest_tries`, `contest_accepts`) VALUES +('admin', 0, 0, 0, 0), +('tester', 0, 0, 0, 0), +('panza', 0, 0, 0, 0); Added: website/other/submits/6 =================================================================== --- website/other/submits/6 (rev 0) +++ website/other/submits/6 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1,33 @@ +#include "fuel.h" +#include <algorithm> + +void saveHighest(vector<Fuel>& v) +{ + Fuel::FUELTYPE current = Fuel::FUELTYPE::LOW; + fstream f("out.txt"); + + f << *(v.begin()) << endl; + + for (vector<Fuel>::iterator i = v.begin(); i != v.end(); i++) + { + if ((*i).getType() != current) + { + current = (*i).getType(); + f << (*i) << endl; + } + } +} + +int main() +{ + vector<Fuel> v; + fstream f("in.txt"); + + f >> v; + + sort(v.begin(), v.end()); + + saveHighest(v); + + return 0; +} \ No newline at end of file Added: website/other/submits/7 =================================================================== --- website/other/submits/7 (rev 0) +++ website/other/submits/7 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1,33 @@ +#include "fuel.h" +#include <algorithm> + +void saveHighest(vector<Fuel>& v) +{ + Fuel::FUELTYPE current = Fuel::FUELTYPE::LOW; + fstream f("out.txt"); + + f << *(v.begin()) << endl; + + for (vector<Fuel>::iterator i = v.begin(); i != v.end(); i++) + { + if ((*i).getType() != current) + { + current = (*i).getType(); + f << (*i) << endl; + } + } +} + +int main() +{ + vector<Fuel> v; + fstream f("in.txt"); + + f >> v; + + sort(v.begin(), v.end()); + + saveHighest(v); + + return 0; +} \ No newline at end of file Added: website/other/submits/8 =================================================================== --- website/other/submits/8 (rev 0) +++ website/other/submits/8 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1,33 @@ +#include "fuel.h" +#include <algorithm> + +void saveHighest(vector<Fuel>& v) +{ + Fuel::FUELTYPE current = Fuel::FUELTYPE::LOW; + fstream f("out.txt"); + + f << *(v.begin()) << endl; + + for (vector<Fuel>::iterator i = v.begin(); i != v.end(); i++) + { + if ((*i).getType() != current) + { + current = (*i).getType(); + f << (*i) << endl; + } + } +} + +int main() +{ + vector<Fuel> v; + fstream f("in.txt"); + + f >> v; + + sort(v.begin(), v.end()); + + saveHighest(v); + + return 0; +} \ No newline at end of file Added: website/other/submits/9 =================================================================== --- website/other/submits/9 (rev 0) +++ website/other/submits/9 2008-12-10 17:34:11 UTC (rev 442) @@ -0,0 +1,33 @@ +#include "fuel.h" +#include <algorithm> + +void saveHighest(vector<Fuel>& v) +{ + Fuel::FUELTYPE current = Fuel::FUELTYPE::LOW; + fstream f("out.txt"); + + f << *(v.begin()) << endl; + + for (vector<Fuel>::iterator i = v.begin(); i != v.end(); i++) + { + if ((*i).getType() != current) + { + current = (*i).getType(); + f << (*i) << endl; + } + } +} + +int main() +{ + vector<Fuel> v; + fstream f("in.txt"); + + f >> v; + + sort(v.begin(), v.end()); + + saveHighest(v); + + return 0; +} \ No newline at end of file Modified: website/other/todo.txt =================================================================== --- website/other/todo.txt 2008-12-10 00:41:43 UTC (rev 441) +++ website/other/todo.txt 2008-12-10 17:34:11 UTC (rev 442) @@ -1,3 +1,7 @@ +1. Virtual Contests +2. Teams +3. Team Contests +------------------------------------------------ +/-1. Add Zend_Log, write - undecided, FILE? DB? 2. Design Change 3. Ostacium_CrudAction redesign @@ -5,7 +9,7 @@ 5. Front_Controller => catch Exception => go to Error Controller 6. Caching for DB, VIEW, etc. -7. Table Prefix - відложено -8. Custom Admin Email ++8. Custom From Email 9. Add mb_ support to everything 10!. _authenticateCreateSelect - quote the reference! how? 11. Extend Profiler - getLongestQuery \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |