- 浏览: 11839 次
- 性别:
- 来自: 上海
最新评论
文章列表
1 查看cpu是否64位
执行cat /proc/cpuinfo
看看里面flags 字段是否有“lm”
2.查看操作系统是否64位。
使用命令getconf LONG_BIT 可以快速的知道
当前操作系统是32位还是64位。
mongrel_rails,出错,显示too many open files。
ulimit -a 显示open file 1024
修改/etc/security/limits.conf
设置为4096,可以添加如下内容:
* soft nofile 4096
* hard nofile 4096
重启ok
DBMS vs NOSQL
- 博客分类:
- 项目总结
NOSQLDB categories
key / value pairs, sharded arrays, and document-oriented
approaches)
google App data stores. Its syntax in Python is simple and clear, and it was specifically
created to be easy to use and reminiscent of relational databases, while only providing the
services typical of key/valu ...
Optimistic Concurrency, also known as MVCC (Multi-Version
Concurrency Control).
This mechanism relies on timestamps (presupposing a shared
clock) or Vector Clocks, as described in [Lamport, 1978], to determine the modification
dates of transactions. In a nutshell, when transaction A begins, it rea ...
mmap 使用
1. 1mmap 映射1G大小的文件,如果超过1G,再新建一个1G的mmap,映射的位置当前的位置。
2. 1mmap 映射128M大小,没超过128M,就重新从头来mmap,大小增加128M。
性能 2 > 1
ruby on rails 打包
- 博客分类:
- rails
1. 打包Gems
有用的命令
# rake gems # List the gems that this rails application depends on
# rake gems:install # Installs all required gems for this application.
# rake gems:unpack # Unpacks all gems into vendor/gems.
# rake gems:unpack:dependencies # Unpack all dependenci ...
做中文查询纠错,需要一个拼音到中文词汇的对应表。网上找不到,只要利用baidu来构建一个。
原理:
难点是多音字。输入一个词,根据拼音汉字表,可以得到其搜有发音,比如“银行”的发音有可能有 “yinhang”, “yinxing”,哪一个才是对的呢?
发送 GET 请求到 to baidu.com,
"http://www.baidu.com/s?bs=zhongguo&f=8&wd=yinhang"
从搜索结果可以得到,
您要找的是不是: 银行 ,
百度一下,找到相关网页约170,000篇,用时 0.070秒
这样就可以知道” yinhang ...
在64位机器上
sizeof(size_t) = 8
sizeof(unsigned int) = 4
size_t a = 4;
boost::any b = (a);
boost::any_cast<unsigned int>(b);
会抛出 异常信息
Detail: boost::bad_any_cast: failed conversion using boost::any_cast
1. Important things > urgent things
To fix bug in QC is urgent , to prevent and discover bug beforehand is important.
To test the tescases listed in QC is urgent, to add similar testcases to smoketest is important.
To find out why bug occur is more important than to find what the bug is how to f ...
string sf1[] = { "SAd", "aaA" };
那sizeof sf = ?
对于char *sf2[]={"SAd", "aaA" }呢?
那应该等于多少呢?答案
sizeof(sf1)= 2*sizeof(string)= 16;
sizeof(sf2)= 2*sizeof(*sf2)=2*一个指针的大小=8
本人的小网站,小游戏搜索引擎 http://www.wanhuir.com
欢迎光顾