摘要: stl中所有容器都是存储在堆中,当stl中存储的是对象的时候,当容器离开作用域,会调用每个对象的析构。当容器中是指针的时候,离开作用域只会释放指针占用的内存,但是指针指向的内存区域不会释放。vector,earse并不会释放vector占用的内存释放vector占用的内存,最好使用swapvecto... 阅读全文
posted @ 2015-08-25 15:18 li-xingtao 阅读(366) 评论(0) 推荐(0) 编辑
摘要: boolchdir(string$directory)将 PHP 的当前目录改为directory。http://php.net/manual/zh/function.chdir.php获取当前目录:getcwd()获取执行文件所在目录:dirname(__FILE__) ;shell:获取当天目录... 阅读全文
posted @ 2015-08-25 15:10 li-xingtao 阅读(551) 评论(0) 推荐(0) 编辑
摘要: 要想属性可搜索,需要在在Model的rules 设定可以搜索的属性public function rules() | public function rules() { return [ [['id', 'date', 'type', 'blocked_time', 'create_ti... 阅读全文
posted @ 2015-08-14 20:24 li-xingtao 阅读(558) 评论(0) 推荐(0) 编辑
摘要: http://www.zhihu.com/question/19732473process发起IO请求同步、异步是指process与IO操作是不是同步(异步IO操作完成主动通知process)阻塞、非阻塞是指process是否会等待(非阻塞process需要不断查看IO是否完成) 阅读全文
posted @ 2015-08-10 20:34 li-xingtao 阅读(118) 评论(0) 推荐(0) 编辑
摘要: php -l filename.php 来检查语法 阅读全文
posted @ 2015-08-04 18:19 li-xingtao 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 使用getrusage获取进程使用系统资源信息http://www.2cto.com/kf/201304/200572.html 阅读全文
posted @ 2015-07-26 20:31 li-xingtao 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 1. cat /proc/pid/status2.ps -e -o 'pid,comm,args,pcpu,rsz,vsz,stime,user,uid'其中rsz是是实际内存 阅读全文
posted @ 2015-07-01 01:32 li-xingtao 阅读(250) 评论(0) 推荐(0) 编辑
摘要: cat testaaabbbccccat test | xargs -i sh error.sh -p {} -l-p aaa -l-p bbb -l-p ccc -lseq 1 100产生1-100的数字 阅读全文
posted @ 2015-06-05 14:04 li-xingtao 阅读(117) 评论(0) 推荐(0) 编辑
摘要: target ... : prerequisites ...commandtarget是目标文件,prerequisite是依赖文件,command是执行的动作当target不存在或者prerequisite存在文件比target新的话,command就会执行command要以tab键开始,或者当c... 阅读全文
posted @ 2015-06-01 18:07 li-xingtao 阅读(113) 评论(0) 推荐(0) 编辑
摘要: strtotime() 函数定义和用法strtotime() 函数将任何英文文本的日期时间描述解析为 Unix 时间戳。语法strtotime(time,now)参数描述time规定要解析的时间字符串。now用来计算返回值的时间戳。如果省略该参数,则使用当前时间。说明该函数预期接受一个包含美国英语日... 阅读全文
posted @ 2015-06-01 09:56 li-xingtao 阅读(177) 评论(0) 推荐(0) 编辑