09 2018 档案

摘要:否则调用基类指针时,派生类的析构函数没有被使用 阅读全文
posted @ 2018-09-30 11:52 友哥 阅读(184) 评论(0) 推荐(0)
摘要:a 阅读全文
posted @ 2018-09-30 11:31 友哥 阅读(333) 评论(0) 推荐(0)
摘要:#define LIGHT_SPEED 3e8 // m/sec (in a vacuum) 阅读全文
posted @ 2018-09-30 10:51 友哥 阅读(142) 评论(0) 推荐(0)
摘要:赞 阅读全文
posted @ 2018-09-30 10:42 友哥 阅读(242) 评论(0) 推荐(0)
摘要:sql_set_variables 阅读全文
posted @ 2018-09-29 17:58 友哥 阅读(281) 评论(0) 推荐(0)
摘要:import MySQLdb import sys db = MySQLdb.connect(host="127.0.0.1", # your host, usually localhost user="root", # your username passwd="111111", # ... 阅读全文
posted @ 2018-09-27 10:35 友哥 阅读(157) 评论(0) 推荐(0)
摘要:https://stackoverflow.com/questions/9439480/from-import-vs-import 阅读全文
posted @ 2018-09-26 19:22 友哥 阅读(186) 评论(0) 推荐(0)
摘要:#!/usr/bin/python # Hello World def order(): print("haha") print('Hello World!') order() 阅读全文
posted @ 2018-09-26 19:17 友哥 阅读(718) 评论(0) 推荐(0)
摘要:def reverse(data): for index in range(len(data)-1, -1, -1): yield data[index] for char in reverse('golf'): print char 阅读全文
posted @ 2018-09-26 17:43 友哥 阅读(136) 评论(0) 推荐(0)
摘要: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... 阅读全文
posted @ 2018-09-26 17:34 友哥 阅读(2666) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2018-09-25 17:27 友哥 阅读(107) 评论(0) 推荐(0)
摘要:无法确定其值是多少,很可能是野指针 阅读全文
posted @ 2018-09-24 22:57 友哥 阅读(97) 评论(0) 推荐(0)
摘要:慎用全局变量,即使使用,也要用函数管理起来 阅读全文
posted @ 2018-09-24 18:03 友哥 阅读(117) 评论(0) 推荐(0)
摘要:int (*pf)(void); int f(void) { pf = &f; // 没问题 pf = ***f; // 取址? pf(); // 函数指针可以调用? (****pf)(); // 这又是什么? (***************f)(); // 这个够变态了吧? } 阅读全文
posted @ 2018-09-23 20:40 友哥 阅读(135) 评论(0) 推荐(0)
摘要:https://coolshell.cn/articles/11466.html 阅读全文
posted @ 2018-09-23 11:55 友哥 阅读(168) 评论(0) 推荐(0)
摘要:c++数组不支持多态 https://coolshell.cn/articles/9543.htmlwhy gcc in c++ https://airs.com/ian/cxx-slides.pdfc++坑多吗 https://coolshell.cn/articles/7992.htmlwhy 阅读全文
posted @ 2018-09-23 09:21 友哥 阅读(636) 评论(1) 推荐(0)
摘要:my_global.h 阅读全文
posted @ 2018-09-21 14:56 友哥 阅读(135) 评论(0) 推荐(0)
摘要:头文件尽量加在.cc文件中 只有需要,才加在.h中 阅读全文
posted @ 2018-09-20 20:49 友哥 阅读(177) 评论(0) 推荐(0)
摘要:继承层次尽量少,但是千万不能因为这个原则,违反实际继承关系 阅读全文
posted @ 2018-09-20 20:47 友哥 阅读(95) 评论(0) 推荐(0)
摘要:select * from federatedTest where name='aaa';(gdb) p *start_key$2 = {key = 0x7f64f4103be8 "", length = 23, keypart_map = 1, flag = HA_READ_KEY_EXACT}( 阅读全文
posted @ 2018-09-20 11:16 友哥 阅读(200) 评论(0) 推荐(0)
摘要:http://www.yolinux.com/TUTORIALS/C++Singleton.html 阅读全文
posted @ 2018-09-19 20:44 友哥 阅读(105) 评论(0) 推荐(0)
摘要: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")); ... 阅读全文
posted @ 2018-09-19 14:42 友哥 阅读(201) 评论(0) 推荐(0)
摘要:长度相对固定,浪费不明显的情况下 用定长的字符串 长度不固定,变化区间可能很大 用变长的 性能 考虑预分配一个能包含90%场景的的长度 阅读全文
posted @ 2018-09-18 14:51 友哥 阅读(700) 评论(0) 推荐(0)
摘要:for (std::list::iterator iterator_condition_columns = \ condition_columns.begin();;){ begin_offset += sprintf(condition_begin_limit_rows + begin_offset, "%s asc", \ ... 阅读全文
posted @ 2018-09-18 11:06 友哥 阅读(290) 评论(0) 推荐(0)
摘要:入参合法判断 入参若为对象,存取函数打印出异常情况 阅读全文
posted @ 2018-09-16 17:34 友哥 阅读(194) 评论(0) 推荐(0)
摘要:全局变量在main函数之前初始化原则上禁止拷贝构造函数和赋值函数如果只有数据,没有方法,可以用struct析构函数声明为虚函数尽量避免重载操作符 难以定位的bug 误以为简单的操作存取控制 可以放到声明文件中 输入参数为值或者常数引用,输出参数为指针overloading 函数名相同,但是参数不同o 阅读全文
posted @ 2018-09-16 11:57 友哥 阅读(142) 评论(0) 推荐(0)
摘要:不会转发到子类中 阅读全文
posted @ 2018-09-16 10:56 友哥 阅读(196) 评论(0) 推荐(0)
摘要:在最近使用的地方,再声明和定义 阅读全文
posted @ 2018-09-16 10:51 友哥 阅读(200) 评论(0) 推荐(0)
摘要:调研 整理思路 流程图 类设计 序列图(可能) 阅读全文
posted @ 2018-09-15 17:15 友哥 阅读(210) 评论(0) 推荐(0)
摘要: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 && ... 阅读全文
posted @ 2018-09-15 15:29 友哥 阅读(376) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2018-09-13 19:20 友哥 阅读(348) 评论(0) 推荐(0)
摘要:#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... 阅读全文
posted @ 2018-09-13 19:07 友哥 阅读(1011) 评论(1) 推荐(0)
摘要:#include using namespace std; /* start of Enclosing class declaration */ class Enclosing { private: int x; /* start of Nested class declaration */ class Nested { ... 阅读全文
posted @ 2018-09-13 11:56 友哥 阅读(156) 评论(0) 推荐(0)
摘要:a 阅读全文
posted @ 2018-09-12 15:01 友哥 阅读(97) 评论(0) 推荐(0)
摘要:使用函数数组,实现多态 参考my_strtoll10 阅读全文
posted @ 2018-09-12 11:51 友哥 阅读(148) 评论(0) 推荐(0)
摘要:/* 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... 阅读全文
posted @ 2018-09-12 00:17 友哥 阅读(248) 评论(0) 推荐(0)
摘要:基类和子类接口保持统一,其他可以定制化 阅读全文
posted @ 2018-09-10 21:20 友哥 阅读(120) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2018-09-09 12:06 友哥 阅读(134) 评论(0) 推荐(0)
摘要:一旦重启,很容易就会丢失的 阅读全文
posted @ 2018-09-09 10:20 友哥 阅读(219) 评论(0) 推荐(0)
摘要:好开心,再也不用再多个工具之间切换了,哈哈 擦,功能太弱 阅读全文
posted @ 2018-09-08 22:09 友哥 阅读(275) 评论(0) 推荐(0)
摘要:入参检查,且不正常情况需要打印出来,供排查问题 阅读全文
posted @ 2018-09-07 10:34 友哥 阅读(162) 评论(0) 推荐(0)
摘要:#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... 阅读全文
posted @ 2018-09-06 10:47 友哥 阅读(139) 评论(0) 推荐(0)
摘要:#include #include class destructor_test{ public: ~destructor_test(){ std::cout << "~destructor_test" << std::endl; } }; class test{ private: destructor_test destructor_test_instance; };... 阅读全文
posted @ 2018-09-05 15:30 友哥 阅读(374) 评论(0) 推荐(0)
摘要:一旦类初始化,那么对象必然会被创建,指针则可以在需要时候再去初始化所指向。 阅读全文
posted @ 2018-09-05 14:57 友哥 阅读(266) 评论(0) 推荐(0)
摘要:如果可以只出现在.cc中,就不出现在.h中 阅读全文
posted @ 2018-09-05 14:13 友哥 阅读(126) 评论(0) 推荐(0)
摘要:类图和序列图,对理清思路和代码流程,效果极佳 阅读全文
posted @ 2018-09-05 11:27 友哥 阅读(103) 评论(0) 推荐(0)
摘要:危险的征兆啊 阅读全文
posted @ 2018-09-05 11:16 友哥 阅读(94) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2018-09-04 16:53 友哥 阅读(102) 评论(0) 推荐(0)
摘要:只能通过对象的方式 阅读全文
posted @ 2018-09-04 11:42 友哥 阅读(142) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2018-09-03 21:28 友哥 阅读(98) 评论(0) 推荐(0)
摘要:基类处理流程中的函数,如果子类有实现,就会使用子类的,否则使用基类的。 阅读全文
posted @ 2018-09-03 15:47 友哥 阅读(324) 评论(0) 推荐(0)