ruler demo with c++.