Author Archives: coder4

解决vc2003、2005、2008不支持c99中int定义的办法。。

gcc可以通过-c99来强制打开c99,并且按规矩实现了stdint.h。但是vc就没这么规矩了,必须升级到vc2010才行,实验室的服务器显然没这么先进。。。。。。

解决方法:

http://stackoverflow.com/questions/126279/c99-stdint-h-header-and-ms-visual-studio

这里给出了一些很猛的人写的“可移植版本”stdint.h,在你的程序中直接引用这些可移植版本的stdint.h就可以了!

哎,觉得[......]

继续阅读

关于Redis的“vm-max-memory limit exceeded by more than 10%”问题

网上搜了以下,总体是这个意思:vm+swap只能把value swap到文件中,如果单独key就超过了vm-max-memory,那么就swap不出去了。对话如下:
Q1
What might be the cause of this error:

vm-max-memory limit exceeded by more than 10% but unable to swap more

objects out!

thank you
A1
Redis is only ab[......]

继续阅读

Redis配置文件模板

话说redis.io改版后,好多东西都找不到了,比如redis的配置模板,我摘抄了一份如下,大家可以点击这里看最新的。

redis.conf
# Redis configuration file example

# Note on units: when memory size is needed, it is possible to specifiy
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k =>[......]

继续阅读