存档

2009年7月10日 的存档

完全使用Linux工作

2009年7月10日 davidzhao 4 条评论

工作后很久以来,我一直在Linux环境下工作,除了偶尔的需要在Windows 上面使用MSVC编译运行一些测试和示例程序之外。不过我是在Windows XP上面使用cygwin来模拟Linux环境的,外加ssh到一个Linux服务器做一部分工作。Cygwin几乎可以完全地模拟Linux环境,但是偶尔还是会感到不方便。而我之前没有在laptop上面安装和使用 Linux是因为我偶尔需要使用qq,以及有些网站不用IE无法正确地使用。 阅读全文…

分类: David Zhao, 生活圆桌 标签:

Berkeley DB Performance Test

2009年7月10日 davidzhao 4 条评论

各位读者,很抱歉这篇文章是英文的,我当初做笔记的时候,写成英文了,这样才可以在同事之间交流。而现在确实没时间翻译过来了,还望大家理解,谢谢!

In this article I’d like to talk about the caveats and how-to’s when doing performance test with Berkeley DB, when the data volume is huge. For legal reasons I can not publish the result of my test without further approval, so I decided not to do so.

I. Context

I need to insert 10 billion key/data pairs to a btree database, each key item is 768 bytes, with no duplicate keys, and keys are inserted increasing only; each data item varies between KB/2 to 1KB. Thus each key/data pair varies between 1.25KB to 2KB.

阅读全文…

gcc4.4 issues

2009年7月10日 davidzhao 评论已被关闭

各位读者,很抱歉这篇文章是英文的,我当初做笔记的时候,写成英文了,这样才可以在同事之间交流。 而现在确实没时间翻译过来了,还望大家理解,谢谢!

If your code builds well using gcc4.3 and below, it may not build with gcc4.4, which was released in April 2009.

Following are some of the changes that violates c/c++ standard:

1. gcc4.4 does not by default #include stdio.h, or stdlib.h, no header files are by default included, all header files of standard c/c++ libraries need to be explicitly included.

阅读全文…

C++ Template Corner Cases

2009年7月10日 davidzhao 评论已被关闭

各位读者,很抱歉这篇文章是英文的,我当初做笔记的时候,写成英文了,这样才可以在同事之间交流。而现在确实没时间翻译过来了,还望大家理解,谢谢!

Following are some corner cases of C++ template features. A lot of the text is simply extracted from “C++ Templates: The Complete Guide”, with some of my personal understanding. These features are trivial and easily neglected, but you should have some impression to them in case you run into troubles caused by the neglect.

I made my notes in English, and I don’t bother to translate them into Chinese, forgive my laziness. :)

0. use “typename” to extract type defined within a type parameter, like this: typename T::iterator itr; otherwise the ‘itr’ is treated as a data member of T.

1. zero initialization
When using a var x of type T, we MUST initialize it like this: T x = T(); so that when T is a primitive type, x can also be initialized with 0, or NULL (when T is a pointer type). Of course we must make sure
when T is a class type, it has a default constructor. Simply using T x; can’t initialize x when T is a primitive type. 阅读全文…

分类: David Zhao, 程序设计 标签:
Դ