Recent Posts
-
August 26, 2015
用objcopy来给elf可执行文件加上源码的git的提交版本信息
objcopy 把一个文件全部内容作为elf格式的section插入# git rev-parse HEAD0af0d9e7fb4cbecd5b22f00f1a136c9db933b26d# git rev-parse --short HEAD0af0d9e# cat /tmp/git_commit_hashgit_commit_hash=0af0d9e7fb4cbecd5b22f00f1a136c9db933b26d# objcopy --add-section .git_commi...
-
August 14, 2015
Windows10系统gvim的tagbar插件显示tag侧边栏时点击函数名导致gvim程序崩溃的bug
错误时的调用栈 comctl32.dll!CToolTipsMgr::GetToolAtPoint(struct HWND__ *,int,int,int,int) Unknown comctl32.dll!CToolTipsMgr::ToolAtMessagePos(void) Unknown comctl32.dll!CToolTipsMgr::ShowVirtualBubble(void) Unknown comctl32.dll!CToolTipsMgr::HandleRelaye...
-
July 28, 2015
Golang 的 lib pg 连接 postgresql时碰到ssl renegotiation failurei导致driver bad connection问题
使用 golang lib/pg https://github.com/lib/pq 去连接postgresql时候发生这个错误 2015/07/27 17:48:30 main.go:392: driver: bad connection 出错的代码, rows.Err() 里面得到的错误 for rows.Next() { err = rows.Scan(&id, &typ, &status) } err = rows....
-
July 03, 2015
两个web前端开发库
reacthttp://facebook.github.io/react/index.html管理数据和UI 控件。 数据变化, UI自动更新。 可以通过ajax 修改数据。 写数据到显示界面的映射代码。react 一般推荐的用法是,结合flux架构的使用模式fluxhttps://github.com/facebook/flux一种单数据流向的 action -》 store -》 react component 的 设计模式refluxjshttps://github.com/spo...
-
July 02, 2015
闰秒问题leep Second Problem
听说我们买的网络设备(服务器)由于6月30好的闰秒问题,部署在不同地区的全部这种服务器全部挂了。说是cpu利用率突然变得很高。看上去是旧版本的linux内核更新闰秒的bug,导致futex这些定时器不断超时重试。这里有一些leap second可能导致cpu load 很高的原因的解释http://www.pythian.com/blog/handling-the-leap-second-linux/http://developerblog.redhat.com/2015/06/01/fi...
-
July 02, 2015
Regular Expression Engines正则表达式的匹配引擎库re2和pcre Jit势均力敌啊
Performance comparison of regular expression engineshttp://sljit.sourceforge.net/regex_perf.html RE2 是google开放的,c++ 的接口,可能c++ 使用更方便一些? PCRE2 的c函数接口使用看起来略显麻烦一些。
-
June 18, 2015
解决mysys Git在windows Xp系统中文乱码的配置
修改mingw64 git的全局配置 c:\git\mingw64\etc\gitconfig 或者 c:\users<username>.gitconfig[core] quotepath = off editor = gvim[gui] #代码库统一用urf-8 encoding = utf-8[i18n] #设置 commit log 提交时使用 utf-8 编码致 commitencoding = utf-8 #使得在 $ git...
-
June 16, 2015
Test Highlight
/* gcc -o prlimit prlimit.c */#define _GNU_SOURCE#define _FILE_OFFSET_BITS 64#include <stdio.h>#include <time.h>#include <stdlib.h>#include <unistd.h>#include <sys/resource.h>#define errExit(msg) do { perror(msg); ...
-
June 15, 2015
Test Post
测试 标题1 标题2 列表1 列表2 列表3 列表4
-
June 11, 2015
Gcc链接多个外部链接库时,只对某个库做静态链接,其他的都是动态链接
-Wl,-Bstatic -l需要静态链接的库 -Wl,-Bdynamic -l需要动态链接的库