**********************************************************************************************************
964423
public function afficherRecapitulatifAncres($idEvenementGroupeAdresse = 0, $idEvenementCourant = 0)
    {
        $html="";
        $t = new Template('modules/archi/templates/');
        $t->set_filenames((array('recapitulatifAncres'=>'recapitulatifAncres.tpl')));

        $resEvenementsLies=$this->getInfosEvenementsLiesForAncres($idEvenementGroupeAdresse);

        while ($fetch = mysql_fetch_assoc($resEvenementsLies)) {
            $couleur = "#000000";

            if ($fetch['idEvenement'] == $idEvenementCourant) {
                $couleur = "#FF0000";
            }


            // le type de structure est le meme que l'evenement precedent , on ne l'affiche pas, c'est pour cela qu'on le transmet a la fonction d'affichage

            $titreAncre = _("Sans titre");
            if (trim($fetch['titre'])!='') {
                $titreAncre = $fetch['titre'];
            }

            if ($fetch['nomTypeEvenement']!='') {
                $titreAncre.=" - ".$fetch['nomTypeEvenement'];
            }
            if ($fetch['date']!='' && $fetch['date']!='0000-00-00') {
                $titreAncre.=" - ".$this->date->toFrench($fetch['date']);
            }

            $t->assign_block_vars('ancres', array(
                    'titre' => stripslashes($titreAncre),
                    'couleur'=>$couleur
            ));
        }

        ob_start();
        $t->pparse('recapitulatifAncres');
        $html .= ob_get_contents();
        ob_end_clean();

        return $html;
    }
798330
public function notBetween()
    {
        $this->failIf(
            $this->data[0] >= $this->data[1] &&
            $this->data[0] <= $this->data[2]
        );
    }
1174745
public function onBeforeWrite()
    {
        if (!$this->isInDB()) {
            $this->CreatorID = Member::currentUserID();
        }

        if (!$this->VersionNumber) {
            $versions = DataObject::get(
                'FileVersion', sprintf('"FileID" = %d', $this->FileID)
            );

            if ($versions) {
                $this->VersionNumber = $versions->Count() + 1;
            } else {
                $this->VersionNumber = 1;
            }
        }

        if (!$this->Filename) {
            $this->Filename = $this->saveCurrentVersion();
        }

        parent::onBeforeWrite();
    }
464405
public function empty()
    {
        if ($this->small > 0 || $this->tall > 0 || $this->wide > 0) {
            for ($i = 0; $i < $this->rows; $i += 1) {
                for ($j = 0; $j < $this->columns; $j += 1) {
                    $this->cells[$i][$j] = null;
                }
            }
            $this->small = 0;
            $this->tall = 0;
            $this->wide = 0;
        }
    }
44826
private boolean _createDeltas()
    {
        if (isInitialStateMarked())
        {
            if (_deltas == null)
            {
                _deltas = new HashMap<Serializable, Object>(2);
            }
            return true;
        }

        return false;
    }
1150746
public function sortChange($value)
    {
        if ($value == 0) {
            return;
        }
        $owner = $this->owner;
        $condition = $this->getCondition();
        $newSort = $owner->{$this->sortAttribute} + $value;
        if ($value > 0) {
            // move up
            $max = $this->getMaxSort();
            if ($owner->{$this->sortAttribute} === $max) {
                return;
            }
            if ($newSort >= $max) {
                $newSort = $max;
            }
            $condition[] = [">", $this->sortAttribute, $owner->{$this->sortAttribute}];
            $condition[] = ["<=", $this->sortAttribute, $newSort];
            $counterChanger = -1;
        } else {
            // move down
            if ($owner->{$this->sortAttribute} === 0) {
                return;
            }
            if ($newSort < 0) {
                $newSort = 0;
            }
            $condition[] = ['<', $this->sortAttribute, $owner->{$this->sortAttribute}];
            $condition[] = ['>=', $this->sortAttribute, $newSort];
            $counterChanger = 1;
        }
        $owner->updateAllCounters([$this->sortAttribute => $counterChanger], $condition);
        $owner->updateAttributes([$this->sortAttribute => $newSort]);
    }
1123840
public function init()
    {
        parent::init();
        $this->db = Instance::ensure($this->db, Connection::className());
        if ($this->cache !== null) {
            $this->cache = Instance::ensure($this->cache, Cache::className());
        }
    }
435107
public function process()
    {
        parent::process();

        if ($this->value === null) {
            return;
        }

        $this->value = trim($this->value);

        if ($this->value == '') {
            $this->value = null;
            return;
        }

        if (!$this->validateUri($this->value)) {
            if (
                $this->validateUri($this->default_scheme . '://' . $this->value)
            ) {
                if ($this->scheme_required) {
                    $this->addMessage(
                        $this->getValidationMessage('scheme-required')
                    );
                } else {
                    $this->value = $this->default_scheme . '://' . $this->value;
                }
            } else {
                $this->addMessage($this->getValidationMessage('invalid-uri'));
            }
        }
    }
617827
public function initialize()
    {
        if ($this->isInitialize) {
            return ;
        }

        $this->isInitialize = true;

        $this->getEventManager()->trigger(self::EVENT_INITIALIZE, $this);
    }
6957
private void init() {
        quantiles = new double[data.length][8];
        for (int i = 0; i < data.length; i++) {
            int n = data[i].length;
            Arrays.sort(data[i]);
            quantiles[i][1] = data[i][n / 4];
            quantiles[i][2] = data[i][n / 2];
            quantiles[i][3] = data[i][3 * n / 4];
            quantiles[i][5] = quantiles[i][3] - quantiles[i][1]; // interquartile range
            quantiles[i][6] = quantiles[i][1] - 1.5 * quantiles[i][5];
            quantiles[i][7] = quantiles[i][3] + 1.5 * quantiles[i][5];
            quantiles[i][0] = quantiles[i][6] < data[i][0] ? data[i][0] : quantiles[i][6];
            quantiles[i][4] = quantiles[i][7] > data[i][data[i].length - 1] ? data[i][data[i].length - 1] : quantiles[i][7];
        }
    }
1014246
public function setJdFromYmd(): void
    {
        if ($this->year === 0) {
            $this->minimum_julian_day = 0;
            $this->maximum_julian_day = 0;
        } elseif ($this->month === 0) {
            $this->minimum_julian_day = $this->calendar->ymdToJd($this->year, 1, 1);
            $this->maximum_julian_day = $this->calendar->ymdToJd($this->nextYear($this->year), 1, 1) - 1;
        } elseif ($this->day === 0) {
            [$ny, $nm] = $this->nextMonth();
            $this->minimum_julian_day = $this->calendar->ymdToJd($this->year, $this->month, 1);
            $this->maximum_julian_day = $this->calendar->ymdToJd($ny, $nm, 1) - 1;
        } else {
            $this->minimum_julian_day = $this->calendar->ymdToJd($this->year, $this->month, $this->day);
            $this->maximum_julian_day = $this->minimum_julian_day;
        }
    }
412637
public function populate($data = array())
    {
        if (isset($data['name']) && $data['name'] !== null) {
            $this->name = $data['name'];
        }
        if (isset($data['code']) && $data['code'] !== null) {
            $this->code = $data['code'];
        }
        if (isset($data['phase']) && $data['phase'] !== null) {
            $this->phase = $data['phase'];
        }
        if (isset($data['active']) && $data['active'] !== null) {
            $this->active = $data['active'];
        }
    }
821868
void execute() {

        String sCmd = null;

        if (4096 <= ifHuge.length()) {
            sCmd = ifHuge;
        } else {
            sCmd = txtCommand.getText();
        }

        if (sCmd.startsWith("-->>>TEST<<<--")) {
            testPerformance();

            return;
        }

        String[] g = new String[1];

        lTime = System.currentTimeMillis();

        try {
            if (sStatement == null) {
                return;
            }

            sStatement.execute(sCmd);

            lTime = System.currentTimeMillis() - lTime;

            int r = sStatement.getUpdateCount();

            if (r == -1) {
                formatResultSet(sStatement.getResultSet());
            } else {
                g[0] = "update count";

                gResult.setHead(g);

                g[0] = String.valueOf(r);

                gResult.addRow(g);
            }

            addToRecent(txtCommand.getText());
        } catch (SQLException e) {
            lTime = System.currentTimeMillis() - lTime;
            g[0]  = "SQL Error";

            gResult.setHead(g);

            String s = e.getMessage();

            s    += " / Error Code: " + e.getErrorCode();
            s    += " / State: " + e.getSQLState();
            g[0] = s;

            gResult.addRow(g);
        }

        updateResult();
        System.gc();
    }
1033482
public function process()
    {
        parent::process();

        if ($this->value === null) {
            return;
        }

        try {
            $integer_value = $this->getNumericValue($this->value);

            if ($integer_value === null) {
                $this->addMessage($this->getValidationMessage('integer'));
            } else {
                $this->value = $integer_value;
            }
        } catch (SwatIntegerOverflowException $e) {
            if ($e->getSign() > 0) {
                $this->addMessage(
                    $this->getValidationMessage('integer-maximum')
                );
            } else {
                $this->addMessage(
                    $this->getValidationMessage('integer-minimum')
                );
            }

            $integer_value = null;
        }
    }
996166
public function execute()
    {
        if (!$this->isEmpty()) {
            $this->table->delete($this->context + $this->where)->run();
        }

        parent::execute();
    }
168113
@Override
  public void aggregate()
  {
    final IndexedInts keys = keySelector.getRow();
    for (int i = 0; i < valueSelectors.length; i++) {
      values[i] = valueSelectors[i].getDouble();
    }
    synchronized (this) {
      for (int i = 0, keysSize = keys.size(); i < keysSize; i++) {
        final String key = keySelector.lookupName(keys.get(i));
        sketch.update(key, values);
      }
    }
  }
763427
public function init()
    {
        parent::init();

        if ($this->tile !== null) {
            $this->tile->init();
        }

        foreach ($this->groups as $group) {
            $group->init();
            // index the group by id if it is not already indexed
            if (!array_key_exists($group->id, $this->groups_by_id)) {
                $this->groups_by_id[$group->id] = $group;
            }
        }
    }