Author Archives: Xin Wang

Encode Fix messages with boost::fusion

Advertisements

Posted in Programming | Leave a comment

Scheme call/cc iterator step by step

Every time control is called, it resets itself to “resume”, which is next expression to be executed. Next step, we rewrite control function to take numbers from a list. It is done by adding for-each and a lambda function to … Continue reading

Posted in Programming | Leave a comment

Notes on learning haskell (1)

Posted in Programming | Leave a comment

Cheap dummy head node

It is well known that adding a dummy head node can simplify the insertion and deletion on a linked list, by eliminating the need of special cases (For example: http://www.classes.cs.uchicago.edu/archive/2001/spring/CS117/Lectures/HTML/0406/html/slide_5.html). However, a dummy node uses extra memory, which is not … Continue reading

Posted in Programming | Leave a comment

Python implementation of sieve of Eratosthenes

Lazy functional programming languages can support infinite data structure that contains infinite number of elements. You can define your computation on the infinite data structure. Since the evaluation is lazy, the actual computation will be delayed until it is needed. … Continue reading

Posted in Programming | Leave a comment

Chinese Scholar’s Garden in Staten Island

Posted in Programming | Leave a comment

A puzzle…

Here is a puzzle discussed on Terence Tao’s blog (Yes, Terence Tao!) http://terrytao.wordpress.com/2011/04/07/the-blue-eyed-islanders-puzzle-repost/  

Posted in Programming | Leave a comment