上一页 1 2 3 4 5 6 7 8 9 10 ··· 25 下一页
摘要: vim在centos中的版本为7.0,导致很多插件都无法使用,所以想到升级一下。wget ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2tar jvzf vim-7.4.tar.bz2cd vim74#安装依赖yum install ncurses-de... 阅读全文
posted @ 2014-06-17 10:35 westfly 阅读(702) 评论(0) 推荐(0) 编辑
摘要: 无意中将home下的所有文件都删除了,一些配置文件都丢了。重新登陆后,发现无法加载bashrc。查找后,发现问题不在于bashrc,而在与.bash_profile丢失login shell mode 只会读取 ~/.bash_profile , ~/.bash_login , ~/.profile... 阅读全文
posted @ 2014-06-17 09:53 westfly 阅读(493) 评论(0) 推荐(0) 编辑
摘要: Clover是个好的多Tab资源管理器,但在Win8下总是崩溃啊,让人很崩溃。无奈投奔TotalCommand吧,就是梯度有些高。当然不习惯,也可以使用下XYPlorer 阅读全文
posted @ 2014-05-04 21:37 westfly 阅读(2304) 评论(2) 推荐(0) 编辑
摘要: http://incise.org/hash-table-benchmarks.html 阅读全文
posted @ 2014-04-28 20:21 westfly 阅读(189) 评论(0) 推荐(0) 编辑
摘要: curl -R -O http://www.lua.org/ftp/lua-5.2.3.tar.gz编译代码时,遇到如下错误 /usr/lib/libreadline.so: undefined reference to `tgetnum': /usr/lib/libreadline.so: undefined reference to `tgoto': /usr/lib/libreadline.so: undefined reference to `tgetflag': /usr/lib/libreadline.so: undefined reference to ` 阅读全文
posted @ 2014-03-18 11:09 westfly 阅读(918) 评论(0) 推荐(0) 编辑
摘要: 考虑如下问题假设有两个不定参数的函数void proc_one(int x, ...)void proc_two(...)假设在proc_one中需要将其不定参数部分传递给proc_two中呢?搜索了下,并没有透明的方法,只能再声明一个处理函数void proc_two (va_list ap)为了减少冗余代码,void proc_two(...)的实现为void proc_two(...){ va_list ap; va_start(ap, fmt); proc_two(ap); va_end(ap);}这也是为什么printf有vprintf版本的原因吧。 阅读全文
posted @ 2014-02-27 18:27 westfly 阅读(1071) 评论(0) 推荐(0) 编辑
摘要: 众所周知,map有find,但vector的find只能调用algorithm中的find通用方法。参考《How to find an item in a std::vector?》对于结构体来说,如何定义==呢?想到了重载==操作符,通常的情形是重载相同类型,在例子中,我重载了int类型的。结果也过了,感觉很请强大,具体参考如下代价#include #include using namespace std;struct ReaderInfo { int key; size_t value; bool operator == (const ReaderInfo& other) cons 阅读全文
posted @ 2014-02-24 19:29 westfly 阅读(854) 评论(0) 推荐(0) 编辑
摘要: 基本需求分析完数据后,一般需要将数据以附件的形式发送处理,这个已经在《》中有介绍,如何用Python实现附件的发送。但不是所有人都关心附件的内容,一般邮件中需要有些概要的信息,如附件信息的统计信息等。这就需要以表格的形式发送出来。如何设计一个通用的产生Table的函数,对模块的复用性大有益处。一个表格必备的有表格名,表格各列的解释,数据。如下是我的尝试(代码说明问题)function GenerateTable(){ local header="$1" local title="$2" shift 2 awk -v header="$heade 阅读全文
posted @ 2014-01-23 22:35 westfly 阅读(1909) 评论(0) 推荐(0) 编辑
摘要: 其实不知道该起什么题目。先说下需求,线上的log是按照五分钟为粒度切分的,即每五分钟产生一个文件,19:04的log写入到1900结尾的log文件中,19:05写入到1905结尾的log文件中。在实时分析log的时候,往往需要我们将log的后缀拼接出来,如下是我实现的函数function GenLogSuffixFromUnixTime() { local unix_time=$1 local minute=`date -d @$unix_time +%M` minute=$(((10 + minute)%10)) if [[ $minute -ge 5 ]]; then min... 阅读全文
posted @ 2014-01-23 22:19 westfly 阅读(2649) 评论(1) 推荐(0) 编辑
摘要: 遇到 No module named BeautifulSoup 错误,但是的确从官方下载了BeautifulSoup,并安装成功。后来才发现,有两个BeautifulSoup的版本,一个是2012年停止维护的BeautifulSoup3,还有个是新起的BeautifulSoup4.BeautifulSoup3 是from BeautifulSoup import BeautifulSoup而BeautifulSoup4 中的语句是 from bs4 import BeautifulSoup但所引用的库代码依赖的为BeautifulSoup3,而非安装的BeautifulSoup4。安装好Be 阅读全文
posted @ 2014-01-14 09:13 westfly 阅读(825) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 25 下一页