xor: oldIndex ^ index
495098
public void gotoNextBlockStartWritable(int index, int xor) { // goto block start pos
        if (xor < (1 << 10)) { // level = 1
            if (depth == 1) {
                display1 = new Object[32];
                display1[0] = display0;
                depth += 1;
            }
            display0 = new Object[32];
            display1[(index >> 5) & 31] = display0;
        } else if (xor < (1 << 15)) { // level = 2
            if (depth == 2) {
                display2 = new Object[32];
                display2[0] = display1;
                depth += 1;
            }
            display0 = new Object[32];
            display1 = new Object[32];
            display1[(index >> 5) & 31] = display0;
            display2[(index >> 10) & 31] = display1;
        } else if (xor < (1 << 20)) { // level = 3
            if (depth == 3) {
                display3 = new Object[32];
                display3[0] = display2;
                depth += 1;
            }
            display0 = new Object[32];
            display1 = new Object[32];
            display2 = new Object[32];
            display1[(index >> 5) & 31] = display0;
            display2[(index >> 10) & 31] = display1;
            display3[(index >> 15) & 31] = display2;
        } else if (xor < (1 << 25)) { // level = 4
            if (depth == 4) {
                display4 = new Object[32];
                display4[0] = display3;
                depth += 1;
            }
            display0 = new Object[32];
            display1 = new Object[32];
            display2 = new Object[32];
            display3 = new Object[32];
            display1[(index >> 5) & 31] = display0;
            display2[(index >> 10) & 31] = display1;
            display3[(index >> 15) & 31] = display2;
            display4[(index >> 20) & 31] = display3;
        } else if (xor < (1 << 30)) { // level = 5
            if (depth == 5) {
                display5 = new Object[32];
                display5[0] = display4;
                depth += 1;
            }
            display0 = new Object[32];
            display1 = new Object[32];
            display2 = new Object[32];
            display3 = new Object[32];
            display4 = new Object[32];
            display1[(index >> 5) & 31] = display0;
            display2[(index >> 10) & 31] = display1;
            display3[(index >> 15) & 31] = display2;
            display4[(index >> 20) & 31] = display3;
            display5[(index >> 25) & 31] = display4;
        } else { // level = 6
            throw new IllegalArgumentException();
        }
    }
660261
function findBiggestUtxo(utxos) {
  var largestAmount = 0;
  var largestIndex = 0;

  for (var i = 0; i < utxos.length; i++) {
    var thisUtxo = utxos[i];

    if (thisUtxo.satoshis > largestAmount) {
      largestAmount = thisUtxo.satoshis;
      largestIndex = i;
    }
  }

  return utxos[largestIndex];
}
858604
def _xor8(ins):
    
    op1, op2 = tuple(ins.quad[2:])
    if _int_ops(op1, op2) is not None:
        op1, op2 = _int_ops(op1, op2)

        output = _8bit_oper(op1)  # True or X = not X
        if op2 == 0:  # False xor X = X
            output.append('push af')
            return output

        output.append('sub 1')
        output.append('sbc a, a')
        output.append('push af')
        return output

    output = _8bit_oper(op1, op2)
    output.append('call __XOR8')
    output.append('push af')
    REQUIRES.add('xor8.asm')

    return output
515260
def GetSubkeyByIndex(self, index):
    
    subkeys = list(self._subkeys.values())

    if index < 0 or index >= len(subkeys):
      raise IndexError('Index out of bounds.')

    return subkeys[index]
648702
def index2qindexc(self, index):
        
        r = (index // 0x10)
        c = index % 0x10 + 0x11
        return self.index(r, c)
126049
public static void xor(ByteBuffer src, ByteBuffer dst, int mask) {
    	int remainder = src.remaining() % 4;
    	int remaining = src.remaining() - remainder;
    	int end = remaining + src.position();

    	// xor a 32bit word at a time as long as possible
    	while (src.position() < end) {
    		int masked = src.getInt() ^ mask;
    		dst.putInt(masked);
    	}

    	// xor the remaining 3, 2, or 1 bytes
    	byte b;
    	switch (remainder) {
    	case 3:
    		b = (byte) (src.get() ^ ((mask >> 24) & 0xff));
    		dst.put(b);
    		b = (byte) (src.get() ^ ((mask >> 16) & 0xff));
    		dst.put(b);
    		b = (byte) (src.get() ^ ((mask >> 8) & 0xff));
    		dst.put(b);
    		break;
    	case 2:
    		b = (byte) (src.get() ^ ((mask >> 24) & 0xff));
    		dst.put(b);
    		b = (byte) (src.get() ^ ((mask >> 16) & 0xff));
    		dst.put(b);
    		break;
    	case 1:
    		b = (byte) (src.get() ^ (mask >> 24));
    		dst.put(b);
    		break;
    	case 0:
		default:
			break;
    	}
    }
111865
def previousIndex(self, attrs):
        
        if not has_key(attrs, 'href'): return None

        i = -1
        for a in self.a:
            i += 1
            match = 0

            if has_key(a, 'href') and a['href'] == attrs['href']:
                if has_key(a, 'title') or has_key(attrs, 'title'):
                        if (has_key(a, 'title') and has_key(attrs, 'title') and
                            a['title'] == attrs['title']):
                            match = True
                else:
                    match = True

            if match: return i
754002
function keyIndexing(selector, maxLen, index) {
  var opts = resolverOpts(RESOLVE_MODE.KEY, maxLen, index);
  return resolveSelector(selector, opts);
}
321478
def find_index(array, x):
    
    i = bisect.bisect_left(array, x)
    if i != len(array) and array[i] == x:
        return i
    raise ValueError
758913
def arm_index( index )
      index = index.index if index.is_a?(Risc::Instruction)
      raise "index error #{index}" if index < 0
      index * 4
    end
284699
def _reindex_with_indexers(self, reindexers, fill_value=None, copy=False,
                               allow_dups=False):
        

        # reindex doing multiple operations on different axes if indicated
        new_data = self._data
        for axis in sorted(reindexers.keys()):
            index, indexer = reindexers[axis]
            baxis = self._get_block_manager_axis(axis)

            if index is None:
                continue

            index = ensure_index(index)
            if indexer is not None:
                indexer = ensure_int64(indexer)

            # TODO: speed up on homogeneous DataFrame objects
            new_data = new_data.reindex_indexer(index, indexer, axis=baxis,
                                                fill_value=fill_value,
                                                allow_dups=allow_dups,
                                                copy=copy)

        if copy and new_data is self._data:
            new_data = new_data.copy()

        return self._constructor(new_data).__finalize__(self)
302540
function prev(index, lines) {
    while (index--) {
      var line = lines[index].trim();

      if (line && !/^(\/\/|\/\*)/.test(line)) {
        return { line: line, index: index };
      }
    }

    return {};
  }
1061985
void flip(long index) {
		assert index >= 0 && index < numBits : "index=" + index + " numBits=" + numBits;
		int wordNum = (int) (index >> 6); // div 64
		long bitmask = 1L << index; // mod 64 is implicit
		bits[wordNum] ^= bitmask;
	}
615541
function matchIndex(prop) {
    if (!prop || !/\[\d+\]/.test(prop))
        return false;
    var prefix = prop.match(/[^\[]+/i);
    var idx;
    var indices = prop.match(/\d+/g);
    if (!indices)
        return false;
    return {
        name: prefix[0],
        index: indices[0],
        indices: indices.slice(1)
    };
}
476173
function getNodeIndex(node) {
	var ret = 0;
	while (node.previousSibling) {
		ret++;
		node = node.previousSibling;
	}
	return ret;
}
1039886
public static int indexOf(ByteBuf buffer, int fromIndex, int toIndex, byte value) {
        if (fromIndex <= toIndex) {
            return firstIndexOf(buffer, fromIndex, toIndex, value);
        } else {
            return lastIndexOf(buffer, fromIndex, toIndex, value);
        }
    }
1348706
private int getKeyIndex(int key) {
    reindexItems();

    int index = Arrays.binarySearch(sortedKeys, key);
    if (index >= 0) {
      int prevIndex = index - 1;
      while (prevIndex >= 0 && sortedKeys[prevIndex] == key) {
        index = prevIndex;
        prevIndex = index - 1;
      }
      return index;
    } else {
      return -1;
    }
  }