Compares two sequences.

@param \Fridge\DBAL\Schema\Sequence $oldSequence The old sequence.
@param \Fridge\DBAL\Schema\Sequence $newSequence The new sequence.

@return boolean TRUE if sequences are different else FALSE.
549691
public function compareSequences(Sequence $oldSequence, Sequence $newSequence)
    {
        return ($oldSequence->getName() !== $newSequence->getName())
            || ($oldSequence->getInitialValue() !== $newSequence->getInitialValue())
            || ($oldSequence->getIncrementSize() !== $newSequence->getIncrementSize());
    }
343362
@SuppressWarnings("unchecked")
	protected <C extends Compound> Sequence<C> reverseSequence(Sequence<C> sequence) {
		if(getStrand() != Strand.NEGATIVE) {
			return sequence;
		}

		Sequence<C> reversed = new ReversedSequenceView<C>(sequence);
		// "safe" operation as we have tried to check this
		if(canComplement(sequence)) {
			Sequence<ComplementCompound> casted = (Sequence<ComplementCompound>) reversed;
			ComplementSequenceView<ComplementCompound> complement =
					new ComplementSequenceView<ComplementCompound>(casted);
			return (Sequence<C>)complement;
		}
		return reversed;
	}
232625
public function longestCommonSubsequence(array $a, array $b)
    {
        $c = array();

        $m = count($a);
        $n = count($b);

        for ($i = 0; $i <= $m; $i++) {
            $c[$i][0] = 0;
        }

        for ($j = 0; $j <= $n; $j++) {
            $c[0][$j] = 0;
        }

        for ($i = 1; $i <= $m; $i++) {
            for ($j = 1; $j <= $n; $j++) {
                if ($this->matchStrategy->isMatch($a[$i - 1], $b[$j - 1])) {
                    $c[$i][$j] = 1 + (isset($c[$i - 1][$j - 1]) ? $c[$i - 1][$j - 1] : 0);
                } else {
                    $c[$i][$j] = max(
                        isset($c[$i][$j - 1]) ? $c[$i][$j - 1] : 0,
                        isset($c[$i - 1][$j]) ? $c[$i - 1][$j] : 0
                    );
                }
            }
        }

        $lcs = array_pad(array(), $m + 1, 0);
        $this->compileMatches($c, $a, $b, $m, $n, $lcs);

        return $lcs;
    }
14895
public function _nextSequence($sequence)
    {
        $sequence = strtoupper($sequence);
        $id = $this->_lockSequence($sequence);
        $increment = $this->_connection->execute(
            "UPDATE sequences SET id=id+1 WHERE name=?", $sequence);

        return $id;
    }
880574
private boolean setPrevious(byte[] sequence, int start, int length) {
    if (previous == null || previous.length < length) {
      previous = new byte[length];
    }

    System.arraycopy(sequence, start, previous, 0, length);
    previousLength = length;
    return true;
  }
680293
public void updateSequenceElement(int[] sequence, int pos, int oldVal) {
    if(models != null){
      for(int i = 0; i < models.length; i++)
        models[i].updateSequenceElement(sequence, pos, oldVal);
      return; 
    }
    model1.updateSequenceElement(sequence, pos, 0);
    model2.updateSequenceElement(sequence, pos, 0);
  }
782881
public function createSequence($sequence)
    {
        $changeSetElt = $this->createChangeSet('create-sequence-' . $sequence->getName());

        $sequenceName = QualifiedName::fromAsset($sequence);
        $createSequenceElt = $this->document->createElement('createSequence');

        if ($sequenceName->getNamespaceName()) {
            $createSequenceElt->setAttribute('schemaName', $sequenceName->getNamespaceName());
        }
        $createSequenceElt->setAttribute('sequenceName', $sequenceName->getName());
        $createSequenceElt->setAttribute('startValue', $sequence->getInitialValue());

        $changeSetElt->appendChild($createSequenceElt);
        $this->root->appendChild($changeSetElt);
    }
432045
public function dropSequence($sequence)
    {
        $changeSetElt = $this->createChangeSet('drop-sequence-' . $sequence->getName());

        $sequenceName = QualifiedName::fromAsset($sequence);
        $dropSequenceElt = $this->document->createElement('dropSequence');

        if ($sequenceName->getNamespaceName()) {
            $dropSequenceElt->setAttribute('schemaName', $sequenceName->getNamespaceName());
        }

        $dropSequenceElt->setAttribute('sequenceName', $sequenceName->getName());

        $changeSetElt->appendChild($dropSequenceElt);
        $this->root->appendChild($changeSetElt);
    }
1257638
private function getDroppedSequences(Schema $oldSchema, Schema $newSchema)
    {
        $droppedSequences = array();

        foreach ($oldSchema->getSequences() as $sequence) {
            if (!$newSchema->hasSequence($sequence->getName())
                || $this->compareSequences($sequence, $newSchema->getSequence($sequence->getName()))) {
                $droppedSequences[] = $sequence;
            }
        }

        return $droppedSequences;
    }
970732
function longestPositiveIncreasingSubsequence(ns, newStart) {
  let seq = [],
    is = [],
    l = -1,
    pre = new Array(ns.length);

  for (let i = newStart, len = ns.length; i < len; i++) {
    let n = ns[i];
    if (n < 0) continue;
    let j = findGreatestIndexLEQ(seq, n);
    if (j !== -1) pre[i] = is[j];
    if (j === l) {
      l++;
      seq[l] = n;
      is[l]  = i;
    } else if (n < seq[j + 1]) {
      seq[j + 1] = n;
      is[j + 1] = i;
    }
  }

  for (let i = is[l]; l >= 0; i = pre[i], l--) {
    seq[l] = i;
  }

  return seq;
}
873500
public function compareViews(View $oldView, View $newView)
    {
        return ($oldView->getName() !== $newView->getName()) || ($oldView->getSQL() !== $newView->getSQL());
    }
945902
protected final <R extends Request<T>> R setSequence(int sequence) {
        checkIfActive();
        this.sequence = sequence;
        return (R) this;
    }
92126
public function getCreateSequenceSQLQueries(Sequence $sequence)
    {
        if (!$this->supportSequences()) {
            throw PlatformException::methodNotSupported(__METHOD__);
        }

        return array(
            'CREATE SEQUENCE '.$sequence->getName().
            ' INCREMENT BY '.$sequence->getIncrementSize().
            ' MINVALUE '.$sequence->getInitialValue().
            ' START WITH '.$sequence->getInitialValue()
        );
    }
901777
protected function equals($old, $new)
    {
        if (is_array($old)) {
            // compare arrays
            if (array_keys($old) != array_keys($new)) {
                return false;
            }

            foreach (array_keys($old) as $key) {
                if ( ! $this->equals($old[$key], $new[$key])) {
                    return false;
                }
            }

            return true;
        }

        if ( ! is_object($old) ) {
            // compare non-array scalars
            return ($old == $new);
        }

        if (get_class($old) != get_class($new)) {
            // compare object by class name
            return false;
        }

        // compare each sub-node
        foreach ($old->getSubNodeNames() as $property) {
            if ( ! $this->equals($old->$property, $new->$property)) {
                return false;
            }
        }

        return true;
    }
239287
public function hasSequences()
    {
        $result = $this->_driver->prepare(
            'SELECT 1 FROM sqlite_master WHERE name = "sqlite_sequence"'
        );
        $result->execute();
        $this->_hasSequences = (bool)$result->rowCount();
        $result->closeCursor();

        return $this->_hasSequences;
    }
1262619
function DropSequence($seqname = 'adodbseq')
  {
                $res = $this->Execute("DROP TABLE $seqname");
                if(!$res){
                        print $this->ErrorMsg();
                        return false;
                }
                else
                        return true;
        }
804518
public function compareForeignKeys(ForeignKey $oldForeignKey, ForeignKey $newForeignKey)
    {
        return ($oldForeignKey->getName() !== $newForeignKey->getName())
            || ($oldForeignKey->getLocalColumnNames() !== $newForeignKey->getLocalColumnNames())
            || ($oldForeignKey->getForeignTableName() !== $newForeignKey->getForeignTableName())
            || ($oldForeignKey->getForeignColumnNames() !== $newForeignKey->getForeignColumnNames())
            || ($oldForeignKey->getOnDelete() !== $newForeignKey->getOnDelete())
            || ($oldForeignKey->getOnUpdate() !== $newForeignKey->getOnUpdate());
    }