cosail

  博客园  :: 首页  ::  ::  ::  :: 管理

2014年5月16日

摘要: Vim替换----------------------------------------------------------substitute命令: :[range]s/from/to/[flags]from替换成to指定的字符串(from可为正则表达式,to可为空)range:范围,可以通过... 阅读全文
posted @ 2014-05-16 21:35 cosail 阅读(341) 评论(0) 推荐(0) 编辑

2014年5月9日

摘要: 格式化全文: gg 到达文件最开始 = 要求缩进 G 直到文件尾 自动缩进当前行: ==格式化当前光标接下来的n行: n==格式化选定的行: v选中需要格式化的代码段 = 缩进选定的行: v选中需要格式化的代码段 >或< 右或左缩进 阅读全文
posted @ 2014-05-09 12:17 cosail 阅读(132) 评论(0) 推荐(0) 编辑

2014年5月8日

摘要: Ubuntu14.04下:1. 安装cups 和cups-pdf,其中cups-pdf是虚拟打印的主要模块: sudo apt-get install cups-pdf2. cups-pdf 的 backend 要求 root 权限,所以设置一下权限: sudo chmod 4755 /usr/... 阅读全文
posted @ 2014-05-08 15:37 cosail 阅读(277) 评论(0) 推荐(0) 编辑

2014年5月1日

摘要: *************************** list.txt : 目录 ********************************1. variable.sh2. condition.sh3. control.sh4. AndOr.sh5. statementBlock.sh6. ... 阅读全文
posted @ 2014-05-01 17:31 cosail 阅读(268) 评论(0) 推荐(0) 编辑

2014年4月19日

摘要: #include #include #include //access() #include //创建多级目录 int createMultiLevelDir(char* sPathName) { char DirName[256]; int i, len; strcpy(Di... 阅读全文
posted @ 2014-04-19 21:17 cosail 阅读(4483) 评论(0) 推荐(0) 编辑

摘要: #include #include //strrchr(), strncpy()#include //realloc()#include //readlink()#define MAXBUFSIZE 1024//通过链接文件名获取被目标文件绝对路径//为了防止buffer不够大,包... 阅读全文
posted @ 2014-04-19 19:03 cosail 阅读(2076) 评论(0) 推荐(0) 编辑

2014年4月8日

摘要: #include #include int use_strtok(){ char str[] = "192.168.1.222"; char* token[4] = {}; token[0] = strtok(str, "."); //第一次调用strtok(), 第一个参数是要取词的字符串 ... 阅读全文
posted @ 2014-04-08 22:54 cosail 阅读(197) 评论(0) 推荐(0) 编辑

摘要: #include #include #include //atoi(), 这里用不了itoa()函数(不属于标准)//字符串形式到整数形式int IP_str2int(const char *IP){ char* token = NULL; int intIP = 0; char strIP[16... 阅读全文
posted @ 2014-04-08 22:48 cosail 阅读(1611) 评论(0) 推荐(0) 编辑