read and write file is a very common operation regarding file mainuplation.However, the powerfull getline only can read line by line(with new line cha...
分类:
其他好文 时间:
2014-10-24 12:54:51
阅读次数:
161
异步客户端/服务端
现在,是比较有趣(也比较难)的异步!
当查看图表时,你需要知道Boost.Asio代表由Boost.Asio执行的一个异步调用。例如do_read(),Boost.Asio和on_read()代表了从do_read()到on_read()的逻辑流程,但是你永远不知道什么时候轮到on_read(),你只是知道你最终会调用它。...
分类:
编程语言 时间:
2014-10-24 11:04:03
阅读次数:
262
from sys import argvscript, input_file = argvdef print_all(f): print f.read() def rewind(f): f.seek(0)def print_a_line(line_count, f): pri...
分类:
其他好文 时间:
2014-10-24 10:25:01
阅读次数:
253
Spring-framework source codegit url: git clone git://github.com/SpringSource/spring-framework.git导入IDERun ./import-into-eclipse.sh or read import-into...
分类:
编程语言 时间:
2014-10-24 06:54:55
阅读次数:
186
1.私钥不能读取read private data error因为是先搞的安卓,所以前部分申请,上传公钥都是安卓那边的同事做了,于是我直接从同事那里拿了私钥和公钥。不能读取怀疑过私钥没转pcks8,但是我自己在mac上转报错unable read data。。。所以我以为这个是转过的所以不能再转。坑...
分类:
移动开发 时间:
2014-10-24 01:38:15
阅读次数:
189
BufferedInputStream 自带 8M 缓冲区,我们自己又定义 byte[] buf = new byte[1024*1024];那 bis.read(buf) 就会去, 8M 缓冲区取数据, 读到自己的 1M 缓冲区, 直到碰到 bos.write(buf,0,len) 把1M缓冲区的...
分类:
其他好文 时间:
2014-10-24 01:33:42
阅读次数:
212
select @@tx_isolation; //查看隔离级别
set transaction isolation level read uncommitted; //设置读未提交级别
start transaction; //打开事务
rollback; //回滚
commit; //提交
set transaction isolation leve...
分类:
数据库 时间:
2014-10-23 17:46:58
阅读次数:
206
问题现象:
在从.gz文件中按一定缓存大小读取文件时,会莫名其妙地出现重复读取让此一读过的数据:
例如,第一次:
abcdefghi
第二次读取成了:
jkldefghi
原因:
百思不得其解,后来看网络上有说法说read方法不一定将缓存填满。
于是上述现象得到了解释,即第二次其实只读到了jkl这几个字符,而后面的defghi又没有被清除掉,于是出现了上述现象。
解决方法:
每...
分类:
其他好文 时间:
2014-10-23 16:19:13
阅读次数:
256
原因使用Eclipse+maven构建项目build完之后,会在项目顶上显示一个叹号.打开problem显示原因为对应的jar包损坏.如图:解决方案使用别的版本的jar包自己上网找到没问题的jar包进行替换补充关于有人说可以在.classpath文件中删除这个对应的依赖来解决问题实质是治标不治本.不...
分类:
系统相关 时间:
2014-10-23 14:04:00
阅读次数:
23534
from sys import argvscript, filename = argvtxt = open(filename)print "Here's your file %r:" % filename print txt.read()print "Type the filename again:...
分类:
其他好文 时间:
2014-10-23 14:03:25
阅读次数:
129