原创 C++ 11: lexical closure in lambda function, example 1

In functional programming (FP), there are some important features: First class function.Lambda function.Lexical closure

原创 My X window config: .xinitrc

First, install stumpwm, xrandr . then, add a file ~/.xinitrc xrandr --output VGA1 --mode 1920x1080 --rotate left --abov

原创 C++: template meta programming, emample 1

code: #include <iostream> template <int N> struct Factorial { enum { value = N * Factorial<N - 1>::value }; };

原创 C++: Function as template parameter, example

Function as template parameter. Code: #include <iostream> template <typename F, typename D> D Funcall(F f, D a, D b) {

原创 C++ 11: simple map reduce functions

Try to simulate common lisp's map/reduce functions in C++11. Code: #include <iostream> #include <list> #include <sstrea

原创 C++ 11 : Variadic Templates , Example

In Lisp, we can use variadic function parameters like this: (in Emacs shell) ~ $ (+ 1 2 3) 6 ~ $ (+ 3 4.5 1) 8.5 ~ $ In

原创 Mounting Individual Parititons in RAW Disk Images

From: http://blog.lifebloodnetworks.com/?p=934 Let us say, for the sake of simplicity, that you backup whole disks by

原创 Speed comparison between C & Lisp

In the book "On Lisp" written by Paul Graham, he says lisp can be fast as C, this surprised me. So I decide to benchmar

原创 Career management

From Wikipedia, the free encyclopedia Career management is the combination of structured planning and the active manage

原创 example: call cuda toolkit API from python, curand

see: CUDA ToolkitCUDA Runtime APIcuRANDctypes — A foreign function library for PythonIt's well known that NVIDIA's GPU

原创 docker with sshfs mounted directory

requirement I want to run a docker image in machine A, and mount a directory DIR_B in Machine B. try I mkdir a director

原创 Generate C enum define from python dict

First we need to prepare the dict, then sort and format it: text = """#ifndef bb2421a299d24d4abbe59c3721a794f9 #def

原创 Career Management Lession 2/6 - Forge Relationships

Forge Relationships Career success is complex today—you’ll encounter many opportunities and navigate lots of change. D

原创 Career Management Lession 1/6 - Chart Your Career Path

Chart Your Career Path Don’t wait for someone else to decide the direction of your career. When it comes to managing y

原创 ipmi IP setup

I have acquired a static IP for IPMI, then try to configure it in Linux. ipmitool lan set 1 access off  ## must set, or