@param int $n

@throws \OutOfBoundsException
963381
public function setPosition($n)
    {
        $n = (int) $n;
        if ($n > $this->getLength()) {
            throw new \OutOfBoundsException(sprintf('Require position out of bound'));
        }

        $this->position = $n;
    }
576537
public function randomSubsetWithReplacement(int $n) : self
    {
        if ($n < 1) {
            throw new InvalidArgumentException('Cannot generate a subset of'
                . " less than 1 sample, $n given.");
        }

        $max = $this->numRows() - 1;

        $subset = [];

        for ($i = 0; $i < $n; $i++) {
            $subset[] = $this->samples[rand(0, $max)];
        }

        return self::quick($subset);
    }
340145
public function seek($position)
    {
        $this->rewind();
        for ($i=0; $i<$position; $i++) {
            $this->next();
        }
        if (!$this->valid()) {
            throw new \OutOfBoundsException(
                sprintf('Invalid seek position "%s"!', $position)
            );
        }
    }
356220
public function offsetGet($offset)
	{
		if(array_key_exists($offset, $this->items))
		{
			return $this->items[$offset];
		}

		throw new OutOfBoundsException(vsprintf('Undefined offset [ %s ].', [$offset]));
	}
1189682
public function actionNewPlain($limit = 10)
    {
        if ($limit === 'all') {
            $limit = null;
        } else {
            $limit = (int) $limit;
            if ($limit < 1) {
                throw new Exception("The limit must be greater than 0.");
            }
        }

        $migrations = $this->getNewMigrations();

        if (empty($migrations)) {
            echo 'None';
        } else {
            $n = count($migrations);
            echo "Found $n new " . ($n === 1 ? 'migration' : 'migrations') . ":\n";

            foreach ($migrations as $migration) {
                echo $migration . "\n";
            }
        }
    }
1318373
public function write_longlong($n)
    {
        if ($n < 0) {
            throw new AMQPInvalidArgumentException('Longlong out of range: ' . $n);
        }

        // if PHP_INT_MAX is big enough for that
        // direct $n<=PHP_INT_MAX check is unreliable on 64bit (values close to max) due to limited float precision
        if (bcadd($n, -PHP_INT_MAX, 0) <= 0) {
            // trick explained in http://www.php.net/manual/fr/function.pack.php#109328
            if ($this->is64bits) {
                list($hi, $lo) = $this->splitIntoQuads($n);
            } else {
                $hi = 0;
                $lo = $n;
            } //on 32bits hi quad is 0 a priori
            $this->out .= pack('NN', $hi, $lo);
        } else {
            try {
                $this->out .= self::packBigEndian($n, 8);
            } catch (AMQPOutOfBoundsException $ex) {
                throw new AMQPInvalidArgumentException('Longlong out of range: ' . $n, 0, $ex);
            }
        }

        return $this;
    }
1187033
public function skip($n)
    {
        $start = $this->currentPosition;

        $ret = @fseek($this->stream, $n, SEEK_CUR);
        if ($ret === -1) {
            return -1;
        }

        $this->currentPosition = ftell($this->stream);

        if ($start > $this->currentPosition) {
            $skipped = $start - $this->currentPosition;
        } else {
            $skipped = $this->currentPosition - $start;
        }

        return $skipped;
    }
600583
public void insert(int n) {
    this.indices.growTo(n + 1, -1);
    assert !this.inHeap(n);
    this.indices.set(n, this.heap.size());
    this.heap.push(n);
    this.percolateUp(this.indices.get(n));
  }
1054689
public function encryptInteger($n) {
		if (!is_numeric($n)) return null;
		return (PHP_INT_SIZE == 4 ? self::encrypt32($n) : self::encrypt64($n)) ^ $this->encPassword;
	}
163396
public function writeShort($n)
    {
        if ($n < 0 || $n > 65535) {
            throw new \InvalidArgumentException('Octet out of range 0..65535');
        }

        $this->flushBits();
        $this->out .= pack('n', $n);
        return $this;
    }
177197
public function &offsetGet($n) {
        if(!$this->offsetExists($n)) {
            throw new IndexNotFoundException((string) $n);
        }
        return $this->data[$n];
    }
1169674
public function setNumber($num)
    {
        $num = (int) $num;
        if ($num <= 0) {
            throw new \InvalidArgumentException(sprintf(
                    'Invalid Number "%s" - Polygon Coordinates Number Must Be '
                    . 'Greater Than Zero'
                    , $num
            ));
        }
        $count = count($this->getCoordinates());
        if ($num > $count) {
            throw new \OutOfBoundsException(sprintf(
                    'Given Coodrinates Number "%s" Is Greater Than The Actual '
                    . 'Coordinates Array Size "%s"'
                    , $num, $count
            ));
        }
        $this->count = $num;

        return $this;
    }
1078359
public static function uniform(int $n) : self
    {
        if ($n < 1) {
            throw new InvalidArgumentException('The number of elements'
                . " must be greater than 0, $n given.");
        }

        $a = [];

        for ($i = 0; $i < $n; $i++) {
            $a[] = rand(-PHP_INT_MAX, PHP_INT_MAX) / PHP_INT_MAX;
        }

        return static::quick($a);
    }
435321
protected function readBuffer($n)
    {
        $n = min($n, strlen($this->buffer) - $this->offset);
        if ($n === 0) {
            // substr('', 0, 0) => false, which screws up read loops that are
            // expecting non-blocking reads to return ''. This avoids that edge
            // case when the buffer is empty/used up.
            return '';
        }
        $block = substr($this->buffer, $this->offset, $n);
        $this->offset += $n;
        return $block;
    }
640351
public function getInteger($key)
	{
		$resolved = false;
		$value = $this->getByKey($key, $this->data, $resolved);
		
		if($resolved)
		{
			return (int)$value;
		}
		
		if(func_num_args() > 1)
		{
			return func_get_arg(1);
		}
		
		throw new \OutOfBoundsException('Configuration setting not found: "' . $key . '"');
	}
16493
public function limit(int $n): self
    {
        return new self(new Limit($this->getIterator(), 0, $n), $this->type);
    }
1070146
public function advance($t, $n) {
        for ($i = 0; $i < $n; $i++) {
            $t = $this->next($t);
        }
        return $t;
    }