imState 的 update 操作方法
518161
function update(state, updater, description) {
    if (!state.__store__) {
        throw new Error('[Pastate] You can only operate pastate immutable state');
    }
    return state.__store__.update(state, updater, description);
}
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("更新参数时传入了非法的下标");
                }
            }
        }
    }
938948
private <T> Observable<PollingState<T>> updateStateFromLocationHeaderOnPutAsync(final PollingState<T> pollingState) {
        return pollAsync(pollingState.locationHeaderLink(), pollingState.loggingContext())
                .flatMap(new Func1<Response<ResponseBody>, Observable<PollingState<T>>>() {
                    @Override
                    public Observable<PollingState<T>> call(Response<ResponseBody> response) {
                        int statusCode = response.code();
                        if (statusCode == 202) {
                            pollingState.withResponse(response);
                            pollingState.withStatus(AzureAsyncOperation.IN_PROGRESS_STATUS, statusCode);
                        } else if (statusCode == 200 || statusCode == 201) {
                            try {
                                pollingState.updateFromResponseOnPutPatch(response);
                            } catch (CloudException | IOException e) {
                                return Observable.error(e);
                            }
                        }
                        return Observable.just(pollingState);
                    }
                });
    }
392419
function modUpdatePreparedState( id ) {
        var visited = {};
        update( id );

        function update( id ) {
            if ( !modIs( id, MODULE_ANALYZED ) ) {
                return false;
            }
            if ( modIs( id, MODULE_PREPARED ) || visited[ id ] ) {
                return true;
            }

            visited[ id ] = 1;
            var module = modModules[ id ];
            var prepared = true;

            each(
                module.depMs,
                function ( dep ) {
                    return ( prepared = update( dep.absId ) );
                }
            );

            // 判断resource是否加载完成。如果resource未加载完成，则认为未准备好
            prepared && each(
                module.depRs,
                function ( dep ) {
                    prepared = !!(dep.absId && modIs( dep.absId, MODULE_DEFINED ));
                    return prepared;
                }
            );

            if ( prepared ) {
                module.state = MODULE_PREPARED;
            }

            return prepared;
        }
    }
337543
function update() {
    var updateData = this._prepUpdate(this.single.update);
    var wheres = this.where();
    var returning = this.single.returning;
    return {
      sql: 'update ' + this.tableName + ' set ' + updateData.join(', ') + (wheres ? ' ' + wheres : '') + this._returning(returning),
      returning: returning
    };
  }
532883
def update_by_id(self, data, table, id_value):
        '''
        
        '''
        key_map = {}
        if len(data) == 0:
            print('请确保data被正确传入了')
            return -1
        datas = {}
        updates = ''
        for k, v in data.items():
            # 防止sql注入
            datas.update({k: pymysql.escape_string(str(v))})
        for d in datas:
            updates += "{}='{}',".format(str(d), str(datas[d]))
        if len(updates) <= 0:
            return -1
        # 生成sql语句
        sql = "update {} set {} where id = '{}'".format(
            table, updates[:-1], str(id_value))
        res = self.query(sql)
        return 1 if res != -1 else res
1372900
public int update(DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException {
		if (mappedUpdate == null) {
			mappedUpdate = MappedUpdate.build(dao, tableInfo);
		}
		int result = mappedUpdate.update(databaseConnection, data, objectCache);
		if (dao != null && !localIsInBatchMode.get()) {
			dao.notifyChanges();
		}
		return result;
	}
1268062
public void update(Collection<Integer> x, int y)
    {
        assert y == 1 || y == -1 : "感知机的标签y必须是±1";
        for (Integer f : x)
            parameter[f] += y;
    }
766472
@Override
	public void update () {
		// Execute the global state (if any)
		if (globalState != null) globalState.update(owner);

		// Execute the current state (if any)
		if (currentState != null) currentState.update(owner);
	}
930339
public float update(Instance inst, float[] weights, int k,
			float[] extraweight, Object predictLabel,
			Object goldenLabel, float c) {
		int[][] data = (int[][]) inst.getData();
		int[] target;
		if (goldenLabel == null)
			target = (int[]) inst.getTarget();
		else
			target = (int[]) goldenLabel;
		int[] predict = (int[]) predictLabel;
		// 当前clique中不同label的个数
		int ne = 0;
		/**
		 * 偏移索引
		 * 
		 */
		int tS = 0, pS = 0;

		float diffW = 0;

		int loss = 0;

		int L = data.length;
		// 稀疏矩阵表示(f(x,y)-f(x,\bar{y}))
		TIntIntHashMap diffF = new TIntIntHashMap(); // 最多有2*L*numTemplets个不同

		for (int o = -templets.maxOrder - 1, l = 0; l < L; o++, l++) {
			tS = tS * numLabels % templets.numStates + target[l]; // 目标值：计算当前状态组合的y空间偏移
			pS = pS * numLabels % templets.numStates + predict[l];// 预测值：计算当前状态组合的y空间偏移
			if (predict[l] != target[l])
				ne++;
			if (o >= 0 && (predict[o] != target[o]))
				ne--; // 减去移出clique的节点的label差异

			if (ne > 0) { // 当前clique有不相同label
				loss++; // L(y,ybar)
				for (int t = 0; t < numTemplets; t++) {
					if (data[l][t] == -1)
						continue;
					int tI = data[l][t] + templets.offset[t][tS]; // 特征索引：找到对应weights的维数
					int pI = data[l][t] + templets.offset[t][pS]; // 特征索引：找到对应weights的维数
					if (tI != pI) {
						diffF.adjustOrPutValue(tI, 1, 1);
						diffF.adjustOrPutValue(pI, -1, -1);
						diffW += weights[tI] - weights[pI]; // w^T(f(x,y)-f(x,ybar))
					}
				}
			}
		}

		float diff = 0;
		TIntIntIterator it = diffF.iterator();
		for (int i = diffF.size(); i-- > 0;) {
			it.advance();
			diff += it.value() * it.value();
		}
		it = null;
		float alpha;
		float delta;
		if (useLoss) {
			delta = loss;
		} else
			delta = 1;
		if (diffW < delta) {

			tS = 0;
			pS = 0;
			ne = 0;
			alpha = (delta - diffW) / diff;
			// System.out.println(alpha);
			alpha = Math.min(c, alpha);
			it = diffF.iterator();
			for (int i = diffF.size(); i-- > 0;) {
				it.advance();
				weights[it.key()] += it.value() * alpha;
			}

			return loss;
		} else {
			return 0;
		}
	}
203121
def update(self, typ, id, **kwargs):
        
        return self._load(self._request(typ, id=id, method='PUT', data=kwargs))
759708
function (entering, params, onEnter, updateParams) {
          var inactivatedState = getInactivatedState(entering);
          if (inactivatedState && (updateParams || !getInactivatedState(entering, params))) {
            var savedLocals = entering.locals;
            this.stateExiting(inactivatedState);
            entering.locals = savedLocals;
          }
          entering.self.status = 'entered';

          if (onEnter)
            $injector.invoke(onEnter, entering.self, entering.locals.globals);
        }
297428
function _handleFQStateChange(fqstate) {

        var i, len, moduleName, moduleObj, modules, states, tokens, currentState;

        if (!fqstate) {
            // Notifies all modules
            for (moduleName in _modules) {
                if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) {
                    moduleObj = _modules[moduleName];
                    moduleObj.currentState = moduleObj.initialState;
                    moduleObj.onStateChange(unescape(moduleObj.currentState));
                }
            }
            return;
        }

        modules = [];
        states = fqstate.split("&");
        for (i = 0, len = states.length; i < len; i++) {
            tokens = states[i].split("=");
            if (tokens.length === 2) {
                moduleName = tokens[0];
                currentState = tokens[1];
                modules[moduleName] = currentState;
            }
        }

        for (moduleName in _modules) {
            if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) {
                moduleObj = _modules[moduleName];
                currentState = modules[moduleName];
                if (!currentState || moduleObj.currentState !== currentState) {
                    moduleObj.currentState = currentState || moduleObj.initialState;
                    moduleObj.onStateChange(unescape(moduleObj.currentState));
                }
            }
        }
    }
517795
function(params, callback) {
                var updateThreadInfoData = {
                    chatMessageVOType: chatMessageVOTypes.UPDATE_THREAD_INFO,
                    typeCode: params.typeCode,
                    subjectId: params.threadId,
                    content: {},
                    pushMsgType: 4,
                    token: token
                };

                if (params) {
                    if (parseInt(params.threadId) > 0) {
                        updateThreadInfoData.subjectId = params.threadId;
                    }
                    else {
                        fireEvent('error', {
                            code: 999,
                            message: 'Thread ID is required for Updating thread info!'
                        });
                    }

                    if (typeof params.image == 'string') {
                        updateThreadInfoData.content.image = params.image;
                    }

                    if (typeof params.description == 'string') {
                        updateThreadInfoData.content.description = params.description;
                    }

                    if (typeof params.title == 'string') {
                        updateThreadInfoData.content.name = params.title;
                    }

                    if (typeof params.metadata == 'object') {
                        updateThreadInfoData.content.metadata = JSON.stringify(params.metadata);
                    }
                    else if (typeof params.metadata == 'string') {
                        updateThreadInfoData.content.metadata = params.metadata;
                    }
                }

                return sendMessage(updateThreadInfoData, {
                    onResult: function(result) {
                        callback && callback(result);
                    }
                });
            }
718985
function update(id, object) {
	// Validations
	if (!_isValidId(id)) {
		return false;
	}

	// Action
	const index = _getIndexOfId(id);

	if (index > -1) {
		if (_isValidAmbushOnUpdate(id, object)) {
			const current = goblin.ambush[index];
			const newAmbush = Object.assign({}, current, object);
			newAmbush.description = _cleanDescription(newAmbush.description);

			// Set updated ambush
			goblin.ambush[index] = newAmbush;
			goblin.ambushEmitter.emit(
				'change',
				{
					type: 'update',
					oldValue: JSONfn.clone(current),
					value: JSONfn.clone(goblin.ambush[index])
				}
			);
		}
	} else {
		logger('AMBUSH_UPDATE_INVALID_REFERENCE');
	}

	return true;
}
444050
public synchronized U update(int i, Function<U, U> updater) {
    U updated = updater.apply(this.get(i));
    set(i, updated);
    return updated;
  }
179023
def update(self):
        """"""
        if self.single_channel:
            self.im.set_data(self.data[self.ind, :, :])
        else:
            self.im.set_data(self.data[self.ind, :, :, :])
        self.ax.set_ylabel('time frame %s' % self.ind)
        self.im.axes.figure.canvas.draw()