Does a depth first search starting at the specified cell. Makes sure the specified swimlane is never left by the algorithm.
184490
protected TreeNode dfs(Object cell, Object parent, Set<Object> visited) {
    if (visited == null) {
      visited = new HashSet<Object>();
    }

    TreeNode node = null;

    mxIGraphModel model = graph.getModel();
    if (cell != null && !visited.contains(cell) && (!isVertexIgnored(cell) || isBoundaryEvent(cell))) {
      visited.add(cell);
      node = createNode(cell);

      TreeNode prev = null;
      Object[] out = graph.getEdges(cell, parent, invert, !invert, false);

      for (int i = 0; i < out.length; i++) {
        Object edge = out[i];

        if (!isEdgeIgnored(edge)) {
          // Resets the points on the traversed edge
          if (resetEdges) {
            setEdgePoints(edge, null);
          }

          // Checks if terminal in same swimlane
          Object target = graph.getView().getVisibleTerminal(edge, invert);
          TreeNode tmp = dfs(target, parent, visited);

          if (tmp != null && model.getGeometry(target) != null) {
            if (prev == null) {
              node.child = tmp;
            } else {
              prev.next = tmp;
            }

            prev = tmp;
          }
        }
      }
    }

    return node;
  }
795447
private void preorderTreeDepth(INode root, HashMap<INode, Integer> order, HashMap<INode, Integer> depth) {
        order.clear();
        depth.clear();

        int num = 1;

        Deque<INode> stack = new ArrayDeque<INode>();
        stack.push(root);
        while (!stack.isEmpty()) {
            INode v = stack.pop();

            order.put(v, num++);
            if (!v.hasParent()) {
                depth.put(v, 0);
            } else {
                depth.put(v, depth.get(v.getParent()) + 1);
            }

            for (int i = v.getChildCount() - 1; i >= 0; i--) {
                stack.push(v.getChildAt(i));
            }
        }
    }
1157915
private int compare(Composite sliceBounds, List<ByteBuffer> sstableBounds, CellNameType comparator, boolean isSliceStart)
    {
        for (int i = 0; i < sstableBounds.size(); i++)
        {
            if (i >= sliceBounds.size())
            {
                // When isSliceStart is true, we're comparing the end of the slice against the min cell name for the sstable,
                // so the slice is something like [(1, 0), (1, 0)], and the sstable max is something like (1, 0, 1).
                // We want to return -1 (slice start is smaller than max column name) so that we say the slice intersects.
                // The opposite is true when dealing with the end slice.  For example, with the same slice and a min
                // cell name of (1, 0, 1), we want to return 1 (slice end is bigger than min column name).
                return isSliceStart ? -1 : 1;
            }

            int comparison = comparator.subtype(i).compare(sliceBounds.get(i), sstableBounds.get(i));
            if (comparison != 0)
                return comparison;
        }

        // the slice bound and sstable bound have been equal in all components so far
        if (sliceBounds.size() > sstableBounds.size())
        {
            // We have the opposite situation from the one described above.  With a slice of [(1, 0), (1, 0)],
            // and a min/max cell name of (1), we want to say the slice start is smaller than the max and the slice
            // end is larger than the min.
            return isSliceStart ? -1 : 1;
        }

        return 0;
    }
759482
protected boolean seekToRow(long currentRow) throws IOException {
    boolean seeked = false;

    // If this holds it means we checked if the row is null, and it was not,
    // and when we skipRows we don't want to skip this row.
    if (currentRow != previousPresentRow) {
      nextIsNull(currentRow);
    }

    if (valuePresent) {
      if (currentRow != previousRow + 1) {
        numNonNulls--;
        long rowInStripe = currentRow - rowBaseInStripe - 1;
        int rowIndexEntry = computeRowIndexEntry(currentRow);
        // if previous == rowIndexEntry * rowIndexStride - 1 even though they are in different
        // index strides seeking will only leaves us where we are.
        if ((previousRow != rowIndexEntry * rowIndexStride  - 1 &&
            rowIndexEntry != computeRowIndexEntry(previousRow)) || currentRow < previousRow) {
          if (present == null) {
            previousRowIndexEntry = rowIndexEntry;
            numNonNulls = countNonNulls(rowInStripe - (rowIndexEntry * rowIndexStride));
          }
          seek(rowIndexEntry, currentRow <= previousRow);
          skipRows(numNonNulls);
        } else {
           if (present == null) {
             // If present is null, it means there are no nulls in this column
             // so the number of nonNulls is the number of rows being skipped
             numNonNulls = currentRow - previousRow - 1;
           }
          skipRows(numNonNulls);
        }
        seeked = true;
      }

      numNonNulls = 0;
      previousRow = currentRow;
    }

    return seeked;
  }
909115
private int skipAhead(RunContainer skippingOn, int pos, int targetToExceed) {
    int left = pos;
    int span = 1;
    int probePos = 0;
    int end;
    // jump ahead to find a spot where end > targetToExceed (if it exists)
    do {
      probePos = left + span;
      if (probePos >= skippingOn.nbrruns - 1) {
        // expect it might be quite common to find the container cannot be advanced as far as
        // requested. Optimize for it.
        probePos = skippingOn.nbrruns - 1;
        end = toIntUnsigned(skippingOn.getValue(probePos))
            + toIntUnsigned(skippingOn.getLength(probePos)) + 1;
        if (end <= targetToExceed) {
          return skippingOn.nbrruns;
        }
      }
      end = toIntUnsigned(skippingOn.getValue(probePos))
          + toIntUnsigned(skippingOn.getLength(probePos)) + 1;
      span *= 2;
    } while (end <= targetToExceed);
    int right = probePos;
    // left and right are both valid positions. Invariant: left <= targetToExceed && right >
    // targetToExceed
    // do a binary search to discover the spot where left and right are separated by 1, and
    // invariant is maintained.
    while (right - left > 1) {
      int mid = (right + left) / 2;
      int midVal = toIntUnsigned(skippingOn.getValue(mid))
          + toIntUnsigned(skippingOn.getLength(mid)) + 1;
      if (midVal > targetToExceed) {
        right = mid;
      } else {
        left = mid;
      }
    }
    return right;
  }
99801
public CellFinder startPosition(final Cell cell) {
        ArgUtils.notNull(cell, "cell");
        
        return startPosition(cell.getColumnIndex(), cell.getRowIndex());
    }
302598
def go_to_next_cell(self):
        """"""
        cursor = self.textCursor()
        cursor.movePosition(QTextCursor.NextBlock)
        cur_pos = prev_pos = cursor.position()
        while not self.is_cell_separator(cursor):
            # Moving to the next code cell
            cursor.movePosition(QTextCursor.NextBlock)
            prev_pos = cur_pos
            cur_pos = cursor.position()
            if cur_pos == prev_pos:
                return
        self.setTextCursor(cursor)
510243
function(){
		var cell = this.getcell();
		if(cell.isnull || cell===this.mouseCell){ return;}

		if(this.cursor.modesnum && this.puzzle.playmode && !this.cursor.checksnum(this.inputPoint) && cell.noNum()){
			this.setcursorsnum(cell);
		}
		else if(cell!==this.cursor.getc()){
			this.setcursor(cell);
		}
		else{
			this.inputqnum_main(cell);
		}
		this.mouseCell = cell;
	}
182046
function(start, end, direction) {
      var current = (start = startOfLine(start)), before = start && startOfLine(start.previousSibling);
      if (!isBR(end)) end = endOfLine(end, this.container);
      this.addDirtyNode(start);

      do {
        var next = endOfLine(current, this.container);
        if (current) this.highlight(before, next, true);
        this.indentLineAfter(current, direction);
        before = current;
        current = next;
      } while (current != end);
      select.setCursorPos(this.container, {node: start, offset: 0}, {node: end, offset: 0});
    }
513906
public CellFinder startPosition(final int column, final int row) {
        ArgUtils.notMin(column, 0, "column");
        ArgUtils.notMin(row, 0, "row");
        
        this.startColumn = column;
        this.startRow = row;
        
        return this;
    }
711901
function (array, c, depth) {
        var start = array.length - (array.length / Math.pow(2, depth));
        for (var i = start, len = array.length; i < len; i += 1) {
            array[i] += c;
        }
    }
62282
public Object depthFirst(NodeVisitor nodeVisitor, Node root) {
        return depthFirst(nodeVisitor, Collections.singleton(root));
    }
443642
public boolean next() {
    if (sketchAccessor_ == null) { // initial setup
      sketchAccessor_ = DoublesSketchAccessor.wrap(sketch_);
    } else { // advance index within the current level
      i_++;
    }
    if (i_ < sketchAccessor_.numItems()) {
      return true;
    }
    // go to the next non-empty level
    do {
      level_++;
      if (level_ > 0) {
        bits_ >>>= 1;
      }
      if (bits_ == 0L) {
        return false; // run out of levels
      }
      weight_ *= 2;
    } while ((bits_ & 1L) == 0L);
    i_ = 0;
    sketchAccessor_.setLevel(level_);
    return true;
  }
939618
boolean first(RowCursor minCursor, 
                RowCursor resultCursor, 
                boolean isMatch)
  {
    int ptr = _rowHead;
    int rowLength = resultCursor.length();
    int removeLength = resultCursor.removeLength();
    int sortOffset = _rowSortHead;
    
    byte []buffer = _buffer;

    while (ptr < sortOffset) {
      int code = buffer[ptr] & CODE_MASK;
      
      int minCmp;
      int cmp;

      switch (code) {
      case INSERT:
        if ((minCmp = minCursor.compareKeyRow(buffer, ptr)) <= 0
            && ((cmp = resultCursor.compareKeyRow(buffer, ptr)) > 0
                || cmp == 0 && ! isMatch)) {
          fillMatch(ptr, resultCursor);
          
          if (minCmp == 0) {
            return true;
          }
          
          isMatch = true;
        }

        ptr += rowLength;
        break;
        
      case INSERT_DEAD:
        ptr += rowLength;
        break;
        
      case REMOVE:
        if ((minCmp = minCursor.compareKeyRemove(buffer, ptr)) <= 0
            && ((cmp = resultCursor.compareKeyRemove(buffer, ptr)) > 0
                || cmp == 0 && ! isMatch)) {
          resultCursor.setRemove(buffer, ptr);
          //resultCursor.setKey(buffer, ptr + 1);
          
          if (minCmp == 0) {
            return true;
          }
          
          isMatch = true;
        }

        ptr += removeLength;
        break;
        
      default:
        System.out.println("BROKEN_ENTRY:");
        return false;
      }
    }

    if (sortOffset < BLOCK_SIZE) {
      return findFirstSorted(minCursor, resultCursor, isMatch);
    }
    else {
      return isMatch;
    }
  }
450684
def depth_first_spanning_tree(start_node)
      raise ArgumentError unless vertices.include?(start_node)
      tree = DirectedAdjacencyGraph.new
      visited = Set.new
      build_dfst(tree, start_node, visited)
      tree
    end
1327332
public static Cell findCell(Sheet sheet, String cellReference, String searchKey) {
        if (isFullCellReference(cellReference)) {
            return findCell(sheet, cellReference);
        }

        if (isColReference(cellReference)) {
            val cellRef = new CellReference(cellReference + "1");
            return searchColCell(sheet, cellRef.getCol(), searchKey);
        }

        if (isRowReference(cellReference)) {
            val cellRef = new CellReference("A" + cellReference);
            return searchRowCell(sheet, cellRef.getRow(), searchKey);
        }

        return searchCell(sheet, searchKey);
    }
520901
protected void seekToPresentRow(long currentRow) throws IOException {
    if (currentRow != previousPresentRow + 1) {
      long rowInStripe = currentRow - rowBaseInStripe - 1;
      int rowIndexEntry = computeRowIndexEntry(currentRow);
      if (rowIndexEntry != computeRowIndexEntry(previousPresentRow) ||
          currentRow < previousPresentRow) {
        // Since we're resetting numNulls we need to seek to the appropriate row not just in the
        // present stream, but in all streams for the column
        seek(rowIndexEntry, currentRow < previousPresentRow);
        numNonNulls = countNonNulls(rowInStripe - (rowIndexEntry * rowIndexStride));
      } else {
        numNonNulls += countNonNulls(currentRow - previousPresentRow - 1);
      }
    }

    // If this is the first row in a row index stride update the number of non-null values to 0
    if ((currentRow - rowBaseInStripe - 1) % rowIndexStride == 0) {
      numNonNulls = 0;
    }

    previousPresentRow = currentRow;
  }