09 2018 档案
摘要:#define LIGHT_SPEED 3e8 // m/sec (in a vacuum)
阅读全文
摘要:import MySQLdb import sys db = MySQLdb.connect(host="127.0.0.1", # your host, usually localhost user="root", # your username passwd="111111", # ...
阅读全文
摘要:https://stackoverflow.com/questions/9439480/from-import-vs-import
阅读全文
摘要:#!/usr/bin/python # Hello World def order(): print("haha") print('Hello World!') order()
阅读全文
摘要:def reverse(data): for index in range(len(data)-1, -1, -1): yield data[index] for char in reverse('golf'): print char
阅读全文
摘要:class Dog: def __init__(self, name): self.name = name self.tricks = [] # creates a new empty list for each dog def add_trick(self, trick): self.tricks.append(tric...
阅读全文
摘要:int (*pf)(void); int f(void) { pf = &f; // 没问题 pf = ***f; // 取址? pf(); // 函数指针可以调用? (****pf)(); // 这又是什么? (***************f)(); // 这个够变态了吧? }
阅读全文
摘要:https://coolshell.cn/articles/11466.html
阅读全文
摘要:c++数组不支持多态 https://coolshell.cn/articles/9543.htmlwhy gcc in c++ https://airs.com/ian/cxx-slides.pdfc++坑多吗 https://coolshell.cn/articles/7992.htmlwhy
阅读全文
摘要:select * from federatedTest where name='aaa';(gdb) p *start_key$2 = {key = 0x7f64f4103be8 "", length = 23, keypart_map = 1, flag = HA_READ_KEY_EXACT}(
阅读全文
摘要:http://www.yolinux.com/TUTORIALS/C++Singleton.html
阅读全文
摘要:void String::print(String *str) { char *st= (char*)Ptr, *end= st+str_length; for (; st append(STRING_WITH_LEN("\\\\")); break; case '\0': str->append(STRING_WITH_LEN("\\0")); ...
阅读全文
摘要:长度相对固定,浪费不明显的情况下 用定长的字符串 长度不固定,变化区间可能很大 用变长的 性能 考虑预分配一个能包含90%场景的的长度
阅读全文
摘要:for (std::list::iterator iterator_condition_columns = \ condition_columns.begin();;){ begin_offset += sprintf(condition_begin_limit_rows + begin_offset, "%s asc", \ ...
阅读全文
摘要:全局变量在main函数之前初始化原则上禁止拷贝构造函数和赋值函数如果只有数据,没有方法,可以用struct析构函数声明为虚函数尽量避免重载操作符 难以定位的bug 误以为简单的操作存取控制 可以放到声明文件中 输入参数为值或者常数引用,输出参数为指针overloading 函数名相同,但是参数不同o
阅读全文
摘要:int handler::sample_next(uchar *buf) { // Temporary set inited to RND, since we are calling rnd_next(). int res = rnd_next(buf); std::uniform_real_distribution rnd(0.0, 1.0); while (!res && ...
阅读全文
摘要:#include #include int main(int argc, char **argv) { MYSQL *con = mysql_init(NULL); if (con == NULL) { fprintf(stderr, "%s\n", mysql_error(con)); exit(1); } if (mysql_real_c...
阅读全文
摘要:#include using namespace std; /* start of Enclosing class declaration */ class Enclosing { private: int x; /* start of Nested class declaration */ class Nested { ...
阅读全文
摘要:/* update the time of the last modification (in handler::update_time) */ #define HA_STATUS_TIME 4 /* update the 'constant' part of the info: handler::max_data_file_length, max_index_fil...
阅读全文
摘要:好开心,再也不用再多个工具之间切换了,哈哈 擦,功能太弱
阅读全文
摘要:#include using namespace std; int main () { // declare simple variables int i; int j; double d; // declare reference variables int& r = i; double& s = d; j = 1...
阅读全文
摘要:#include #include class destructor_test{ public: ~destructor_test(){ std::cout << "~destructor_test" << std::endl; } }; class test{ private: destructor_test destructor_test_instance; };...
阅读全文
摘要:一旦类初始化,那么对象必然会被创建,指针则可以在需要时候再去初始化所指向。
阅读全文