Position immediately after the given instruction.  The current block
        is also changed to the instruction's basic block.
429598
def position_after(self, instr):
        
        self._block = instr.parent
        self._anchor = self._block.instructions.index(instr) + 1
227862
public static void insertAfter(Element newElement, Element after) {
        after.parentNode.insertBefore(newElement, after.nextSibling);
    }
719319
int insert(Object caller, int version, bbBlock curr, int pos, int len)
    {
        assert mutation_in_progress(caller, version);
        // DEBUG: int amountMoved = 0;
        // DEBUG: int before = this._buf_limit;
        // DEBUG: assert _validate();
        // if there's room in the current block - just
        // move the "trailing" bytes down and we're done
        int neededSpace = len - curr.unusedBlockCapacity();
        if (neededSpace <= 0) {
            // we have all the space we need in the current block
            // DEBUG: amountMoved =
            insertInCurrOnly(caller, version, curr, pos, len);
        }
        else {
            // we'll need at least some additional space beyond the curr
            // block, see if there's room in the
            // next one, otherwise we'll make more (blocks)
            bbBlock next = null;
            if (curr._idx < this._next_block_position - 1) {
                // if there is another block
                next = this._blocks.get(curr._idx + 1);
            }
            if (next != null &&
                (neededSpace <= next.unusedBlockCapacity())
            ) {
                // with the addition of the free space in the following block we have enough
                // DEBUG: amountMoved =
                insertInCurrAndNext(caller, version, curr, pos, len, next);
            }
            else {
                // we'll have to make one or more new blocks
                // first figure out much will be in the first
                // and last blocks (i.e. ignoring the whole
                // blocks
                int lenNeededInLastAddedBlock = neededSpace % _blockSizeUpperLimit;
                int tailLen = curr.bytesAvailableToRead(pos);
                if (lenNeededInLastAddedBlock < tailLen) lenNeededInLastAddedBlock = tailLen;
                if (lenNeededInLastAddedBlock < neededSpace
                 && neededSpace < this._blockSizeUpperLimit) {
                    // if we need less than the largest block then we should
                    // make *one* block with all of the needed space
                    lenNeededInLastAddedBlock = neededSpace;
                }
                bbBlock newblock = insertMakeNewTailBlock(caller, version, curr, lenNeededInLastAddedBlock);
                // now see if the curr block and this newblock have enough
                // available space to do the job, and if there's some trailing
                // data from curr that will end up staying in curr
                if (len <= (curr.unusedBlockCapacity()
                           + newblock.unusedBlockCapacity())
                ) {
                    // insert this as a zero length block immediately  after _curr
                    // insertBlock also adjusts the trailing blocks idx values
                    insertBlock(newblock);
                    // now pretend we just have the "push into the next block" case
                    // DEBUG: amountMoved =
                    insertInCurrAndNext(caller, version, curr, pos, len, newblock);
                }
                else {
                    // and last we have the case of having to insert more than 1 block
                    // which means all of the trailing bytes in _curr move into the last
                    // block
                    // DEBUG: amountMoved =
                    insertAsManyBlocksAsNeeded(caller, version, curr, pos, len, newblock);
                }
            }
        }
        // DEBUG: if (this._buf_limit - before != len
        // DEBUG: || amountMoved != len) {
        // DEBUG: throw new BlockedBufferException("insert went wrong #1 !!!");
        // DEBUG: }
        assert _validate();
        return len;
    }
1072560
public void position(long p) throws IOException {
        long blockStart = (input.position() - maxOffset) 
         / buffer.length * buffer.length;
        long blockEnd = blockStart + maxOffset;
        if ((p >= blockStart) && (p < blockEnd)) {
            // Desired position is somewhere inside current buffer
            long adj = p - blockStart;
            offset = (int)adj;
            return;
        }
        positionDirect(p);
    }
222170
public void position(long p) throws IOException {
        if ((p < 0) || (p > array.length)) {
            throw new IOException("Invalid position: " + p);
        }
        offset = (int)p;
    }
513563
private void performSetAdj(int position, boolean value) {
		checkMutable();
		final int i = position >> ADDRESS_BITS;
		final long m = 1L << (position & ADDRESS_MASK);
		if (value) {
			bits[i] |=  m;
		} else {
			bits[i] &= ~m;
		}
	}
1291894
private bbBlock init(int initialSize, bbBlock initialBlock)
    {
        this._lastCapacity = BlockedBuffer._defaultBlockSizeMin;
        this._blockSizeUpperLimit = BlockedBuffer._defaultBlockSizeUpperLimit;
        while (this._lastCapacity < initialSize &&
               this._lastCapacity < this._blockSizeUpperLimit)
        {
            this.nextBlockSize(this, 0);
        }
        int count = initialSize / this._lastCapacity;
        if (initialBlock != null) count = 1;
        this._blocks = new ArrayList<bbBlock>(count);
        if (initialBlock == null) {
            initialBlock = new bbBlock(this.nextBlockSize(this, 0));
        }
        this._blocks.add(initialBlock);
        this._next_block_position = 1;
        // create any preallocated blocks (following _next_block_position)
        bbBlock b;
        for (int need = initialSize - initialBlock.blockCapacity()
           ; need > 0
           ; need -= b.blockCapacity()
        ) {
            b = new bbBlock(this.nextBlockSize(this, 0));
            b._idx = -1;
            this._blocks.add(b);
        }
        return initialBlock;
    }
350507
function positionAfter (arr, prevChild) {
    var idx
    if (prevChild === null) {
      return 0
    } else {
      idx = findIndex(arr, prevChild)
      return (idx === -1) ? arr.length : idx + 1
    }
  }
849784
function position() {
    /**
     * Find our nearest block level parent and access its lines property.
     * @var Block_Frame_Decorator
     */ 
    $p = $this->_frame->find_block_parent();

    // Debugging code:

//     pre_r("\nPositioning:");
//     pre_r("Me: " . $this->_frame->get_node()->nodeName . " (" . spl_object_hash($this->_frame->get_node()) . ")");
//     pre_r("Parent: " . $p->get_node()->nodeName . " (" . spl_object_hash($p->get_node()) . ")");

    // End debugging

    if ( !$p )
      throw new DOMPDF_Exception("No block-level parent found.  Not good.");

    $f = $this->_frame;
    
    $cb = $f->get_containing_block();
    $line = $p->get_current_line_box();

    // Skip the page break if in a fixed position element
    $is_fixed = false;
    while($f = $f->get_parent()) {
      if($f->get_style()->position === "fixed") {
        $is_fixed = true;
        break;
      }
    }

    $f = $this->_frame;

    if ( !$is_fixed && $f->get_parent() &&
         $f->get_parent() instanceof Inline_Frame_Decorator &&
         $f->is_text_node() ) {
      
      $min_max = $f->get_reflower()->get_min_max_width();
      
      // If the frame doesn't fit in the current line, a line break occurs
      if ( $min_max["min"] > ($cb["w"] - $line->left - $line->w - $line->right) ) {
        $p->add_line();
      }
    }
    
    $f->set_position($cb["x"] + $line->w, $line->y);

  }
1236235
def position_before(self, instr):
        
        self._block = instr.parent
        self._anchor = self._block.instructions.index(instr)
838988
def on_to_position(self, speed, position, brake=True, block=True):
        
        speed = self._speed_native_units(speed)
        self.speed_sp = int(round(speed))
        self.position_sp = position
        self._set_brake(brake)
        self.run_to_abs_pos()

        if block:
            self.wait_until('running', timeout=WAIT_RUNNING_TIMEOUT)
            self.wait_until_not_moving()
1315300
private void setNextSamplePosition(long position)
    {
        tryAgain: while (true)
        {
            position += minIndexInterval;
            long test = indexIntervalMatches++;
            for (int start : startPoints)
                if ((test - start) % BASE_SAMPLING_LEVEL == 0)
                    continue tryAgain;

            nextSamplePosition = position;
            return;
        }
    }
75946
@Override
  public int nextStartPosition() throws IOException {
    if (currentStartPosition < minPosition) {
      currentStartPosition = minPosition;
      currentEndPosition = currentStartPosition + 1;
    } else {
      currentStartPosition++;
      currentEndPosition = currentStartPosition + 1;
      if (currentStartPosition > maxPosition) {
        currentStartPosition = NO_MORE_POSITIONS;
        currentEndPosition = NO_MORE_POSITIONS;
      }
    }
    return currentStartPosition;
  }
1103954
public void setPosition(int newIndex) {

    //check NULL-Bitmap that indicate if field is null
    if ((buf[1 + (newIndex + 2) / 8] & (1 << ((newIndex + 2) % 8))) != 0) {
      this.lastValueNull = BIT_LAST_FIELD_NULL;
      return;
    }

    //if not must parse data until reading the desired field
    if (index != newIndex) {
      int internalPos = this.pos;
      if (index == -1 || index > newIndex) {
        //if there wasn't previous non-null read field, or if last field was after searched index,
        // position is set on first field position.
        index = 0;
        internalPos = 1 + (columnInformationLength + 9) / 8; // 0x00 header + NULL-Bitmap length
      } else {
        //start at previous non-null field position if was before searched index
        index++;
        internalPos += length;
      }

      for (; index <= newIndex; index++) {
        if ((buf[1 + (index + 2) / 8] & (1 << ((index + 2) % 8))) == 0) {
          if (index != newIndex) {
            //skip bytes
            switch (columnInformation[index].getColumnType()) {
              case BIGINT:
              case DOUBLE:
                internalPos += 8;
                break;

              case INTEGER:
              case MEDIUMINT:
              case FLOAT:
                internalPos += 4;
                break;

              case SMALLINT:
              case YEAR:
                internalPos += 2;
                break;

              case TINYINT:
                internalPos += 1;
                break;

              default:
                int type = this.buf[internalPos++] & 0xff;
                switch (type) {

                  case 251:
                    break;

                  case 252:
                    internalPos +=
                        2 + (0xffff & (((buf[internalPos] & 0xff) + ((buf[internalPos + 1] & 0xff)
                            << 8))));
                    break;

                  case 253:
                    internalPos += 3 + (0xffffff & ((buf[internalPos] & 0xff)
                        + ((buf[internalPos + 1] & 0xff) << 8)
                        + ((buf[internalPos + 2] & 0xff) << 16)));
                    break;

                  case 254:
                    internalPos += 8 + ((buf[internalPos] & 0xff)
                        + ((long) (buf[internalPos + 1] & 0xff) << 8)
                        + ((long) (buf[internalPos + 2] & 0xff) << 16)
                        + ((long) (buf[internalPos + 3] & 0xff) << 24)
                        + ((long) (buf[internalPos + 4] & 0xff) << 32)
                        + ((long) (buf[internalPos + 5] & 0xff) << 40)
                        + ((long) (buf[internalPos + 6] & 0xff) << 48)
                        + ((long) (buf[internalPos + 7] & 0xff) << 56));
                    break;

                  default:
                    internalPos += type;
                    break;
                }
                break;
            }
          } else {
            //read asked field position and length
            switch (columnInformation[index].getColumnType()) {
              case BIGINT:
              case DOUBLE:
                this.pos = internalPos;
                length = 8;
                this.lastValueNull = BIT_LAST_FIELD_NOT_NULL;
                return;

              case INTEGER:
              case MEDIUMINT:
              case FLOAT:
                this.pos = internalPos;
                length = 4;
                this.lastValueNull = BIT_LAST_FIELD_NOT_NULL;
                return;

              case SMALLINT:
              case YEAR:
                this.pos = internalPos;
                length = 2;
                this.lastValueNull = BIT_LAST_FIELD_NOT_NULL;
                return;

              case TINYINT:
                this.pos = internalPos;
                length = 1;
                this.lastValueNull = BIT_LAST_FIELD_NOT_NULL;
                return;

              default:
                //field with variable length
                int type = this.buf[internalPos++] & 0xff;
                switch (type) {
                  case 251:
                    //null length field
                    //must never occur
                    //null value are set in NULL-Bitmap, not send with a null length indicator.
                    throw new IllegalStateException(
                        "null data is encoded in binary protocol but NULL-Bitmap is not set");

                  case 252:
                    //length is encoded on 3 bytes (0xfc header + 2 bytes indicating length)
                    length = 0xffff & ((buf[internalPos++] & 0xff)
                        + ((buf[internalPos++] & 0xff) << 8));
                    this.pos = internalPos;
                    this.lastValueNull = BIT_LAST_FIELD_NOT_NULL;
                    return;

                  case 253:
                    //length is encoded on 4 bytes (0xfd header + 3 bytes indicating length)
                    length = 0xffffff & ((buf[internalPos++] & 0xff)
                        + ((buf[internalPos++] & 0xff) << 8)
                        + ((buf[internalPos++] & 0xff) << 16));
                    this.pos = internalPos;
                    this.lastValueNull = BIT_LAST_FIELD_NOT_NULL;
                    return;

                  case 254:
                    //length is encoded on 9 bytes (0xfe header + 8 bytes indicating length)
                    length = (int) ((buf[internalPos++] & 0xff)
                        + ((long) (buf[internalPos++] & 0xff) << 8)
                        + ((long) (buf[internalPos++] & 0xff) << 16)
                        + ((long) (buf[internalPos++] & 0xff) << 24)
                        + ((long) (buf[internalPos++] & 0xff) << 32)
                        + ((long) (buf[internalPos++] & 0xff) << 40)
                        + ((long) (buf[internalPos++] & 0xff) << 48)
                        + ((long) (buf[internalPos++] & 0xff) << 56));
                    this.pos = internalPos;
                    this.lastValueNull = BIT_LAST_FIELD_NOT_NULL;
                    return;

                  default:
                    //length is encoded on 1 bytes (is then less than 251)
                    length = type;
                    this.pos = internalPos;
                    this.lastValueNull = BIT_LAST_FIELD_NOT_NULL;
                    return;

                }
            }
          }
        }
      }
    }
    this.lastValueNull = length == NULL_LENGTH ? BIT_LAST_FIELD_NULL : BIT_LAST_FIELD_NOT_NULL;
  }
363729
public void updatePosition(final BitfinexPosition position) {
		
		synchronized (positions) {
			// Replace position
			positions.removeIf(p -> p.getCurrencyPair() == position.getCurrencyPair());
			positions.add(position);
			positions.notifyAll();
		}
		
		notifyCallbacks(position);
	}
86549
private void moveToNextBlock() {
		blk = new BlockId(blk.fileName(), blk.number() - 1);
		pg.read(blk);
		currentRec = (Integer) pg.getVal(LogMgr.LAST_POS, INTEGER).asJavaVal();
	}
1092456
public void resetPosition()
    {
        try   {
            if (m_daIn != null)
                m_daIn.reset();
            else if (m_baOut != null)
            {
                byte[] byInput = m_baOut.toByteArray();
                this.setPhysicalData(byInput);
            }
            super.resetPosition();
        } catch (IOException ex)    {
            ex.printStackTrace();
        }
    }