Insertion methods
174991
static void insertPreLongs(final WritableMemory wmem, final int preLongs) {
    final int curByte = wmem.getByte(PREAMBLE_LONGS_BYTE);
    final int mask = 0x3F;
    final byte newByte = (byte) ((preLongs & mask) | (~mask & curByte));
    wmem.putByte(PREAMBLE_LONGS_BYTE, newByte);
  }
1090666
private static void insertionSort(int array[], int offset, int end) {
		for (int x=offset; x<end; ++x) {
			for (int y=x; y>offset && array[y-1]>array[y]; y--) {
				int temp = array[y];
				array[y] = array[y-1];
				array[y-1] = temp;
			}
		}
	}
610187
public void insert(Widget w, int beforeIndex) throws IndexOutOfBoundsException {

        insert(w, m_main, beforeIndex, true);
    }
256072
private static void insertionSort(double[] data, int start, int end) {
    for(int i = start + 1; i < end; i++) {
      for(int j = i; j > start && data[j - 1] > data[j]; j--) {
        swap(data, j, j - 1);
      }
    }
  }
706700
def _insert_item(self, key, new_item, instance, is_after):
        """"""
        index = self._get_index_for_insert(key, instance)
        index = index + 1 if is_after else index
        self.__items = self.__items[:index] + new_item + self.__items[index:]
        # Make sure indexing works with new items
        for new_key, new_value in new_item:
            if new_key in self:
                value_list = [val for k, val in self.__items if k == new_key]
                dict_setitem(self, new_key, value_list)
            else:
                dict_setitem(self, new_key, [new_value])
823566
def insert_line lineno=@current_index
      prompt = "Insert: "
      maxlen = 80
      #config={}; 
      #config[:default] = line
      #ret, str = rb_getstr(@form.window, $error_message_row, $error_message_col,  prompt, maxlen, config)
      ret, str = input_string prompt
      #ret, str = rb_getstr(@form.window, @row+@height-1, @col+1, prompt, maxlen, config)
      $log.debug " rb_getstr returned #{ret} , #{str} "
      return if ret != 0

      # pad based expect @content not list
      # remove list after a while FIXME
      @list ||= @content
      @list.insert lineno, str
      ## added handler on 2010-05-23 11:46 - undo works - tested in testlistbox.rb
      fire_handler :CHANGE, InputDataEvent.new(0,str.length, self, :INSERT_LINE, lineno, str)
      fire_dimension_changed
    end
61444
public void insertNewRow() {

        // reset all fields
        for (int i = 0; i < komponente.length; i++) {
            komponente[i].clearContent();
        }    // end of for (int i=0; i<komponente.length; i++)

        // reset the field for the primary keys
        for (int i = 0; i < primaryKeys.length; i++) {
            komponente[pkColIndex[i]].setEditable(true);
        }

        ZaurusEditor.printStatus("enter a new row for table " + tableName);
    }
1354807
public void insert(String key, char val) {
        // make sure we have enough room in the arrays
        int len = key.length()
                  + 1;    // maximum number of nodes that may be generated
        if (freenode + len > eq.length) {
            redimNodeArrays(eq.length + BLOCK_SIZE);
        }
        char strkey[] = new char[len--];
        key.getChars(0, len, strkey, 0);
        strkey[len] = 0;
        root = insert(root, strkey, 0, val);
    }
1042864
function insert(argh, key, value, option) {
  //
  // Automatic value conversion. This makes sure we store the correct "type"
  //
  if ('string' === typeof value && !isNaN(+value)) value = +value;
  if (value === 'true' || value === 'false') value = value === 'true';

  var single = option.charAt(1) !== '-'
    , properties = key.split('.')
    , position = argh;

  if (single && key.length > 1) return key.split('').forEach(function short(char) {
    insert(argh, char, value, option);
  });

  //
  // We don't have any deeply nested properties, so we should just bail out
  // early enough so we don't have to do any processing
  //
  if (!properties.length) return argh[key] = value;

  while (properties.length) {
    var property = properties.shift();

    if (properties.length) {
      if ('object' !== typeof position[property] && !Array.isArray(position[property])) {
        position[property] = Object.create(null);
      }
    } else {
      position[property] = value;
    }

    position = position[property];
  }
}
1058759
private void insertionSort(int left, int right) {
        for (int p = left + 1; p <= right; p++) {
            byte[] tmpRange = ranges[p];
            String tmpFilename = filenames[p];

            int j;
            for (j = p; j > left && KeyUtils.compareKey(tmpRange, ranges[j - 1]) < 0; j--) {
                ranges[j] = ranges[j - 1];
                filenames[j] = filenames[j - 1];
            }
            ranges[j] = tmpRange;
            filenames[j] = tmpFilename;
        }
    }
1151614
public void insert(final String[] argin) {
	values = new String[argin.length];
	System.arraycopy(argin, 0, values, 0, argin.length);
	is_empty_val = false;
    }
860066
@Override
  public void insertString( int offset, String str, AttributeSet a ) throws BadLocationException
  {
    switch( str )
    {
      case "(":
        str = addParenthesis();
        break;
      case "\n":
        str = addWhiteSpace( offset );
        break;
      case "\"":
        str = addMatchingQuotationMark();
        break;
      case "{":
        str = addMatchingBrace( offset );
        break;
    }
    super.insertString( offset, str, a );
    processChangedLines( offset, str.length() );
  }
813644
public void insert_us(final int[] argin) {
	final short[] values = new short[argin.length];
	for (int i = 0; i < argin.length; i++) {
	    values[i] = (short) (argin[i] & 0xFFFF);
	}
	attrval.r_dim.dim_x = argin.length;
	attrval.r_dim.dim_y = 0;
	DevVarUShortArrayHelper.insert(attrval.value, values);
    }
940725
@SuppressWarnings("unchecked")
    void insert(Suffix<T, S> suffix, ActivePoint<T, S> activePoint) {
        Object item = suffix.getEndItem();

        if (edges.containsKey(item)) {
            if (tree.isNotFirstInsert() && activePoint.getNode() != tree.getRoot())
                tree.setSuffixLink(activePoint.getNode());
            activePoint.setEdge(edges.get(item));
            activePoint.incrementLength();
        } else {
            saveSequenceTerminal(item);
            Edge<T, S> newEdge = new Edge<>(suffix.getEndPosition() - 1, this,
                    sequence, tree);
            edges.put((T) suffix.getEndItem(), newEdge);
            suffix.decrement();
            activePoint.updateAfterInsert(suffix);

            if (tree.isNotFirstInsert() && !this.equals(tree.getRoot())) {
                tree.getLastNodeInserted().setSuffixLink(this);
            }
            if (suffix.isEmpty()) {
            }
            else
                tree.insert(suffix);
        }
    }
1221893
@SuppressWarnings("unchecked")
	public static <T> Object insert(Object array, int index, T... newElements) {
		if (isEmpty(newElements)) {
			return array;
		}
		if(isEmpty(array)) {
			return newElements;
		}
		
		final int len = length(array);
		if (index < 0) {
			index = (index % len) + len;
		}
		
		final T[] result = newArray(array.getClass().getComponentType(), Math.max(len, index) + newElements.length);
		System.arraycopy(array, 0, result, 0, Math.min(len, index));
		System.arraycopy(newElements, 0, result, index, newElements.length);
		if (index < len) {
			System.arraycopy(array, index, result, index + newElements.length, len - index);
		}
		return result;
	}
471509
private void insert(String url, List<Article> newArticles) {
		if(!articleMap.containsKey(url))
			articleMap.put(url, new ArrayList<Article>());

		List<Article> articleList = articleMap.get(url);
		articleList.addAll(newArticles);

		log("New size for " + url + " is " + articleList.size());
	}
212021
@Override
    public synchronized void insertUpdate(DocumentEvent e) {
        int len = e.getLength();
        int off = e.getOffset();
        if (outputMark > off) {
            outputMark += len;
        }
    }