---------------- 创建失败是回话被关闭交互 ----------------
17303
function (message) {
    var that = this;
    that._traceLogEventsCount();
    that.mc.trigger(TypeMsg$3.OnCreateError, message);
  }
156040
public static void main(String[] args) throws Exception {
		CWSTagger tag = new CWSTagger("./models/seg.m");	

		RLSeg rlseg = new RLSeg(tag,"./tmpdata/FNLPDATA/all.dict");

		tag.setDictionary(tempdict);

		System.out.println("\n处理文件：");
		String s4 = tag.tagFile("../example-data/data-tag.txt");
		System.out.println(s4);
		String[] toks = s4.split("\\s+");
		int newset = rlseg.update(toks);
		rlseg.close();

		tag.setDictionary(tempdict);

		System.out.println("\n处理文件：");
		String s = tag.tagFile("../example-data/data-tag.txt");
		System.out.println(s);


	}
257695
public function index()
    {











$article = Article::load()->findOrFail(1);
echo '<pre>'; print_r($article );

$article = Article::load()->find(1);
echo '<pre>'; print_r($article );





// Récupérer un article WHERE slug
$article = Article::load()->where('slug', '=', 'article-1')->find();
// Résultat SQL : "SELECT * FROM articles WHERE slug = 'article-1' LIMIT 1"


$article->testQuery();

// Récupérer un article WHERE slug ou une erreur HTTP 404
$article = Article::load()->where('slug', '=', 'article-1')->findOrFail();
// Résultat SQL : "SELECT * FROM articles WHERE slug = 'article-1' LIMIT 1"



// Récupérer un article WHERE slug
$article = Article::load()->findBySlug('article-1');
// Résultat SQL : "SELECT * FROM articles WHERE slug = 'article-1' LIMIT 1"

// Récupérer un article WHERE slug ou une erreur HTTP 404
$article = Article::load()->findOrFailBySlug('article-1');
// Résultat SQL : "SELECT * FROM articles WHERE slug = 'article-1' LIMIT 1"



// Récupérer une collection d'articles avec un WHERE
$articles = Article::load()->where('status', '=', 1)->findAll();
// Résultat SQL : "SELECT * FROM articles WHERE status = 1"



// Récupérer une collection d'articles avec un WHERE
$articles = Article::load()->findAllByStatus(1);
// Résultat SQL : "SELECT * FROM articles WHERE status = 1"



$articles = Article::load()->where('status', '=', 1)->where('status', '=', 2)->findAll();
// Résultat SQL : "SELECT * FROM articles WHERE status = 1 AND online = 1"



$articles = Article::load()->where('status', '=', 1)->orWhere('status', '=', 2)->findAll();
// Résultat SQL : "SELECT * FROM articles WHERE status = 1 OR online = 1"




$articles = Article::load()->whereIn('id', [1, 2, 3])->findAll();
// Résultat SQL : "SELECT * FROM articles WHERE id IN (1, 2, 3)"



$articles = Article::load()->whereIn('id', [1, 2, 3])->orWhereIn('id', [7, 8, 9])->findAll();
// Résultat SQL : "SELECT * FROM articles WHERE id IN (1, 2, 3) OR id IN (20, 21, 22)"


$articles = Article::load()->where('status', '=', 1)->orderBy('title', 'ASC')->findAll();
// Résultat SQL : "SELECT * FROM articles WHERE status = 1 ORDER BY 'title' ASC"



$articles = Article::load()->where('status', '=', 1)->limit(5)->offset(2)->findAll();
// Résultat SQL : "SELECT * FROM articles WHERE status = 1 LIMIT 5 OFFSET 2"




$article = new Article();

$articles = $article->paginate();
// Résultats SQL :
// SELECT COUNT(id) AS nb FROM articles WHERE status = 1
// Et :
// SELECT * FROM articles WHERE status = 1 LIMIT 10 OFFSET ? 

echo '<pre>'; print_r($article->getTotal());  // return int - Nombre d'articles paginés

$pagination = $article->getPagination();

foreach ($articles as $article) {
    echo $article->title;
}

echo $pagination->render();  // return string
echo $pagination->perPage();  // return string




$article = new Article();

$articles = $article->paginate(5);





// Par exemple, récupérer tous les articles qui sont joints à une catégorie WHERE son id avec un INNER JOIN
$articlesJoinedToCategory = Article::load()
    ->join(
        ArticleCategory::getTableIntermediateJoinedArticles(),
        Article::getTable().'.id', '=', ArticleCategory::getTableIntermediateJoinedArticles().'.article_id'
    )
    ->where(ArticleCategory::getTableIntermediateJoinedArticles().'.category_id', '=', 2)
    ->findAll();
// Résultat SQL :
// "SELECT * FROM articles
// INNER JOIN articles_categories_intermediate 
//   ON articles.id = articles_categories_intermediate.article_id
// WHERE articles_categories_intermediate.category_id = 2"
echo '<pre>'; print_r($articlesJoinedToCategory);


echo '<hr>';

// Par exemple, récupérer tout les articles qui sont joints à une catégorie WHERE son id avec un LEFT JOIN
$articlesJoinedToCategory = Article::load()
    ->leftJoin(
        ArticleCategory::getTableIntermediateJoinedArticles(),
        Article::getTable().'.id', '=', ArticleCategory::getTableIntermediateJoinedArticles().'.article_id'
    )
    ->where(ArticleCategory::getTableIntermediateJoinedArticles().'.category_id', '=', 2)
    ->findAll();
// Résultat SQL :
// "SELECT * FROM articles
// LEFT JOIN articles_categories_intermediate 
//   ON articles.id = articles_categories_intermediate.article_id
// WHERE articles_categories_intermediate.category_id = 2"
echo '<pre>'; print_r($articlesJoinedToCategory);

echo '<hr>';

// Par exemple, récupérer tout les articles qui sont joints à une catégorie WHERE son id avec un RIGHT JOIN
$articlesJoinedToCategory = Article::load()
    ->rightJoin(
        ArticleCategory::getTableIntermediateJoinedArticles(),
        Article::getTable().'.id', '=', ArticleCategory::getTableIntermediateJoinedArticles().'.article_id'
    )
    ->where(ArticleCategory::getTableIntermediateJoinedArticles().'.category_id', '=', 2)
    ->findAll();
// Résultat SQL :
// "SELECT * FROM articles
// RIGHT JOIN articles_categories_intermediate 
//   ON articles.id = articles_categories_intermediate.article_id
// WHERE articles_categories_intermediate.category_id = 2"
echo '<pre>'; print_r($articlesJoinedToCategory);




Article::load()->select('title, description, content')->where('id', '=', 1)->find();

Article::load()->select('title', 'description', 'content')->where('id', '=', 1)->find();

Article::load()->select(['title', 'description', 'content'])->where('id', '=', 1)->find();




$countArticles = Article::load()->count('id');
// return int - Résultat SQL : "SELECT COUNT(id) AS nb FROM articles"
// PS : Le paramètres 'id' n'est pas obligatoire. Est '*' par défaut.
echo '<pre>'; print_r($countArticles);


$countArticlesByStatus =  Article::load()->countByStatus(1);
// return int - Résultat SQL : "SELECT COUNT(*) AS nb FROM articles WHERE status = 1"
// PS : En 2ème paramètres de "countByStatus" on peut préciser la colonne en ajoutant un 2ème paramètres. Est '*' par défaut.




$sumIdArticles = Article::load()->sum('id');
// return int - Résultat SQL : "SELECT SUM(id) AS sum FROM articles"
echo '<pre>'; print_r($sumIdArticles);




$maxIdArticles = Article::load()->max('id');
// return int - Résultat SQL : "SELECT MAX(id) AS max FROM articles"
echo '<pre>'; print_r($maxIdArticles);




$condition = true;
$articles = Article::load()
    ->select('title, description, content')
    ->where('id', '!=', 1)
    ->when($condition === true, function ($query) {
        return $query->where('status', '=', 1);
    })
    ->findAll();
// Si $condition = true - Résultat SQL : "SELECT title, description, content FROM articles WHERE id != 1 AND status = 1"
// Si $condition = false - Résultat SQL : "SELECT title, description, content FROM articles WHERE id != 1"






$article = new Article();
$articles = $article->runRowCount(true)->findAll();
echo '<pre>'; print_r($article->getRowCount());
// return int - Nombre de lignes affectées



/*

$article = new Article();
$article->setStatus(2);
$article->setH1('Article 18');
$article->setDescription('Description Article 18');
$article->setContent('Content Article 18');
$article->setTitle('Title Article 18');
$article->setSlug('article-120');
$article->setUserId(2);
$article->save();


echo $article->getLastInsertId();
die;

Article::load()->create([
    'status' => 2,
    'h1' => 'Article 12',
    'description' => 'Description Article 12',
    'content' => 'Content Article 12',
    'title' => 'Title Article 12',
    'user_id' => 1,
    'slug' => 'article-12',
]);
// Résultat SQL :
// "INSERT INTO articles (status, h1, description, content, title, slug)
//  VALUES (1, 'Article 12', 'Description Article 12', 'Content Article 12', 'Title Article 12', 'article-12')"

*/








$article = Article::load()->findById(1);
$article->setStatus(2);
$article->setH1('Article 1');
$article->setDescription('Description Article 1');
$article->setContent('Content Article 1');
$article->setTitle('Title Article 1');
$article->setSlug('article-1');
$article->save();



echo $article->getNow();



Article::load()
    ->where('id', '=', 1)
    ->limit(1)
    ->update([
        'status' => 2,
        'h1' => 'Article 1',
        'description' => 'Description Article 1',
        'content' => 'Content Article 1',
        'title' => 'Title Article 1',
        'slug' => 'article-1',
    ]);



$_POST = [
    'status' => 2,
    'h1' => 'Article 1',
    'description' =>
    'Description Article 1',
    'content' => 'Content Article 1',
    'title' => 'Title Article 1',
    'slug' => 'article-1',
];

$article = Article::load()->findById(1);
$article->fill($_POST);
$article->save();

$_POST = [];


// Résultat SQL :
// "UPDATE articles SET
//  status = 1, h1 = 'Article 1', description = 'Description Article 1', content = 'Content Article 1', title = 'Title Article 1', slug = 'article-1'
//  WHERE id = 1 LIMIT 1"




$_POST = [
    'status' => 2,
    'h1' => 'Article 1',
    'description' =>
    'Description Article 1',
    'content' => 'Content Article 1',
    'title' => 'Title Article 1',
    'slug' => 'article-1',
];

$article = Article::load()->findById(1);

var_dump( $article->getTitle() );

$article->fill($_POST);

var_dump( $article->getTitle() );

$article->save();

var_dump( $article->getTitle() );

$_POST = [];












/*
$article = Article::load()->findById(18);
$article->delete();
// Résultats SQL :
// "SELECT * FROM articles WHERE id = 13 LIMIT 1"
// Et :
// "DELETE FROM articles WHERE id = 13 LIMIT 1"


Article::load()->where('id', '=', 17)->limit(1)->delete();

*/





$article = Article::load()->findById(1);
echo '<pre>'; print_r($article->getH1());





$article = new Article();

/*
try {
    // Démarrer une transaction
    $article->beginTransaction();

    // Valider une transaction
    $article->validTransaction();
} catch (\Exception $e) {
    // Annuler une transaction
    $article->cancelTransaction();
}
*/



echo '<hr>';




// Récupérer l'article WHERE son id :
$article = Article::load()->findById(1);
// Résultat SQL : "SELECT * FROM articles WHERE id = 1 LIMIT 1"

// Prenons pour exemple que la colonne 'user_id' de l'article a pour valeur "2"
// Récupérer l'user relié à cette article :
$userJoinedTiArticle = $article->user();
echo '<pre>'; print_r($userJoinedTiArticle);
// Résultat SQL : SELECT users.* FROM users WHERE users.id = 2 LIMIT 1



echo '<hr>';




$user = User::load()->findById(1);
// Résultat SQL : "SELECT * FROM users WHERE id = 1 LIMIT 1"

// Récupérer tous les articles reliés à cette user
$articlesJoinedToUser = $user->articles();
echo '<pre>'; print_r($articlesJoinedToUser);




echo '<hr>';






// Récupérer l'article WHERE son id :
$article = Article::load()->findById(1);
// Résultat SQL : "SELECT * FROM articles WHERE id = ? LIMIT 1"

// Récupérer toute les catégories jointes à cette article :
$articleCategories = $article->articleCategories();
echo '<pre>'; print_r($articleCategories);
// Résultat SQL :
// SELECT articles_categories.* FROM articles_categories
// INNER JOIN articles_categories_intermediate
//   ON articles_categories.id = articles_categories_intermediate.category_id
// WHERE articles_categories_intermediate.article_id = 2



$a = new Article;
$a->testQuery();




$article = new Article();
echo '<pre>'; print_r($article->getDbTable());




$article = new Article();
echo '<pre>'; print_r($article->getTable());





        return $this->view('article/index', [
            'baliseTitle' => 'Article listing title',
            'metaDescription' => 'Article listing desciption',
        ]);  
    }
1133829
function(url, filepath, fn){
        // 提交请求
        try{
            fs.createReadStream(filepath).pipe(request.post(url, fn))
        }
        catch(e){ fn(e) }
    }
390582
function convertFormatNumber (value, num) {
  // 序数
  if (num === 0) {
    return suji(value, '序数');
  }
  // 0埋め
  if (typeof value === 'number') {
    value = value + '';
    return value.length < num ? ('000000000' + value).slice(-num) : value;
  }
  // 切り捨て
  return num && num < value.length ? value.substring(0, num) : value;
}
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;
    }
844338
function() {
			if(index < count) {
				inspectors[index++].inspect(this); // 执行递归，进行下一轮检查
			} else if(index++ === count) {
				ctrler.execute(); // 当inspector 被执行完时，执行 controller
				end();
			}
		}
284051
function htmlParse() {
  var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '<div></div>';
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  var transData = {}; //存放转化后的数据

  var res = {}; //返回的数据

  transData = (0, _html2json.html2json)(data, 'root', options); // console.log('解析结果是', transData);

  res = transData;
  return res;
}
205757
function(input) {
      // 清理input数据、因为parsed数据最终会被缓存，
      // 我们要尽量让相同的选择器只对应一份parsed数据
      input = clean(input);
      // 先检查缓存中是否有数据
      if (parsed = this.cache.get(input)) return parsed;
      // 如果没有: 初始化参数
      var parsed = this.parsed = [
        [null]
      ];
      var remain = this.input = input;
      var TRUNK = this.TRUNK;
      var prevRemain;
        // 将remain进行this._process这里每匹配一个字符串都会进行一次reduce
      while (prevRemain != (remain = remain.replace(TRUNK, this._process.bind(this)))) {
        prevRemain = remain;
      }
      // 如果没有被解析完 证明选择器字符串有不能被解析的部分
      if (remain !== '') this.error(remain);
      // 返回数据并推入cache
      return this.cache.set(input, parsed);
    }
659589
public function start() {
        if ($this->dialect) {
            //允许事务嵌套
            $this->transLevel += 1;
            $dialect          = $this->dialect;
            if ($dialect->inTransaction()) {
                return true;
            }
            $rst = $dialect->beginTransaction();
            if ($rst) {
                return true;
            } else {
                $this->transLevel -= 1;
            }
        }

        return false;
    }
639060
function(){
		var loopcount = 0;

		while(1){
			var Rdeg = ((Math.random() * 384)|0)-64; if(Rdeg<0){Rdeg=0;} if(Rdeg>255){Rdeg=255;}
			var Gdeg = ((Math.random() * 384)|0)-64; if(Gdeg<0){Gdeg=0;} if(Gdeg>255){Gdeg=255;}
			var Bdeg = ((Math.random() * 384)|0)-64; if(Bdeg<0){Bdeg=0;} if(Bdeg>255){Bdeg=255;}

			// HLSの各組成値を求める
			var Cmax = Math.max(Rdeg,Math.max(Gdeg,Bdeg));
			var Cmin = Math.min(Rdeg,Math.min(Gdeg,Bdeg));

			var Hdeg = 0;
			var Ldeg = (Cmax+Cmin)*0.5 / 255;
			var Sdeg = (Cmax===Cmin?0:(Cmax-Cmin)/((Ldeg<=0.5)?(Cmax+Cmin):(2*255-Cmax-Cmin)) );

			if(Cmax===Cmin){ Hdeg = 0;}
			else if(Rdeg>=Gdeg && Rdeg>=Bdeg){ Hdeg = (    60*(Gdeg-Bdeg)/(Cmax-Cmin)+360)%360;}
			else if(Gdeg>=Rdeg && Gdeg>=Bdeg){ Hdeg = (120+60*(Bdeg-Rdeg)/(Cmax-Cmin)+360)%360;}
			else if(Bdeg>=Gdeg && Bdeg>=Rdeg){ Hdeg = (240+60*(Rdeg-Gdeg)/(Cmax-Cmin)+360)%360;}

			// YCbCrのYを求める
			var Ydeg = (0.29891*Rdeg + 0.58661*Gdeg + 0.11448*Bdeg) / 255;

			if( (this.minYdeg<Ydeg && Ydeg<this.maxYdeg) && (Math.abs(this.lastYdeg-Ydeg)>0.15) && (Sdeg<0.02 || 0.40<Sdeg) &&
				 (((360+this.lastHdeg-Hdeg)%360>=45)&&((360+this.lastHdeg-Hdeg)%360<=315)) ){
				this.lastHdeg = Hdeg;
				this.lastYdeg = Ydeg;
				//alert("rgb("+Rdeg+", "+Gdeg+", "+Bdeg+")\nHLS("+(Hdeg|0)+", "+(""+((Ldeg*1000)|0)*0.001).slice(0,5)+", "+(""+((Sdeg*1000|0))*0.001).slice(0,5)+")\nY("+(""+((Ydeg*1000)|0)*0.001).slice(0,5)+")");
				return "rgb("+Rdeg+","+Gdeg+","+Bdeg+")";
			}

			loopcount++;
			if(loopcount>100){ return "rgb("+Rdeg+","+Gdeg+","+Bdeg+")";}
		}
	}
312146
public function init($ini) {
		/*
		 * 是否使用自定义配置
		 */
		$config = parse_ini_file(false === $ini ? __DIR__ . '/../etc/server.ini' : $ini, true);
		
		/*
		 * 如果指定服务，则合并该服务下的配置与全局配置
		 */
		if (false === empty($this->service) && true === isset($config[$this->service])) {
			$config[$this->service] = array_merge($config['global'], $config[$this->service]);
			unset($config['global']);
		}
		
		/*
		 * 设置运行模式与socket方式
		 */
		foreach ($config as $key => $value) {
			if (true === empty($value)) {
				continue 1;
			}
			if (self::SWOOLE_MODE_PROCESS == $value['mode']) {
				$value['mode'] = SWOOLE_PROCESS;
			} else {
				$value['mode'] = SWOOLE_BASE;
			}
			
			switch ($value['socket']) {
				case self::SWOOLE_SOCKET_TCP6:
					$value['socket'] = SWOOLE_TCP6;
					break;
				case self::SWOOLE_SOCKET_UDP:
					$value['socket'] = SWOOLE_UDP;
					break;
				case self::SWOOLE_SOCKET_UDP6:
					$value['socket'] = SWOOLE_UDP6;
					break;
				case self::SWOOLE_SOCKET_DGRAM:
					$value['socket'] = SWOOLE_UNIX_DGRAM;
					break;
				case self::SWOOLE_SOCKET_STREAM:
					$value['socket'] = SWOOLE_UNIX_STREAM;
					break;
				case self::SWOOLE_SOCKET_TCP:
				default:
					$value['socket'] = SWOOLE_TCP;
					break;
			}
			$this->config[$key] = $value;
		}
	}
680410
function(data){
			//console.log(data);
			//丢弃data的第一行
			var res = '', i = 1, len = data.length;
			for(; i < len; i++){
				res += data[i].replace(/^[\t ]+/, '');
			}
			return res;
		}
415481
public function handle()
    {
        $message = trim($this->argument('message'));

        $topicName = trim($this->option('topic'));
        $tag = trim($this->option('tag'));

        /**
         * @var Client
         */
        $client = $this->mns;
        if (!$client) {
            $this->error('请先配置阿里云MSN服务，并在DI里面注册');

            return;
        }

        //
        $topic = $client->getTopicRef($topicName);
        try {
            $request = new PublishMessageRequest($message, $tag);
            $res = $topic->publishMessage($request);
            if ($res->isSucceed()) {
                $this->line('Topic Message published');
                $this->output->newLine();
                $this->call('mns:list-topic');
            }
        } catch (\Exception $e) {
            $this->error($e->getMessage());
        }
    }
382743
function(rules) {
      if (typeOf(rules) === "string") { //当不是hash传入时
        var tmp = {};
        tmp[rules] = arguments[1];
        rules = tmp;
      }
      // 可以同时接受object型或者key, value对的参数
      for (var i in rules) {
        var rule = rules[i];
        if (typeOf(rule) !== "object") {
          rule = {
            regexp: rule
          };
        }
        var reg = rule.regexp;
        if (typeOf(reg) === "regexp") {
          rule.regexp = reg.toString().slice(1, -1);
        }
        // 初始化order
        if (rule.order === undefined) rule.order = 1;
        this._rules[i] = rule;
      }
      // 每进行一次新规则监听，都重新组装一次
      this.setup();
      return this;
    }
486531
private function f1()
    {
        $_linkstr = "\n<p class=\"links\">\n"; //begin
        if ($this->totalpage < 2) {
            $nextpage = $this->cpage + 1;
            $_linkstr .= "<span class=\"disabled\">首页</span>" . " \n";
            $_linkstr .= "<span class=\"disabled\">上一页</span> \n";
            $_linkstr .= "<span class=\"disabled\">下一页</span> \n";
            $_linkstr .= "<span class=\"disabled\">尾页</span> \n";
        } elseif ($this->cpage < 2) {
            // 首页
            $nextpage = $this->cpage + 1;
            $_linkstr .= "<span class=\"disabled\">首页</span>" . " \n";
            $_linkstr .= "<span class=\"disabled\">上一页</span> \n";
            $_linkstr .= "<a href=\"" . $this->url ( $nextpage ) . "\">下一页</a> \n";
            $_linkstr .= "<a href=\"" . $this->url ( $this->totalpage ) . "\">尾页</a> \n";
        } elseif ($this->cpage >= $this->totalpage) {
            // ＝尾页
            $prepage = $this->cpage - 1;

            $_linkstr .= "<a href=\"" . $this->url ( 1 ) . "\">首页</a>\n";
            $_linkstr .= "<a href=\"" . $this->url ( $prepage ) . "\">上一页</a>\n";
            $_linkstr .= "\n<span class=\"disabled\">下一页</span>\n";
            $_linkstr .= "<span class=\"disabled\">尾页</span>" . "\n";
        } else {
            // 正常
            $prepage  = $this->cpage - 1;
            $nextpage = $this->cpage + 1;

            $_linkstr .= "<a href=\"" . $this->url ( 1 ) . "\">首页</a>\n";
            $_linkstr .= "<a href=\"" . $this->url ( $prepage ) . "\">上一页</a>\n";
            $_linkstr .= "\n<a href=\"" . $this->url ( $nextpage ) . "\">下一页</a>\n";
            $_linkstr .= "<a href=\"" . $this->url ( $this->totalpage ) . "\">尾页</a>\n";
        }
        $_linkstr .= "</p>\n"; //end div
        return $_linkstr;
    }
14469
function UserInfo() {
	//使用者帳號(索引用)
	this.strAccount = "";
	//電子信箱
	this.strEmail = "";
	//信箱通知勾選
	this.bEmailNotify = false;
	//電話資料
	this.strPhone = "";
	//簡訊通知勾選
	this.bSMSNotify = false;
	//使用者名稱(暱稱?)
	this.strUserName = "";
	//語系控制
	this.strLanguages = "";
	//系統保護
	this.bSystemAegis = false;
	//登入次數
	this.iLoginCount = 0;
	//登入時間
	this.iLogin = 0;
	//最後登出時間
	this.iLastLogout = 0;
}