Add the given todo.
@param todo The todo
330887
function add() {
            vm.error = undefined;
            service.add({
                description: vm.description
            }, function() {
                _fetch();
            }, function() {
                vm.error = 'An error occurred when adding a todo';
            });
            vm.description = '';
        }
162120
public void addTerm(String key)
    {
        TermFrequency value = trieSingle.get(key);
        if (value == null)
        {
            value = new TermFrequency(key);
            trieSingle.put(key, value);
        }
        else
        {
            value.increase();
        }
        ++totalTerm;
    }
747155
private void add(Field f) {

        m_fields.put(f.name(), f);
        m_doc.add(f);
    }
889020
function create (todoList, text) {
  // Hand waving here -- not showing how this interacts with XHR or persistent
  // server-side storage.
  // Using the current timestamp in place of a real id.
  var id = Date.now();
  _todos[id] = {
    id: id,
    todo_list_id: todoList.id,
    complete: false,
    text: text
  };
}
513118
@Override
  public void add(Object obj) {
    lock.writeLock().lock();
    try {
      populated = true;
      this.queueActionLocked(DeltaType.Added, obj);
    } finally {
      lock.writeLock().unlock();
    }
  }
682808
function(data){
      var todo_div = $('span[item="' + data.__id__ + '"]').find('div'),
          todo_checkbox = $('span[item="' + data.__id__ + '"]').find('input[type="checkbox"]');
      if (data.done){
        data.done = false;
        todo_div.removeClass('done');
        todo_checkbox.attr('checked', false);
      } else {
        data.done = true;
        todo_div.addClass('done');
        todo_checkbox.attr('checked', true);
      }
      cm.update(data.__id__, { done: data.done });
    }
437482
protected function assertTodo($todo = NULL) {
    if (func_num_args() == 0) {
      $todo = $this->todo;
    }
    
    if ($todo != NULL && !$this->validateTodo($todo)) {
      throw new InvalidTodoException('Todo: '.Code::varInfo($todo).' ist nicht in der todoMap');
    }
  }
779675
function(todoEl) {
			var todoId = getClosestTodoId(todoEl),
				editInputEl = todoEl.querySelector('.edit'),
				newTitle = (editInputEl.value).trim();

			todoEl.querySelector('label').textContent = newTitle;
			todosDB.edit(todoId, newTitle);
		}
891136
public void add(DOCUMENT doc) {
      if (doc != null) {
         documents.add(doc);
         int id = documents.size() - 1;
         for (KEY key : documentMapper.apply(doc)) {
            index.put(key, id);
         }
      }
   }
1121855
function (id, callback) {
        var todos = data.todos;

        for (var i = 0; i < todos.length; i++) {
          if (todos[i].id == id) {
            todos.splice(i, 1);
            break;
          }
        }

        flush();
        callback.call(undefined, data.todos);
      }
802334
public void add(T item) {
        CompletableFuture<Queue<T>> pending;
        Queue<T> result = null;
        synchronized (this.contents) {
            Exceptions.checkNotClosed(this.closed, this);
            this.contents.addLast(item);
            pending = this.pendingTake;
            this.pendingTake = null;
            if (pending != null) {
                result = fetch(this.contents.size());
            }
        }

        if (pending != null) {
            pending.complete(result);
        }
    }
47913
public void add(int theOpCode, int theOperand) {
        if (DEBUGCODE) {
            System.out.println("Add " + bytecodeStr(theOpCode)
                + ", " + Integer.toHexString(theOperand));
        }
        int newStack = itsStackTop + stackChange(theOpCode);
        if (newStack < 0 || Short.MAX_VALUE < newStack)
            badStack(newStack);

        switch (theOpCode) {
            case ByteCode.GOTO:
                // This is necessary because dead code is seemingly being
                // generated and Sun's verifier is expecting type state to be
                // placed even at dead blocks of code.
                addSuperBlockStart(itsCodeBufferTop + 3);
                // fallthru...
            case ByteCode.IFEQ:
            case ByteCode.IFNE:
            case ByteCode.IFLT:
            case ByteCode.IFGE:
            case ByteCode.IFGT:
            case ByteCode.IFLE:
            case ByteCode.IF_ICMPEQ:
            case ByteCode.IF_ICMPNE:
            case ByteCode.IF_ICMPLT:
            case ByteCode.IF_ICMPGE:
            case ByteCode.IF_ICMPGT:
            case ByteCode.IF_ICMPLE:
            case ByteCode.IF_ACMPEQ:
            case ByteCode.IF_ACMPNE:
            case ByteCode.JSR:
            case ByteCode.IFNULL:
            case ByteCode.IFNONNULL: {
                if ((theOperand & 0x80000000) != 0x80000000) {
                    if ((theOperand < 0) || (theOperand > 65535))
                        throw new IllegalArgumentException(
                            "Bad label for branch");
                }
                int branchPC = itsCodeBufferTop;
                addToCodeBuffer(theOpCode);
                if ((theOperand & 0x80000000) != 0x80000000) {
                    // hard displacement
                    addToCodeInt16(theOperand);
                    int target = theOperand + branchPC;
                    addSuperBlockStart(target);
                    itsJumpFroms.put(target, branchPC);
                } else {  // a label
                    int targetPC = getLabelPC(theOperand);
                    if (DEBUGLABELS) {
                        int theLabel = theOperand & 0x7FFFFFFF;
                        System.out.println("Fixing branch to " +
                            theLabel + " at " + targetPC +
                            " from " + branchPC);
                    }
                    if (targetPC != -1) {
                        int offset = targetPC - branchPC;
                        addToCodeInt16(offset);
                        addSuperBlockStart(targetPC);
                        itsJumpFroms.put(targetPC, branchPC);
                    } else {
                        addLabelFixup(theOperand, branchPC + 1);
                        addToCodeInt16(0);
                    }
                }
            }
            break;

            case ByteCode.BIPUSH:
                if ((byte) theOperand != theOperand)
                    throw new IllegalArgumentException("out of range byte");
                addToCodeBuffer(theOpCode);
                addToCodeBuffer((byte) theOperand);
                break;

            case ByteCode.SIPUSH:
                if ((short) theOperand != theOperand)
                    throw new IllegalArgumentException("out of range short");
                addToCodeBuffer(theOpCode);
                addToCodeInt16(theOperand);
                break;

            case ByteCode.NEWARRAY:
                if (!(0 <= theOperand && theOperand < 256))
                    throw new IllegalArgumentException("out of range index");
                addToCodeBuffer(theOpCode);
                addToCodeBuffer(theOperand);
                break;

            case ByteCode.GETFIELD:
            case ByteCode.PUTFIELD:
                if (!(0 <= theOperand && theOperand < 65536))
                    throw new IllegalArgumentException("out of range field");
                addToCodeBuffer(theOpCode);
                addToCodeInt16(theOperand);
                break;

            case ByteCode.LDC:
            case ByteCode.LDC_W:
            case ByteCode.LDC2_W:
                if (!(0 <= theOperand && theOperand < 65536))
                    throw new ClassFileFormatException("out of range index");
                if (theOperand >= 256
                    || theOpCode == ByteCode.LDC_W
                    || theOpCode == ByteCode.LDC2_W) {
                    if (theOpCode == ByteCode.LDC) {
                        addToCodeBuffer(ByteCode.LDC_W);
                    } else {
                        addToCodeBuffer(theOpCode);
                    }
                    addToCodeInt16(theOperand);
                } else {
                    addToCodeBuffer(theOpCode);
                    addToCodeBuffer(theOperand);
                }
                break;

            case ByteCode.RET:
            case ByteCode.ILOAD:
            case ByteCode.LLOAD:
            case ByteCode.FLOAD:
            case ByteCode.DLOAD:
            case ByteCode.ALOAD:
            case ByteCode.ISTORE:
            case ByteCode.LSTORE:
            case ByteCode.FSTORE:
            case ByteCode.DSTORE:
            case ByteCode.ASTORE:
                if (theOperand < 0 || 65536 <= theOperand)
                    throw new ClassFileFormatException("out of range variable");
                if (theOperand >= 256) {
                    addToCodeBuffer(ByteCode.WIDE);
                    addToCodeBuffer(theOpCode);
                    addToCodeInt16(theOperand);
                } else {
                    addToCodeBuffer(theOpCode);
                    addToCodeBuffer(theOperand);
                }
                break;

            default:
                throw new IllegalArgumentException(
                    "Unexpected opcode for 1 operand");
        }

        itsStackTop = (short) newStack;
        if (newStack > itsMaxStack)
            itsMaxStack = (short) newStack;
        if (DEBUGSTACK) {
            System.out.println("After " + bytecodeStr(theOpCode)
                + " stack = " + itsStackTop);
        }
    }
905343
def replace(self, p_todos):
        
        self.erase()
        self.add_todos(p_todos)
        self.dirty = True
470598
def add(self, p_src):
        
        todos = self.add_list([p_src])

        return todos[0] if len(todos) else None
1282292
public void add(final String arg) {
        if (arg != null) {
            final Argument argument = parse(arg);
            add(argument);
        }
    }
935562
def append(self, p_todo, p_string):
        
        if len(p_string) > 0:
            new_text = p_todo.source() + ' ' + p_string
            p_todo.set_source_text(new_text)
            self._update_todo_ids()
            self.dirty = True
1327410
protected void addMethod(String k, ExecutableElement e, MethodModel exec) {
    ArrayList<ContractableMethod> list = methodMap.get(k);
    if (list == null) {
      list = new ArrayList<ContractableMethod>();
      methodMap.put(k, list);
    }
    list.add(new ContractableMethod(e, exec));
  }