ruby-doc.org/core-2.1.2/String.html
2014-09-03 15:54 · ruby
typedef struct atom { int element; struct atom *next; }; vs. typedef struct { int element; struct atom *next; } atom; http://stackoverflow.com/questions/18806392/typedef-struct-declarations
2014-04-29 16:18 · c
#include <iostream> #include <tr1/functional> using std::tr1::bind; using std::tr1::function; using std::tr1::placeholders::_1; using std::tr1::placeholders::_2; class CTest { public: int test( int a, int b , int c, int d) { return a - b + c*d; } }; int main() { CTest obj; std::tr1::function<int(in…
2014-03-10 16:49 · c++
http://stackoverflow.com/questions/21558/in-c-what-is-a-virtual-base-class 主要是为了避免歧义。
2014-01-27 10:20 · c++
http://www.iteye.com/topic/1125183
2014-01-27 10:10 · java
最近在学习c,话说从java转向c真的蛮痛苦。Anyway,学习就是一份好经历。 看到如下一段code: #define APP_TOOL_OP_TYPES(f) \ f(SIMPLE, "simple", FALSE) \ f(JSON, "json", TRUE) \ f(PYTHON, "python", TRUE) \ typedef enum { APP_TOOL_OP_INVALID, #define DEFINE_OP_TYPE(_x, _y, _z) APP_TOOL_OP_##_x, APP_TOOL_OP_TYPES(DEFINE_OP_TYPE) #undef DEFI…
2014-01-26 10:04 · c
看了这个java nio的教程,明白了什么是Selector.wakeUp() http://ifeve.com/selectors/ wakeUp() 某个线程调用select()方法后阻塞了,即使没有通道已经就绪,也有办法让其从select()方法返回。只要让其它线程在第一个线程调用select()方法的那个对象上调用Selector.wakeup()方法即可。阻塞在select()方法上的线程会立马返回。 如果有其它线程调用了wakeup()方法,但当前没有线程阻塞在select()方法上,下个调用select()方法的线程会立即“醒来(wake up)”。
2014-01-10 21:28 · java
The bug and fix is at https://issues.apache.org/jira/browse/HADOOP-10110
2014-01-06 13:18 · hadoop