月度归档: 2012 年 3 月
高效方案——Programmers(34)
载于《程序员》杂志2012年第2期。
作者西乔:http://blog.xiqiao.info/2012/03/16/1150
转载自膘叔:http://www.neatstudio.com/show-2038-1.shtml
HE Interactive Programming Courses
没错,这里的HE,就是美国的那个数据中心Hurricane Electric。
他们除了提供免费的域名解析服务:http://dns.he.net。
还提供了免费的交互式编程课程:http://code.he.net。
而且,他们居然还在google花钱打广告推广他们这么好的免费服务,所以这里顺便帮他们做一下免费广告:)
两个pub/sub客户端
Faye : http://faye.jcoglan.com/ Faye还有一个服务端。
https://gist.github.com/661855
PHP妖孽
PHP要时时注意编码问题的坑。
各种妖孽
php cURL模拟POST请求,碰到这样的错误:
HTTP/1.0 417 Expectation failed
Server: squid
Date: Fri, 02 Mar 2012 16:08:46 GMT
Content-Type: text/html
Content-Length: 1563
X-Squid-Error: ERR_INVALID_REQ 0
X-Cache: MISS from none.net
Via: 1.0 none.net:80 (squid)
Connection: close
请求头
POST /abc.php HTTP/1.1
User-Agent: Internal Callback
Host: www.abc.com
Accept: */*
Content-Length: 14598
Content-Type: application/x-www-form-urlencoded
Expect: 100-continue
解决方案:设置CURLOPT_HTTPHEADER为array(‘Expect:’)
参考链接:
http://chrismckee.co.uk/curl-http-417-expectation-failed/
http://www.shesek.info/php/http-error-417-with-php-curl
Tornado实时行情报价
用Tornado实现了一个实时行情报价系统,长轮询,一个简单的应用,从看文档查资料到实现。
花了大概两个小时。
好惊讶。
继续玩python:)
接下来要做点其他好玩的东西了。