PHP5.4改变的新特性(未完待续) 07月04日

PHP5.4改变的特性

20 Jun 2011, PHP 5.4.0 Alpha 1
- autoconf 2.59+ is now supported (and required) for generating the
configure script with ./buildconf. Autoconf 2.60+ is desirable
otherwise the configure help order may be incorrect. (Rasmus, Chris Jones)

删除的特性:
. break/continue $var syntax. (Dmitry)
. Safe mode and all related ini options. (Kalle) //删除安全模式相关的所有函数和配置
. register_globals and register_long_arrays ini options. (Kalle) //删除这两个函数配置文件中的内容
. import_request_variables(). (Kalle) //
. allow_call_time_pass_reference. (Pierrick)
. define_syslog_variables ini option and its associated function. (Kalle)
. highlight.bg ini option. (Kalle)
. Session bug compatibility mode (session.bug_compat42 and
session.bug_compat_warn ini options). (Kalle)
. session_is_registered(), session_register() and session_unregister()
functions. (Kalle)
. y2k_compliance ini option. (Kalle)

- Moved extensions to PECL: (Johannes) //sqlite 被移动到PECL中
. ext/sqlite. (更多…)

Facebook创新之BigPipe:优化页面加载时间【转】 07月01日

from http://www.infoq.com/cn/news/2010/08/bigpipe-facebook-optimize

近日,Facebook的研究科学家Changhao Jiang介绍了一个名为BigPipe的技术,这项技术可使Facebook站点的访问速度提升一倍。BigPipe是Facebook的创新研究之一,同时也是Facebook的“秘密武器”,它能够极大提升站点的性能:在大多数浏览器中,BigPipe都能将用户感受到的延迟时间降低一半,除了Firefox 3.6,BigPipe可以将Firefox 3.6的延迟时间降低50ms左右,大约降低了22%左右。

BigPipe及相关创新的驱动力是:

相比于10年前,现代Web站点的动态性与交互性都迈上了一个新台阶,传统的页面处理模型已经无法满足当今Internet速度上的需求了。 (更多…)

BASE64编码的图片在网页中的显示【转】 06月27日

BASE64编码的图片在网页中的显示【转】

摘编自:http://www.javaeye.com/topic/314651 原作者:mfcai 1.为什么 [...]

Thrift vs. Protocol Buffers 06月23日

Google recently released its Protocol Buffers as open source. About a year ago, Facebook released a similar product called Thrift. I’ve been comparing them; here’s what I’ve found:

Thrift Protocol Buffers
Backers Facebook, Apache (accepted for incubation) Google
Bindings C++, Java, Python, PHP, XSD, Ruby, C#, Perl, Objective C, Erlang, Smalltalk, OCaml, and Haskell C++, Java, Python
(Perl, Ruby, and C# under discussion)
Output Formats Binary, JSON Binary
Primitive Types bool
byte
16/32/64-bit integersdouble
string
byte sequence
map<t1,t2>
list<t>
set<t>
bool32/64-bit integers
float
double
string
byte sequence

“repeated” properties act like lists

Enumerations Yes Yes
Constants Yes No
Composite Type struct message
Exception Type Yes No
Documentation So-so Good
License Apache BSD-style
Compiler Language C++ C++
RPC Interfaces Yes Yes
RPC Implementation Yes No
Composite Type Extensions No Yes

Overall, I think Thrift wins on features and Protocol Buffers win on documentation. Implementation-wise, they’re quite similar. Both use integer tags to identify fields, so you can add and remove fields without breaking existing code. Protocol Buffers support variable-width encoding of integers, which saves a few bytes. (Thrift has an experimental output format with variable-width ints.)

The major difference is that Thrift provides a full client/server RPC implementation, whereas Protocol Buffers only generate stubs to use in your own RPC system.

Update July 12, 2008: I haven’t tested for speed, but from a cursory examination it seems that, at the binary level, Thrift and Protocol Buffers are very similar. I think Thrift will develop a more coherent community now that it’s under Apache incubation. It just moved to a new web site and mailing list, and the issue trackeris active.

Kyoto Cabinet 基本规格书【转】 06月20日

如果你知道 Tokyo Cabinet ,那么就应该知道 Kyoto Cabinet,因为他们都是同一个作者(平林幹雄)开发出来的 Key-Value 数据库。

Kyoto Cabinet:a straightforward implementation of DBM,主页:http://fallabs.com/kyotocabinet/ ,演示文稿:http://www.slideshare.net/estraier/kyotoproducts-5886452 。

Tokyo Cabinet:a modern implementation of DBM,主页: http://fallabs.com/tokyocabinet/

以下Tokyo Cabinet简称为TC, Kyoto Cabinet简称为KC,本文主要对KC做介绍。
KC是TC的后继者或兄弟项目,因为KC在各方面都超过了,所以作者在TC的首页上的开头向所有人推荐使用KC(我也是这个推荐才开始关注KC的)。TC为C实现,为了更好的可维护性,KC采用C++实现。

以下内容的英文原文来自:http://fallabs.com/kyotocabinet/spex.html (更多…)

浅谈Facebook的服务器架构(组图)【转】 06月13日

浅谈Facebook的服务器架构(组图)【转】

导读:毫无疑问,作为全球最领先的社交网络,Facebook的高性能集群系统承担了海量数据的处理,它的服务器架构 [...]

利用Curl、socket、file_get_contents POST数据 05月16日

 /**
* Socket版本
* 使用方法:
* $post_string = "app=socket&version=beta";
* request_by_socket('facebook.cn','/restServer.php',$post_string);
*/
function request_by_socket($remote_server,$remote_path,$post_string,$port = 80,$timeout = 30){
$socket = fsockopen($remote_server,$port,$errno,$errstr,$timeout);
if (!$socket) die("$errstr($errno)");
fwrite($socket,"POST $remote_path HTTP/1.0");
fwrite($socket,"User-Agent: Socket Example");
fwrite($socket,"HOST: $remote_server");
fwrite($socket,"Content-type: application/x-www-form-urlencoded");
fwrite($socket,"Content-length: ".strlen($post_string)+8."");
fwrite($socket,"Accept:*/*");
fwrite($socket,"");
fwrite($socket,"mypost=$post_string");
fwrite($socket,"");
$header = "";
while ($str = trim(fgets($socket,4096))) {
$header.=$str;
}


$data = "";
while (!feof($socket)) {
$data .= fgets($socket,4096);
}
return $data;
}
 /**
* Curl版本
* 使用方法:
* $post_string = "app=request&version=beta";
* request_by_curl('http://facebook.cn/restServer.php',$post_string);
*/
function request_by_curl($remote_server,$post_string){
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$remote_server);
curl_setopt($ch,CURLOPT_POSTFIELDS,'mypost='.$post_string);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_USERAGENT,"Jimmy's CURL Example beta");
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
?>
 /**
* 其它版本
* 使用方法:
* $post_string = "app=request&version=beta";
* request_by_other('http://facebook.cn/restServer.php',$post_string);
*/
function request_by_other($remote_server,$post_string){
$context = array(
'http'=>array(
'method'=>'POST',
'header'=>'Content-type: application/x-www-form-urlencoded'."".
'User-Agent : Jimmy's POST Example beta'."".
'Content-length: '.strlen($post_string)+8,
'content'=>'mypost='.$post_string)
);
$stream_context = stream_context_create($context);
$data = file_get_contents($remote_server,FALSE,$stream_context);
return $data;
}
?>

汶川三周年 05月11日

汶川三周年

三年来,一直没有敢回去到汶川看一看,我害怕,害怕看见荧幕上真实的场景。 有人说经历过生死才会有豁达的胸襟,我没 [...]

技术与工作 05月09日

技术与工作最理想的状态是——自己能学习到新的技术,这些技术能应用到工作中;工作的内容有不那么枯燥,都那么具有挑战性。

但是突然想起一句名言——工作,它之所以成为工作,是因为你只需要工作而不需要思考。也许,工作,就是人和机器之间的中间层,等到某一天机器人有这种功能了,人自然就不用工作了。

突然想写这篇文章是我感觉国内的技术永远都是那么的扯淡,可能是因为我先扯淡吧,感觉所有的程序员都在忙碌着一些东西,到最后,问他,今年他做了什么,他回答,他妈的天天加班干活,哪有时间做啥啊。

程序员的工作是富有挑战性的,但是这个是在国外,在国内,很少真的有程序员,能做到程序结伴,不断挑战新的高度。大多数是年轻的时候努力奋斗了几年,到后来,因为本方向的发展空间不是很大了,但是又不能跳转到其他的方向,怎么办呢,带几个新人吧,这样也有点领导的性质了。但是,有没有想过,大学研究生读了这么多年,工作写了这么多代码,突然有一天不写了,转做项目管理了。这也就是中国的IT的现状,工作几年之后大家都痛苦地抛弃了代码,抛弃了自己以前的很多代码积累。

我可能太落后了,可能太年轻了,不知道此中的利害,也许,每一个程序员在开始的时候都想过要写出非常牛逼的程序,直到有一天,他发现他的代码并不能改变世界的时候,他才知道原来在中国,每一个程序员都成不了bill gates。

夜深了,胡乱写….

php技术大会2011 05月08日

php技术大会2011

2011-05-07,在北京长城饭店参加完了2011年php技术大会,这个算是中国php的最高技术论坛吧,到场的人大概有1000多,当然,百度、腾讯、淘宝、新浪等大公司来的人应该超过了一半。php,这个顶着中国70%左右的互联网流量的编程语言,神奇的把大家聚合在了一起。

第 6 页,共 12 页« 最新...45678...最旧 »