hit counter

Timeline

My development logbook

Little Erlange Exercise 1

Problem definition: Euler Problem 1

Python version


print reduce(lambda x, y : x + y,
filter(lambda x: x % 3 == 0 or x % 5 == 0,
range(1, 1001)))



Erlang version



-module(p1).
-export([pr_sum/0]). %% print sum

pr_sum() –>
L = lists:seq(1, 1000),
L1 = [ X ||X <– L, (X rem 3) == 0 orelse (X rem 5) == 0],
sum(L1).

sum(L) –> sum(L, 0).
sum([], Acc) –> Acc;
sum([H|T], Acc) –> sum(T, Acc + H).

France and Deregulation

Very obviously, the martial status and love life of Sarkozy is taking the limelight, and mainstream media basically treat this story as if it belongs to entertainment section.

Oh, well, that’s why mainstream media is mainstream, isn’t it?

So, when I learn about the reform Sarkozy has brought to France, I was a bit surprised. News like this basically escape me, a news junkie.

The following are some example:

  • Abolished the 35 work hours/week restriction. On top of this, a worker does not have to pay tax on the income resulted from his/her overtime. Employer is also only required to pay a lesser contribution to pension and health care levy for the overtime payment.

  • Simplify the tax laws: for some lower income family, a bill is passed so that a ceiling, 50%, is imposed on they have to pay to government. This does not include just income tax alone, but also covering various government fee and charge.

  • Bills passed to weaken Union power

  • Actively encourage the R&D via financial incentive

(It is reported by Bloomberg on the Economy Podcast – Interview with Philippe Farve, 21 Dec 07 )

It seems like it is going to be a Generational Change in France. In the all these hype of BRIC (Bazil, Russia, India and China), people probably is not aware that Europe actually has a balanced and increasing vibrant economy.

Next to do: get some quantitative data to verify the above view.

Have It Both Ways

Just had a chat with a colleague the other day. He was watching the BoC (Bank of China) Stock. My colleague said the stock price was depressed due to its involvement in the sub-prime market. A spokesperson of the bank said they are in it because their traders are “inexperienced”.

I cannot help but laugh! “Inexperienced”? You really can’t have it both way: when you are making money, you are the smartest person on the world. All the profit are the result of your vision, insight, education, risking-taking spirit, understanding of market and sophistication. But when the tide turns against you, “Oops, ya know, this thing is kinda new to me”. Yet handsome bonus is still waiting for you at the end of the year, like usual.

It does not make sense to me. You should not have it both ways.

(*What my colleague said is not fact checked)
(Writing in a slightly sarcastic mode)