随笔分类 -  Language

摘要:```#include #include #include bool divby5(int x){ return x % 5 ? 0 : 1;}int square(const int x){ return x*x;}void find_sample(){ int num_find = 6; std... 阅读全文
posted @ 2015-04-15 15:42 Lcnoctave 阅读(157) 评论(0) 推荐(0)
摘要:```1. install pip - goto[pip](https://pip.pypa.io/en/latest/installing.html)develop页面,download get-pip.py - python get-pip.py --proxy="[user:passw... 阅读全文
posted @ 2015-04-03 00:13 Lcnoctave 阅读(297) 评论(0) 推荐(0)
摘要:# C++ 11 lamada- ```[capture-list](params)mutable(optional) exception attribute -> ret {body}```- lamada表达式允许捕获局部变量,而类的成员变量则需要捕获this,as:```[this](){}`... 阅读全文
posted @ 2015-04-01 19:22 Lcnoctave 阅读(354) 评论(0) 推荐(0)
摘要:```Choose``` 阅读全文
posted @ 2014-11-27 14:23 Lcnoctave 阅读(810) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2014-11-16 18:27 Lcnoctave
摘要:首先吐个槽:python字符串有find,find,index, rindex, 都是只能查找一次字符串出现的位置, 可别说还有个count:出现的次数都返回了,愣是没给出出现的位置!!!在python3的文档里也没有发现有支持的function......好吧,手工写一个(查找字符串中所有的反斜杠... 阅读全文
posted @ 2014-11-13 21:28 Lcnoctave 阅读(15511) 评论(1) 推荐(0)
摘要:![](http://images.cnitblog.com/blog/584382/201411/131747519448426.gif)- 上面是这几个类的继承关系,都需要包含,ifstream输入,ofstream输出,fstream既输入又输出> ios::in 输入(读) ios::o... 阅读全文
posted @ 2014-11-13 18:14 Lcnoctave 阅读(451) 评论(0) 推荐(0)
摘要:* [stackoverflow:] ( http://stackoverflow.com/questions/1711/what-is-the-single-most-influential-book-every-programmer-should-read?tab=votes#tab-top )... 阅读全文
posted @ 2014-11-10 23:33 Lcnoctave 阅读(273) 评论(0) 推荐(0)
摘要:关于回调函数网上一直讲的云里雾里貌似深奥其实回调函数就是一函数指针,除此之外没有别的特殊之处之所以用回调是因为它是函数的句柄,具体的实现可以放到其他任何地方,常被用于构造一模块一部分功能交由另外一个模块完成而回调与异步也没有特殊的关系,其本身没有异步的功能,只是常常在异步编程中被用来两个线程通信而已 阅读全文
posted @ 2014-07-28 23:50 Lcnoctave 阅读(152) 评论(0) 推荐(0)
摘要:指针是C语言中公认的最为强大的语法要素,但同时也是最难理解的语法要素,它曾给程序员带来了无数麻烦和痛苦,以致于在C语言之后诞生的很多新兴 语言中我们再也难觅指针的身影了。下面是一个最简单的C语言指针的例子:int a = 5;int *p = &a;其中p就是一个指针变量。如果C语言中仅仅存在这类指针,那显然指针不会形成“大患”。经常地我们会在代码中看到下面的情形:int **q = &p;int ***z = &q;随着符号'*'个数的增加,C代码的理解复杂度似乎也曾指数级别增长似的。像q、z这样的指向指针的指针(pointer to pointer 阅读全文
posted @ 2014-03-17 22:29 Lcnoctave 阅读(442) 评论(0) 推荐(0)