Some Erlang code.To deal some misc in my work.