2013年9月25日

suffering-oriented programming, by Nathan

摘要: http://nathanmarz.com/blog/suffering-oriented-programming.html 阅读全文

posted @ 2013-09-25 10:23 Torstan 阅读(129) 评论(0) 推荐(0) 编辑

2013年7月9日

write a macro to judge big endian or little endian

摘要: Big endian means the most significant byte stores first in memory. int a=0x01020304, if the cpu is big endian, data are store 01 02 03 04 in memory in increasing address.Below is a simple code to make the judgement.//execute the following cmd on the command line, //Judge the output, 1 for little end 阅读全文

posted @ 2013-07-09 21:07 Torstan 阅读(411) 评论(0) 推荐(0) 编辑

2013年5月28日

how does vector work?

摘要: Currently, I am finding a bug related to meory allocated by vector. I have some findings about the mechanism of vector.0. vector maintains 3 pointers:_M_start,_M_finish, and_M_end_of_storage. At first, vector is empty, i.e._M_start=_M_finish=_M_end_of_storage=NULL.invariant: elements are stored in [ 阅读全文

posted @ 2013-05-28 20:29 Torstan 阅读(224) 评论(0) 推荐(0) 编辑

2013年4月17日

install and use zookeeper C client API

摘要: 1. install zookeeper in cluster参考前面的STORM安装http://www.cnblogs.com/Torstan/archive/2013/03/07/2948319.html2. install zookeerper C client APIcd zookeeper-3.3.5/src/cautoreconf -ifIf this happens, we need install cppunit1.10.2 . $ autoreconf -if>> aclocal:configure.ac:33: warning: macro `AM_PATH_ 阅读全文

posted @ 2013-04-17 19:33 Torstan 阅读(1478) 评论(0) 推荐(0) 编辑

2013年4月7日

install and use boost::thread

摘要: I am describing how to use boost::thread libaray below.step1. download boost fromhttp://www.boost.org/, e.g.boost_1_52_0.tar.gzstep2. extract the fileboost_1_52_0.tar.gz toboost_1_52_0step3. cd to the boost file, boost_1_52_0, and exectutesh bootstrap.sh --prefix=$HOME/boost --with-libraries=threads 阅读全文

posted @ 2013-04-07 20:34 Torstan 阅读(273) 评论(0) 推荐(0) 编辑

an array of zero length

摘要: an array of zero length is a hack which is used to for variable size of array, since the element of zero length in a struct does not exist from the point of view of the storage, while it exists from the point of the compiler.Here is a sample code.#include <stdio.h>#include <stdlib.h>stru 阅读全文

posted @ 2013-04-07 19:56 Torstan 阅读(228) 评论(0) 推荐(0) 编辑

2013年3月28日

The science of programming

摘要: The science of programming is to make building blocks that people can understand and useeasily, and peopel will work together to solve very largest problems together. 阅读全文

posted @ 2013-03-28 10:47 Torstan 阅读(178) 评论(0) 推荐(0) 编辑

2013年3月7日

安装STORM

摘要: 1.安装单机版Storm的依赖软件比较多,需要装Python、zookeeper、zeromq以及jzmq,然后才是storm的安装。1.1安装Python2.7.2#下载python,http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz#tarzxvfPython-2.7.2.tgz#cdPython-2.7.2#./configure#make#makeinstall#vi/etc/ld.so.conf追加/usr/local/lib/#sudoldconfig1.2安装java#下载java,下载版本1.6.0_32#cp-r/p 阅读全文

posted @ 2013-03-07 16:28 Torstan 阅读(812) 评论(0) 推荐(0) 编辑

2012年11月19日

explicit instantiations in template class/function

摘要: 1. explicitinstantiation of template functionIn a.h, an interface of template function is declared, and the implementation of the template function is defined in a.cc.In a.cc, we should add code to specify certain type of instatiations of the function so that the instantiation can be complied in fin 阅读全文

posted @ 2012-11-19 12:04 Torstan 阅读(310) 评论(0) 推荐(0) 编辑

2012年11月12日

How does gdb work?

摘要: http://www.alexonlinux.com/how-debugger-worksSIGTRAP is used as a mechanism for a debugger to be notified when theprocess it's debugging hits a breakp... 阅读全文

posted @ 2012-11-12 14:36 Torstan 阅读(287) 评论(0) 推荐(0) 编辑

导航