Calculate which page is currently the "focused" page.
In horizontal mode, this is the page farthest to the left,
where at least half of the page is showing.
@returns {int} The current page
163995
function () {
            var prev, page,
                state = this.state,
                pages = state.pages;

            prev = util.bisectRight(pages, state.scrollLeft, 'x0') - 1;
            page = util.bisectRight(pages, state.scrollLeft + pages[prev].width / 2, 'x0') - 1;
            return 1 + page;
        }
262283
function (pageNum) {
            var index = util.clamp(pageNum - 1, 0, this.numPages - 1),
                page = this.state.pages[index];
            return { top: page.y0, left: page.x0 };
        }
767872
def visible?(page)
      # outer
      if outer > 0
        return true if outer >= page
        return true if (pages - outer) < page
      end

      # current page
      return true if current_page == page

      # inner
      return true if inner_range.include? page

      false
    end
259426
function paginatedInfo() {
      var first = (this.currentPage - 1) * this.currentPerPage + 1;
      var last = Math.min(this.total, this.currentPage * this.currentPerPage);

      if (last === 0) {
        first = 0;
      }

      return "".concat(first, " - ").concat(last, " ").concat(this.ofText, " ").concat(this.total);
    }
1165233
function () {
        var currentPage = this.getCurrentPage(),
            totalPages  = this.getTotalPages();

        return currentPage && (totalPages === Paginator.VALUE_UNLIMITED || currentPage < totalPages);
    }
92365
public void lastPage() {
		int idx = pages.size()-1;
		
		if( idx < 0 ) {
			idx = 0;
		}
		if( pageIndex != idx ) {
			pageIndex = idx;
			currentPage = null;
		}
	}
747855
public final int getTotalPages() {
    if (getTotalItems() < getPageSize()) {
      return 1;
    } else {
      final int remainder = getTotalItems() % getPageSize();
      final int quotient = getTotalItems() / getPageSize();
      return (0 == remainder) ? quotient : (quotient + 1);
    }
  }
1036722
function () {
            var prevPageIndex,
                currentPageIndex,
                rowIndex,
                row,
                offset,
                state = this.state,
                pages = state.pages;

            prevPageIndex = util.bisectRight(pages, state.scrollTop, 'y0') - 1;
            if (prevPageIndex < 0) {
                return 1;
            }
            offset = state.scrollTop + pages[prevPageIndex].height / 2;
            currentPageIndex = util.bisectRight(pages, offset, 'y0') - 1;
            rowIndex = pages[currentPageIndex].rowIndex;
            row = state.rows[rowIndex];
            return 1 + row[0];

        }
1230293
private int getCurrentPageStartRow() {
		int startRow = 0;

		if (getPaginationMode() != PaginationMode.NONE) {
			int rowsPerPage = getRowsPerPage();
			TableDataModel model = getDataModel();

			if (model instanceof TreeTableDataModel) {
				// For tree tables, pagination only occurs on first-level nodes (ie. those
				// underneath the root node), however they might not be consecutively
				// numbered. Therefore, the start and end row indices need to be adjusted.
				TreeTableDataModel treeModel = (TreeTableDataModel) model;
				TreeNode root = treeModel.getNodeAtLine(0).getRoot();

				int startNode = getCurrentPage() * rowsPerPage;
				startRow = ((TableTreeNode) root.getChildAt(startNode)).getRowIndex() - 1; // -1 as the root is not included in the table
			} else {
				startRow = getCurrentPage() * rowsPerPage;
			}
		}

		return startRow;
	}
629567
function() {
  var doc = document.documentElement;
  return {
    x: (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0),
    y: (window.pageYOffset || doc.scrollTop)  - (doc.clientTop || 0)
  };
}
1030244
public function getCurrentPageFirstItem()
    {
        $first = ($this->current - 1) * $this->limit;

        if ($first > $this->total) {
            return 0;
        }

        return $first;
    }
1186356
def left(self):
        '''
        

        '''

        res = self.body_left[self.lcount]()
        self.lcount += 1
        return res
1081184
function() {

			var self = this;

			return {
				left: self.__scrollLeft,
				top: self.__scrollTop,
				zoom: self.__zoomLevel
			};

		}
266340
function () {
            var carousel = this;
            return carousel.get("currentPage") + 1 == carousel.get("numPages") ?
                   carousel.get("numItems") - 1:
                   carousel.get("firstVisible") + carousel.get("numVisible") - 1;
        }
1285228
private function _currentPage(): int
    {
        $currentPage = Craft::$app->getRequest()->getQueryParam($this->pageParam, 1);

        if (is_numeric($currentPage) && $currentPage > $this->totalPages) {
            $currentPage = $this->totalPages > 0 ? $this->totalPages : 1;
        } else if (!is_numeric($currentPage) || $currentPage < 0) {
            $currentPage = 1;
        }

        return (int)$currentPage;
    }
49691
function () {
            var min = this.state.currentPage - 1,
                max = min + 1;
            return util.constrainRange(min, max, this.numPages);
        }
247904
public int getCurrentPage() {
        int currentPage = 1;
        int count = mScrollable.getScrollingItemsCount();
        if (mSupportScrollByPage && mCurrentItemIndex >= 0 &&
                mCurrentItemIndex < count) {
            currentPage = (Math.min(mCurrentItemIndex + mPageSize - 1, count - 1)/mPageSize);
        }
        return currentPage;
    }