/*
更新传进来的target
Update只能更新包含ID字段的数据
target若存在ID字段, 则以此ID进行更新否则新添加一条记录
510115
function(schemaName, target, cb, options) {
  var schema  = SCHEMA[schemaName]
    , idField = schema._idField_
    , id      = target[idField]
    , options = options || {}

  if (typeof id == 'undefined' || id === '') {
    cb && cb(new Error('update ' + schemaName + ' failed: ID is not exist'))
    return
  }

  var key = schemaName + ':' + id

  client.hgetall(key, function(err, object) {
    if (!object && options.mode != 'insert') {
      cb && cb(err || new Error('update ' + key + ' failed: object doesn\'t exist'))
      return
    }

    filter(schemaName, target, function(err, result) {
      if (err || result === false) {
        cb && cb(err || new Error('update ' + schemaName + ' failed: invalid field value'))
        return
      }

      client.hmset(schemaName + ':' + id, target, function(err) {
        if (err) {
          cb && cb(err)
          return
        }

        filter(schemaName, target, cb, { FUNCS: COMMANDS, mode: options.mode, oldModel: object  })
      })
    }, { FUNCS: FILTERS, mode: options.mode, oldModel: object })

  })

}
254312
public void updateTarget() {
        /* save updated entity */
        final Target target = targetManagement.update(entityFactory.target().update(controllerId)
                .name(nameTextField.getValue()).description(descTextArea.getValue()));
        /* display success msg */
        uINotification.displaySuccess(i18n.getMessage("message.update.success", target.getName()));
        // publishing through event bus
        eventBus.publish(this, new TargetTableEvent(BaseEntityEventType.UPDATED_ENTITY, target));
    }
348823
function updateItem(id, updater) {
  return new Promise((resolve, reject) => {
    return instance.pkgs.then(db => {
      const obj = db.transaction(db.name, 'readwrite')
        .objectStore(db.name);
      const req = obj.get(id);
      req.onerror = event => reject(event);
      req.onsuccess = event => {
        const res = event.target.result;
        updater(res);
        const upd = obj.put(res);
        upd.onsuccess = () => resolve();
        upd.onerror = event => reject(event);
      };
    });
  });
}
443387
private void updateFormAction(String id) {

        setAction(
            CmsXmlContentUgcApi.SERVICE_URL
                + "?"
                + CmsUgcConstants.PARAM_FORM_DATA_ID
                + "="
                + id
                + "&"
                + CmsUgcConstants.PARAM_SESSION_ID
                + "="
                + m_formSession.getSessionId());
    }
492030
function reloadState(model, notify) {
    return function reload() {
        let { pathname, histories } = model,
            method = actionTypes.replace;

        // 更新监听
        return notify({
            pathname, method, histories, length: histories.length
        });
    };
}
457938
public function updateId()
    {
        if (empty($this->parentNode->key)) {
            $this->id = "{$this->keyDelimiter}$this->key{$this->keyDelimiter}";
        } else {
            $this->id = "{$this->parentNode->id}$this->keyDelimiter{$this->key}$this->keyDelimiter";
        }
        $this->id = preg_replace('/[#]{2,}/', self::DEFAULT_KEY_DELIMITER, $this->id);
    }
917517
public void updateRepeatNumber(int newNum, int path_id, String client_uuid) throws Exception {
        updateRequestResponseTables("repeat_number", newNum, getProfileIdFromPathID(path_id), client_uuid, path_id);
    }
615
private int updateStructure(int id, Task task, Integer outlineLevel)
   {
      task.setID(Integer.valueOf(id++));
      task.setOutlineLevel(outlineLevel);
      outlineLevel = Integer.valueOf(outlineLevel.intValue() + 1);
      for (Task childTask : task.getChildTasks())
      {
         id = updateStructure(id, childTask, outlineLevel);
      }
      return id;
   }
1169121
function doUpdate (root, entry, cb) {
    entry = utils.updateEntry(root, entry, ['dateDetected'])

    // console.log('overwriting', root, 'with', entryJSON, 'resulting in', entry.toJSON())
    put(entry, cb)
  }
1075717
function (opts) {
        var target   = opts.target,
            priority = opts.priority,
            paused   = opts.paused

        var i, len
        var entry = {target: target, priority: priority, paused: paused}
        var added = false

        if (priority === 0) {
            this.updates0.push(entry)
        } else if (priority < 0) {
            for (i = 0, len = this.updatesNeg.length; i < len; i++) {
                if (priority < this.updatesNeg[i].priority) {
                    this.updatesNeg.splice(i, 0, entry)
                    added = true
                    break
                }
            }

            if (!added) {
                this.updatesNeg.push(entry)
            }
        } else /* priority > 0 */{
            for (i = 0, len = this.updatesPos.length; i < len; i++) {
                if (priority < this.updatesPos[i].priority) {
                    this.updatesPos.splice(i, 0, entry)
                    added = true
                    break
                }
            }

            if (!added) {
                this.updatesPos.push(entry)
            }
        }

        this.hashForUpdates[target.id] = entry
    }
1294673
def remove_target(self, target_id):
        """"""
        updated_targets = []
        for target in self.my_osid_object_form._my_map['targets']:
            if target['id'] != target_id:
                updated_targets.append(target)
        self.my_osid_object_form._my_map['targets'] = updated_targets
1345289
function(args, callback) {
      // Make sure the ID exists
      var t = this, model = args.model;
      if (!model || !model.id) {
        return callback({msg:'SyncProbe create - Data model with ID not present'});
      }

      // Make sure the file doesn't already exist
      t.getFullPath(model.id, function(error, response) {
        if (error) {
          return callback(error);
        }

        if (response.stats) {
          return callback({msg:'Document with this ID already exists'});
        }

        // Forward to the update control
        t.update_control(args, callback);
      });
    }
945969
public void update(int[] goldIndex, int[] predictIndex)
    {
        for (int i = 0; i < goldIndex.length; ++i)
        {
            if (goldIndex[i] == predictIndex[i])
                continue;
            else // 预测与答案不一致
            {
                parameter[goldIndex[i]]++; // 奖励正确的特征函数（将它的权值加一）
                if (predictIndex[i] >= 0 && predictIndex[i] < parameter.length)
                    parameter[predictIndex[i]]--; // 惩罚招致错误的特征函数（将它的权值减一）
                else
                {
                    throw new IllegalArgumentException("更新参数时传入了非法的下标");
                }
            }
        }
    }
216526
def update_target(self, name, current, total):
        """"""
        self.refresh(self._bar(name, current, total))
886111
function update() {
    var $this = this,
      self = User.resourceConstructor().call(this, this.id);

    return self.update.apply(self, arguments).then(function (updated) {
      Utils.extend($this, updated, true);
      return updated;
    });
  }
1053212
protected static void updateLrd(LofPoint targetPoint, LofDataSet dataSet)
    {
        // 対象点の局所到達可能密度を更新する。
        double lrd = calculateLrd(targetPoint, dataSet);
        targetPoint.setLrd(lrd);
    }
63957
def trigger_update_by_id(self, id, data, **kwargs):
        ""
        api_path = "/api/v2/triggers/{id}.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, method="PUT", data=data, **kwargs)