mirror of https://github.com/BOINC/boinc.git
- web DB code: fix PHP warning when enumeration returns nothing.
From Nicolas. fixes #974 - client: tiny code shuffle svn path=/trunk/boinc/; revision=20178
This commit is contained in:
parent
76d3d51331
commit
e7dcff182f
|
@ -427,4 +427,14 @@ Rom 14 Jan 2010
|
|||
|
||||
clientgui/
|
||||
ViewNotices.cpp,h
|
||||
|
||||
|
||||
David 15 Jan 2010
|
||||
- web DB code: fix PHP warning when enumeration returns nothing.
|
||||
From Nicolas. fixes #974
|
||||
- client: tiny code shuffle
|
||||
|
||||
client/
|
||||
work_fetch.cpp
|
||||
cpu_sched.cpp
|
||||
html/inc/
|
||||
db_conn.inc
|
||||
|
|
|
@ -827,7 +827,7 @@ static inline bool more_important(RESULT* r0, RESULT* r1) {
|
|||
if (miss0 && !miss1) return true;
|
||||
if (!miss0 && miss1) return false;
|
||||
|
||||
// favor coproc jobs, so that if we're RAM-limited
|
||||
// favor coproc jobs, so that e.g. if we're RAM-limited
|
||||
// we'll use the GPU instead of the CPU
|
||||
//
|
||||
bool cp0 = r0->uses_coprocs();
|
||||
|
|
|
@ -254,6 +254,11 @@ void RSC_WORK_FETCH::update_busy_time(double dur, double nused) {
|
|||
busy_time_estimator.update(dur, nused);
|
||||
}
|
||||
|
||||
static bool wacky_dcf(PROJECT* p) {
|
||||
double dcf = p->duration_correction_factor;
|
||||
return (dcf < 0.02 || dcf > 80.0);
|
||||
}
|
||||
|
||||
// Choose the best project to ask for work for this resource,
|
||||
// given the specific criterion
|
||||
//
|
||||
|
@ -283,6 +288,10 @@ PROJECT* RSC_WORK_FETCH::choose_project(int criterion) {
|
|||
switch (criterion) {
|
||||
case FETCH_IF_MINOR_SHORTFALL:
|
||||
if (rpwf.overworked()) continue;
|
||||
if (wacky_dcf(p)) continue;
|
||||
break;
|
||||
case FETCH_IF_MAJOR_SHORTFALL:
|
||||
if (wacky_dcf(p)) continue;
|
||||
break;
|
||||
case FETCH_IF_PROJECT_STARVED:
|
||||
if (rpwf.overworked()) continue;
|
||||
|
@ -340,8 +349,7 @@ void RSC_WORK_FETCH::set_request(PROJECT* p) {
|
|||
if (!w.may_have_work) return;
|
||||
if (w.overworked()) return;
|
||||
if (shortfall) {
|
||||
double dcf = p->duration_correction_factor;
|
||||
if (dcf < 0.02 || dcf > 80.0) {
|
||||
if (wacky_dcf(p)) {
|
||||
// if project's DCF is too big or small,
|
||||
// its completion time estimates are useless; just ask for 1 second
|
||||
//
|
||||
|
|
|
@ -43,16 +43,16 @@ array(
|
|||
'',
|
||||
1234896753
|
||||
),
|
||||
array(
|
||||
'http://www.weebl00.nl/leiterow/zowtar/BOINC/',
|
||||
'BOINC mIRC',
|
||||
'0.1',
|
||||
'MRC file for sending your BOINC status on IRC',
|
||||
'http://www.weebl00.nl/leiterow/zowtar/BOINC/',
|
||||
'all',
|
||||
'',
|
||||
1177964485
|
||||
),
|
||||
//array(
|
||||
// 'http://www.weebl00.nl/leiterow/zowtar/BOINC/',
|
||||
// 'BOINC mIRC',
|
||||
// '0.1',
|
||||
// 'MRC file for sending your BOINC status on IRC',
|
||||
// 'http://www.weebl00.nl/leiterow/zowtar/BOINC/',
|
||||
// 'all',
|
||||
// '',
|
||||
// 1177964485
|
||||
//),
|
||||
//array('boinc-irc.exe',
|
||||
// 'Boinc mIRC',
|
||||
// '1.0',
|
||||
|
|
|
@ -130,11 +130,6 @@ function show_create() {
|
|||
<li><b>Companies</b>:
|
||||
use BOINC for <a href=dg.php>desktop Grid computing</a>.
|
||||
</ul>
|
||||
Related software:
|
||||
<ul>
|
||||
<li> <a href=\"http://bolt.berkeley.edu/\">Bolt</a>: middleware for web-based education and training
|
||||
<li> <a href=\"http://bossa.berkeley.edu/\">Bossa</a>: middleware for distributed thinking projects
|
||||
</ul>
|
||||
</td></tr>
|
||||
";
|
||||
}
|
||||
|
@ -147,8 +142,20 @@ function show_other() {
|
|||
</center>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
<table width=100%><tr><td width=50% valign=top>
|
||||
<ul>
|
||||
<li> ".tra("Help wanted!")."
|
||||
<li> <a href=\"dev/\">".tra("Message boards")."</a>
|
||||
<li> <a href=email_lists.php>".tra("Email lists")."</a>
|
||||
<li> <a href=\"trac/wiki/ProjectPeople\">".tra("Personnel and contributors")."</a>
|
||||
<li> <a href=\"trac/wiki/BoincEvents\">".tra("Events")."</a>
|
||||
<li> <a href=\"trac/wiki/BoincPapers\">".tra("Papers and talks")."</a>
|
||||
<li> <a href=\"trac/wiki/ResearchProjects\">".tra("Research projects")."</a>
|
||||
<li> <a href=logo.php>".tra("Logos and graphics")."</a>
|
||||
<li> <a href=\"http://bolt.berkeley.edu/\">Bolt</a> and <a href=\"http://bossa.berkeley.edu/\">Bossa</a>
|
||||
</ul>
|
||||
</td><td valign=top>
|
||||
<ul>
|
||||
<li> ".tra("Help wanted")."
|
||||
<ul>
|
||||
<li> <a href=\"trac/wiki/DevProjects\">".tra("Programming")."</a>
|
||||
<li> <a href=\"trac/wiki/TranslateIntro\">".tra("Translation")."</a>
|
||||
|
@ -158,15 +165,8 @@ function show_other() {
|
|||
</ul>
|
||||
<li> <a href=\"trac/wiki/SoftwareDevelopment\">".tra("Software development")."</a>
|
||||
<li> <a href=\"trac/wiki/SoftwareAddon\">".tra("APIs for add-on software")."</a>
|
||||
<li> <a href=\"trac/wiki/ProjectPeople\">".tra("Personnel and contributors")."</a>
|
||||
<li> <a href=\"dev/\">".tra("Message boards")."</a>
|
||||
<li> <a href=email_lists.php>".tra("Email lists")."</a>
|
||||
<li> <a href=\"trac/wiki/BoincEvents\">".tra("Events")."</a>
|
||||
<li> <a href=\"trac/wiki/ConferenceList\">".tra("Conferences")."</a>
|
||||
<li> <a href=\"trac/wiki/BoincPapers\">".tra("Papers and talks")."</a>
|
||||
<li> <a href=logo.php>".tra("Logos and graphics")."</a>
|
||||
<li> <a href=\"trac/wiki/ResearchProjects\">".tra("Research projects")."</a>
|
||||
</ul>
|
||||
</td></tr></table>
|
||||
<br>
|
||||
</td></tr>
|
||||
";
|
||||
|
|
|
@ -83,6 +83,7 @@ class DbConn {
|
|||
function enum_general($classname, $query) {
|
||||
$result = $this->do_query($query);
|
||||
if (!$result) return null;
|
||||
$x = array();
|
||||
while ($obj = mysql_fetch_object($result, $classname)) {
|
||||
$x[] = $obj;
|
||||
}
|
||||
|
@ -100,6 +101,7 @@ class DbConn {
|
|||
$query = "select $fields from DBNAME.$table $where_clause $order_clause";
|
||||
$result = $this->do_query($query);
|
||||
if (!$result) return null;
|
||||
$x = array();
|
||||
while ($obj = mysql_fetch_object($result, $classname)) {
|
||||
$x[] = $obj;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue