05 2014 档案

摘要:SQLite 支持三种线程模式:1. 单线程模式 这种模式下,没有进行互斥,多线程使用不安全2. 多线程模式 这种模式下,在多线程中使用单个数据库连接是不安全的,否则就是安全的。(译注:即不能在多个线程中共享数据库连接)3. 串行模式 这种模式下,sqlite是线程安全的。(译注:即使在多个线程中不... 阅读全文
posted @ 2014-05-30 23:17 anjsxz 阅读(276) 评论(0) 推荐(0) 编辑
摘要:http://en.cppreference.com/w/cpp/io/clogclog绑定到标准错误的 ostream 对象。默认情况下,写到 clog 时是带缓冲 的。通常用于将程序执行信息写入到日志文件中C++ 中,把负值赋给 unsigned 对象是完全合法的,其结果是 该负数对该类型的取值个数求模后的值L’a’ 宽字符字面值与其他变量不同,除非特别说明,在全局作用域声明的 cons... 阅读全文
posted @ 2014-05-23 06:05 anjsxz 阅读(153) 评论(0) 推荐(0) 编辑
摘要:find_last_of 找不到值时 返回很大的数, 阅读全文
posted @ 2014-05-21 16:21 anjsxz 阅读(410) 评论(0) 推荐(0) 编辑
摘要:lint /splint---------------------------------------------------------------------------------左值表示存存储在计算机内存中的对象NUL 结束一个ACSII字符串NULL表示什么也不指向------------------------------------------------------------... 阅读全文
posted @ 2014-05-21 06:44 anjsxz 阅读(212) 评论(0) 推荐(0) 编辑
摘要:-lboost_serializationhttps://www.ibm.com/developerworks/cn/aix/library/au-boostserialization/#include #include #include #include 无需额外编码,就可以将C++编程语言中的很多元素序列化。类、类指针、数组和 Standard Template Library (... 阅读全文
posted @ 2014-05-17 08:54 anjsxz 阅读(309) 评论(0) 推荐(0) 编辑
摘要:scp ~/.ssh/id_rsa.pub username@xxx.xx:~/.ssh/authorized_keys 阅读全文
posted @ 2014-05-16 23:08 anjsxz 阅读(128) 评论(0) 推荐(0) 编辑
摘要:取的文件大小1.int fd = open("data.txt",O_RDONLY); int len = lseek(fd,0,SEEK_END);2.structstatsb; if ((fstat(fd, &sb)) == -1) { perror("fstat"); }sb.st_size3... 阅读全文
posted @ 2014-05-16 20:16 anjsxz 阅读(131) 评论(0) 推荐(0) 编辑
摘要:std::string ="fsaffaf";char *source=&buf[0]; 阅读全文
posted @ 2014-05-16 10:02 anjsxz 阅读(174) 评论(0) 推荐(0) 编辑
摘要:1. std::ifstream t("example.txt"); std::string str((std::istreambuf_iterator(t)), std::istreambuf_iterator());2void readfile(const std::stri... 阅读全文
posted @ 2014-05-16 09:29 anjsxz 阅读(159) 评论(0) 推荐(0) 编辑
摘要:pugixmlboost.loghttp://www.cryptopp.com/sqlitehttps://github.com/pmed/sqlitepphttps://github.com/neosmart/CppSQLitehttp://sourceforge.net/projects/wxsqlite/ 阅读全文
posted @ 2014-05-15 08:06 anjsxz 阅读(143) 评论(0) 推荐(0) 编辑
摘要:http://zh.highscore.de/cpp/boost/std::auto_ptr 析构的时候调用 delete 操作符来自动释放所包含的对象boost::scoped_ptr / boost::scoped_array不能传递它所包含的对象的所有权 到另一个作用域指针boost::shared_ptr /boost::shared_array在内部记录着引用到某个对象的共 ... 阅读全文
posted @ 2014-05-14 21:57 anjsxz 阅读(267) 评论(0) 推荐(0) 编辑
摘要:An intent service is similar to regular service, with two main exceptions: whatever work is to be done in onHandleIntent() will execute on a separate worker thread, and once it’s done, the service wil... 阅读全文
posted @ 2014-05-14 20:41 anjsxz 阅读(80) 评论(0) 推荐(0) 编辑
摘要:-(UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath{ returnUITableViewCellEditin... 阅读全文
posted @ 2014-05-13 15:04 anjsxz 阅读(116) 评论(0) 推荐(0) 编辑
摘要:要先std::sortstd::set_differencestd::set_union 阅读全文
posted @ 2014-05-13 13:20 anjsxz 阅读(303) 评论(0) 推荐(0) 编辑
摘要:UIImageView *v = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, _msg.contentF.size.width, _msg.contentF.size.height)]; [v setImageWithURL:[N... 阅读全文
posted @ 2014-05-13 11:08 anjsxz 阅读(172) 评论(0) 推荐(0) 编辑
摘要:多线程主要有三种方法:1.基本实现:NSthread ,NSObject =pthread_create() 及基本包装2.NSRunLoop ,本质上是一种多路复用加异步IO,也及reactor核心,或叫EventLoop3.NSOperation/GCD queue ,本质上是一种任务队列加线... 阅读全文
posted @ 2014-05-12 12:06 anjsxz 阅读(119) 评论(0) 推荐(0) 编辑
摘要:sudo apt-get install libstdc++6:i386 libncurses5:i386sudo apt-get install ia32-libs 阅读全文
posted @ 2014-05-12 07:22 anjsxz 阅读(91) 评论(0) 推荐(0) 编辑
摘要:aliases -- Aliases of other commandsbreakpoints -- Making program stop at certain pointsdata -- Examining datafiles -- Specifying and examining filesi... 阅读全文
posted @ 2014-05-10 17:17 anjsxz 阅读(214) 评论(0) 推荐(0) 编辑
摘要:/* Signals. */#define SIGHUP 1 /* Hangup (POSIX). */#define SIGINT 2 /* Interrupt (ANSI). */#define SIGQUIT 3 /* Quit (POSIX). */#define SIGILL ... 阅读全文
posted @ 2014-05-10 15:40 anjsxz 阅读(143) 评论(0) 推荐(0) 编辑
摘要:find . -type f -name "*.h" -o -name "*.cpp" | while read file; do new=$(echo $file | sed -e 's/[0-9-]//g') [ ! -f "$new" ] && mv "$file" "$new"d... 阅读全文
posted @ 2014-05-10 13:30 anjsxz 阅读(119) 评论(0) 推荐(0) 编辑
摘要:#工程里的文件夹SRCDIRS = file1 file2 file3 .#要生成的程序PROGRAMS=main#搜索每个文件夹里的cpp文件SRCS=$(foreach dir,$(SRCDIRS),$(wildcard $(dir)/*.cpp))#每个cpp文件所对应的.o文件OBJS=$(... 阅读全文
posted @ 2014-05-09 19:32 anjsxz 阅读(75) 评论(0) 推荐(0) 编辑
摘要:curl -fsSL https://raw.github.com/supermarin/Alcatraz/master/Scripts/install.sh | sh 阅读全文
posted @ 2014-05-09 14:37 anjsxz 阅读(75) 评论(0) 推荐(0) 编辑
摘要:/etc/sysconfig/network-scripts/ifcfg-eth0IPADDR=x.x.x.xGATEWAY=y.y.y.yNETMASK=x.x.x.xyum -y install openssh-server openssh-clientschkconfig sshd onser... 阅读全文
posted @ 2014-05-08 14:09 anjsxz 阅读(99) 评论(0) 推荐(0) 编辑
摘要:find . -xtype f -perm +111 -print0 | xargs -0 file | grep "ELF" 阅读全文
posted @ 2014-05-08 12:02 anjsxz 阅读(101) 评论(0) 推荐(0) 编辑
摘要:在高性能的网络程序中,使用得最为广泛的恐怕要数 “non-blocking IO + IO multiplexing”这种模型,即 Reactor 模式while (!done){int timeout_ms = max(1000, getNextTimedCallback());int retv... 阅读全文
posted @ 2014-05-07 20:19 anjsxz 阅读(215) 评论(0) 推荐(0) 编辑
摘要:pid_t fork(void);返回值: 若成功调用一次则返回两个值,子进程返回0,父进程返回子进程ID;否则,出错返回-1int socketpair(int d, int type, int protocol, int sv[2]);建立一对匿名的已经连接的套接字int ret = socke... 阅读全文
posted @ 2014-05-06 07:29 anjsxz 阅读(128) 评论(0) 推荐(0) 编辑
摘要:~/Library/Application Support/Developer/Shared/Xcode/Plug-inshttps://github.com/macoscope/CodePilothttps://github.com/JugglerShu/XVimhttps://github.co... 阅读全文
posted @ 2014-05-05 19:03 anjsxz 阅读(115) 评论(0) 推荐(0) 编辑
摘要:WHERE 在分组和聚集计算之前选取输入行(因此,它控制哪些行进入聚集计算), 而 HAVING 在分组和聚集之后选取分组的行。 因此,WHERE 子句不能包含聚集函数; 因为试图用聚集函数判断那些行输入给聚集运算是没有意义的。 相反,HAVING 子句总是包含聚集函数。 (严格说来,你可以写不使用... 阅读全文
posted @ 2014-05-04 09:40 anjsxz 阅读(86) 评论(0) 推荐(0) 编辑
摘要:import urllib2,os;pf='Package Control.sublime-package';ipp=sublime.installed_packages_path();os.makedirs(ipp) if not os.path.exists(ipp) else None;ope... 阅读全文
posted @ 2014-05-03 20:12 anjsxz 阅读(164) 评论(0) 推荐(0) 编辑
摘要:sudo apt-get install cscope;ace-jump-mode(autoload 'ace-jump-mode "ace-jump-mode" t)(eval-after-load "ace-jump-mode" '(ace-jump-mode-enable-mark-sy... 阅读全文
posted @ 2014-05-03 16:43 anjsxz 阅读(152) 评论(0) 推荐(0) 编辑
摘要:explicit可以有效得防止构造函数的隐式转换带来的错误或者误解输出vectorcopy(vec.begin(), vec.end(), ostream_iterator(cout, " "));for (auto c : vec) std::cout << c << ' ';array to vectorvint vec(arr,arr+sizeof arr/sizeof... 阅读全文
posted @ 2014-05-02 14:39 anjsxz 阅读(102) 评论(0) 推荐(0) 编辑
摘要:sudo apt-get install cmakesudo apt-get install libboost-dev libboost-test-devsudo apt-get install libcurl4-openssl-dev libc-ares-devsudo apt-get insta... 阅读全文
posted @ 2014-05-02 14:37 anjsxz 阅读(216) 评论(0) 推荐(0) 编辑
摘要:http://www.cmake.org/cmake/help/v2.8.8/cmake.htmladd_executable的作用是指示CMake生成一个可执行文件add_library的作用是指示CMake生成一个库,根据参数SHARED还是STATIC来决定生成动态库还是静态库include_... 阅读全文
posted @ 2014-05-01 09:31 anjsxz 阅读(321) 评论(0) 推荐(0) 编辑
摘要:runtime bundle/vim-pathogen/autoload/pathogen.vimset nocompatible " be iMproved, requiredfiletype off " required" set th... 阅读全文
posted @ 2014-05-01 06:45 anjsxz 阅读(146) 评论(0) 推荐(0) 编辑
摘要:http://cmakeed.sourceforge.net/eclipse/ cmake -G"Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug -D_ECLIPSE_VERSION=4.2 ../src 项目属性> C/C++ Bu... 阅读全文
posted @ 2014-05-01 06:36 anjsxz 阅读(124) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示