Add item to buffer
185439
function add(item) {
			var newEnd = (end + 1) % BUF_SIZE;

			if(end >= 0 && newEnd === begin) {
				throw Error('Buffer overflow: Buffer exceeded max size: ' + BUF_SIZE);
			}
			
			buffer[newEnd] = item;
			end = newEnd;
		}
575624
@Override
  public StringBuilder appendToBuffer(StringBuilder buf) {
    buf.append(getTask());
    buf.append(": ");
    buf.append(getProcessed());
    return buf;
  }
1045553
def push(self, item):
        '''
        '''
        hash(item)
        heapq.heappush(self._items, item)
1039706
def insertItem(self, index, item):
        """"""
        row = index.row()
        self.beginInsertRows(QtCore.QModelIndex(), row, row)
        self.model.insertRow(row)
        self.endInsertRows()
        self.model.overwriteParam(index.row(), item)
590986
def add_and_display_buffer(self, buffer, redraw=True):
        
        # FIXME: some buffers have arguments, do a proper comparison -- override __eq__
        if buffer not in self.buffers:
            logger.debug("adding new buffer {!r}".format(buffer))
            self.buffers.append(buffer)
        self.display_buffer(buffer, redraw=redraw)
808513
def upload_buffer(self, target_id, page, address, buff):
        """"""
        # print len(buff)
        count = 0
        pk = CRTPPacket()
        pk.set_header(0xFF, 0xFF)
        pk.data = struct.pack('=BBHH', target_id, 0x14, page, address)

        for i in range(0, len(buff)):
            pk.data.append(buff[i])

            count += 1

            if count > 24:
                self.link.send_packet(pk)
                count = 0
                pk = CRTPPacket()
                pk.set_header(0xFF, 0xFF)
                pk.data = struct.pack('=BBHH', target_id, 0x14, page,
                                      i + address + 1)

        self.link.send_packet(pk)
1358437
def addItem( self, item ):
        
        result = super(XNodeScene, self).addItem(item)
        self.setModified()
        self._cache.add(item)
        
        return result
873392
def append(self, item):
        """"""
        if len(self) == 0:
            # Special case, we make this the current item
            self.index = 0

        self.items.append(item)
503728
public void add(final byte[] buf, final int offset, final int len) {
    segments.add(new BufferSegment(buf, offset, len));
    total_length += len;
  }
1095101
def add_to_buffer(self, content, read_position):
        
        self.read_position = read_position
        if self.read_buffer is None:
            self.read_buffer = content
        else:
            self.read_buffer = content + self.read_buffer
362458
def put (self, item):
        
        with self.mutex:
            self._put(item)
            self.not_empty.notify()
634262
function fill(buffer, value, from, to) {
  for (let i = from; i < to; ++i) {
    buffer[i] = Number(value)
  }
}
51193
function buffer(arr) {
    if (!Array.isArray(arr)) {
        return;
    }

    var l = new List();
    arr.forEach(function(el) {
        l[syncMethodName("add")](el);
    });
    return convert[syncMethodName("asScalaBuffer")](l);
}
1056852
function put(item) {
    if (monitor) monitor("put", item);
    if (readQueue.length) {
      if (monitor) monitor("take", item);
      readQueue.shift()(null, item);
    }
    else {
      dataQueue.push(item);
    }
    return dataQueue.length <= bufferSize;
  }
1048384
def heappush(heap, item):
    """"""
    heap.append(item)
    _siftdown(heap, 0, len(heap)-1)
320310
def put(self, item):
        '''
        
        '''
        if self.isfini:
            return False

        self.fifo.append(item)

        if len(self.fifo) == 1:
            self.event.set()

        return True
471786
private void addToBuffer()
	{

		if (list != null && !list.isEmpty()) {

			ChronoIndexData info;

			// Real index in revision history mapped to RevisionCounter
			// Sorted by real index (time) in ascending order
			Collections.sort(list);

			StringBuilder reverseMapping = new StringBuilder();

			int size = list.size();
			for (int i = 1; i <= size; i++) {

				info = list.get(i - 1);
				if (info.getRevisionCounter() != i) {

					if (reverseMapping.length() > 0) {
						reverseMapping.append(" ");
					}

					reverseMapping.append(i);
					reverseMapping.append(" ");
					reverseMapping.append(info.getRevisionCounter());
				}

				info.setIndex(i);
				info.setSortFlag(false);
			}

			// RevisionCounter mapped to real index in revision history
			// Sorted by revisionCounters in ascending order
			Collections.sort(list);
			StringBuilder mapping = new StringBuilder();

			while (!list.isEmpty()) {

				info = list.remove(0);
				if (info.getRevisionCounter() != info.getIndex()) {

					if (mapping.length() > 0) {
						mapping.append(" ");
					}

					mapping.append(info.getRevisionCounter());
					mapping.append(" ");
					mapping.append(info.getIndex());
				}
			}

			if (mapping.length() > 0) {

				boolean sql = !insertStatement.isEmpty();
				String val = (sql?"(":"") + articleID + (sql?",'":",\"") + mapping.toString()
						+ (sql?"','":"\",\"") + reverseMapping.toString() +(sql?"')":"\"");

				if (buffer.length() + val.length() >= MAX_ALLOWED_PACKET) {
					storeBuffer();
				}

				if (sql&&buffer.length() > insertStatement.length()) {
					buffer.append(",");
				}

				buffer.append(val);

				if(!sql){
					buffer.append("\n");
				}
			}
		}
	}