文章归档

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

  1. Part 1
  2. Part 2: CPU caches
  3. Part 3 (Virtual memory)
  4. Part 4 (NUMA systems)
  5. Part 5 (What programmers can do - cache optimization)
  6. Part 6 (What programmers can do - multi-threaded optimizations)
  7. Part 7 (Memory performance tools)
  8. Part 8 (Future technologies)
  9. »» 继续阅读全文

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

原文:http://www.mohu.org/info/symbols/symbols.htm

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

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

-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方面的一份非常详细的文档

  1. Red Hat Enterprise Linux 6 Resource Management Guide

what is the real necessary change

看内核patchs的时候,经常会看到一些清理代码的patch,理由是unnecessary,比如这个:

[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

- http://blog.golang.org/2011/06/profiling-go-programs.html

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如何处理三元表达式

关于vim script的条件表达式,描述有点问题,在runtime/doc/usr_41.txt文档里:

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)

有问题那句我红色标出来了,它的意思是说,在计算一个条件表达式的值的时候三部分都是会先被计算的。也就是说,先计算(a)的值,(b)的值,和(c)的值,然后根据(a)是否为true,选择表达式最终的值。 这个做法看起来很有问题,我确实想不出为什么要这么做,至少c这些语言大多编译器的实现,都是最终转化为一个goto语句吧。 如果这么做是可行的,那么是不是说:

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

即使最终的结果是part2,但是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

»» 继续阅读全文

第 8 页,共 13 页« 最新...678910...最旧 »