原创 M-Tree for Similarity Search

My current area of research is similarity search. Just like the normal search process, we need several data structures

原创 Several notes on Redis

These notes on Redis are based on its beta version. One could see its source code on my GitHub, where I have tidied the

原创 A simple implementation of string split in C++

Since string's split function is not naturally provided in C++, we must implement it by ourselves. Here is a simple imp

原创 #undef的用處

如果你想定義這個宏那就#define X如果你不想讓你已經#define X的宏在其他其他地方由於引入了這個包含宏的.h文件而引起一些編譯問題,那你就#undef X掉,就這麼簡單。舉個簡單的例子。有1.c,11.h,12.h三個文件其中

原创 C++11 Concurrency Tutorial – Part 3: Advanced locking and condition variables

In the previous article, we saw how to use mutexes to fix concurrency problems. In this post, we will continue to work

原创 C++11 Concurrency Tutorial – Part 2 : Protect shared data

In the previous article, we saw how to start threads to execute some code in parallel. All the code executed in the th

原创 C++ Singleton

Singleton in C++: #include <iostream> using namespace std; class Restaurant { public: static Restaurant *getInstance(

原创 C++11 Concurrency – Part 1 : Start Threads

C++11 introduced a new thread library. This library includes utilities for starting and managing threads. It also cont

原创 Setting shared (dynamic) library in Eclipse C++ in Linux

1. Build shared library project from Eclipse. 2. Create header (hello.h) and source (hello.cc) file. Build them to c

原创 非阻塞IO和阻塞IO

非阻塞IO 和阻塞IO:        在網絡編程中對於一個網絡句柄會遇到阻塞IO 和非阻塞IO 的概念, 這裏對於這兩種socket 先做一下說明:        基本概念:               阻塞IO::      

原创 Convert skills in C++, including int, double, float, bool with string

#include <sstream> // must #include <iostream> using namespace std; int main() { stringstream ss; /************ int

原创 Understanding of extern "C"

In this example, there are two files, namely f1.c and test.cc. f1.c void f1() { return; } test.cc extern "C" { ext

原创 Two ways using global objects in C++

1.Through include Globe.h #ifndef GLOBE_H_ #define GLOBE_H_ int g = 0; #endif /* GLOBE_H_ */ A.h #ifndef A_H_ #defin

原创 Code analysis of Hadoop v0.1.0 (2) conf package

conf package is about the configuration set about the whole system, which is frequently used in other packages. So we f

原创 Big-endian and little-endian

Big-endian is used in the network transmission, while Little-endian is popular in x-86 systems. Two pictures follow. P