Skip to content

Instantly share code, notes, and snippets.

View overminder's full-sized avatar
😂
居然可以发状态了你敢信

Overmind Jiang overminder

😂
居然可以发状态了你敢信
View GitHub Profile
@overminder
overminder / foo.cc
Created November 1, 2017 17:15
Inheriting C++ base class constructor
// Provides a mechanism to `inherit` a base class constructor
// verbatim (i.e., with the exact same parameter list) in a subclass.
//
// Note that in C++11 and onwards there's a better way to do it:
// See https://stackoverflow.com/questions/8093882/using-c-base-class-constructors
class Foo {
public:
#define FOO_CTOR(name, body, ...) \
explicit name(int x, int y) \
@overminder
overminder / .gitignore
Last active October 21, 2017 01:43
Recur->Iter
.*.swp
*.pyc
@overminder
overminder / .gitignore
Last active September 5, 2016 07:51
Tying the Knot
.stack-work
stack.yaml
@overminder
overminder / .gitignore
Last active July 24, 2016 04:32
C++: Method pointer
main
*.o

TypeScript --noImplicitAny is not enough!

@overminder
overminder / README.md
Created December 22, 2015 02:38
TCP Graceful Shutdown

SYNOPSIS

Examine with TCP graceful shutdown behaviors in different libraries.

@overminder
overminder / README.md
Last active August 29, 2015 14:08
std::function implementation
@overminder
overminder / README
Last active August 29, 2015 14:06
Branch predication
See main.c. Requires gcc or llvm-clang to compile.
$ time ./a.out --fast 40
fibo(40) = 102334155
real 0m0.571s
user 0m0.567s
sys 0m0.002s
$ time ./a.out --slow 40
fibo(40) = 102334155
见 http://h.acfun.tv/t/4240594?r=4256785
http://www.zhihu.com/question/25037476/answer/30100671