摘要: 1,执行 xinput 查看有哪些输入设备# xinput list? Virtual core pointer id=2 [master pointer (3)]? ? Virtual core XTEST pointer id=4 [slave pointer (2)]? ? PixArt Lenovo USB Optical Mouse id=9 [slave pointer (2)]? ? DualPoint Stick id=12 [slave pointer (2)]? ? AlpsPS/2 ALPS Dua... 阅读全文
posted @ 2014-03-19 17:41 超级忍者龟 阅读(320) 评论(0) 推荐(0)
摘要: set nocompatibleset numberset wrap!filetype onset history=50filetype plugin on"set background=darkcolorscheme pablosyntax onset cursorlineset autoindentset smartindentset tabstop=4set shiftwidth=4set softtabstop=4set noexpandtabset smarttabset showcmdset showmodeset showmatchset vb t_vb=set rul 阅读全文
posted @ 2014-03-18 22:54 超级忍者龟 阅读(109) 评论(0) 推荐(0)
摘要: 打开~/.bashrc文件,最后加入如下:export LANG=zh_CN.UTF-8;export LC_CTYPE="zh_CN.UTF-8";export LC_NUMERIC="zh_CN.UTF-8";export LC_TIME="zh_CN.UTF-8";export LC_COLLATE="zh_CN.UTF-8";export LC_MONETARY="zh_CN.UTF-8";export LC_MESSAGES="zh_CN.UTF-8";export 阅读全文
posted @ 2014-03-18 22:53 超级忍者龟 阅读(321) 评论(0) 推荐(0)
摘要: 打开putty主程序,选择window-〉Appearance-〉Font settings-〉Change Settings,选择Fixedsys字体,字符集选择CHINESE_GB2312。在window-〉Appearance-〉 Translation中,Received data assumed to be in which character set 中,把Use font encoding改为UTF-8如果经常使用,把这些设置保存在session里面.保存方法:再做完以上操作的同时选中以下两项:在window-〉Appearance-〉 Translation中,选中:TReat 阅读全文
posted @ 2014-03-18 22:52 超级忍者龟 阅读(134) 评论(0) 推荐(0)
摘要: 1:打开Source Insight,打开项目,选择基本 2:打开右边文件Utils.em,它是Source Insight启动时候执行的文件,里面都是宏,有兴趣的朋友可以自己添加一些宏命令进去,这里我们要添加一个宏,就是让Backspace删除一个字,在Utils.em末尾添加宏:macro SuperBackspace(){ hwnd = GetCurrentWnd(); hbuf = GetCurrentBuf(); if (hbuf == 0) stop; // empty buffer // get current cursor posti... 阅读全文
posted @ 2014-03-18 22:45 超级忍者龟 阅读(982) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2014-03-17 13:27 超级忍者龟 阅读(143) 评论(0) 推荐(0)
摘要: 双向链表节点数据结构:1 struct list_head {2 struct list_head *next, *prev;3 };链表的初始化:1 static inline void INIT_LIST_HEAD(struct list_head *list)2 {3 list->next = list;4 list->prev = list;5 }添加一个节点: 1 static inline void list_add(struct list_head *new, struct list_head *head) 2 { 3 __list_add(new... 阅读全文
posted @ 2014-03-17 09:47 超级忍者龟 阅读(198) 评论(0) 推荐(0)
摘要: 为了移植性能的考虑,为了同一份代码在不同平台不同CPU下都能正确获得对应平台的各种数据大小范围,Linux下使用的宏是这样的:1 #define INT_MAX ((int)(~0U>>1))2 #define INT_MIN (-INT_MAX - 1)3 #define UINT_MAX (~0U)4 #define LONG_MAX ((long)(~0UL>>1))5 #define LONG_MIN (-LONG_MAX - 1)6 #define ULONG_MAX (~0UL)7 #define LLONG_MAX ((long long... 阅读全文
posted @ 2014-03-15 18:09 超级忍者龟 阅读(1871) 评论(0) 推荐(0)
摘要: 这两个宏在内核中定义如下:1 #define likely(x) __builtin_expect((x),1)2 #define unlikely(x) __builtin_expect((x),0)__builtin_expect() 是 GCC (version >= 2.96)提供给程序员使用的,目的是将“分支转移”的信息提供给编译器,这样编译器可以对代码进行优化,以减少指令跳转带来的性能下降。编译器会根据可能性大小,把非跳转代码紧跟在if之前的代码后面,而把跳转代码放到可能性小的位置。__builtin_expect((x),1) 表示 x 的值为真的可能性更大;... 阅读全文
posted @ 2014-03-14 11:25 超级忍者龟 阅读(263) 评论(0) 推荐(0)