## Every Programmer Should Know

Latency Numbers http://www.eecs.berkeley.edu/~rcs/research/interactive_latency.html, it will be less change in the future

What Every Programmer Should Know About Memory

## 常用数学符号的LaTeX表示方法

１、指数和下标可以用^和_后加相应字符来实现。比如：

2、平方根（square root）的输入命令为：\sqrt，n 次方根相应地为: \sqrt[n]。方根符号的大小由LATEX自动加以调整。也可用\surd 仅给出 符号。比如：

3、命令\overline 和\underline 在表达式的上、下方画出水平线。比如：

4、命令\overbrace 和\underbrace 在表达式的上、下方给出一水平的大括号。

5、向量（Vectors）通常用上方有小箭头（arrow symbols）的变量表示。这可由\vec 得到。另两个命令\overrightarrow 和\overleftarrow在定义从A 到B 的向量时非常有用。

6、分数（fraction）使用\frac{...}{...} 排版。一般来说，1/2 这种形式更受欢迎，因为对于少量的分式，它看起来更好些。

7、积分运算符（integral operator）用\int 来生成。求和运算符（sum operator）由\sum 生成。乘积运算符（product operator）由\prod 生成。上限和下限用^ 和_来生成，类似于上标和下标。

»» 继续阅读全文

## The Secret to 10 Million Concurrent Connections -The Kernel is the Problem, Not the Solution

Now that we have the C10K concurrent connection problem licked, how do we level up and support 10 million concurrent connections? Impossible you say. Nope, systems right now are delivering 10 million concurrent connections using techniques that are as radical as they may be unfamiliar.

To learn how it’s done we turn to Robert Graham, CEO of Errata Security, and his absolutely fantastic talk at Shmoocon 2013 called C10M Defending The Internet At Scale.

Robert has a brilliant way

»» 继续阅读全文

## Red Hat Enterprise Linux 6 Resource Management Guide

Redhat在关于cgroup方面的一份非常详细的文档

## what is the real necessary change

[PATCH] vfs: no need to check about IS_IMMUTABLE in do_fallocate

From: Ashish Sangwan <a.sangwan <at> samsung.com> In do_fallocate, first there is check for FMODE_WRITE and after that there is second check for IS_IMMUTABLE. A file cannot be opened in write mode if the corresponding inode is immutable, hence the second check is not required. Signed-off-by: Ashish Sangwan <a.sangwan <at> samsung.com> Signed-off-by: Namjae Jeon <namjae.jeon <at> samsung.com> --- fs/open.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/fs/open.c b/fs/open.c index 8c74100..939e402 100644 --- a/fs/open.c +++ b/fs/open.c <at> <at> -245,9 +245,6 <at> <at> int do_fallocate(struct

»» 继续阅读全文

## Profiling Go Program

At Scala Days 2011 a few weeks ago, Robert Hundt presented a paper titled “Loop Recognition in C++/Java/Go/Scala.” The paper implemented a specific loop finding algorithm, such as you might use in a flow analysis pass of a compiler, in C++, Go, Java, Scala, and then used those programs to draw conclusions about typical performance concerns in these languages. The Go program presented in that paper runs quite slowly, making it an excellent opportunity to demonstrate how to use Go's profiling tools to take a slow program and make it faster.

By using Go's profiling

»» 继续阅读全文

## 最短shell代码实现乘法表

the first version:

[shell] for i in {1..5}; do for j in {1..5}; do let k=$i*$j; echo $i*$j=$k; done; done; [/shell] then, i research for a while, and write the 2rd [shell] seq 5 | awk '{for(i=1;i<=$1;i++){printf($1 "*"i"="i*$1" ")};print""}' [/shell]

## vim如何处理三元表达式

Borrowed from the C language is the conditional expression: a ? b : c If "a" evaluates to true "b" is used, otherwise "c" is used. Example: > :let i = 4 :echo i > 5 ? "i is big" : "i is small" < i is small ~ The three parts of the constructs are always evaluated first, thus you could see it work as: (a) ? (b) : (c)

：let a = 3 < 5 ? 3 - 1 : getchar()

»» 继续阅读全文

## goroutine scheduler

some references

• Analysis of the Go runtime scheduler
• Dmitry Vyukov. Scalable Go Scheduler Design Doc

go runtime and go scheduler

The runtime keeps track of each goroutine, and will schedule them to run in turn on a pool of threads belonging to the process. Goroutines are separate from threads but rely upon them to run, and scheduling goroutines onto threads effectively is crucial for the efficient performance of Go programs. The idea behind goroutines is that they are capable of running concurrently, like threads, but are also extremely lightweight in comparison. So, while there might be multiple threads

»» 继续阅读全文