## selectIndex

Selects the search result at the given index in the list,
and deselcts any currently-selected item

@param {number} idx Index of the item to select
328814
function selectIndex(idx){

    // If another item is currently selected, deselect it
    if(selectedItem) selectedItem.className = selectedItem.className.replace(/\s?selected/,'');

    // Grab the search results straight from the DOM
    var r = document.getElementById('searchresults');
    var items = r.childNodes;

    // If we actually have no items, there's not much we can do
    if(items.length === 0){
      selectedSearchIndex = -1;
      selectedItem = false;
      return;
    }

    // Store the item and its index in helper variables
    selectedSearchIndex = idx;
    var s = selectedItem = items[idx];

    // Select the item
    s.className += ' selected';

    // Figure out whether or not the item is fully visible inside
    // the scrollable view, and if not, then scroll appropriately
    var o = s.offsetTop - r.offsetTop - r.scrollTop;
    if(o < 0){
      r.scrollTop = s.offsetTop - r.offsetTop;
    }else if(o > r.offsetHeight - s.offsetHeight){
      r.scrollTop = o + r.scrollTop - r.offsetHeight + s.offsetHeight;
    }
  }
896014
void onColumnSelect(final int index, final boolean selected) {
        final DataColumnDef columnDef = acceptableColumns.get(index);
        if (selected) {
            listEditor.getList().add(columnDef.clone());
        } else {
            listEditor.getList().remove(columnDef);
        }
        columnsChangedEvent.fire(new ColumnsChangedEvent(this, listEditor.getList()));
    }
105490
function selectPreviousItem(){
    var items = document.getElementById('searchresults').childNodes;
    var l = items.length;
    selectIndex((selectedSearchIndex + l - 1) % l);
  }
379638
public FluentSelect deselectByIndex(final int index) {
        executeAndWrapReThrowIfNeeded(new DeselectByIndex(index), Context.singular(context, "deselectByIndex", null, index), true);
        return new FluentSelect(super.delegate, currentElement.getFound(), this.context, monitor, booleanInsteadOfNotFoundException);
    }
979402
public void dropByIndex(int idx) {
    SAXRecord entry = realTSindex.get(idx);
    if (null != entry) {
      realTSindex.remove(idx);
      entry.removeIndex(idx);
      if (entry.getIndexes().isEmpty()) {
        records.remove(String.valueOf(entry.getPayload()));
      }
    }
  }
429699
function pull(xs, x) {
    const idx = xs.indexOf(x);
    if (idx > -1) {
        xs.splice(idx, 1);
    }
}
1110408
public boolean isItemSelected(final int index) {
        checkIndex(index);
        OptionElement item = selectElement.getOptions().getItem(index);
        Option option = itemMap.get(item);
        return option != null && option.isSelected();
    }
845431
function lindex(index) {
  if(index < 0) index = this._data.length + index;
  return this._data[index] || null;
}
68050
function selectIndex(element, index) {
  const count = element.items.length;

  const boundedIndex = (element.selectionWraps) ?
    // JavaScript mod doesn't handle negative numbers the way we want to wrap.
    // See http://stackoverflow.com/a/18618250/76472
    ((index % count) + count) % count :

    // Keep index within bounds of array.
    Math.max(Math.min(index, count - 1), 0);

  const previousIndex = element.selectedIndex;
  if (previousIndex !== boundedIndex) {
    element.selectedIndex = boundedIndex;
    return true;
  } else {
    return false;
  }
}
881379
function(rowIndex, selected, fire) {
        var self = this;
        if (rowIndex === 0) {
            rowIndex = $.map(this.options.data, function(val, index) {
                return index + 1;
            });
        }
        if (!$.isArray(rowIndex)) {
            rowIndex = [rowIndex];
        }

        $.each(rowIndex, function(index, val) {
            var tr = self.$tableBody.find('tbody tr:nth-child(' + (self.rowSpan > 1 ? (val * self.rowSpan) : val) + ')')
                .filter('[class!="sum"]')
                .filter('[class!="select-disabled"]'),
                checkbox = tr.find('.select-col :checkbox');
            if (selected) {
                checkbox.bizCheckbox('check');
                tr.addClass('selected');
            } else {
                checkbox.bizCheckbox('uncheck');
                tr.removeClass('selected');
            }
        });

        var selectedCount = self.$tableBody.find('.select-col .biz-checkbox-checked').length,
            checkboxCount = self.$tableBody.find('.select-col :checkbox').filter(':not(:disabled)').length,
            selectAll = self.$tableHead.find('.select-col :checkbox');
        if (selectedCount === checkboxCount) {
            selectAll.bizCheckbox('check');
        } else {
            selectAll.bizCheckbox('uncheck');
        }

        if (fire && this.options.onSelect) {
            this.options.onSelect.call(this, this.getSelected());
        }
    }
758865
function select (index) {
    // force form to update state for validation
    $mdUtil.nextTick(function () {
      getDisplayValue(ctrl.matches[ index ]).then(function (val) {
        var ngModel = elements.$.input.controller('ngModel');
        $mdLiveAnnouncer.announce(val + ' ' + ctrl.selectedMessage, 'assertive');
        ngModel.$setViewValue(val);
        ngModel.$render();
      }).finally(function () {
        $scope.selectedItem = ctrl.matches[ index ];
        setLoading(false);
      });
    }, false);
  }
439130
def select_item ix0
      return if @items.nil? or @items.empty?
       #$log.debug "insdie select  item :  #{ix0} active: #{@active_index}" 
      if !@active_index.nil?
        @items[@active_index].on_leave 
      end
      previtem = @active_index
      @active_index = ix0
      if @items[ix0].enabled
        @items[ix0].on_enter
      else
        #$log.debug "insdie sele nxt item ENABLED FALSE :  #{ix0}" 
        if @active_index > previtem
          select_next_item
        else
          select_prev_item
        end
      end
      @window.refresh
    end
721179
private void setListSelection(int selectedIndex) {
        if (selectedIndex == -1) {
            list.clearSelection();
        } else {
            list.setSelectedIndex(selectedIndex);
            list.ensureIndexIsVisible(selectedIndex);
        }
    }
624451
def selectByIdx(self, rowIdxs):
        ''
        self.select((self.rows[i] for i in rowIdxs), progress=False)
27839
function refreshIndex () {
    ctrl.selectedIndex = getNearestSafeIndex(ctrl.selectedIndex);
    ctrl.focusIndex    = getNearestSafeIndex(ctrl.focusIndex);
  }
1155965
def DeleteIndex(self, index):
        
        to_remove = None
        for i in self.Items:
            if i.index == index:
                to_remove = i

        if to_remove:
            self.Items.remove(to_remove)
1082922
public int[] getIndices(long idx)
	{
		int xIndices = (int)idx%dim1;
		int yIndices = (int)(idx-xIndices)/dim1;
		int []Indices = {xIndices,yIndices};
		return Indices;
	}