Latest blog posts


         8 years ago  

Golang's package expvar exp oses var iables via HTTP.  Operations on the exposed varibles are atomic. It can be used for the purpose of web page ana ...



         8 years ago  

~/.config/sxhkd/sxhkdrc file # # wm independent hotkeys # # terminal emulator alt + Return gnome-terminal # program launcher alt + space dme ...



         8 years ago  

Follow the instructions descibed in bspwm for dummies and https://github.com/baskerville/bspwm/wiki to install bspwm. Install dmenu. sudo apt-get ins ...



         8 years ago  

imagemagick software suite is used to processing images on Linux. It can be used to capture screen as well. $ sudo aptitude install imagemagick To ca ...



         8 years ago  

x ^ 0s = x x & 1s = x x & x = x x | x = x x | 0s = x x ^ 1s = ~x x ^ x  = 0s x & 0s = 0s x | 1s = 1s a ^ b ^ a = b a ^ b ^ b = a Shifting ...



         8 years ago  

Interface in Go is a type which provides a way to specify the behavior of objects: if something can do this, then it can be used here. So interface is ...



         8 years ago  

RPC server registers two paths ( /_goRPC_ and /debug/rpc ) and their handlers as HTTP server. The handler of /debug/rpc handles the http requests and ...



         8 years ago  

This is an example that access exported members from a unexported struct. // pk/pk.go package pk type point struct { X, Y int } func NewPoint(x, ...



         8 years ago  

1. strings.Reader func NewReader(s string) *Reader 2. bytes.Buffer implements io.Reader, io.Writer interface. func NewBuffer(buf []byte) *Buffer fun ...



         8 years ago  

func SHA1(s string) []byte { h := sha1.New() io.WriteString(h, s) v := h.Sum(nil) ...



         8 years ago  

init function is executed before main function and after all global variable declarations have evaluated (including the varibles and init functions de ...



         8 years ago  

Preflight Request, According to the definition on MDN , "A CORS preflight request is a CORS request that checks to see if the CORS protocol is underst ...



         8 years ago  

On Linux system, ports below 1024 are reserved for programs with root privilege. There are several ways to allow regular users to bind these privileged ...



         8 years ago  

希尔伯特(David Hilbert)在1928年提出了三个关于任意数学形式系统(formal system of mathematics)的基本问题: (1) 这个系统的规 ...



         8 years ago  

As stated in The Effective Go : "Slices hold references to an underlying array, and if you assign one slice to another, both refer to the same array. I ...



         8 years ago  

You can use "docker save" command to save a docker image to file. docker save -o </path/to/filename> <image_name> You can also load a docker image f ...



         8 years ago  

In Virtualbox guest, open setting->network setting->port forwarding, Add a new Rule: change the "Host port" to the port you want to use as forwarding, ...



         10 years ago  

看到 网上有一篇文章 讲如何使用direnv管理GOPATH变量, 很有用。 sudo aptitude install direnv echo 'eval "$(direnv hook bash)"' >> ...



Newer