Move by one page downward (if downward is true), or upward (if false). Return true if we ended up changing the selection, false if not. TODO: Better support for horizontal lists.
437965
function scrollOnePage(element, downward) {

  // Determine the item visible just at the edge of direction we're heading.
  // We'll select that item if it's not already selected.
  const scrollTarget = element.scrollTarget;
  const edge = scrollTarget.scrollTop + (downward ? scrollTarget.clientHeight : 0);
  const indexOfItemAtEdge = getIndexOfItemAtY(element, edge, downward);

  const selectedIndex = element.selectedIndex;
  let newIndex;
  if (indexOfItemAtEdge && selectedIndex === indexOfItemAtEdge) {
    // The item at the edge was already selected, so scroll in the indicated
    // direction by one page. Leave the new item at that edge selected.
    const delta = (downward ? 1 : -1) * scrollTarget.clientHeight;
    newIndex = getIndexOfItemAtY(element, edge + delta, downward);
  }
  else {
    // The item at the edge wasn't selected yet. Instead of scrolling, we'll
    // just select that item. That is, the first attempt to page up/down
    // usually just moves the selection to the edge in that direction.
    newIndex = indexOfItemAtEdge;
  }

  if (!newIndex) {
    // We can't find an item in the direction we want to travel. Select the
    // last item (if moving downward) or first item (if moving upward).
    newIndex = (downward ? element.items.length - 1 : 0);
  }

  if (newIndex !== selectedIndex) {
    element.selectedIndex = newIndex;
    return true; // We handled the page up/down ourselves.
  }
  else {
    return false; // We didn't do anything.
  }
}
288613
function(direction) {
                var currentOrder = this.state.order,
                    newOrder = currentOrder;
                if (direction === PagingCollection.SortDirection.ASCENDING) {
                    newOrder = -1;
                } else if (direction === PagingCollection.SortDirection.DESCENDING) {
                    newOrder = 1;
                }
                if (newOrder !== currentOrder) {
                    this.setSorting(this.state.sortKey, newOrder);
                    this.isStale = true;
                }
            }
858418
function hasEnoughVerticalRoom(parentChartHeight, positionY) {
            return (parentChartHeight - margin.top - margin.bottom - chartHeight) - positionY > 0;
        }
53094
function isVertical(direction) {
      return (direction == ionic.Gestures.DIRECTION_UP || direction == ionic.Gestures.DIRECTION_DOWN);
    }
729007
def hasnew(self,allowempty=False):
        """"""
        for e in  self.select(New,None,False, False):
            if not allowempty and len(e) == 0: continue
            return True
        return False
619214
private function moveToPreviousLine(): bool
    {
        if ($this->currentLineNb < 1) {
            return false;
        }

        $this->currentLine = $this->lines[--$this->currentLineNb];

        return true;
    }
1105687
function isBackwards(sel) {
	sel = sel || getSelection();
	if (isCollapsed(sel)) { return; }

	// Detect if selection is backwards
	var range = doc.createRange();
	range.setStart(sel.anchorNode, sel.anchorOffset);
	range.setEnd(sel.focusNode, sel.focusOffset);
	range.detach();

	// if `collapsed` then it's backwards
	return range.collapsed;
}
365268
def move_up(self):
        
        old_index = self.current_index
        self.current_index -= 1
        self.__wrap_index()
        self.__handle_selections(old_index, self.current_index)
1038570
def next_page(self):
        
        if self.is_last_page():
            return False

        self.page += 1
        self.items = self.fetch_items()
        return True
500852
function MoveNext()
	{
		$ret = @oci_fetch_array($this->_queryID,$this->fetchMode);
		if($ret !== false) {
		global $ADODB_ANSI_PADDING_OFF;
			$this->fields = $ret;
			$this->_currentRow++;
			$this->_updatefields();

			if (!empty($ADODB_ANSI_PADDING_OFF)) {
				foreach($this->fields as $k => $v) {
					if (is_string($v)) $this->fields[$k] = rtrim($v);
				}
			}
			return true;
		}
		if (!$this->EOF) {
			$this->EOF = true;
			$this->_currentRow++;
		}
		return false;
	}
219555
def previous_page(self):
        
        if self.is_first_page():
            return False

        self.page -= 1
        self.items = self.fetch_items()
        return True
375403
def has_next(self):
        
        try:
            next_item = self.paginator.object_list[self.paginator.per_page]
        except IndexError:
            return False
        return True
924029
public boolean scrollView(final View view, int direction){
		if(view == null){
			return false;
		}

		int height = view.getHeight();
		height--;
		int scrollTo = -1;

		if (direction == DOWN) {
			scrollTo = height;
		}

		else if (direction == UP) {
			scrollTo = -height;
		}

		int originalY = view.getScrollY();
		final int scrollAmount = scrollTo;
		inst.runOnMainSync(new Runnable(){
			public void run(){
				view.scrollBy(0, scrollAmount);
			}
		});

		if (originalY == view.getScrollY()) {
			return false;
		}
		else{
			return true;
		}
	}
929587
public boolean nextInOrder() {
        if (mNode == null) {
            return false;
        }
        if (firstChild()) {
            return true;
        }
        if (nextSibling()) {
            return true;
        }
        AccessibilityNodeInfoRef tmp = unOwned(mNode);
        while (tmp.parent()) {
            if (tmp.nextSibling()) {
                reset(tmp);
                return true;
            }
        }
        tmp.clear();
        return false;
    }
832119
def auto_down(self, count=1, go_to_start_of_line_if_history_changes=False):
        
        if self.complete_state:
            self.complete_next(count=count)
        elif self.document.cursor_position_row < self.document.line_count - 1:
            self.cursor_down(count=count)
        elif not self.selection_state:
            self.history_forward(count=count)

            # Go to the start of the line?
            if go_to_start_of_line_if_history_changes:
                self.cursor_position += self.document.get_start_of_line_position()
1344023
protected void moveSelectionBottom() {
		final IStructuredSelection selection = this.list.getStructuredSelection();
		final int index = this.conversions.indexOf(selection.getFirstElement());
		if (index >= 0 && (index + selection.size()) < this.conversions.size()) {
			for (int i = 0; i < selection.size(); ++i) {
				final ConversionMapping previous = this.conversions.remove(index);
				this.conversions.addLast(previous);
			}
			refreshListUI();
			this.list.refresh(true);
			enableButtons();
			preferenceValueChanged();
		}
	}
771940
def move_down(self):
        """"""
        self.at(ardrone.at.pcmd, True, 0, 0, -self.speed, 0)