摘要: using namespace std;templatesplit(const T & str, const T & delimiters, vector& result) { vector v; T::size_type start = 0; auto pos = str.find(delimiters, start); while(pos != T::npos) { if(pos != start) // ignore empty tokens v.emplace_back(str, start, pos - start); start = pos + delimi 阅读全文
posted @ 2013-07-02 13:23 LambdaTea 阅读(457) 评论(0) 推荐(0) 编辑
摘要: int seed = 1;int rand() { return ( (seed = seed *214013 + 2531011) >> 16 ) & 32767;} 阅读全文
posted @ 2013-01-13 11:44 LambdaTea 阅读(128) 评论(0) 推荐(0) 编辑
摘要: vim /usr/bin/yum#!/usr/bin/python2.4(指定使用2.4的版本,如果没有,从别的机器copy一份) 阅读全文
posted @ 2013-01-11 16:56 LambdaTea 阅读(187) 评论(0) 推荐(0) 编辑
摘要: http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/ 阅读全文
posted @ 2013-01-06 16:47 LambdaTea 阅读(77) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <vector>#include <algorithm>#include <boost/bind.hpp>class PrintInt {public: void Print(int i);};void PrintInt::Print(int i) { std::cout << i << std::endl;}int main(int argc, char* argv[]) { std::vector<int> vecs; for(int i = 0; i 阅读全文
posted @ 2012-10-30 11:31 LambdaTea 阅读(494) 评论(0) 推荐(0) 编辑
摘要: D:\WinDDK\7600.16385.1\Debuggers>symchk /r c:\windows\system32 /s SRV*e:\localsymbols*http://msdl.microsoft.com/download/symbols 阅读全文
posted @ 2012-10-29 14:21 LambdaTea 阅读(93) 评论(0) 推荐(0) 编辑
摘要: // for_each. Apply a function to every element of a range.template <class _InputIter, class _Function>_Function for_each(_InputIter __first, _InputIter __last, _Function __f) { __STL_REQUIRES(_InputIter, _InputIterator); for ( ; __first != __last; ++__first) __f(*__first); return __f;}__f(T);. 阅读全文
posted @ 2012-09-04 10:39 LambdaTea 阅读(704) 评论(0) 推荐(0) 编辑
摘要: http://en.wikipedia.org/wiki/C%2B%2B11#Explicit_overrides_and_final 阅读全文
posted @ 2012-08-31 10:53 LambdaTea 阅读(135) 评论(0) 推荐(0) 编辑