I'm twiting

访问统计

free counters

避免和她睡觉

8岁的女孩应该讲故事让她睡觉,18岁的要讲故事骗她和你睡觉,28岁的不用讲自动和你睡觉,38岁的她会讲故事骗你睡觉,48岁的要讲故事避免和她睡觉.

vi搜索及替换命令

/pattern: 从光标开始处向文件尾搜索pattern
?pattern: 从光标开始处向文件首搜索pattern
n: 在同一方向重复上一次搜索命令
N: 在反方向上重复上一次搜索命令
:s/p1/p2/g: 将当前行中所有p1均用p2替代
:n1,n2s/p1/p2/g: 将第n1至n2行中所有p1均用p2替代
:g/p1/s//p2/g: 将文件中所有p1均用p2替换

几个有用的命令

ls *.wav | wc -l
wc => word count 计算词数
ls *.wav | wc -l 即得出当前目录下有多少个wav文件。
find | xargs grep ‘Publication Date’
find [path](path默认为当前目录),find就是递归列出当前目录下的所有文件。
xargs 即参数占位符,将 find 的结果用做 grep 的参数。
find | xargs grep ‘Publication Date’ 即将 find 的结果作为参数执行字符串搜索。
甚至还可以find | grep \.php$ | xargs grep ‘Publication Date’

ubuntu下修改网络配置须知

修改系统网络配置文件后重启网络服务的命令
/etc/init.d/networking restart
这样才可以使修改生效。

这么简单,用scp上传文件

上传文件只需在shell终端仿真器中输入命令“rz”,即可从弹出的对话框中选择本地磁盘上的文件,利用Zmodem上传到服务器

Symfony中获取POST或GET的方法

public function executeTest()
{
$hasName = $this->getRequest()->hasParameter(’name’);
$hasName = $this->hasRequestParameter(’name’); // Shorter version
var_dump( $hasName );
$name = $this->getRequest()->getParameter(’name’);
$name = $this->getRequestParameter(’name’); // Shorter version
var_dump( $name );
return sfView::NONE;
}

祈福灾民,天佑中华

国务院公告为表达全国各族人民对四川汶川大地震遇难同胞的深切哀悼,国务院决定,2008年5月19日至21日为全国哀悼日。在此期间,
全国和各驻外机构下半旗志哀(新浪新闻中心编者注:据现代汉语词典注释,“志哀”是指用某种方式哀悼),停止公共娱乐活动,外交部和我国驻外使领馆设立吊
唁簿。5月19日14时28分起,全国人民默哀3分钟,届时汽车、火车、舰船鸣笛,防空警报鸣响。

Symfony coding standards(Symfony 代码规范)

In the code examples given in this book, you probably noticed that the opening and closing curly braces ({ and }) occupy one line each. This standard makes the code easier to read.
{ 和 } 各占一行, 这样的好处是是代码更易于阅读。

Among
the other coding standards of the framework, indentation is always done
by two blank spaces; tabs are not used. This [...]