Find all occurrences of element in an array, return indices. @NOTUSED
977049
function indexesOf(a, elt) {
  var ret = [], index = 0;
  while ((index = a.indexOf(elt, index)) !== -1) {
    ret.push(index++);
  }
  return ret;
}
533373
function indexOf(array, searchElement, fromIndex)
    {
        fromIndex = Math.max(fromIndex || 0, 0);

        for (var i = fromIndex; i < array.length; i++)
            if(array[i] == searchElement)
                return i;

        return -1;
    }
1175065
def get_matching_indices pattern
      matches = []
      @obj.content.each_with_index { |e,i| 
        # convert to string for tables
        e = e.to_s unless e.is_a? String
        if e  =~ /#{pattern}/
          matches << i
        end
      }
      return matches
    end
1026934
function () {
            var selectedIndexes = this.getSelectedIndexes();
            var retVal = [];
            var items = this._data.items;
            for (var i = 0, length = selectedIndexes.length; i < length; i++) {
                retVal[i] = items[selectedIndexes[i]];
            }
            return retVal;
        }
1172181
function(x) {
            	var index = null, n = this.elements.length;
            	for (var i = 0; i < n; i++) {
            	    if (index === null && this.elements[i] == x) {
            		index = i + 1;
            	    }
            	}
            	return index;
                }
851630
def array_to_indices_hash(array)
    array.inject({}) {|hash,e|  hash[hash.size] = e; hash }
  end
1122356
private static int lastSetWordIndex(int[] array) {
    int i = array.length - 1;
    for (; i >= 0 && wordAt(array, i) == 0; --i) { }
    return i;
  }
215658
private int[] getIndexes() {
    int[] res = new int[this.indexes.size()];
    int i = 0;
    for (Integer idx : this.indexes) {
      res[i] = idx;
      i++;
    }
    return res;
  }
555989
private int[] findIndices(final Literal literal) {

        int count = 0;
        final char s = literal.getFirstChar();
        for (int i = 0; i < myChars.length; i++) {

            // Check the first char for better performance and check the complete string
            if ((myChars[i] == s || s == '?') && literal.matches(myChars, i)) {

                // This index matches
                myBuffer[count] = i;
                count++;
            }
        }

        // Check whether any match has been found
        if (count == 0) {
            return EMPTY;
        }

        // Use an existing array
        if (count == 1 && myBuffer[0] < SINGLE_VALUES.length) {
            final int index = myBuffer[0];
            return SINGLE_VALUES[index];
        }

        // Copy the values
        final int[] values = new int[count];
        for (int i = 0; i < count; i++) {
            values[i] = myBuffer[i];
        }
        return values;
    }
714604
function findIndex(list, predicate) {
  for (var i = 0, item; item = list[i]; i++)
    if (predicate(item)) return i;

  return -1;
}
388417
function findIndex (array, item) {
  return array
    .map(function (i) {
      return i.toLowerCase()
    })
    .indexOf(item.toLowerCase())
}
789935
public static Object getElementFromArrary(Object array, int index) {
    try {
      return Array.get(array, index);
    } catch (ArrayIndexOutOfBoundsException e) {
      return null;
    }
  }
1359276
function getNumElementsFromNonIndexedArrays(arrays) {
    var key = Object.keys(arrays)[0];
    var array = arrays[key];
    if (isArrayBuffer(array)) {
      return array.numElements;
    } else {
      return array.data.length / array.numComponents;
    }
  }
109037
function getAllChildRowIndex(row) {
    // if(row.allChildRowIndex && row.allChildRowIndex.length > 0){
    // 	return row.allChildRowIndex;
    // }
    row.allChildRowIndex = new Array();
    this.getAllChildRowIndexFun(row, row.allChildRowIndex);
    return row.allChildRowIndex;
}
317288
function findAll(predicate) {
        var key,
            elem,
            result = [];
        for (key in _idMap) {
            if (_idMap.hasOwnProperty(key)) {
                elem = _idMap[key];
                if (predicate(elem)) {
                    result.push(elem);
                }
            }
        }
        return result;
    }
1304227
public int[] getElementIndices() {
        if (indices != null)
            return indices;
        Integer[] objIndices = indexToValue.keySet().toArray(new Integer[0]);
        indices = new int[objIndices.length];
        for (int i = 0; i < objIndices.length; ++i)
            indices[i] = objIndices[i].intValue();
        // sort the indices
        Arrays.sort(indices);
        return indices;
    }
698308
public function getAllIndexes()
    {
        foreach ($this->indexes as $type => $indexList) {
            // If we hit the "ALL" type, skip it for now
            if ($type == self::TYPE_ALL) {
                continue;
            }

            // Otherwise yield all indexes registered against this type
            foreach ($this->getIndexes($type, false) as $index) {
                yield $type => $index;
            }
        }

        foreach ($this->getIndexes(self::TYPE_ALL) as $index) {
            yield self::TYPE_ALL => $index;
        }
    }