首先要说,这是个BT的问题,以前还真少想过。先说我遇到的问题吧。

我看到的一行代码里,Memcached的缓存时间被设置为86400*24*4, 等于是96天。而当调用set去存储的时候,memcached会返回true。而当你用get的时候,就是相反的结果了: FALSE

要说BT呢,因为用到Memcached的人,通常不会去给缓存96天,这种情况下,更好的选择是DB、filecache或者其他。尽管BT,我还是去测试了一下最长时间,得到的结果是: 30 days。去memcached源码里查了一下,这下就明白多了:

#define REALTIME_MAXDELTA 60*60*24*30
/*
* given time value that’s either unix time or delta from current unix time, return
* unix time. Use the fact that delta can’t exceed one month (and real time value can’t
* be that low).
*/
static rel_time_t realtime(const time_t exptime) {
/* no. of seconds in 30 days – largest possible delta exptime */
if (exptime == 0) return 0; /* 0 means never expire */
if (exptime > REALTIME_MAXDELTA) {
/* if item expiration is at/before the server started, give it an
expiration time of 1 second after the server started.
(because 0 means don’t expire).  without this, we’d
underflow and wrap around to some large value way in the
future, effectively making items expiring in the past
really expiring never */
if (exptime <= process_started)
return (rel_time_t)1;
return (rel_time_t)(exptime – process_started);
} else {
return (rel_time_t)(exptime + current_time);
}
}
Memcached最大缓存时间为30d, 而且从实际应用上,这么变态的时间也已经足够了。
看源代码是终极办法啊。
很多人会觉得VIM是个非常好的Editor,也有很多人因为黑色的界面而对VIM充满了向往。但很多的人,或者说,大部分上述的人都因为VIM上手过程中频繁的配置,不停的去下载并安装plugin, 来回的修改vimrc文件等等等等,在过了几分热情之后,就渐渐对VIM说baybay了。
各大编辑器或IDE学习成本曲线

各大编辑器或IDE学习成本曲线

今天给大家推荐一个由一位来自台湾的兄弟林佑安(翻墙)开发维护的Vimana,这是一个安装以后,可以自动搜索、下载、安装并配置VIM插件好东东。省得大家到处去找寻了。这是一个Perl编写的东东,所以安装的时候,需要先确定机器里安装了Perl,然后在CPAN下安装(如果你不知道Perl和CPAN,google之)。具体安装与介绍,请参看下面的keynote. 这里面不光是介绍了这个Vimana,事实上主体不是这个,而是介绍了相当的VIM使用技巧,有兴趣的可以认真关注一下,E文的,不过不难的。
PS: VIM 7.3发布了,有兴趣的可以下载来试用一下: ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2。下午的时候我已经在单位的开发机上和Mac上都装上了,我还在体验中。下午郁闷的是,编译的时候居然忘记加multibyte支持,还在twitter上发牢骚说不对中文支持不行了呢。看来这段关注点的变化导致自己有些神经已经退化了。

This standard HTTP header field is defined in RFC 2616

The Cache-Control general-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. The directives specify behavior intended to prevent caches from adversely interfering with the request or response. These directives typically override the default caching algorithms. Cache directives are unidirectional in that the presence of a directive in a request does not imply that the same directive is to be given in the response.

Cache directives MUST be passed through by a proxy or gateway application, regardless of their significance to that application, since the directives might be applicable to all recipients along the request/response chain. It is not possible to specify a cache-directive for a specific cache.

Common Cache-Control header values:

  • Cache-Control: no-cache
  • Cache-Control: private
  • Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
  • Cache-Control: post-check=0, pre-check=0
  • Cache-Control: no-store, no-cache, must-revalidate
  • Cache-Control: must-revalidate, no-store
  • Cache-Control: no-cache,no-store
  • Cache-Control: max-age=60
  • Cache-Control: no-cache, must-revalidate
  • Cache-Control: no-store
  • Cache-Control: max-age=0, must-revalidate
  • Cache-Control: max-age=0, no-cache
  • Cache-Control: no-cache, no-store, must-revalidate, max-age=0
  • Cache-Control: no-store, no-cache, must-revalidate, max-age=0
  • Cache-Control: store, no-cache, must-revalidate
  • Cache-Control: public
  • Cache-Control: max-age=86400
  • Cache-Control: max-age=0
  • Cache-Control: max-age=2592000
  • Cache-Control: private, max-age=0
  • Cache-Control: private, pre-check=0, post-check=0, max-age=0
  • Cache-Control: max-age=3600
  • Cache-Control: must-revalidate
  • Cache-Control: max-age=3600, public
  • Cache-Control: no-cache, no-store, must-revalidate
  • Cache-Control: max-age=600
  • Cache-Control: no-cache=”set-cookie”
  • Cache-Control: private, max-age=0, must-revalidate
  • Cache-Control: must-revalidate = no-cache
  • Cache-Control: no-cache, no-store
  • Cache-Control: private, must-revalidate, max-age=0
  • Cache-Control: max-age=300
  • Cache-Control: private, must-revalidate
  • Cache-Control: Private
  • Cache-Control: max-age=1
  • Cache-Control: max-age=604800
  • Cache-Control: private, no-cache=”set-cookie”
  • Cache-Control: “must-revalidate”
  • Cache-Control: max-age=0, no-store
  • Cache-Control: no-cache,no-store,must-revalidate
  • Cache-Control: private, no-cache
  • Cache-Control: no-cache, pre-check=0, post-check=0
  • Cache-Control: public, max-age=10800
  • Cache-Control: max-age=86400, public
  • Cache-Control: must-revalidate, max-age=1
  • Cache-Control: no-cache,must-revalidate
  • Cache-Control: no-store, no-cache
  • Cache-Control: private, max-age=10800, pre-check=10800
  • Cache-Control: No-cache
  • Cache-Control: cache
  • Cache-Control: max-age=1800
  • Cache-Control: max-age=345600
  • Cache-Control: no-cache, must-revalidate, max-age=0
  • Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0
  • Cache-Control: no-cache,no-store,max-age=0
  • Cache-Control: no-cache=”set-cookie,set-cookie2″
  • Cache-Control: no-store, no-cache, must-revaldate, post-check=1, pre-check=2
  • Cache-Control: pre-check=0, post-check=0, max-age=0
  • Cache-Control: private, post-check=0, pre-check=0, max-age=0
  • Cache-Control: store, no-cache, must-revalidate, post-check=0, pre-check=0
  • Cache-Control: No-Cache
  • Cache-Control: max-age=0, no-cache, no-store
  • Cache-Control: max-age=1209600
  • Cache-Control: no-cache, no-store, must-revalidate, max-age=-1
  • Cache-Control: no-cache, private
  • Cache-Control: no-cache,max-age=0,must-revalidate
  • Cache-Control: post-check=0, pre-check=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
  • Cache-Control: ,
  • Cache-Control: max-age=0, private, must-revalidate
  • Cache-Control: max-age=21600
  • Cache-Control: max-age=28800
  • Cache-Control: max-age=5184000
  • Cache-Control: max-age=82800
  • Cache-Control: no-cache, max-age=1
  • Cache-Control: public,max-age=3600
  • Cache-Control: Public
  • Cache-Control: max-age=0, private
  • Cache-Control: max-age=0, private, proxy-revalidate
  • Cache-Control: max-age=120
  • Cache-Control: max-age=18000
  • Cache-Control: max-age=25920000
  • Cache-Control: max-age=31104000
  • Cache-Control: max-age=311040000
  • Cache-Control: max-age=31536000
  • Cache-Control: max-age=3600, private
  • Cache-Control: max-age=900
  • Cache-Control: must-revalidate, no-cache, no-store, private, s-maxage=0, pre-check=0, post-check=0, max-age=0
  • Cache-Control: no-cache, no-store, must-revalidate
  • Cache-Control: no-cache, no-store, private
  • Cache-Control: no-cache,no-transform
  • Cache-Control: no-cache=”set-cookie, set-cookie2″
  • Cache-Control: no-store, must-revalidate
  • Cache-Control: no-store, no-cache, must-revalidate, max_age=0
  • Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0, private
  • Cache-Control: private, no-cache, max-age=0
  • Cache-Control: private, no-cache, no-store, proxy-revalidate, no-transform
  • Cache-Control: private, no-store
  • Cache-Control: private, proxy-revalidate
  • Cache-Control: public, max-age=60
  • Cache-Control: public, max-age=604800, post-check=7200, pre-check=604800
  • Cache-Control: 7200
  • Cache-Control: “no-cache”
  • Cache-Control: False
  • Cache-Control: NO-CACHE
  • Cache-Control: No-Store
  • Cache-Control: No-store
  • Cache-Control: max-age=-111581876
  • Cache-Control: max-age=-170009618
  • Cache-Control: max-age=-4366177
  • Cache-Control: max-age=-492324790
  • Cache-Control: max-age=-52613456
  • Cache-Control: max-age=-625447
  • Cache-Control: max-age=-9274207
  • Cache-Control: max-age=0, no-cache, no-store, must-revalidate
  • Cache-Control: max-age=0, no-store, max-age=-2592000
  • Cache-Control: max-age=0, no-store, no-cache, must-revalidate
  • Cache-Control: max-age=0, s-maxage=0, private, must-revalidate
  • Cache-Control: max-age=1, must-revalidate, private
  • Cache-Control: max-age=1, no-cache, must-revalidate
  • Cache-Control: max-age=1, s-maxage=1, no-cache, must-revalidate
  • Cache-Control: max-age=10
  • Cache-Control: max-age=10800
  • Cache-Control: max-age=1200
  • Cache-Control: max-age=124416000
  • Cache-Control: max-age=14400
  • Cache-Control: max-age=172800
  • Cache-Control: max-age=180
  • Cache-Control: max-age=1800,public
  • Cache-Control: max-age=25920
  • Cache-Control: max-age=259200
  • Cache-Control: max-age=2678400, public
  • Cache-Control: max-age=300, must-revalidate
  • Cache-Control: max-age=300, private, proxy-revalidate
  • Cache-Control: max-age=315360000
  • Cache-Control: max-age=3600, s-maxage=3600, no-cache
  • Cache-Control: max-age=43200
  • Cache-Control: max-age=60, must-revalidate
  • Cache-Control: max-age=60, private, proxy-revalidate
  • Cache-Control: max-age=600, must-revalidate
  • Cache-Control: max-age=600, s-maxage=600
  • Cache-Control: max-age=604800, public, proxy-revalidate, must-revalidate
  • Cache-Control: max-age=64800
  • Cache-Control: max-age=7075
  • Cache-Control: max-age=7200
  • Cache-Control: max-age=86400, must-revalidate
  • Cache-Control: max-age=864000
  • Cache-Control: must-revalidate, max-age=0
  • Cache-Control: no – cache
  • Cache-Control: no-Cache
  • Cache-Control: no-cache, max-age=0
  • Cache-Control: no-cache, max-age=2592000
  • Cache-Control: no-cache, max-age=3600
  • Cache-Control: no-cache, max-age=86400
  • Cache-Control: no-cache, must-revalidate, max_age=0
  • Cache-Control: no-cache, must-revalidate, max_age=0, private
  • Cache-Control: no-cache, must-revalidate, no-cache=”Set-Cookie”, private
  • Cache-Control: no-cache, must-revalidate, no-store, post-check=0, pre-check=0
  • Cache-Control: no-cache, must-revalidate;
  • Cache-Control: no-cache, no-cache, no-cache, no-cache
  • Cache-Control: no-cache, no-store, max-age=0, must-revalidate
  • Cache-Control: no-cache, no-store, max-age=0, private, must-revalidate, proxy-revalidate
  • Cache-Control: no-cache, no-store, must-revalidate, max-age=0, proxy-revalidate, no-transform, max-age=0
  • Cache-Control: no-cache, no-store, must-revalidate, private
  • Cache-Control: no-cache, no-store, no-transform
  • Cache-Control: no-cache, no-store, private, max-age=0
  • Cache-Control: no-cache, no-store, private, max-age=1, must-revalidate
  • Cache-Control: no-cache, no-store, private, must-revalidate, post-check=0, pre-check=0
  • Cache-Control: no-cache, no-store, proxy-revalidate, must-revalidate
  • Cache-Control: no-cache, nostore
  • Cache-Control: no-cache, post-check=0,pre-check=0, max-age=0, max-age=1
  • Cache-Control: no-cache,must-revalidate, no-store
  • Cache-Control: no-cache,no-store,max-age=0,s-maxage=0,must-revalidate
  • Cache-Control: no-cache,private
  • Cache-Control: no-cache; max-age=0
  • Cache-Control: no-cache=set-cookie
  • Cache-Control: no-cash, must-revalidate
  • Cache-Control: no-store, no-cache, must-revalidate, max-age=0, max-age=0
  • Cache-Control: no-store, no-cache, private
  • Cache-Control: no-store,max-age=0,post-check=0,pre-check=0
  • Cache-Control: no-store,no-cache,must-revalidate, post-check=0, pre-check=0, max_age=0
  • Cache-Control: no-store,no-cache,must-revalidate,max-age=-1
  • Cache-Control: no-store,no-cache,must-revalidate,max-age=0,post-check=0,pre-check=0
  • Cache-Control: no-transform
  • Cache-Control: post-check=-1, pre-check=-1
  • Cache-Control: post-check=3600,pre-check=43200
  • Cache-Control: pre-check=0, post-check=0
  • Cache-Control: private , proxy-revalidate, must-revalidate
  • Cache-Control: private, must-revalidate, no-cache, no-check
  • Cache-Control: private, no-cache, must-revalidate
  • Cache-Control: private, no-cache, must-revalidate, no-store, max-age=0, post-check=0, pre-check=0
  • Cache-Control: private, no-cache, no-store, must-revalidate
  • Cache-Control: private, no-cache, no-store, must-revalidate, max-age=0
  • Cache-Control: private, no-store, must-revalidate
  • Cache-Control: private,max-age=3600
  • Cache-Control: private,no-cache,no-store,max-age=0,must-revalidate,proxy-revalidate
  • Cache-Control: private,no-cache,no-store,must-revalidate
  • Cache-Control: proxy-revalidate, max-age=0, must-revalidate
  • Cache-Control: public, max-age=141456
  • Cache-Control: public, max-age=294
  • Cache-Control: public, max-age=30
  • Cache-Control: public, max-age=300
  • Cache-Control: public, max-age=5
  • Cache-Control: public, must-revalidate
  • Cache-Control: public, must-revalidate, no-cache=”Set-Cookie”, max-age=300
  • Cache-Control: public, proxy-revalidate, must-revalidate, max-age=157680000
  • Cache-Control: s-maxage=1200, must-revalidate, max-age=0

1.本周开始请教练教打羽毛球了

2.周末跟大学网络中心的几个兄弟(也有女生)聚了下,这帮人在一起还是那么单纯地开心

3.越来越多的人不赞成我现在对感情问题的处理方式,需要作出些改变了吗?

4.立秋了,扇子要丢到一边了,时间也越来越少了

收集并整理了一下部分抓取手机网站的搜索引擎robots的User-Agent信息。有需要的同学可以点击下面的链接下载。

目前比较可恶的是部分国内手机搜索引擎,抓取的时候,不会在User-Agent信息里说明自己是robot。其实,说明一下,这样更方便的。

点击这里下载

更新于08-04-2010

这些天在整理Nokia的一些机型信息,用脚本从Nokia Forum上跑出一份产品信息来,包括如下信息:
机型名 model
机型平台 platform
机型系统 system
屏幕分辨率 resolution
产品ID(只是S60平台的有)  productID
图形信息
浏览器信息
设备信息URL地址  Device URL

点击这里下载

Developing for Mobile Rules:

Rule 1:
Do NOT use the emulators.

Rule 2:
Make sure you have:
- iPhone or Android (or both )
- S60
- Windows Mobile
- ( BlackBerry )

Rule 3:
Use media queies

  • @CUGSM: 你虚度的今天,正是昨天死去的人无限向往的明天。
  • 收藏。很多人只是嘴上说说而已,其实就不知道分析目标是什么。这是关键。
  • 一键微博备份到WordPress – WP-Tsina微博插件0.2.0发布#微博#,#wp-tsina#,#备份# http://sinaurl.cn/GclCF
  • 细节.阿尔卡特电话(可挂在墙上的)背面大多标记着两个挂孔之间的长度. 很贴心.
  • 虽然已经离开好几年,但每当看到金山的LOGO的时候,仍然情不自禁的澎湃 //@张老叉:一直都因为曾经在这样一家公司工作过而自豪
  • 京东上订了台燃气热水器,原来的万和已经折腾我一个多月了,再也没兴趣继续折腾那破玩意儿了。出去找东西吃去,明天就有新热水器用了。
  • 整天轻松着,人就要退化了。
  • 某一天变沉默的时候,就是应该换种生活的时候,对于我来说 //@丁丁one:哈哈,关键你是金子的时候,神态也变得跟金子一样;肯定就觉得你沉默的过于异常了。[红牌] //@bbcallen:我是金子的时候,你们都说我不对劲。。。 //@丁丁one: //@闲心若水:再次印证沉默是金。 //@★微博经典语录★:转发微博。
  • @kedy: RT @zhufengme 据刚刚回来的朋友讲,北戴河海域出现原因不明的原油泄漏,基本上已经无法下海游泳,最近要去秦皇岛地区的朋友要留意了
  • I’m sure that sth will be changed, soon.
  • 决定将主战场迁移到twitter,至少不会被管制. 请fo我:kedy
  • WP-Tsina微博插件升级,目前提供在后台一键点击,备份最近微博到WordPress功能。
    定期使用,一来可以防止某些”和谐”的原因导致的微博无法访问、数据丢失的惨烈。
    二来,可以方便的定期汇总到WordPress,省去手动整理的麻烦。
    升级日志:
    = 0.2.0 =
    (2010-07-18)
    1、增加后台一键自动备份微博到Wordpress功能(也可当作每周定期汇总微博用);
    2、版本升级为0.2.0

    = 0.2.0 =(2010-07-18)1、增加后台一键自动备份微博到Wordpress功能(也可当作每周定期汇总微博用);2、版本升级为0.2.0

    2010年过了大半, 我的计划实现了多少?不管计划有没有实现,时间都已经义无反顾的跑了过去。所以, 我计划没有实现的变成了遗憾,实现了的变成了事实 。 下半年,实现计划的机会来了,对自己好一点。别为一些不相干的事情所牵绊,拖沓。 没有人会可怜你!–前同事毕琳

    看到前同事Kelly的这段话的时候,2010年的Q3已经来临。今天是7月4号,在Q3已经过去了4天的时候,在这里做一下Q1,Q2的回顾,根据自己的计划对Q3Q4也做个规划准备。

    在年初为2010制定的几项任务里,第二项已经得到执行,换了工作,到了当当网工作,如今虽仍未完全适应这个新的环境,不过与过去对比来说,还是有了相当大的变化。有了自己的生活时间,感觉很是不同。第一项英语,已经报了EF,虽然比较贵,不过感觉还不错,只是世界杯开始至今,我还未上过课,从明天开始重新上课。带爸妈出游的计划,得在下半年来执行了。女朋友的事情,目前努力中。今年日志得到了一定程度的坚持,不过还是继续努力。

    总的来说,上半年计划里的事情,执行的还算凑合,这里可以打个60分吧。很多让我心虚的或不方便说出来的事,暂时先不往出讲了。在Q3Q4,在下面几个方面需要努力做到:

    1. 坚持学好英语。不光是课堂上,平时生活里,还有在线课程,都需要做的更好 。
    2. 坚持按自己的目标前进。目标之外的事情,可以不必那么坚持。盯住目标前进。自己的想法,在这次承德之行得到一定的肯定,我所需要做的就是时时清楚自己的目标,和为了达到目标需要做的和不必做的事情。

    That’s all. Q3 is coming, Do your best.