简单的神经网络实现前向传播的算法
        这里为什么能用矩阵乘法来计算呢？因为，通过求加权和发现
        正好是矩阵的乘法运算结果。所以，这里充分的体现了数学的美
550472
def example_compute(self):
        
        a = matmul(self.x, self.w1)
        y = matmul(a, self.w2)

        sess = Session()
        sess.run(self.w1.initializer)
        sess.run(self.w2.initializer)
        print('第一种：', sess.run(y))
        sess.close()
1282076
function parseGlyf(reader, ttf, offset) {

            if (null != offset) {
                reader.seek(offset);
            }

            var glyf = {};
            var i;
            var length;
            var instructions;

            // 边界值
            var numberOfContours = reader.readInt16();
            glyf.xMin = reader.readInt16();
            glyf.yMin = reader.readInt16();
            glyf.xMax = reader.readInt16();
            glyf.yMax = reader.readInt16();

            // 读取简单字形
            if (numberOfContours >= 0) {
                // endPtsOfConturs
                var endPtsOfContours = [];
                if (numberOfContours >= 0) {
                    for (i = 0; i < numberOfContours; i++) {
                        endPtsOfContours.push(reader.readUint16());
                    }
                    glyf.endPtsOfContours = endPtsOfContours;
                }

                // instructions
                length = reader.readUint16();
                if (length) {
                    // range错误
                    if (length < MAX_INSTRUCTION_LENGTH) {
                        instructions = [];
                        for (i = 0; i < length; ++i) {
                            instructions.push(reader.readUint8());
                        }
                        glyf.instructions = instructions;
                    }
                    else {
                        console.warn(length);
                    }
                }

                parseSimpleGlyf(reader, glyf);
                delete glyf.endPtsOfContours;
            }
            else {
                parseCompoundGlyf(reader, glyf);
            }

            return glyf;
        }
685652
public void readWriteVar(Class<?> type,String varName,StringBuilder writesb,StringBuilder readsb,boolean nullCheck,Type ...actualType)
	{
//		if(type.isArray())
//		{//数组不支持泛型
//			Class<?> ctype=type.getComponentType();
//			String varTypeName=getVarTypeName(type);
//			String i=varName+"_i";
//			String var_data=varName+"_d";
//			String var_dataTypeName=getVarTypeName(ctype);
//			String var_len=varName+"_l";
//			
//			if(nullCheck)
//			{
//				writesb.append("\t").append("if (" + varName + "!=null){").append("\n");
//				writesb.append("\t").append("buffer.writeBoolean(true);").append("\n");
//				
//				readsb.append("\t").append("if (buffer.readBoolean()){").append("\n");
//			}
//			writesb.append("\t").append("int "+var_len+"="+varName+".length;").append("\n");
//			writesb.append("\t").append("buffer.writeInt("+var_len+");").append("\n");
//			writesb.append("\t").append("for(int "+i +"=0;" +i+"<"+var_len+";"+i+"++){").append("\n");
//			writesb.append("\t").append(var_dataTypeName+" "+var_data+"="+varName+"["+i+"];").append("\n");
//			
//			readsb.append("\t").append("int "+var_len+"=buffer.readInt();").append("\n");
//			readsb.append("\t").append(varName+"=("+varTypeName+") java.lang.reflect.Array.newInstance("+var_dataTypeName+".class,"+var_len+");").append("\n");
//			readsb.append("\t").append("for(int "+i +"=0;" +i+"<"+var_len+";"+i+"++){").append("\n");
//			readsb.append("\t").append(var_dataTypeName+" "+var_data+";").append("\n");
//			//读写变量
//			readWriteVar_Base(ctype, var_data, writesb, readsb, false);
//			//设置值
//			readsb.append("\t").append(varName+"["+i+"]="+var_data+";").append("\n");
//			
//			writesb.append("\t").append("}").append("\n");
//			readsb.append("\t").append("}").append("\n");
//			
//			if(nullCheck)
//			{
//				writesb.append("\t").append("}else{");
//				writesb.append("\t").append("buffer.writeBoolean(false);}").append("\n");
//				
//				readsb.append("\t").append("}").append("\n");
//			}
//			return ;
//		}
		if(Map.class.isAssignableFrom(type))
		{
			Type keyType_=actualType[0];
			Type valueType_=actualType[1];
			Class<?> keyType=null;
			Class<?> valueType=null;
			Type[] keyTypeActs=new Type[]{};
			Type[] valueTypeActs=new Type[]{};
			if(keyType_ instanceof ParameterizedType) 
			{
				ParameterizedType pt=(ParameterizedType)keyType_;
				keyType=(Class<?>)pt.getRawType();
				keyTypeActs=pt.getActualTypeArguments();
			}else
			{
				keyType=(Class<?>)keyType_;
			}
			if(valueType_ instanceof ParameterizedType) 
			{
				ParameterizedType pt=(ParameterizedType)valueType_;
				valueType=(Class<?>)pt.getRawType();
				valueTypeActs=pt.getActualTypeArguments();
			}else
			{
				valueType=(Class<?>)valueType_;
			}
			String var_mapSize=varName+"_ms";
			String var_mapI=varName+"_mi";
			String var_mapKey=varName+"_mk";
			String var_mapValue=varName+"_mv";
			
			String var_mapKeyType=getVarTypeName(keyType,keyTypeActs);
			String var_mapValueType=getVarTypeName(valueType,valueTypeActs);
			String varInstanceType=type.getCanonicalName();
			if(type==Map.class)
			{
				varInstanceType="java.util.HashMap";
			}
			
			if(nullCheck)
			{
				writesb.append("\t").append("if (" + varName + "!=null){").append("\n");
				writesb.append("\t").append("buffer.writeBoolean(true);").append("\n");
				
				readsb.append("\t").append("if (buffer.readBoolean()){").append("\n");
			}
			writesb.append("\t").append("int "+var_mapSize+"="+varName+".size();").append("\n");
			writesb.append("\t").append("buffer.writeInt("+var_mapSize+");").append("\n");
			writesb.append("\t").append("for("+var_mapKeyType+" "+var_mapKey +":" +varName+".keySet()){").append("\n");
			writesb.append("\t").append(var_mapValueType+" "+var_mapValue+"="+varName+".get("+var_mapKey+");").append("\n");
			
			readsb.append("\t").append("int "+var_mapSize+"=buffer.readInt();").append("\n");
			readsb.append("\t").append(varName+"=new "+varInstanceType+"<>();").append("\n");
			readsb.append("\t").append("for(int "+var_mapI +"=0;" +var_mapI+"<"+var_mapSize+";"+var_mapI+"++){").append("\n");
				
			//声明变量
			readsb.append("\t").append(var_mapKeyType+" "+var_mapKey+";").append("\n");
			readsb.append("\t").append(var_mapValueType+" "+var_mapValue+";").append("\n");
			
			//读写变量
			if(keyTypeActs.length>0)
			{
				readWriteVar(keyType, var_mapKey, writesb, readsb, false,keyTypeActs);
			}else
			{
				readWriteVar_Base(keyType, var_mapKey, writesb, readsb, false);
			}
			if(valueTypeActs.length>0)
			{
				readWriteVar(valueType, var_mapValue, writesb, readsb, false,valueTypeActs);
			}else
			{
				readWriteVar_Base(valueType, var_mapValue, writesb, readsb, false);
			}
			
			//设置值
			readsb.append("\t").append(varName+".put("+var_mapKey+","+var_mapValue+");").append("\n");
			
			writesb.append("\t").append("}").append("\n");
			readsb.append("\t").append("}").append("\n");
			
		    if(nullCheck)
			{
				writesb.append("\t").append("}else{");
				writesb.append("\t").append("buffer.writeBoolean(false);}").append("\n");
				
				readsb.append("\t").append("}").append("\n");
			}
			return ;
		}
		if(Collection.class.isAssignableFrom(type))
		{
			Type valueType_=actualType[0];
			Class<?> valueType=null;
			Type[] valueTypeActs=new Type[]{};
			if(valueType_ instanceof ParameterizedType) 
			{
				ParameterizedType pt=(ParameterizedType)valueType_;
				valueType=(Class<?>)pt.getRawType();
				valueTypeActs=pt.getActualTypeArguments();
			}else
			{
				valueType=(Class<?>)valueType_;
			}
			
			String var_listSize=varName+"_ls";
			String var_listI=varName+"_li";
			String var_listValue=varName+"_lv";
			String var_listValueType=getVarTypeName(valueType,valueTypeActs);
			
			String varInstanceType=type.getCanonicalName();
			if(List.class.isAssignableFrom(type))
			{
				if(type==List.class)
				{
					varInstanceType="java.util.ArrayList";
				}
			}
			if(Queue.class.isAssignableFrom(type))
			{
				if(type==Queue.class)
				{
					varInstanceType="java.util.concurrent.ConcurrentLinkedQueue";
				}
			}
			if(Set.class.isAssignableFrom(type))
			{
				if(type==Set.class)
				{
					varInstanceType="java.util.HashSet";
				}
			}
			if(nullCheck)
			{
				writesb.append("\t").append("if (" + varName + "!=null){").append("\n");
				writesb.append("\t").append("buffer.writeBoolean(true);").append("\n");
				
				readsb.append("\t").append("if (buffer.readBoolean()){").append("\n");
			}
			writesb.append("\t").append("int "+var_listSize+"="+varName+".size();").append("\n");
			writesb.append("\t").append("buffer.writeInt("+var_listSize+");").append("\n");
			writesb.append("\t").append("for("+var_listValueType +" "+var_listValue+":" +varName+"){").append("\n");
			
			readsb.append("\t").append("int "+var_listSize+"=buffer.readInt();").append("\n");
			
			readsb.append("\t").append(varName+"=new "+varInstanceType+"<>();").append("\n");
			
			readsb.append("\t").append("for(int "+var_listI +"=0;" +var_listI+"<"+var_listSize+";"+var_listI+"++){").append("\n");
				
			//声明变量
			readsb.append("\t").append(var_listValueType+" "+var_listValue+";").append("\n");
			
			//读写变量
			if(valueTypeActs.length>0)
			{
				readWriteVar(valueType, var_listValue, writesb, readsb, false,valueTypeActs);
			}else
			{
				readWriteVar_Base(valueType, var_listValue, writesb, readsb, false);
			}
			
			//设置值
			readsb.append("\t").append(varName+".add("+var_listValue+");").append("\n");
			
			writesb.append("\t").append("}").append("\n");
			readsb.append("\t").append("}").append("\n");
			
		    if(nullCheck)
			{
				writesb.append("\t").append("}else{");
				writesb.append("\t").append("buffer.writeBoolean(false);}").append("\n");
				
				readsb.append("\t").append("}").append("\n");
			}
			return ;
		}
		//简单类型
		readWriteVar_Base(type, varName, writesb, readsb, nullCheck);
	}
1141616
function Type(/* function | RegExp */ matcher) {
		// 参数合法性检查。
		if (arguments.length != 1) {
			throw new ERR.Arguments(1, arguments.length);
		}
		if (!(typeof matcher == 'function' || matcher instanceof RegExp)) {
			throw new ERR.Type('Type matcher', [ 'Function', 'RegExp' ], matcher);
		}

		// Type() 构造函数参数确定，故毋须使用类似 ParamList.parse 这样的构建器。
		if (!(this instanceof Type)) return new Type(matcher);

		if (matcher instanceof RegExp) {
			this.match = function(value) {
				return matcher.test(value);
			};
		}
		else {
			this.match = matcher;
		}
	}
864261
static boolean loadDat(String path)
    {
        try
        {
            ByteArray byteArray = ByteArray.createByteArray(path + Predefine.BIN_EXT);
            if (byteArray == null) return false;
            int size = byteArray.nextInt();
            CoreDictionary.Attribute[] attributes = new CoreDictionary.Attribute[size];
            final Nature[] natureIndexArray = Nature.values();
            for (int i = 0; i < size; ++i)
            {
                // 第一个是全部频次，第二个是词性个数
                int currentTotalFrequency = byteArray.nextInt();
                int length = byteArray.nextInt();
                attributes[i] = new CoreDictionary.Attribute(length);
                attributes[i].totalFrequency = currentTotalFrequency;
                for (int j = 0; j < length; ++j)
                {
                    attributes[i].nature[j] = natureIndexArray[byteArray.nextInt()];
                    attributes[i].frequency[j] = byteArray.nextInt();
                }
            }
            if (!trie.load(byteArray, attributes) || byteArray.hasMore()) return false;
        }
        catch (Exception e)
        {
            logger.warning("读取失败，问题发生在" + e);
            return false;
        }
        return true;
    }
35706
public static function detectUri()
    {
        // 如果PATH_INFO读不到，那么就从其他途径读
        if ( ! $uri = Arr::get($_SERVER, 'PATH_INFO'))
        {
            // REQUEST_URI和PHP_SELF会包含当前脚本路径
            if (isset($_SERVER['REQUEST_URI']))
            {
                $uri = $_SERVER['REQUEST_URI'];
                if ($requestUri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH))
                {
                    $uri = $requestUri;
                }
                $uri = rawurldecode($uri);
            }
            elseif (isset($_SERVER['PHP_SELF']))
            {
                $uri = $_SERVER['PHP_SELF'];
            }
            elseif (isset($_SERVER['REDIRECT_URL']))
            {
                $uri = $_SERVER['REDIRECT_URL'];
            }
            else
            {
                throw new HelperException('Unable to detect the URI using PATH_INFO, REQUEST_URI, PHP_SELF or REDIRECT_URL');
            }

            $baseUrl = parse_url(Base::$baseUrl, PHP_URL_PATH);
            if (strpos($uri, $baseUrl) === 0)
            {
                $uri = (string) substr($uri, strlen($baseUrl));
            }
            if (Base::$indexFile && strpos($uri, Base::$indexFile) === 0)
            {
                $uri = (string) substr($uri, strlen(Base::$indexFile));
            }
        }

        return $uri;
    }
495875
function (b) {
        var a = this;
        var sx = b.width / a.width;
        var sy = b.height / a.height;

        var m = matrix.create();

        // 矩阵右乘
        matrix.translate(m, m, [-a.x, -a.y]);
        matrix.scale(m, m, [sx, sy]);
        matrix.translate(m, m, [b.x, b.y]);

        return m;
    }
1310203
@Override
    public boolean checkUserPermission(String pattern, RequestMethod method) {
        // 获取用户角色
        Visitor visitor = ThreadContext.getSessionVisitor();
        if (visitor == null) {
            return false;
        }

        String urlPattarn = pattern;
        if (!urlPattarn.endsWith(RoleResourceConstant.URL_SPLITOR)) {
            urlPattarn += RoleResourceConstant.URL_SPLITOR;
        }

        Integer roleId = visitor.getRoleId();

        Map<String, Map<RequestMethod, List<Integer>>> roleResMap = getAllAsMap();
        Map<RequestMethod, List<Integer>> methodMap = roleResMap.get(urlPattarn);
        if (methodMap == null) {
            return false;
        }

        List<Integer> roleIdList = methodMap.get(method);
        if (roleIdList == null) {
            return false;
        }

        if (!roleIdList.contains(roleId)) {
            return false;
        }
        return true;
    }
575328
function parseSliceString(path, l) {
  var _path$split$map = path.split(':').map(function (s) {
    return parseNumber(s);
  }),
      _path$split$map2 = _slicedToArray(_path$split$map, 3),
      start = _path$split$map2[0],
      end = _path$split$map2[1],
      step = _path$split$map2[2];
  // 异常的时候默认值


  start = isNaN(start) ? 0 : start < 0 ? l + start : start;

  end = isNaN(end) ? l : end < 0 ? l + end : // 小于 0 转成正数
  end > l ? l : end; // 最大为长度

  step = isNaN(step) ? 1 : step;

  invariant(step !== 0, 'Step can not be zero!');

  return [start, end, step];
}
1358829
private String compileRealWord(String realWord, CoreDictionary.Attribute attribute)
    {
        if (attribute.nature.length == 1)
        {
            Nature nature = attribute.nature[0];
            if (nature.startsWith("nr"))
            {
                wordID = CoreDictionary.NR_WORD_ID;
//                    this.attribute = CoreDictionary.get(CoreDictionary.NR_WORD_ID);
                return Predefine.TAG_PEOPLE;
            }
            else if (nature.startsWith("ns"))
            {
                wordID = CoreDictionary.NS_WORD_ID;
                // 在地名识别的时候,希望类似"河镇"的词语保持自己的词性,而不是未##地的词性
//                    this.attribute = CoreDictionary.get(CoreDictionary.NS_WORD_ID);
                return Predefine.TAG_PLACE;
            }
//                case nz:
            else if (nature == Nature.nx)
            {
                wordID = CoreDictionary.NX_WORD_ID;
                if (wordID == -1)
                    wordID = CoreDictionary.X_WORD_ID;
//                    this.attribute = CoreDictionary.get(wordID);
                return Predefine.TAG_PROPER;
            }
            else if (nature.startsWith("nt") || nature == Nature.nit)
            {
                wordID = CoreDictionary.NT_WORD_ID;
//                    this.attribute = CoreDictionary.get(CoreDictionary.NT_WORD_ID);
                return Predefine.TAG_GROUP;
            }
            else if (nature.startsWith('m'))
            {
                wordID = CoreDictionary.M_WORD_ID;
                this.attribute = CoreDictionary.get(CoreDictionary.M_WORD_ID);
                return Predefine.TAG_NUMBER;
            }
            else if (nature.startsWith('x'))
            {
                wordID = CoreDictionary.X_WORD_ID;
                this.attribute = CoreDictionary.get(CoreDictionary.X_WORD_ID);
                return Predefine.TAG_CLUSTER;
            }
//                case xx:
//                case w:
//                {
//                    word= Predefine.TAG_OTHER;
//                }
//                break;
            else if (nature == Nature.t)
            {
                wordID = CoreDictionary.T_WORD_ID;
                this.attribute = CoreDictionary.get(CoreDictionary.T_WORD_ID);
                return Predefine.TAG_TIME;
            }
        }

        return realWord;
    }
1374720
function ieRgbaHack(decl, i) {
  //十六进制不足两位自动补 0
  function pad(str) {
    return str.length == 1 ? '0' + str : '' + str
  }
  if (
    (decl.prop == 'background' || decl.prop == 'background-color') &&
    decl.value.match(reRGBA)
  ) {
    // rgba 转换为 AARRGGBB
    var colorR = pad(parseInt(RegExp.$1).toString(16))
    var colorG = pad(parseInt(RegExp.$2).toString(16))
    var colorB = pad(parseInt(RegExp.$3).toString(16))
    var colorA = pad(parseInt(RegExp.$4 * 255).toString(16))
    var ARGB = "'" + '#' + colorA + colorR + colorG + colorB + "'"

    // 插入IE半透明滤镜
    var reBefore = decl.raws.before.replace(reBLANK_LINE, '$1')
    insertDecl(decl, i, {
      raws: {
        before: reBefore
      },
      prop: 'filter',
      value:
        'progid:DXImageTransform.Microsoft.gradient(startColorstr=' +
        ARGB +
        ', endColorstr=' +
        ARGB +
        ')'
    })

    // IE9 rgba 和滤镜都支持，插入 :root hack 去掉滤镜
    var newSelector = ':root ' + decl.parent.selector

    var nextrule = postcss.rule({
      selector: newSelector
    })
    decl.parent.parent.insertAfter(decl.parent, nextrule)
    nextrule.append({
      prop: 'filter',
      value: 'none\\9'
    })
  }
}
553346
public void norm_setTotal() {
        String rule;
        Pattern pattern;
        Matcher match;
        String[] tmp_parser;
        String tmp_target;

        /*
         * 修改了函数中所有的匹配规则使之更为严格
         * modified by 曹零
         */
        rule = "(?<!(周|星期))([0-2]?[0-9]):[0-5]?[0-9]:[0-5]?[0-9]";
        pattern = Pattern.compile(rule);
        match = pattern.matcher(Time_Expression);
        if (match.find()) {
            tmp_parser = new String[3];
            tmp_target = match.group();
            tmp_parser = tmp_target.split(":");
            _tp.tunit[3] = Integer.parseInt(tmp_parser[0]);
            _tp.tunit[4] = Integer.parseInt(tmp_parser[1]);
            _tp.tunit[5] = Integer.parseInt(tmp_parser[2]);
        } /*
         * 添加了省略秒的:固定形式的时间规则匹配
         * add by 曹零
         */ else {
            rule = "(?<!(周|星期))([0-2]?[0-9]):[0-5]?[0-9]";
            pattern = Pattern.compile(rule);
            match = pattern.matcher(Time_Expression);
            if (match.find()) {
                tmp_parser = new String[2];
                tmp_target = match.group();
                tmp_parser = tmp_target.split(":");
                _tp.tunit[3] = Integer.parseInt(tmp_parser[0]);
                _tp.tunit[4] = Integer.parseInt(tmp_parser[1]);
            }
        }
        /*
         * 增加了:固定形式时间表达式的
         * 中午,午间,下午,午后,晚上,傍晚,晚间,晚,pm,PM
         * 的正确时间计算，规约同上
         * add by 曹零
         */
        rule = "(中午)|(午间)";
        pattern = Pattern.compile(rule);
        match = pattern.matcher(Time_Expression);
        if (match.find()) {
            if (_tp.tunit[3] >= 0 && _tp.tunit[3] <= 10) {
                _tp.tunit[3] += 12;
            }
        }

        rule = "(下午)|(午后)|(pm)|(PM)";
        pattern = Pattern.compile(rule);
        match = pattern.matcher(Time_Expression);
        if (match.find()) {
            if (_tp.tunit[3] >= 0 && _tp.tunit[3] <= 11) {
                _tp.tunit[3] += 12;
            }
        }

        rule = "晚";
        pattern = Pattern.compile(rule);
        match = pattern.matcher(Time_Expression);
        if (match.find()) {
            if (_tp.tunit[3] >= 1 && _tp.tunit[3] <= 11) {
                _tp.tunit[3] += 12;
            } else if (_tp.tunit[3] == 12) {
                _tp.tunit[3] = 0;
            }
        }


        rule = "[0-9]?[0-9]?[0-9]{2}-((10)|(11)|(12)|([1-9]))-((?<!\\d))([0-3][0-9]|[1-9])";
        pattern = Pattern.compile(rule);
        match = pattern.matcher(Time_Expression);
        if (match.find()) {
            tmp_parser = new String[3];
            tmp_target = match.group();
            tmp_parser = tmp_target.split("-");
            _tp.tunit[0] = Integer.parseInt(tmp_parser[0]);
            _tp.tunit[1] = Integer.parseInt(tmp_parser[1]);
            _tp.tunit[2] = Integer.parseInt(tmp_parser[2]);
        }

        rule = "((10)|(11)|(12)|([1-9]))/((?<!\\d))([0-3][0-9]|[1-9])/[0-9]?[0-9]?[0-9]{2}";
        pattern = Pattern.compile(rule);
        match = pattern.matcher(Time_Expression);
        if (match.find()) {
            tmp_parser = new String[3];
            tmp_target = match.group();
            tmp_parser = tmp_target.split("/");
            _tp.tunit[1] = Integer.parseInt(tmp_parser[0]);
            _tp.tunit[2] = Integer.parseInt(tmp_parser[1]);
            _tp.tunit[0] = Integer.parseInt(tmp_parser[2]);
        }

        /*
         * 增加了:固定形式时间表达式 年.月.日 的正确识别
         * add by 曹零
         */
        rule = "[0-9]?[0-9]?[0-9]{2}\\.((10)|(11)|(12)|([1-9]))\\.((?<!\\d))([0-3][0-9]|[1-9])";
        pattern = Pattern.compile(rule);
        match = pattern.matcher(Time_Expression);
        if (match.find()) {
            tmp_parser = new String[3];
            tmp_target = match.group();
            tmp_parser = tmp_target.split("\\.");
            _tp.tunit[0] = Integer.parseInt(tmp_parser[0]);
            _tp.tunit[1] = Integer.parseInt(tmp_parser[1]);
            _tp.tunit[2] = Integer.parseInt(tmp_parser[2]);
        }
    }
181138
function isArrayLike(obj) {
        if (obj && typeof obj === "object" && !avalon.isWindow(obj)) {
            var n = obj.length
            if (+n === n && !(n % 1) && n >= 0) { //检测length属性是否为非负整数
                try {
                    if ({}.propertyIsEnumerable.call(obj, "length") === false) { //如果是原生对象
                        return Array.isArray(obj) || /^\s?function/.test(obj.item || obj.callee)
                    }
                    return true
                } catch (e) { //IE的NodeList直接抛错
                    return true
                }
            }
        }
        return false
    }
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);
    }
1306440
static byte[] encode(int count) {
        // 计算需要填充的位数
        int amountToPad = BLOCK_SIZE - (count % BLOCK_SIZE);
        if (amountToPad == 0) {
            amountToPad = BLOCK_SIZE;
        }
        // 获得补位所用的字符
        char padChr = chr(amountToPad);
        String tmp = new String();
        for (int index = 0; index < amountToPad; index++) {
            tmp += padChr;
        }
        return tmp.getBytes(CHARSET);
    }
101839
function take(pattern, namespace) {
      // 判断是否捕获当前 namespaces。
      if (typeof pattern === "string") {
        // 如果是想 take 当前命名空间的话加上 namespace

        if (namespace) {
          return sagaEffects.take(`${namespace}${SEP}${pattern}`);
        }

        if (~pattern.indexOf(SEP)) {
          const fullNamespaces = pattern.split(SEP);
          const actionType = fullNamespaces[fullNamespaces.length - 1];
          const namespaces = fullNamespaces.slice(0, fullNamespaces.length - 1);
          warning(
            namespaces !== model.namespace,
            `sagas.take: ${pattern} should not be prefixed with namespace ${
              model.namespace
            }`
          );
        } else {
          return sagaEffects.take(this.prefixType(pattern, model));
        }
      }
      return sagaEffects.take(pattern);
    }
514982
function Kernel(options, requester) {
    var headers = options.headers;
    // POST请求添加默认的`Content-Type`
    if (options.method === METHOD.POST
        && !util.findHeader(headers, 'Content-Type')
    ) {
        headers['Content-Type'] = 'application/x-www-form-urlencoded';
    }

    var data = options.data;
    if (!util.isString(data) && options.stringify !== false) {
        data = util.stringify(data);
    }

    log(requester, 'info', 'request %s %s %s %s', options.method, options.url, JSON.stringify(headers), data);

    var agents;
    var context = requester.context;
    var agentOptions = context.data.agent;
    if (agentOptions) {
        agents = createAgents(agentOptions);
    }

    var xhr = request(
        {
            url: options.url,
            method: options.method,
            headers: headers,
            body: data,
            timeout: options.timeout
        },
        function (error, res, data) {
            if (!error) {
                // 与client端兼容
                var status = res.status = res.statusCode;
                var level = status >= 400 ? 'error' : 'info';
                log(requester, level, 'response %s %s\n%s', status, JSON.stringify(res.headers), data);
            }
            else {
                log(requester, 'error', error.stack);
                if (error.code) {
                    error = error.code;
                }
            }
            requester.handle(error, res, data);
        },
        agents
    );

    return xhr;
}