- 博客(14)
- 收藏
- 关注

原创 emacs 下的 php 补全插件 很强大
emacs 下的 php 补全插件 很强大。。https://github.com/xcwen/ac-php
2015-02-25 18:41:15
1458
原创 c++ 检查是否存在成员函数
class HasFoo{public : template class SFINAE {}; template static bool test (SFINAE *) { return true; } template static bool test (...) { return false; }};class B
2014-02-26 11:27:40
1675
原创 emacs 高级的 复制 剪切 粘贴
;;(defun my-copy-lines(num) (point-to-register 0) (beginning-of-line) (let ((begin-point (point))) (forward-line num) (copy-region-as-kill begin-point (point))) (jump-to-re
2013-04-24 10:14:20
1701
原创 在top 中 只查看某个程序的数据
在 .bashrc 中加入function ptop(){ `ps -ef | grep $* | awk 'BEGIN{printf "top "}{printf "-p" $2 " " }'`}使之生效 运行: . .bashrc 查看时运行: ptop 程序名效果如下:==[5]==jim@vmtest:~$ptop apache
2013-04-24 10:09:02
1149
原创 shell 日期运算 指定日期
如果用好了date ,你将不要做很多的日期运算。。如: 前天: date +%Y%m%d -d " -2 day"如: 2007/2/12 前14天是什么: date +%Y%m%d -d " 2007/02/12 -14 day"还有比如: date +%Y%m%d -d'2007/02/12 -1 month -1 year -24 day' 看得懂不??上
2013-04-24 10:06:40
1517
原创 C 使用宏 编译期 二进制表示
在游戏精粹3中的“C 宏 重现光辉”中对宏有相当独到的用法,网络上没看到相关资料,现大略写下。//---a.c-----#define Bin0000 0x00#define Bin0001 0x01#define Bin0010 0x02#define Bin0011 0x03#define Bin0100 0x04#define Bin0101 0x
2013-04-24 10:03:58
743
转载 把无限循环小数化为分数
把无限循环小数化为分数给定一个无限循环小数,我们是否能把它化为分数呢?其实方法也很简单,其关键在于利用「无限循环」这一点。例如,给定小数0.272727...,如何把它化为分数呢?我们可以先把它写成1 x 0.272727... = 0.272727... (1)由于这个小数包含两个循环数字,我们把它乘以100:100 x 0.272727... = 27.2727... (2)
2013-04-24 09:59:59
1966
原创 extjs4 tree panel grid 按每一行的内容指定editor
目前extjs4 grid 似乎只能对一整列指定editor.但在使用treepanel时 需要对每个行的数据指定不同的编辑器.一直没有找到相关的方法,目前自己找了一个变通的方案.实现如下: //在cellclick中生成默认的editor,让程序调用到beforeedit this.on("cellclick",this.onCellClick , this);
2013-04-24 09:57:05
1254
原创 utf-8 变长字节的算法
utf8 不比gb2312 ,后者是两个字节表示一个汉字 , 而utf8是变长的。那么在utf8中多少个字节才是表示一个汉字呢?! 在看wesnoth(很不错的回合制游戏)的源码时,特意注意到这一点。找到了分享之:int byte_size_from_utf8_first(unsigned char ch){ int count; if ((ch
2013-04-24 09:44:51
1877
原创 emacs etags 为函数申明生成定义
etags 默认是没有为函数申明生成定义的。使用 etags --declarations 参数就可以为.h 文件中的函数申明生成定义。网络上一直没有找到相关的说明。在此记下。
2013-04-24 09:40:53
678
原创 rtx消息 虚拟机xp 通知到 主机ubuntu
<!--html {font-family:Times,serif; font-size:12pt}.title {text-align:center}.todo {color:red}.done {color:green}.tag {background-color:#add8e6; font-weight:normal}.timestamp
2013-04-23 16:56:01
2281
原创 C regex 匹配汉字的方法
网络上没有找到相关方案,试了半天,算是总算是ok, 分享之#include #include #include int check_nick ( const char * nick){ regex_t re; int ret; regmatch_t pm[10]; if ((ret= regcomp(&re, "^\
2013-04-23 16:46:59
2109
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人