中文标题索引:Gnome Blender 下右control/ctrl键不起作用 可能原因和解决办法:Gnome开启了Pointer...
Continue reading...lightlines插件显示文件完整路径
1 2 3 4 5 6 7 |
let g:lightline = { \ 'active': { \ 'left': [ [ 'mode', 'paste' ], [ 'readonly', 'absolutepath', 'modified' ] ], \ } \ } |
将上述内容加到.vimrc中
Continue reading...vim 自动打开NERDTree定位到文件,并更新lightlines
1 2 3 |
autocmd VimEnter * NERDTree | wincmd p | call lightline#update() |
将上述内容加到.vimrc中
Continue reading...arch linux: no matching host key type found. Their offer: ssh-dss
一. 官方解决办法 reason and...
Continue reading...Linux 配置多个git远程仓库
一. 生成公钥和密钥
1 2 3 |
ssh-keygen -t rsa -b 4096 -C "AdinRease@gmail.com" |
回车后会让我们输入保存文件的名字,注意命名和其他的公钥密钥不要重复...
Continue reading...__atomic_fetch_add 和 atomic_fetch_add_explicit 是什么?
atomic_fetch_add_explicit是一个宏定义, 展开后的名称为 __atomic_fetch_add. __atomic_fetch_add是GCC的一个内置函数,...
Continue reading...Golang 通用类型指针交换
C语言的通用类型指针交换是相当简单的,只需要将指针类型统一转成void*即可,Golang也有一种类似的操作,但是稍微麻烦一点:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
package main import ( "fmt" "sync/atomic" "unsafe" ) func swapPointer(readPointer *unsafe.Pointer, writePointer *unsafe.Pointer) { *writePointer = atomic.SwapPointer(readPointer, *writePointer) } func main() { var a int = 1 var b int = 2 var readPointer *int = &a var writePointer *int = &b fmt.Println(*readPointer) fmt.Println(*writePointer) swapPointer((*unsafe.Pointer)(unsafe.Pointer(&readPointer)), (*unsafe.Pointer)(unsafe.Pointer(&writePointer))) fmt.Println("------------") fmt.Println(*readPointer) fmt.Println(*writePointer) } |
Continue reading...