选中给定索引的点，该操作会引起其他点的连锁反应
509390
function ( index ) {

            var shapeGroup = this.pointShapes[ index ];

            // 重绘当前点
            this._redraw( this.getPointByIndex( index ) );

            // 清空其他点的
            Utils.each( this.pointShapes, function ( shape, i ) {

                if ( i !== index ) {

                    this._clearShapePoint( i );

                }

            }, this );

            // 更新辅助点
            if ( index > 0 ) {
                this._drawAssistPoint( index-1 );
            }

        }
211501
public Object[] resolve(final Invocation inv,
            final ParameterBindingResult parameterBindingResult) throws Exception {
        Object[] parameters = new Object[paramMetaDatas.length];
        for (int i = 0; i < resolvers.length; i++) {
            if (resolvers[i] == null) {
                continue;
            }
            try {
                if (logger.isDebugEnabled()) {
                    logger.debug("Resolves parameter "
                            + paramMetaDatas[i].getParamType().getSimpleName() + " using "
                            + resolvers[i].getClass().getName());
                }
                parameters[i] = resolvers[i].resolve(inv, paramMetaDatas[i]);
                // afterPropertiesSet
                if (parameters[i] instanceof InitializingBean) {
                    ((InitializingBean) parameters[i]).afterPropertiesSet();
                }
                if (parameters[i] == null) {
                    DefValue defValudeAnnotation = paramMetaDatas[i].getAnnotation(DefValue.class);
                    if (defValudeAnnotation != null && paramMetaDatas[i].getParamType() == String.class) {
                        parameters[i] = defValudeAnnotation.value();
                    }
                }
            } catch (TypeMismatchException e) {
                // 出现这个错误肯定是解析一般参数失败导致的，而非bean里面的某个属性值的解析失败

                logger.debug("", e);

                // 对简单类型的参数，设置一个默认值给它以支持对该方法的继续调用
                if (paramMetaDatas[i].getParamType().isPrimitive()) {
                    DefValue defValudeAnnotation = paramMetaDatas[i].getAnnotation(DefValue.class);
                    if (defValudeAnnotation == null
                            || DefValue.NATIVE_DEFAULT.equals(defValudeAnnotation.value())) {
                        // 对这最常用的类型做一下if-else判断，其他类型就简单使用converter来做吧
                        if (paramMetaDatas[i].getParamType() == int.class) {
                            parameters[i] = Integer.valueOf(0);
                        } else if (paramMetaDatas[i].getParamType() == long.class) {
                            parameters[i] = Long.valueOf(0);
                        } else if (paramMetaDatas[i].getParamType() == boolean.class) {
                            parameters[i] = Boolean.FALSE;
                        } else if (paramMetaDatas[i].getParamType() == double.class) {
                            parameters[i] = Double.valueOf(0);
                        } else if (paramMetaDatas[i].getParamType() == float.class) {
                            parameters[i] = Float.valueOf(0);
                        } else {
                            TypeConverter typeConverter = SafedTypeConverterFactory
                                    .getCurrentConverter();
                            parameters[i] = typeConverter.convertIfNecessary("0", paramMetaDatas[i]
                                    .getParamType());
                        }
                    } else {
                        TypeConverter typeConverter = SafedTypeConverterFactory
                                .getCurrentConverter();
                        parameters[i] = typeConverter.convertIfNecessary(defValudeAnnotation
                                .value(), paramMetaDatas[i].getParamType());
                    }
                }
                // 
                String paramName = parameterNames[i];
                if (paramName == null) {
                    for (String name : paramMetaDatas[i].getParamNames()) {
                        if ((paramName = name) != null) {
                            break;
                        }
                    }
                }
                Assert.isTrue(paramName != null);
                FieldError fieldError = new FieldError(//
                        "method", // 该出错字段所在的对象的名字；对于这类异常我们统一规定名字为method
                        paramName, // 出错的字段的名字；取其参数名
                        inv.getParameter(paramName), // 被拒绝的值
                        true,//whether this error represents a binding failure (like a type mismatch); else, it is a validation failure
                        new String[] { e.getErrorCode() },// "typeMismatch"
                        new String[] { inv.getParameter(paramName) }, //the array of arguments to be used to resolve this message
                        null // the default message to be used to resolve this message
                );
                parameterBindingResult.addError(fieldError);
            } catch (Exception e) {
                // 什么错误呢？比如很有可能是构造对象不能成功导致的错误，没有默认构造函数、构造函数执行失败等等
                logger.error("", e);
                throw e;
            }
        }
        return parameters;
    }
923798
public function start()
    {
        if ($this->started) {
            return true;
        }
        
        // start the session
        if (session_status() == PHP_SESSION_NONE) {
            
            $this->init();
            
            // not native
            if ($this->handler) {
                $this->handler->register();
            }
            // 将 session_write_close() 函数注册为关闭会话的函数。
            //@session_register_shutdown();
            //register_shutdown_function('session_write_close');
            
            $res = session_start();
            
            // 将Collection的data绑定到 $_SESSION
            $this->data = & $_SESSION;
            $this->started = true;
            
            if (static::getStorage()) {
                $key = static::getSessionKey();
                $sdata = static::getStorage()->get($key);
                if ($this->data && !$sdata) {
                    foreach ($_SESSION as $k => $v) {
                        $_SESSION[$k] = $v;
                    }
                }
                \Wslim\Ioc::logger('session')->debug(sprintf('[%s]start: %s storage: %s', static::getId(), json_encode($this->data), json_encode($sdata)));
            }
        }
        
        return true;
    }
902528
@Override
	protected ThriftConnection<T> getConnectionInternal() throws ThriftConnectionPoolException {
		ThriftConnection<T> result = pollConnection();
		// 如果立即获取连接失败 则换一个分区继续获取
		// TODO 设置当连接获取超时返回null？
		if (result == null) {
			if (this.pool.getThriftServerCount() == 0) {
				throw new ThriftConnectionPoolException("当前没有可用的服务器  无法获取连接");
			}
			int partition = (int) (Thread.currentThread().getId() % this.pool.thriftServerCount);

			ThriftConnectionPartition<T> thriftConnectionPartition = this.pool.partitions.get(partition);

			try {
				result = thriftConnectionPartition.poolFreeConnection(this.pool.connectionTimeoutInMs,
						TimeUnit.MILLISECONDS);
				if (result == null) {

					throw new ThriftConnectionPoolException("Timed out waiting for a free available connection.");
				}
			} catch (InterruptedException e) {
				throw new ThriftConnectionPoolException(e);
			}
		}
		return result;
	}
742774
protected void invoke(Object pObject) throws APPErrorException {
        try {
            Method method =tgtools.util.ReflectionUtil.findMethod(mService.getClass(),getMethodName(),getModelClass());
            method.invoke(mService,pObject);
        }catch (Exception ex)
        {
            throw new APPErrorException("执行方法错误；原因："+ex.getCause().getMessage(),ex);
        }
    }
379750
public function register()
    {
        $this->container['cache.manager'] = function ($container) {
            $config = $container['config']->get('cache');

            $manager = new Manager($config->drivers->toArray());

            // 设置默认缓存驱动
            $manager->setDefault($config->default);

            // 设置日志处理器
            $logger = value($config->logger);
            if ($logger instanceof LoggerInterface) {
                $manager->setLogger($logger);
            }

            return $manager;
        };

        $this->container['cache'] = function ($container) {
            return $container['cache.manager']->getDefaultCache();
        };

        $this->container['cache.simple'] = function ($container) {
            return $container['cache.manager']->getDefaultSimpleCache();
        };
    }
656516
private void select(String[] resultList, int resultIndex, List<String[]> result) {
		int resultLen = resultList.length;
		if (resultIndex >= resultLen) { // 全部选择完时，输出排列结果
			result.add(Arrays.copyOf(resultList, resultList.length));
			return;
		}

		// 递归选择下一个
		for (int i = 0; i < datas.length; i++) {
			// 判断待选项是否存在于排列结果中
			boolean exists = false;
			for (int j = 0; j < resultIndex; j++) {
				if (datas[i].equals(resultList[j])) {
					exists = true;
					break;
				}
			}
			if (false == exists) { // 排列结果不存在该项，才可选择
				resultList[resultIndex] = datas[i];
				select(resultList, resultIndex + 1, result);
			}
		}
	}
1263270
public static function method() {
        // $this->methodParam 默认值为 '_method'
        // 如果指定 $_POST['_method'] ，表示使用POST请求来模拟其他方法的请求。
        // 此时 $_POST['_method'] 即为所模拟的请求类型。
        if (isset($_POST[$this->methodParam])) {
            return strtoupper($_POST[$this->methodParam]);
            // 或者使用 $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] 的值作为方法名。
        } elseif (isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) {
            return strtoupper($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']);
            // 或者使用 $_SERVER['REQUEST_METHOD'] 作为方法名，未指定时，默认为 GET 方法
        } else {
            return isset($_SERVER['REQUEST_METHOD']) ? strtoupper($_SERVER['REQUEST_METHOD']) : 'GET';
        }
    }
541202
public function execute($sql, $bind = [], $clear_cache = true) {
        $pdo = $this->connect();
        // 根据参数绑定组装最终的SQL语句
        $this->logSql($sql, $bind);
        //释放前次的查询结果
        $this->PDOStatement = null;
        if ($clear_cache) {
            /* @var $dbCache DBCache */
            $dbCache = Ioc::get(DBCache::class);
            $dbCache->deleteCache($sql);
        }
        try {
            // 调试开始
            // 预处理
            $this->PDOStatement = $pdo->prepare($sql);
            // 参数绑定
            $this->bindValue($bind);
            // 执行查询

            $this->PDOStatement->execute();
        } catch (\PDOException $e) {
            $error = $e->errorInfo;
            //2006和2013表示表示连接失败,需要重连接
            if ($error[ 1 ] == 2006 || $error[ 1 ] == 2013) {
                $this->pdo = null;
                $this->connect();
                $this->execute($sql, $bind);
            } else {
                throw $e;
            }
        }
    }
664642
private int resolveTimeout(SofaRequest request, ConsumerConfig consumerConfig, ProviderInfo providerInfo) {
        // 先去调用级别配置
        Integer timeout = request.getTimeout();
        if (timeout == null) {
            // 取客户端配置（先方法级别再接口级别）
            timeout = consumerConfig.getMethodTimeout(request.getMethodName());
            if (timeout == null || timeout < 0) {
                // 再取服务端配置
                timeout = (Integer) providerInfo.getDynamicAttr(ATTR_TIMEOUT);
                if (timeout == null) {
                    // 取框架默认值
                    timeout = getIntValue(CONSUMER_INVOKE_TIMEOUT);
                }
            }
        }
        return timeout;
    }
443808
static public function mode(): string
    {
        try {
            $mode = self::get('system', 'config');
        } catch (ConfigException $e) {
            trigger_error('system/config配置必须指定', E_USER_ERROR);
        }
        return $mode;
    }
755139
public function connect()
    {
        $options = & $this->options;
        
        if (!$this->connection && !@$this->connection->sqlstate) {
            $this->connection = @ new \mysqli($options['host'], $options['username'], $options['password'], $options['database'], $options['port']);
            // error
            if (mysqli_connect_errno()) {
                $msg = mysqli_connect_error();  // 这是中文编码？
                throw new Exception('Db connect error.');
            }
            
            if ($this->connection->connect_error != '') {
                $msg = 'Db Error: Could not connect to database. Connection Error #' . $this->connection->connect_errno . ': ' . $this->connection->connect_error;
                throw new Exception('Db connect error.');
            }
            
            //set charset
            $options['charset'] = isset($options['charset']) ? trim($options['charset']) : 'utf8';
            if ($this->getCharset() != $options['charset']) {
                $this->setCharset($options['charset']);
            }
        }
    }
899039
function (name, value, extra, method) {
    let result = { status: 1, msg: '' };
    if (!name) {
        return result;
    }
    //自定义规则存在则检查
    if (extra && extra.valid) {
        let met;
        if (extra.method) {
            met = (extra.method).toUpperCase();
            if (met === 'ALL' || met === method) {
                met = true;
            } else {
                met = false;
            }
        }
        if (met) {
            let valid = extra.valid;
            if (!Array.isArray(valid)) {
                valid = [valid];
            }
            valid.some(function (validItem) {
                //自定义检测方法
                if (typeof validItem === 'function') {
                    result = validItem(value);
                } else if (typeof (rules[validItem]) === 'function') {
                    let args = extra[validItem + '_args'] || [];
                    if (!Array.isArray(args)) {
                        args = [args];
                    }
                    args = [value].concat(args);
                    if (rules[validItem].apply(rules, args) === false) {
                        result = { status: 0, msg: `${extra.msg[validItem]}` || `${name}值未通过检测!` };
                    }
                }
            });
        }
    }
    return result;
}
743091
function bindEvent() {
        // 处理history.back事件
        window.addEventListener('popstate', onPopState, false);
        // 全局接管指定元素点击事件
        layer.addEventListener('click', proxy, true);
        // bigpipe回调事件
        BigPipe.on('pagerendercomplete', onPagerendered, this); // 执行完页面的ready函数后触发

        // 页面数据到达的时候派发事件
        BigPipe.on('pagearrived', onPageArrived, this);

        // 页面内所有的样式JS都被加载完成后触发
        BigPipe.on('onpageloaded', onPageLoaded, this);
    }
192341
public function setting($setting = []) {
		
		/*
		 * 指定某一个服务运行仅设置该服务下的配置
		 */
		if (false === empty($this->service) && true === isset($this->config[$this->service])) {
			$setting = $this->config[$this->service];
			unset($setting['host'], $setting['port'], $setting['mode'], $setting['socket']);
			parent::set($setting);
		} else {
			/*
			 * 设置所有配置信息
			 */
			foreach ($this->config as $key => $value) {
				unset($value['host'], $value['port'], $value['mode'], $value['socket']);
				$setting[$key] = $value;
				parent::set($setting[$key]);
			}
		}
		
	}
41743
function bind(from, node, comPrefix, valPrefix, clsPrefix, ignores) {
  ignores = Object.assign({
    true: true,
    false: true,
    null: true,
    undefined: true
  }, ignores);

  let hasPath = false;

  //处理节点属性
  let attributes = node.attributes;
  for (let i in attributes) {
    if (!/^\d+$/.test(i)) continue;
    let attr = attributes[i];

    //处理属性值
    if (attr.value.indexOf('{') > -1) {
      attr.value = replaceString(from, attr.value, valPrefix, ignores);
    }

    //绑定事件
    if (/^(bind|catch)\w+/.test(attr.name)) {
      node.setAttribute('data-' + attr.name, attr.value);
      attr.value = '_dispatch';
      if (!hasPath && comPrefix) {
        node.setAttribute('data-path', comPrefix);
      }
    }

    //如果是循环标签,则在子标签中忽略循环索引和值变量
    if (attr.name === 'wx:for') {
      let index = node.getAttribute('wx:for-index') || 'index';
      let item = node.getAttribute('wx:for-item') || 'item';
      ignores[index] = true;
      ignores[item] = true;
    }

    if (clsPrefix && attr.name === 'class') {
      const matchArr = [];
      // "xxx {{a ? 'b' : 'c'}}"
      // => "xxx $"
      attr.value = attr.value.replace(/\{\{([^}]+)\}\}/ig, function (match) {
        matchArr.push(match);
        matchArr.push(match);
        return '$';
      });

      // => "xxx prefix-xxx $ prefix-$"
      attr.value = attr.value.split(' ').map(cls => `${cls} ${clsPrefix}-${cls}`).join(' ');

      // => "xxx prefix-xxx {{a ? 'b' : 'c'}} prefix-{{a ? 'b' : 'c'}}"
      attr.value = attr.value.replace(/\$/g, function () {
        const matchItem = matchArr.shift();
        return matchItem;
      });
    }
  }

  //如果节点为文本
  if (node.nodeName === '#text') {
    let data = node.data;
    if (data) {
      node.replaceData(0, data.length, replaceString(from, data, valPrefix, ignores));
    }
  }

  //递归处理子节点
  for (let i in node.childNodes) {
    if (!/^\d+$/.test(i)) continue;
    let n = node.childNodes[i];
    // 不转换template 定义
    if (n.nodeName === 'template' && n.getAttribute('name')) {
      bindTemplateEvents(n);
      continue;
    }
    bind(from, n, comPrefix, valPrefix, clsPrefix, ignores);
  }
}
407757
private function init()
    {
        $this->refClass = new \ReflectionClass($this->object);
        $className = $this->refClass->getParentClass()->getName();
        // 每个类只需处理一次
        if(!isset(static::$aspects[$className]))
        {
            static::$aspects[$className] = new \SplPriorityQueue;
            $aspects = AnnotationManager::getAnnotationPoints(Aspect::class);
            foreach($aspects as $item)
            {
                // 判断是否属于当前类方法的切面
                $pointCutsSet = AnnotationManager::getMethodsAnnotations($item['class'], PointCut::class);
                foreach($pointCutsSet as $methodName => $pointCuts)
                {
                    foreach($pointCuts as $pointCut)
                    {
                        switch($pointCut->type)
                        {
                            case PointCutType::METHOD:
                                foreach($pointCut->allow as $allowItem)
                                {
                                    if(Imi::checkClassRule($allowItem, $className))
                                    {
                                        static::$aspects[$className]->insert([
                                            'class'     =>  $item['class'],
                                            'method'    =>  $methodName,
                                            'pointCut'  =>  $pointCut,
                                        ], $item['annotation']->priority);
                                        break;
                                    }
                                }
                                break;
                            case PointCutType::ANNOTATION:
                                foreach($this->refClass->getMethods() as $method)
                                {
                                    $methodAnnotations = AnnotationManager::getMethodAnnotations($className, $method->getName());
                                    foreach($pointCut->allow as $allowItem)
                                    {
                                        foreach($methodAnnotations as $annotation)
                                        {
                                            if($annotation instanceof $allowItem)
                                            {
                                                static::$aspects[$className]->insert([
                                                    'class'     =>  $item['class'],
                                                    'method'    =>  $methodName,
                                                    'pointCut'  =>  $pointCut,
                                                ], $item['annotation']->priority);
                                                break 3;
                                            }
                                        }
                                    }
                                }
                                break;
                        }
                    }
                }
                // 判断是否属于当前类的切面
                $pointCuts = AnnotationManager::getMethodsAnnotations($item['class'], PointCut::class);
                foreach($pointCuts as $methodName => $pointCuts)
                {
                    foreach($pointCuts as $pointCut)
                    {
                        switch($pointCut->type)
                        {
                            case PointCutType::CONSTRUCT:
                                // 构造方法
                                foreach($pointCut->allow as $allowItem)
                                {
                                    if(Imi::checkRuleMatch($allowItem, $className))
                                    {
                                        static::$aspects[$className]->insert([
                                            'class'     =>  $item['class'],
                                            'method'    =>  $methodName,
                                            'pointCut'  =>  $pointCut,
                                        ], $item['annotation']->priority);
                                        break;
                                    }
                                }
                                break;
                            case PointCutType::ANNOTATION_CONSTRUCT:
                                // 注解构造方法
                                $classAnnotations = AnnotationManager::getClassAnnotations($className);
                                foreach($pointCut->allow as $allowItem)
                                {
                                    foreach($classAnnotations as $annotation)
                                    {
                                        if($annotation instanceof $allowItem)
                                        {
                                            static::$aspects[$className]->insert([
                                                'class'     =>  $item['class'],
                                                'method'    =>  $methodName,
                                                'pointCut'  =>  $pointCut,
                                            ], $item['annotation']->priority);
                                            break 2;
                                        }
                                    }
                                }
                                break;
                        }
                    }
                }
            }
        }
    }