Recent Posts

vim 里打开 file:line

0x00

Linux 里,很多工具都会按文件加行号file:line)的格式输出,比如 grep

$ grep -nr "Sanitize in progress..."
drivers/mmc/core/mmc_ops.c:1008:     pr_debug("%s: Sanitize in progress...\n", mmc_hostname(host));

又比如 Linux 动态 …

Linux Virtual Memory Split with 3.5G/0.5G

问题

项目里用到的一款开发板,配置的是 32 位 ARM 处理器。因为业务程序相关方面的实际开销,需要在用户态虚拟地址空间 …

Bitcoin (BTC) 算法

Bitcoin (BTC) 的算法,是求解(也可以说是寻找)一个整数(nonce),它被用于在区块链上产生新高度的区块。算法的输入是前一个区块的哈 …

Base64, Base58 等算法的编码和解码过程

这里记录一下字节流在表示和传输中使用到的 Base 编码,即把二进制字节流编码成某种格式 ASCII 文本字符。

Base16

最简单的是平 …

Using RCS Keywords in Perforce

使用 svn 时,有时会把版本管理系统的信息嵌入到代码里,比如版本号、最近修改时间,等等。在软件调试时,这会很有帮助。因为 …

混用不同版本的 libc 造成程序崩溃

程序发生崩溃,调试器提示崩溃发生在 libc 的 free() 函数里面:

Debug Assertion Failed: _CrtIsValidHeapPointer(pUserData)

初步判断,可能是堆(Heap)被写坏了。

于是修改代码,在程序 …

Highlight All Occurrences of Selected Word

在选中某个单词(比如变量、函数、自定义类型,等等)时,如果能把屏幕上所有出现这个单词的地方,都高亮显示出来,对于程序 …

Remove Trailing Whitespace in Visual Studio

编程习惯里通常会建议删除行尾的空格。在 Visual Studio 里,可以通过 Ctrl+K, Ctrl+\ 的按键操作来实现。

不过每次通过手动的方式,未免有 …

What is ULP?

The maximum relative error is defined as ulp (units in the last place).

The ULP is defined as follows:

If x is a real number that lies between two finite consecutive
floating-point numbers a and b, without being equal to one of them,
then ulp(x) = |b - a|, otherwise ulp …

Find the file by inode number

在命令行下会遇到一些文件名里包含有中文、符号或者某些奇怪字符的文件,如果命令的自动补全不完整,键盘操作起来 …