2015-07-19 Klaus Ma
Mac Tips: re-configure system default language sudo languagesetup Mac Tips: Delete invalid ico in launch.app 继续阅读 »
2015-06-23 Klaus Ma
#if __cplusplus >= 201103L #include #else // __cplusplus >= 201103L #include #endif // __cplusplus >= 201103L 继续阅读 »
2015-05-24 Klaus Ma
Install dependencies: Install maven manually: wget http://mirrors.cnnic.cn/apache/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz tar zxvf apache-maven-3.3.3-bin.tar.gz mv apache-maven-3.3.3 /usr/local/apache-maven 继续阅读 »
2014-10-12 Klaus Ma
Problem Description: Given a sequence of integers a1, …, an and q queries x1, …, xq on it. For each query xi you have to count the number of pairs (l, r) such that 1 ≤ l ≤ r ≤ n and gcd(al, al + 1, …, ar) = xi. is a greatest common divisor of v1, v2, …, vn, that is equal to a largest positive integer that divides all 继续阅读 »
2014-09-30 Klaus Ma
In Mitigating the shellshock vulnerability (CVE-2014-6271 and CVE-2014-7169), RedHat provide a System-based mitigation by LD_PRELOAD; but there is an issue that it generates core dump when running /lib64/libc.so.6. 继续阅读 »
2014-01-01 Klaus Ma
Environment LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch: graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch Distributor ID: RedHatEnterpriseServer Description: Red Hat Enterprise Linux Server release 6.4 (Santiago) Release: 6.4 Codename: San 继续阅读 »
2013-06-21 Klaus Ma
本以为ACE_Message_Block只是对void*一个简单的封装, 查看了源码发现里还有一层ACE_Data_Block:是一个带引用记数的数据区;ACE_Message_Block::duplicate会对 ACE_Message_Block进行”浅复制”,即两个ACE_Message_Block对象引用同一个ACE_Data_Block对象,但 ACE_Data_Block的引用记数为2; 继续阅读 »
2013-06-05 Klaus Ma
0MQ (also spelled ZeroMQ, 0MQ or ZMQ) was originally a high-performance asynchronous messaging library aimed at use in scalable distributed or concurrent applications. It provides a message queue, but unlike message-oriented middleware, a 0MQ system can run without a dedicated message broker. The library is designed to 继续阅读 »
2013-06-02 Klaus Ma
For the performance tuning, the simplest way is to record how many time is elapsed in a function. The only difficulty we’re facing is that: there maybe many exit for a function. Thanks to C++’s constructor/deconstructor feature, it’s easy for developer to record the elsaped time. 继续阅读 »
2013-03-19 Klaus Ma
The father of C++ said that he never meet MLK issue after using auto pointer. It’s a good practice to use auto pointer to replace malloc/free. There are also some practice for auto pointer. 继续阅读 »