07 2011 档案
摘要:Art腾讯CDC腾讯WSD阿里巴巴UED百度泛用户体验ChinaUINoSQLMongoDB Developing-scalable-PHP-applications-using-MongoDB http://highscalability.com/youtube-architecture http://en.wikipedia.org/wiki/MapReduce http://en.wikipedia.org/wiki/Hadoop Distributing-PHP-processing-with-Gearman.h...
阅读全文
摘要:使用expect可以省去手动交互的过程,比如scp的密码曾遇到这样一段代码:(Bash脚本)#!/usr/bin/expect -fset HOST "192.168.102.1"set USER "codefor"set PASS "codefor"set BOOKFILE "/home/codefor"#uploadspawn "scp *.zip $USER@$HOST:$BOOKFILE"expect { "*password*" {send "$PASS\
阅读全文
摘要:关于spl_autoload_register的说明,参见SPL autoload分析:http://www.cnblogs.com/codefor/archive/2011/05/04/2036917.html当使用类的成员函数作为spl_autoload_register的参数的时候要注意:静态方法:array(类名,方法名)非静态方法:array(类的实例,方法名)代码示例:<?phpclass Codefor1{ static function t1($class){ require_once $class; }}class Codefor2{ function t2($clas
阅读全文
摘要:我们知道,函数、类会改变当前变量的作用域。if,while等分支循环结构会继承外部作用域,即外部变量对分支循环结构内部可见。但是C语言不支持if,while等分支循环结构内部作用域对外可见,而PHP则不然。在PHP中,if,while等分支循环结构中声明的局部变量,在分支循环结构后面仍然有效。比如,函数中声明的变量在函数外面是不可见的C语言:#include<stdio.h>int foo(){ int bar; bar = 3;}int main(){ printf("%d\n",bar); return 0;} 报错:scope.c: In function
阅读全文
摘要:自己曾写过这样一段代码:if(file_exists($pmr_config["datasetfile"])){ $tmp_counter = 0; $hd = fopen($pmr_config["datasetfile"], "r"); if($hd !== FALSE){ while (!feof($hd)) { $buffer = fgets($hd); if($tmp_counter >= $seq){ $result[] = $buffer; } $tmp_counter++; if($tmp_counter >
阅读全文
浙公网安备 33010602011771号