This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @todo 敏感词匹配核心库,本函数适用于GBK的编码匹配 | |
* | |
* @fun1.生产成Tree型文件方法: | |
* @name execMmakeWordsTree($filePaths="./wordsTree.txt") | |
* @param filePaths => 生成文件的路径 | |
* @return bool#gbk | |
* | |
* @fun2.获取Tree型文件数据方法: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
智子云 | |
======================= | |
作品介绍 | |
----------- | |
+ 怎么理解智子云呢?不做详细文字描述,就拿作品实例来说吧 | |
+ 就当前应用场景而言,我们在演讲PPT的时候会怎么做呢? | |
> 本地编辑PPT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* 正文百科词条加链接 | |
* | |
* @author ol | |
* | |
* @example | |
* $trans = new AddBaikeLink($text, $tagArr); | |
* $new_text = $trans->addLink(); | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ralatebaikekw(subject, message) | |
{ | |
if(isUndefined(subject) || subject == -1) { | |
subject = $('subject').value; | |
subject = subject.replace(/<\/?[^>]+>|\[\/?.+?\]|"/ig, ""); | |
subject = subject.replace(/\s{2,}/ig, ' '); | |
} | |
if(isUndefined(message) || message == -1) { | |
message = getEditorContents(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python | |
#-*-coding:gbk-*- | |
import os | |
import sys | |
import re | |
reload(sys) | |
sys.setdefaultencoding("gbk") | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
set_time_limit(0); | |
class Test_database | |
{ | |
private $read_dbhost = ''; | |
private $read_dbuser = ''; | |
private $read_dbpw = ''; | |
private $read_dbname = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ob_start(); //打开缓冲区 | |
Header("Cache-Control: public"); | |
Header("Content-type: application/octet-stream"); | |
Header("Accept-Ranges: bytes"); | |
if (strpos($_SERVER["HTTP_USER_AGENT"],'MSIE')) { | |
Header('Content-Disposition: attachment; filename=test.php'); | |
}else if (strpos($_SERVER["HTTP_USER_AGENT"],'Firefox')) { | |
Header('Content-Disposition: attachment; filename=test.doc'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
最常见的词语二分法: | |
$str = '这是我的网站www.7di.net!'; | |
//$str = iconv('GB2312','UTF-8',$str); | |
$result = spStr($str); | |
print_r($result); | |
/** | |
* UTF-8版 中文二元分词 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* 打印数组 | |
* | |
* @param int $num 数组内的元素个数 | |
*/ | |
function printArr($num){ | |
global $array;//全局数组 | |
for($i=0;$i<$num;$i++) | |
echo $array[$i]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fsRank($base, $temp=null) | |
{ | |
static $ret = array(); | |
$len = strlen($base); | |
if($len <= 1) | |
{ | |
//echo $temp.$base.'<br/>'; | |
$ret[] = $temp.$base; | |
} | |
else |
NewerOlder