发布时间:2014-08-23 16:34:36
顺时针旋转点击(此处)折叠或打开rotated = zip(*original[::-1])逆时针旋转点击(此处)折叠或打开rotated_ccw = zip(*original)[::-1]这里主要用到zip函数定义:zip([iterable, ...])zip()是Python的一个内建函数,它接受一系列可迭代的.........【阅读全文】
发布时间:2014-08-12 08:44:15
点击(此处)折叠或打开std::vector split(const std::string &s, char delim,) { std::vector &elems std::stringstream ss(s); std::string item;.........【阅读全文】
发布时间:2014-03-01 22:38:23
最近在看mongoose的源代码,发现里面有一条宏定义是这样的:点击(此处)折叠或打开#define DBG(x) do { printf("%-20s ", __func__); printf x; putchar('\n'); \ fflush(stdout); } while(0) google了下发现这个do{..}while(0)主要是为了.........【阅读全文】
发布时间:2014-02-24 14:02:53
Linux c多线程编程时创建线程的函数:int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine) (void *), void *arg);给子线程传递参数要通过void *类型的arg参数,大多传递参数都是传.........【阅读全文】