Warning: session_start(): open(/var/lib/php/sessions/sess_q03r4ebff823lfljl44vvrdj9d, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
sclass Lowest {
A best;
double score;
transient O onChange;
synchronized bool isNewBest(double score) {
ret best == null || score < this.score;
}
synchronized double bestScore() {
ret best == null ? Double.NaN : score;
}
double score() { ret bestScore(); }
synchronized float floatScore() {
ret best == null ? Float.NaN : (float) score;
}
synchronized float floatScoreOr(float defaultValue) {
ret best == null ? defaultValue : (float) score;
}
bool put(A a, double score) {
bool change = false;
synchronized(this) {
if (a != null && isNewBest(score)) {
best = a;
this.score = score;
change = true;
}
}
if (change)
pcallF(onChange);
ret change;
}
synchronized A get() { ret best; }
synchronized bool has() { ret best != null; }
}