获得用户资料,根据自己的情况读取数据库
323103
protected function getUserInfo($uid) {
        static $userinfo=array();
        if(!isset($userinfo[$uid])){
             $userinfo[$uid] = Db::table($this->prefix.$this->_config['auth_user'])->where(array('uid'=>$uid))->find();
        }
        return $userinfo[$uid];
    }
1262641
public void init() {
        try {
            String[] names = tgtools.web.platform.Platform.getBeanFactory().getBeanDefinitionNames();
            for (String name : names) {
                if (name.endsWith("CommandImpl") && tgtools.web.platform.Platform.getBean(name) instanceof Command && mType.equals(((Command) tgtools.web.platform.Platform.getBean(name)).getType())) {
                    addCommand((Command)tgtools.web.platform.Platform.getBean(name));
                }
            }
        } catch (Exception e) {
            LogHelper.error("","CommandFactory 初始化失败；原因："+e.toString(),"CommandFactory.init",e);
        }
    }
552501
private void fillCollection(Collection<?> collection) {

        int count = 0;

        // 展开  Collection 容器, 输出逗号分隔以支持 IN (...) 语法
        // "IN :varlist" --> "IN (?, ?, ...)"
        if (collection.isEmpty()) {

            // 输出  "IN (NULL)" 保证不会产生错误
            builder.append(NULL);

        } else {

            // 输出逗号分隔的参数表
            for (Object value : collection) {

                if (value != null) {

                    if (count > 0) {
                        builder.append(COMMA);
                    }

                    // 输出参数内容
                    addArg(value);

                    builder.append(QUESTION);

                    count++;
                }
            }
        }
    }
693556
function modCompletePreDefine(currentId) {
        // HACK: 这里在IE下有个性能陷阱，不能使用任何变量。
        //       否则貌似会形成变量引用和修改的读写锁，导致wait4PreDefine释放困难
        each(wait4PreDefine, function (mod) {
            modPreDefine(
                currentId,
                mod.deps,
                mod.factory
            );
        });

        wait4PreDefine.length = 0;
    }
1179341
private static void processBiGram() {
        //移除二元模型出现频率为1的情况
        Iterator<String> iter = BIGRAM.keySet().iterator();
        while(iter.hasNext()){
            String key = iter.next();
            if(BIGRAM.get(key) < 2){
                iter.remove();
            }
        }
        try(BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("src/main/resources/bigram.txt"),"utf-8"))){
            for(Entry<String, Integer> item : BIGRAM.entrySet()){
                writer.write(item.getKey()+" "+item.getValue()+"\n");
            }
        }catch(Exception e){
            LOGGER.info("保存bigram模型失败：", e);
        }
    }
328607
@SuppressWarnings("unchecked")
	
	/**
	 * 返回列表 key 中，下标为 index 的元素。
	 * 下标(index)参数 start 和 stop 都以 0 为底，也就是说，以 0 表示列表的第一个元素，
	 * 以 1 表示列表的第二个元素，以此类推。
	 * 你也可以使用负数下标，以 -1 表示列表的最后一个元素， -2 表示列表的倒数第二个元素，以此类推。
	 * 如果 key 不是列表类型，返回一个错误。
	 */
	public <T> T lindex(Object key, long index) {
		Jedis jedis = getJedis();
		try {
			return (T)valueFromBytes(jedis.lindex(keyToBytes(key), index));
		}
		finally {close(jedis);}
	}
914647
function init() {
  const {supportCordova = false} = this.config;

  onReady = onReady.bind(this);

  /***
   * 如果开启了对cordova的支持
   */
  if (supportCordova) {
    /***
     * 如果开启了对cordova的支持，那么页面完成事件和cordova的deviceReady事件必须同时完成后才能支持后续代码
     */
    Promise.all([
      readyPromise(),
      DOMContentLoadedPromise(),
      devicereadyPromise()
    ]).then(() => {
      onReady();
      fireEvent(window.document, "DOMContentAndDeviceReady");
    }).catch((error) => {

    });
  }
  else {
    /***
     * 页面载入完成事件
     */
    $(window.document).ready(onReady);

    /***
     * 自动 init
     */
    window.addEventListener("DOMContentLoaded", onReady);
  }
}
685138
public static <T> void remove(List<T> list, List<Integer> removes) {
        // 不是ArrayList的先转换为ArrayList
        if (!(list instanceof ArrayList)) {
            list = new ArrayList<>(list);
        }
        int flag = 0;
        // 删除
        for (int i = 0; i < removes.size(); i++) {
            if (flag < removes.get(i)) {
                flag = removes.get(i);
                list.remove(flag - i);
            } else {
                throw new CollectionException("删除集合中多个元素时指针应该按照从小到大的顺序排序");
            }
        }
    }
735647
public void append(byte data) {
        // 当数组长度等于当前数据大小时进行扩展
        if (0 >= (this.datas.length - size)) {
            // 如果扩展后的数组大于当前数组，那么先把当前数组长度增加，一次扩展256
            byte[] newData = new byte[256 + size];
            System.arraycopy(this.datas, 0, newData, 0, size);
            this.datas = newData;
        }
        this.datas[size] = data;
        this.size += 1;
        modCount++;
    }
1020087
@Override
    public void recognition(Term[] terms) {
        int length = terms.length - 1;
        Term from = null;
        Term to = null;
        Term temp = null;
        for (int i = 0; i < length; i++) {
            if (terms[i] == null) {
                continue;
            } else if (".".equals(terms[i].getName()) || "．".equals(terms[i].getName())) {
                // 如果是.前后都为数字进行特殊处理
                to = terms[i].to();
                from = terms[i].from();
                if (from.termNatures().numAttr.flag && to.termNatures().numAttr.flag) {
                    from.setName(from.getName() + "." + to.getName());
                    TermUtil.termLink(from, to.to());
                    terms[to.getOffe()] = null;
                    terms[i] = null;
                    i = from.getOffe() - 1;
                }
                continue;
            } else if (!terms[i].termNatures().numAttr.flag) {
                continue;
            }

            temp = terms[i];
            // 将所有的数字合并
            while ((temp = temp.to()).termNatures().numAttr.flag) {
                terms[i].setName(terms[i].getName() + temp.getName());
            }
            // 如果是数字结尾
            if (MyStaticValue.isQuantifierRecognition && temp.termNatures().numAttr.numEndFreq > 0) {
                terms[i].setName(terms[i].getName() + temp.getName());
                temp = temp.to();
            }

            // 如果不等,说明terms[i]发生了改变
            if (terms[i].to() != temp) {
                TermUtil.termLink(terms[i], temp);
                // 将中间无用元素设置为null
                for (int j = i + 1; j < temp.getOffe(); j++) {
                    terms[j] = null;
                }
                i = temp.getOffe() - 1;
            }
        }

    }
370874
public static void main(String... args) throws Exception {

        String string = "SELECT :expr1, #($expr2.class),"
                + " WHERE #if(:expr3) {e = $expr3} #else {e IS NULL}"
                + "#for(variant in $expr4.bytes) { AND c = :variant}" // NL
                + " {AND d = :expr-5}? {AND f = $expr6}?" // NL
                + " BY #!(:expr7) ASC";

        // 在输入中查找  PREFIX 字符
        Matcher matcher = PATTERN_KEYWORD.matcher(string);

        int position = 0;

        while (matcher.find(position)) {

            System.out.println("===============================");
            System.out.println("group 0: " + matcher.group(0));
            System.out.println("group 1: " + matcher.group(1));
            System.out.println("group 2: " + matcher.group(2));
            System.out.println("group 3: " + matcher.group(3));

            position = matcher.end();
        }

        // 在循环表达式中查找
        matcher = PATTERN_IN.matcher("variant in :expr5");

        if (matcher.matches()) {

            System.out.println("===============================");
            System.out.println("group 0: " + matcher.group(0));
            System.out.println("group 1: " + matcher.group(1));
            System.out.println("group 2: " + matcher.group(2));
        }

        // 编译下列语句
        ExqlPattern pattern = new ExqlCompiler(string).compile();

        ExqlContext context = new ExqlContextImpl();

        HashMap<String, Object> map = new HashMap<String, Object>();

        map.put("expr1", "expr1");
        map.put("expr2", "expr2");
        map.put("expr3", "expr3");
        map.put("expr4", "expr4");
        map.put("expr5", "expr5");
        // map.put("expr6", "expr6");
        map.put("expr7", "expr7");

        pattern.execute(context, map, map);
        System.out.println(context.flushOut());
        System.out.println(Arrays.toString(context.getArgs()));
    }
43081
function tryFinishRequire() {
            if (typeof callback === 'function' && !isCallbackCalled) {
                var isAllCompleted = 1;
                each(ids, function (id) {
                    if (!BUILDIN_MODULE[id]) {
                        return (isAllCompleted = !!modIs(id, MODULE_DEFINED));
                    }
                });

                // 检测并调用callback
                if (isAllCompleted) {
                    isCallbackCalled = 1;

                    callback.apply(
                        global,
                        modGetModulesExports(ids, BUILDIN_MODULE)
                    );
                }
            }
        }
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);
		}
	}
464876
private static void combineWords(String[] wordNet, int start, int end, CoreDictionary.Attribute[] attributeArray, CoreDictionary.Attribute value)
    {
        if (start + 1 != end)   // 小优化，如果只有一个词，那就不需要合并，直接应用新属性
        {
            StringBuilder sbTerm = new StringBuilder();
            for (int j = start; j < end; ++j)
            {
                if (wordNet[j] == null) continue;
                sbTerm.append(wordNet[j]);
                wordNet[j] = null;
            }
            wordNet[start] = sbTerm.toString();
        }
        attributeArray[start] = value;
    }
1265027
@Override
	public void run() {
		ThriftConnectionHandle<T> connection;
		long tmp;
		long nextCheckInMs = this.maxConnectionAge;

		int partitionSize = this.thriftConnectionPartition.getAvailableConnections();
		long currentTime = System.currentTimeMillis();
		for (int i = 0; i < partitionSize; i++) {
			try {
				connection = this.thriftConnectionPartition.poolFreeConnection();

				if (connection != null) {
					connection.setOriginatingPartition(this.thriftConnectionPartition);

					tmp = this.maxConnectionAge - (currentTime - connection.getConnectionCreationTimeInMs());

					if (tmp < nextCheckInMs) {
						nextCheckInMs = tmp;
					}

					// 判断连接是否过期
					if (connection.isExpired(currentTime)) {
						// 关闭连接
						closeConnection(connection);
						continue;
					}

					if (lifoMode == ServiceOrder.LIFO) {
						if (!(connection.getConnectionPartition().getFreeConnections().offer(connection))) {
							connection.internalClose();
						}
					} else {
						this.thriftConnectionPool.putConnectionBackInPartition(connection);
					}
					// 避免cpu使用率过高 进行一段时间休眠
					Thread.sleep(20L);
				}
			} catch (Throwable e) {
				logger.error("Connection max age thread exception.", e);
			}
		}

	}
346815
static byte[] encode(int count) {
        // 计算需要填充的位数
        int amountToPad = BLOCK_SIZE - (count % BLOCK_SIZE);
        if (amountToPad == 0) {
            amountToPad = BLOCK_SIZE;
        }
        // 获得补位所用的字符
        char padChr = chr(amountToPad);
        StringBuilder tmp = new StringBuilder();
        for (int index = 0; index < amountToPad; index++) {
            tmp.append(padChr);
        }
        return tmp.toString().getBytes(CHARSET);
    }
540938
public void set(Object key, Object value) {
		for (Scope cur=this; true; cur=cur.parent) {
			// HashMap 允许有 null 值 value，必须要做 containsKey 判断
			if (cur.data != null && cur.data.containsKey(key)) {
				cur.data.put(key, value);
				return ;
			}
			
			if (cur.parent == null) {
				if (cur.data == null) {			// 支持顶层 data 为 null 值
					cur.data = new HashMap();
				}
				cur.data.put(key, value);
				return ;
			}
		}
	}