God made the integers, all else is the work of man.

2019-02-14
C++ rvalue reference

c++ rvalue reference

why we need rvalue references?

rvalue references are a new reference type introduced in c++0x that help solve the problem of unnecessary copying and enable perfect forwarding. When the right-hand side of an assignment is an rvalue, the the left-hand side object can steal resources from the right-hand side object rather than performing a separate allocation, thus enabling move semantics.

Read More

2019-01-30
[Translation] Trusted Computing Group At |(TCG)| Organisation

Trusted Computing Group At | (TCG) | Organisation

Trusted Computing based on hardware root of trust has been developed by industry to protect computing infrastructure and billions of end points.

基于可信的硬件可信计算,已被产业界开发出来,用以保护计算基础设施以及数以万计的终端产品。

Read More

2019-01-28
[Translation] High-Performance Server Architecture

High-Performance Server Architecture-Jeff Darcy

The purpose of this document is to share some ideas that I’ve developed over the years about how to develop a certain kind of application for which the term “server” is only a weak approximation. More accurately, I’ll be writing about a broad class of programs that are designed to handle very large numbers of discrete messages or requests per second. Network servers most commonly fit this definition, but not all programs that do are really servers in any sense of the word. For the sake of simplicity, though, and because “High-Performance Request-Handling Programs” is a really lousy title, we’ll just say “server” and be done with it.

这篇文档的目的在于分享一些思路,关于我多年来如何开发某些特定的应用——可以近似地称为‘’服务器‘’。更准确地说,我即将写就的是关于广义上旨在解决吞吐量(每秒处理数量巨大的非连续消息或者请求)的一类程序。网络服务器最符合这个定义,但并非所有程序所完成的功能是真正意义上的服务器程序。简而言之,因为“高性能请求处理问题”真的是一个非常蹩脚称谓,所以我们称这类程序叫做“服务器”,且一直以来就是这么叫的。

Read More

2018-04-07
Eulogy for My Grandpa

Eulogy for My Grandpa

Read More

2016-12-23
Another Way To Generate A Prime Table

1
2
3
4
5
6
7
8
9
10
11
12
13
void CalculatePrimesUpTo(int max) {
::std::fill(is_prime_, is_prime_ + is_prime_size_, true);
is_prime_[0] = is_prime_[1] = false;

for (int i = 2; i <= max; i++) {
if (!is_prime_[i]) continue;

// Marks all multiples of i (except i itself) as non-prime.
for (int j = 2*i; j <= max; j += i) {
is_prime_[j] = false;
}
}
}
Read More