设置关联属性，不可立即解析，防止table、pk参数未设置完全
764179
public static function setRelation(string $attr, array $params, $class)
    {
        if (!isset(self::$relationData[$class])) {
            self::$relationData[$class] = [];
        }
        self::$relationData[$class][$attr] = [$params]; //键名为未解析标记
    }
85271
private static void destroy(boolean active) {
        // TODO 检查是否有其它需要释放的资源
        RpcRunningState.setShuttingDown(true);
        for (Destroyable.DestroyHook destroyHook : DESTROY_HOOKS) {
            destroyHook.preDestroy();
        }
        List<ProviderConfig> providerConfigs = new ArrayList<ProviderConfig>();
        for (ProviderBootstrap bootstrap : EXPORTED_PROVIDER_CONFIGS) {
            providerConfigs.add(bootstrap.getProviderConfig());
        }
        // 先反注册服务端
        List<Registry> registries = RegistryFactory.getRegistries();
        if (CommonUtils.isNotEmpty(registries) && CommonUtils.isNotEmpty(providerConfigs)) {
            for (Registry registry : registries) {
                registry.batchUnRegister(providerConfigs);
            }
        }
        // 关闭启动的端口
        ServerFactory.destroyAll();
        // 关闭发布的服务
        for (ProviderBootstrap bootstrap : EXPORTED_PROVIDER_CONFIGS) {
            bootstrap.unExport();
        }
        // 关闭调用的服务
        for (ConsumerBootstrap bootstrap : REFERRED_CONSUMER_CONFIGS) {
            ConsumerConfig config = bootstrap.getConsumerConfig();
            if (!CommonUtils.isFalse(config.getParameter(RpcConstants.HIDDEN_KEY_DESTROY))) { // 除非不让主动unrefer
                bootstrap.unRefer();
            }
        }
        // 关闭注册中心
        RegistryFactory.destroyAll();
        // 关闭客户端的一些公共资源
        ClientTransportFactory.closeAll();
        // 卸载模块
        if (!RpcRunningState.isUnitTestMode()) {
            ModuleFactory.uninstallModules();
        }
        // 卸载钩子
        for (Destroyable.DestroyHook destroyHook : DESTROY_HOOKS) {
            destroyHook.postDestroy();
        }
        // 清理缓存
        RpcCacheManager.clearAll();
        RpcRunningState.setShuttingDown(false);
        if (LOGGER.isWarnEnabled()) {
            LOGGER.warn("SOFA RPC Framework has been release all resources {}...",
                active ? "actively " : "");
        }
    }
1209427
private function execute2(): bool
    {
        //创建语句
        try {
            $this->statement->create();
        } catch (MysqlException $e) {
            trigger_error('MYSQL语句错误:' . $e->getMessage(), E_USER_ERROR);
        }

        // 检查缓存配置开关
        if (!$this->enabled()) {
            return self::executeStatementAndClear();
        }

        // 重构相关表名
        $tables = $this->statement->getTable();

        // 如果可以解析表名 清除相关缓存
        if ($tables and count($tables)) {
            $cache = CacheFactory::createByType($this->cacheType);

            // 清除相关表中的所有缓存.因为可能影响到
            foreach ($tables as $name) {
                $cache->clear($name);
            }
        }

        return self::executeStatementAndClear();
    }
643923
function getTableCellOffset( cell ) {

        tab = domUtils.findParentByTagName( cell, "table", false);

        if( tab.offsetVal === undefined ) {

            var prev = cell.previousSibling;

            if( prev ) {

                //最后一个单元格和前一个单元格的width diff结果 如果恰好为一个border width， 则条件成立
                tab.offsetVal = cell.offsetWidth - prev.offsetWidth === UT.borderWidth ? UT.borderWidth : 0;

            } else {
                tab.offsetVal = 0;
            }

        }

        return tab.offsetVal;

    }
20948
function (range) {
            //每次获取cells之前必须先清除上次的选择，否则会对后续获取操作造成影响
            this.clearSelected();
            var beginRowIndex = range.beginRowIndex,
                beginColIndex = range.beginColIndex,
                endRowIndex = range.endRowIndex,
                endColIndex = range.endColIndex,
                cellInfo, rowIndex, colIndex, tdHash = {}, returnTds = [];
            for (var i = beginRowIndex; i <= endRowIndex; i++) {
                for (var j = beginColIndex; j <= endColIndex; j++) {
                    cellInfo = this.indexTable[i][j];
                    rowIndex = cellInfo.rowIndex;
                    colIndex = cellInfo.colIndex;
                    // 如果Cells里已经包含了此Cell则跳过
                    var key = rowIndex + '|' + colIndex;
                    if (tdHash[key]) continue;
                    tdHash[key] = 1;
                    if (rowIndex < i || colIndex < j || rowIndex + cellInfo.rowSpan - 1 > endRowIndex || colIndex + cellInfo.colSpan - 1 > endColIndex) {
                        return null;
                    }
                    returnTds.push(this.getCell(rowIndex, cellInfo.cellIndex));
                }
            }
            return returnTds;
        }
609828
function (fields, data, vaildRules, method = '') {
    let result = { status: 1, msg: '' }, rdata = {}, rflag = false;
    if (method === 'ADD') { //新增数据add
        for (let f in fields) {
            rflag = !fields[f].pk || fields[f].isnull !== true;
            //默认值
            if (lib.isEmpty(data[f])) {
                if (rflag) {
                    rdata[f] = setDefault(fields[f].defaults, fields[f].type, data[f]);
                } else {
                    data[f] !== undefined && (rdata[f] = data[f]);
                }
            } else {
                rdata[f] = data[f];
            }

            //数据类型检查
            if (rflag) {
                result = dataCheck(f, rdata[f], (fields[f].type || 'string'));
                if (!result.status) {
                    return Promise.reject(result.msg);
                }
            }

            //自定义规则检查
            if (vaildRules[f]) {
                result = ruleCheck(f, rdata[f], vaildRules[f], method);
                if (!result.status) {
                    return Promise.reject(result.msg);
                }
            }
        }
    } else if (method === 'UPDATE') { //编辑数据update
        for (let d in data) {
            //剔除多余字段
            if (fields[d] && data[d] !== undefined) {
                //isnull or pk
                rflag = !fields[d].pk || fields[d].isnull !== true;
                //默认值
                if (lib.isEmpty(data[d])) {
                    if (rflag) {
                        rdata[d] = (fields[d].defaults !== undefined && fields[d].defaults !== null) ? fields[d].defaults : data[d];
                    } else {
                        data[d] !== undefined && (rdata[d] = data[d]);
                    }
                } else {
                    rdata[d] = data[d];
                }

                //数据类型检查
                if (rflag) {
                    result = dataCheck(d, rdata[d], (fields[d].type || 'string'));
                    if (!result.status) {
                        return Promise.reject(result.msg);
                    }
                }

                //自定义规则检查
                if (vaildRules[d]) {
                    result = ruleCheck(d, rdata[d], vaildRules[d], method);
                    if (!result.status) {
                        return Promise.reject(result.msg);
                    }
                }
            }
        }
    } else {
        rdata = data;
    }
    return Promise.resolve(rdata);
}
310528
function () {
                var self = this, attrs = self.getAttrs(), attr, m;
                for (attr in attrs) {
                    m = ON_SET + ucfirst(attr);
                    if (self[m]) {
                        // 自动绑定事件到对应函数
                        self.on('after' + ucfirst(attr) + 'Change', onSetAttrChange);
                    }
                }
            }
200680
public void ack(TerminEventData data) {
        Assert.notNull(data);
        // 目前只有select模块需要发送ack信号，这里一旦收到一个信号后就删除对应的termin节点，后续可扩展
        // 删除termin节点
        String path = StagePathUtils.getTermin(data.getPipelineId(), data.getProcessId());
        try {
            zookeeper.delete(path);
        } catch (ZkNoNodeException e) {
            // ignore,说明节点已经被删除
        } catch (ZkException e) {
            throw new ArbitrateException("Termin_ack", e);
        }

        TerminMonitor terminMonitor = ArbitrateFactory.getInstance(data.getPipelineId(), TerminMonitor.class);
        terminMonitor.ack(data.getProcessId());
    }
119460
function () {
                    var index = 0;

                    while (index < fireLength) {

                        if ([].indexOf.call(arguments, list[index]) !== -1) {

                            // 从队列中删除当前回调
                            list.splice(index, 1);

                            // 如果当前回调队列被多层嵌套执行
                            // 上几层队列也可能会受到影响
                            if (firing) {
                                if (fireQueue.length) {
                                    fireQueue.forEach(function (value, key) {
                                        // 被删除的回调位于当前索引位置前面
                                        // 当前索引位置自减1
                                        if (index <= value) {
                                            fireQueue[key]--;
                                        }
                                    });
                                }

                                // 如果被删除的函数的索引位置在fireIndex的前面
                                // fireIndex自减1

                                if (index <= fireIndex) {
                                    fireIndex--;
                                }
                            }

                            // 回调列表长度改变
                            fireLength--;
                        } else {
                            index++;
                        }
                    }

                    return this;
                }
305018
def QA_SU_save_stock_terminated(client=DATABASE):
    '''
    
    '''

    # 🛠todo 已经失效从wind 资讯里获取
    # 这个函数已经失效
    print("！！！ tushare 这个函数已经失效！！！")
    df = QATs.get_terminated()
    #df = QATs.get_suspended()
    print(
        " Get stock terminated from tushare,stock count is %d  (终止上市股票列表)" %
        len(df)
    )
    coll = client.stock_terminated
    client.drop_collection(coll)
    json_data = json.loads(df.reset_index().to_json(orient='records'))
    coll.insert(json_data)
    print(" 保存终止上市股票列表 到 stock_terminated collection， OK")
1128135
private <T> void postHandleRelatedColumn(List<T> tList, String... relatedColumnProperties) {
        if (tList == null || tList.isEmpty()) {
            return;
        }

        JoinTable joinTable = DOInfoReader.getJoinTable(tList.get(0).getClass());
        if (joinTable != null) { // 处理join的方式
            List<Object> list1 = new ArrayList<Object>();
            List<Object> list2 = new ArrayList<Object>();

            Field joinLeftTableFiled = DOInfoReader.getJoinLeftTable(tList.get(0).getClass());
            Field joinRightTableFiled = DOInfoReader.getJoinRightTable(tList.get(0).getClass());
            for (T t : tList) {
                Object obj1 = DOInfoReader.getValue(joinLeftTableFiled, t);
                if (obj1 != null) {
                    list1.add(obj1);
                }
                Object obj2 = DOInfoReader.getValue(joinRightTableFiled, t);
                if (obj2 != null) {
                    list2.add(obj2);
                }
            }

            postHandleRelatedColumn(list1);
            postHandleRelatedColumn(list2);
            return;
        }

        SQLAssert.allSameClass(tList);
        Class<?> clazz = tList.get(0).getClass();

        List<Field> relatedColumns = DOInfoReader.getRelatedColumns(clazz);
        for (Field field : relatedColumns) {

            // 只处理指定的field
            if (relatedColumnProperties != null && relatedColumnProperties.length > 0) {
                boolean isContain = false;
                for (String property : relatedColumnProperties) {
                    if (property != null && property.equals(field.getName())) {
                        isContain = true;
                        break;
                    }
                }
                if (!isContain) {
                    continue;
                }
            }

            RelatedColumn column = field.getAnnotation(RelatedColumn.class);
            if (column.localColumn().trim().isEmpty()) {
                LOGGER.warn("relatedColumn value is empty, field:{}", field);
                continue;
            }
            if (column.remoteColumn().trim().isEmpty()) {
                LOGGER.warn("remoteColumn value is empty, field:{}", field);
                continue;
            }

            Field localField = DOInfoReader.getFieldByDBField(clazz, column.localColumn());
            if (localField == null) {
                LOGGER.error("cannot find localField,db column name:{}", column.localColumn());
                continue;
            }

            // 批量查询数据库，提高效率的关键
            Class<?> remoteDOClass;
            if (field.getType() == List.class) {
                remoteDOClass = DOInfoReader.getGenericFieldType(field);
            } else {
                remoteDOClass = field.getType();
            }

            Field remoteField = DOInfoReader.getFieldByDBField(remoteDOClass,
                    column.remoteColumn());
            if (remoteField == null) {
                LOGGER.error("cannot find remoteField,db column name:{}", column.remoteColumn());
                continue;
            }

            Set<Object> values = new HashSet<Object>(); // 用于去重
            for (T t : tList) {
                Object value = DOInfoReader.getValue(localField, t);
                if (value != null) {
                    values.add(value);
                }
            }

            if (values.isEmpty()) {
                // 不需要查询数据库，但是对List的，设置空List，确保list不会是null
                if (field.getType() == List.class) {
                    for (T t : tList) {
                        DOInfoReader.setValue(field, t, new ArrayList<Object>());
                    }
                }
                continue;
            }

            List<?> relateValues;
            if (column.dataService() != void.class &&
                    IDBHelperDataService.class.isAssignableFrom(column.dataService())) {
                IDBHelperDataService dataService = (IDBHelperDataService)
                        applicationContext.getBean(column.dataService());
                if (dataService == null) {
                    LOGGER.error("dataService is null for {}", column.dataService());
                    relateValues = new ArrayList<Object>();
                } else {
                    relateValues = dataService.get(new ArrayList<Object>(values),
                            clazz, column.localColumn(),
                            remoteDOClass, column.remoteColumn());
                }
            } else {
                String inExpr = column.remoteColumn() + " in (?)";
                if (column.extraWhere() == null || column.extraWhere().trim().isEmpty()) {
                    relateValues = getAll(remoteDOClass, "where " + inExpr, values);
                } else {
                    String where;
                    try {
                        where = SQLUtils.insertWhereAndExpression(column.extraWhere(), inExpr);
                        relateValues = getAll(remoteDOClass, where, values);
                    } catch (JSQLParserException e) {
                        LOGGER.error("wrong RelatedColumn extraWhere:{}, ignore extraWhere",
                                column.extraWhere());
                        relateValues = getAll(remoteDOClass, "where " + inExpr, values);
                    }
                }
            }

            if (field.getType() == List.class) {
                Map<Object, List<Object>> mapRemoteValues = new HashMap<Object, List<Object>>();
                Map<String, List<Object>> mapRemoteValuesString = new HashMap<String, List<Object>>();
                for (Object obj : relateValues) {
                    Object oRemoteValue = DOInfoReader.getValue(remoteField, obj);
                    if (oRemoteValue == null) {continue;}

                    List<Object> oRemoteValueList = mapRemoteValues.get(oRemoteValue);
                    if (oRemoteValueList == null) {
                    	oRemoteValueList = new ArrayList<Object>();
                        mapRemoteValues.put(oRemoteValue, oRemoteValueList);
                    }
                    oRemoteValueList.add(obj);
                    
                    List<Object> oRemoteValueListString = mapRemoteValuesString.get(oRemoteValue.toString());
                    if (oRemoteValueListString == null) {
                    	oRemoteValueListString = new ArrayList<Object>();
                        mapRemoteValuesString.put(oRemoteValue.toString(), oRemoteValueListString);
                    }
                    oRemoteValueListString.add(obj);
                }
                for (T t : tList) {
                    List<Object> valueList = new ArrayList<Object>();
                    Object oLocalValue = DOInfoReader.getValue(localField, t);
                    if (oLocalValue != null) {
                        List<Object> objRemoteList = mapRemoteValues.get(oLocalValue);
                        if (objRemoteList != null) {
                            valueList = objRemoteList;
                        } else {
                            List<Object> objRemoteStringList = mapRemoteValuesString.get(oLocalValue.toString());
                            if (objRemoteStringList != null) {
                                LOGGER.warn("@RelatedColumn fields local:{},remote:{} is different classes. Use String compare.",
                                        localField, remoteField);
                                valueList = objRemoteList;
                            }
                        }
                    }
                    if (valueList.isEmpty()) { // 没有匹配数据时，当原字段有值，则不修改原来的值
                        if (DOInfoReader.getValue(field, t) == null) {
                            DOInfoReader.setValue(field, t, valueList);
                        }
                    } else {
                        DOInfoReader.setValue(field, t, valueList);
                    }
                }
            } else {
                Map<Object, Object> mapRemoteValues = new HashMap<Object, Object>();
                Map<String, Object> mapRemoteValuesString = new HashMap<String, Object>();
                for (Object obj : relateValues) {
                    Object oRemoteValue = DOInfoReader.getValue(remoteField, obj);
                    if (oRemoteValue != null) {
                        mapRemoteValues.put(oRemoteValue, obj);
                        mapRemoteValuesString.put(oRemoteValue.toString(), obj);
                    }
                }
                for (T t : tList) {
                    Object oLocalValue = DOInfoReader.getValue(localField, t);
                    if (oLocalValue == null) {continue;}
                    
                    Object objRemote = mapRemoteValues.get(oLocalValue);
                    if (objRemote != null) {
                        DOInfoReader.setValue(field, t, objRemote);
                        continue;
                    }
                    Object objRemoteString = mapRemoteValuesString.get(oLocalValue.toString());
                    if (objRemoteString != null) {
                        LOGGER.warn("@RelatedColumn fields local:{},remote:{} is different classes. Use String compare.",
                                localField, remoteField);
                        DOInfoReader.setValue(field, t, objRemoteString);
                    }
                }
            }
        }
    }
1049989
function(param) {
      var step, start, res;
      //如果无参数 当成是获取第一个元素
      if (!param || !(param = param.replace(/\s+/g, ""))) {
        return {
          start: 1,
          step: 0
        };
      }
      if (res = nthCache.get(param)) return res;
      // 对even odd等转化为标准的a，b组合(即step与start)
      if (param == "even") {
        start = 2;
        step = 2;
      } else if (param == "odd") {
        step = 2;
        start = 1;
      } else {
        res = param.match(nthValueReg);
        // 对错误的nth参数抛出错误
        if (!res) step = null; // 无论其他参数，如果step为null，则永远为false
        else {
          if (res[1]) {
            step = 0;
            start = parseInt(res[1]);
          } else {
            if (res[2] == "-") res[2] = "-1";
            step = res[2] ? parseInt(res[2]) : 1;
            start = res[3] ? parseInt(res[3]) : 0;
          }
        }
      }
      if (start < 1) {
        if (step < 1) {
          step = null; //标志false
        } else {
          start = -(-start) % step + step;
        }
      }
      return nthCache.set(param, {
        start: start,
        step: step
      });
    }
128509
public static void stop() {
        synchronized (lock) {
            if (singleton == null) return;
            LeaderSelector leaderSelector = singleton.leaderSelector;
            if (leaderSelector == null) {
                return;
            }
            LOG.info("节点退出zk选举");
            leaderSelector.close();
            singleton = null;
            LOG.info("退出选举 完毕");
        }
    }
1100532
public static <T> void forEach(T[] input,boolean[] inputSkip,T[] output ,int outPutIndex,ForEachController<T> controller)
	{
		for(int i=0;i<input.length;i++)
		{
			if(inputSkip[i])
			{
				continue;
			}
			output[outPutIndex]=input[i];//输出当前位锁定值
			ComputeStatus status=controller.onOutEvent(output, outPutIndex);
			if(status.isStop())
			{
				return;
			}
			if(status.isSkip())
			{//跳过下层循环
				continue;
			}
			outPutIndex++;
			if(outPutIndex>=input.length)
			{//如果是最后一个则返回
				break;
			}
			//解锁下一个
			inputSkip[i]=true;//锁定当前位占用索引,其它位不可使用该索引
			forEach(input, inputSkip, output, outPutIndex,controller);
			outPutIndex--;//回到当前
			inputSkip[i]=false;//释放锁定
		}
	}
574121
function () {
        const editor = this.editor
        const $textElem = editor.$textElem

        $textElem.on('keydown', e => {
            if (e.keyCode !== 8) {
                return
            }
            const txtHtml = $textElem.html().toLowerCase().trim()
            if (txtHtml === '<p><br></p>') {
                // 最后剩下一个空行，就不再删除了
                e.preventDefault()
                return
            }
        })

        $textElem.on('keyup', e => {
            if (e.keyCode !== 8) {
                return
            }
            let $p
            const txtHtml = $textElem.html().toLowerCase().trim()

            // firefox 时用 txtHtml === '<br>' 判断，其他用 !txtHtml 判断
            if (!txtHtml || txtHtml === '<br>') {
                // 内容空了
                $p = $('<p><br/></p>')
                $textElem.html('') // 一定要先清空，否则在 firefox 下有问题
                $textElem.append($p)
                editor.selection.createRangeByElem($p, false, true)
                editor.selection.restoreSelection()
            }
        })

    }
1027790
private void select(int dataIndex, String[] resultList, int resultIndex, List<String[]> result) {
		int resultLen = resultList.length;
		int resultCount = resultIndex + 1;
		if (resultCount > resultLen) { // 全部选择完时，输出组合结果
			result.add(Arrays.copyOf(resultList, resultList.length));
			return;
		}

		// 递归选择下一个
		for (int i = dataIndex; i < datas.length + resultCount - resultLen; i++) {
			resultList[resultIndex] = datas[i];
			select(i + 1, resultList, resultIndex + 1, result);
		}
	}
415857
public function getDbFields(){
        if(isset($this->options['table'])) {// 动态指定表名
            if(is_array($this->options['table'])){
                $table  =   key($this->options['table']);
            }else{
                $table  =   $this->options['table'];
                if(strpos($table,')')){
                    // 子查询
                    return false;
                }
            }
            $fields     =   $this->db->getFields($table);
            return  $fields ? array_keys($fields) : false;
        }
        if($this->fields) {
            $fields     =  $this->fields;
            unset($fields['_type'],$fields['_pk']);
            return $fields;
        }
        return false;
    }