Why do you need the third parameter for in_array:
Chinese:
http://www.zendstudio.net/archives/php-in_array-s-low-performance/
Auf deutsch, gib es änliche Thema:
http://www.phpgangsta.de/php-in_array-die-performance-bremse
Why do you need the third parameter for in_array:
Chinese:
http://www.zendstudio.net/archives/php-in_array-s-low-performance/
Auf deutsch, gib es änliche Thema:
http://www.phpgangsta.de/php-in_array-die-performance-bremse
I found a article to do this:
http://www.phpvim.net/os/mac/git-branch-in-bash-prompt.html
It works.
在工作中用了git后在家就实在受不了svn的笨拙branch了。所以决定转移到git.
install过程主要参考了这两篇文档
http://git-scm.com/book/zh/%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%8A%E7%9A%84-Git-Gitosis
http://wiki.ubuntu.org.cn/Git%E6%9C%8D%E5%8A%A1%E5%99%A8Gitosis%E5%AE%89%E8%A3%85%E8%AE%BE%E7%BD%AE
安装的过程比较顺利,但是装完后出现点问题。
1.我是用ssh登录的。所以把自己的公钥传给git服务器段后可以不用输入密码。只要用用户git登录,实用我的公钥即可。
2 装完后,并不像上面的文章说得那样会自动为你的项目建立repository,需要自己跑到 /home/git目录下,创建自己个项目.git目录
3 目录创建完毕后,不要用git init 来初始化仓库,而是实用git –bar init 来。这是来自 http://www.cnblogs.com/abeen/archive/2010/06/17/1759496.html 的解释。否则第一次pushd的时候会有问题。
http://www.ibm.com/developerworks/cn/opensource/os-php-5.3namespaces/
今天看到的比较特殊的 use xxx as 的用法
use Sovendus\Model\Mapper\Strategy\Pick\OnePerSink as PickStrategy;
From: http://yueliangdao0608.blog.51cto.com/397025/312602/
mk-query-digest –select Query_time,Lock_time,Rows_sent,Rows_examined –processlist h=localhost,u=root,p=password
use Ctrl+C to stop.
OPTION:
–select
–processlist DSN
Maatkit 是 Baron Schwartz 的另一项创造,是一系列命令行工具的集合。所有工具都是用 Perl 编写的,用来补充 MySQL 未能提供的的那些重要功能。可以在 http://www.maatkit.org/ 上找到它们,包括了分析工具和其它一些小功能。
这些分析工具的其中一个是 mk-query-profiler,当它检测服务器状态变量时能够执行查询,并会打印出一个具体且易读的关于查询前后的系统状态变量差异情况的报告。这份报告能使查询有更深的理解,而不仅限于在它执行的时候。
可以将查询通过管道传入 mk-query-profiler 的标准输入口,指定一个或多个查询文件,或者仅仅是要求它检测服务器而不运行任何查询(当运行一个外部应用时,这种方式会用得上)。也能让它运行 shell 命令而不是查询。
mk-query-profiler 的报告分成好几个段落。默认的情况下,这个报告打印出的是一批摘要信息,但是,也可以得到一份包含了每一个查询或者所选择的查询的报告,然后加载到 mk-profile-compact 的辅助工具里方便地进行比较。
以下是这份报告的主要段落:
总而言之,这份报告可以细致地描述出服务器正在处理多少种类型的任务,这比仅仅是衡量查询所需要的时间要有价值得多。例如。可以帮助筛选这样两个查 询:它们在第负载时,在一个小数据集上都用几乎相等的时间完成了查询;但是,当使用到的数据量变到很大的时候,或者说在高负载的时候,它们的表现就有了巨 大的差异。它也可以被用来验证优化是否起到了作用,在这种应用环境下,它就像是一个微型的基准测试工具。
在这个工具里还有另外几种分析工具:
mk-visual-explain
mk-duplicate-key-checker
mk-deadlock-logger
mk-heartbeat
mk-archiver
mk-find
mk-parallel-dump
mk-parallel-restore
mk-show-grants
mk-slave-delay
mk-slave-prefetch
mk-slave-restart
mk-table-checksum
mk-table-sync
check the link: http://www.percona.com/doc/percona-server/5.5/installation.html
1. wget *.d3b
2. dpkg -i *.deb
3. apt-get -f install
http://www.markhansen.co.nz/javascript-optional-parameters/
Import is:
function connect(hostname, port, method) {
hostname = hostname || "localhost";
port = port || 80;
method = method || "GET";
}
The short-circuit OR operator ||
returns the left side if the left argument is truthy (evaluates to true
in conditionals), otherwise it checks if the right argument is truthy, returning it. We can use this shortcut because undefined
is falsy: in conditionals, undefined
evaluates to false
.
This shortcut approach is a very common idiom, but it does have a disadvantage: You can’t use for any argument that could accept a falsy value: false
, 0
, null
, undefined
, the empty string ""
, and NaN
.
Using the ||
shortcut will override any falsy input value. If you expect a falsy value, you must explicitly check for argument === undefined
.
Example: to get system date for n minute ago in format like “26-Aug-2013 11:04” , can write:
date +’%d-%b-%Y %H:%M’ -d ‘1 minute ago’
if [];
then
do sth.
fi
Last week worked my old DWL-810+ Wlan Bridge (cost 60 EUR 6 years ago ) not any more. Yesterday I bought a DIR-615 H1 W-Lan Route for 15 EUR. Today I refresh the firmware with DD-WRT v24 PreSP2 Build 21061and set it as a Repeater-Bridege. It work fine.
Link: http://www.dd-wrt.com/
Firmware: http://www.dd-wrt.com/routerdb/de/download/D-Link/DIR-615/H1/H2/dlink-dir615h-factory-webflash.bin/3974
Wiki about config as Repeater-Bridge: http://www.dd-wrt.com/wiki/index.php/Repeater_Bridge