English Breakfast

Posted in   English   at 2011-09-21

Topic: Breakfast

What do you want for Breakfast? What did you have for Breakfast?

I had something for breakfast. I will have something for breakfast.

You can also use this for Lunch, dinner or a snack.

Like….

I had ice cream for a snack.

Rice, noodles, dumplings, McDonalds.

Add oil!

Topic: Kent comes to visit

Questions:

Good morning.

How was your flight? How was your trip over? How was the traffic? How is your family? How are your children?

Answers: If he asks you how work is going, you can say: Everything is going great! Everything is going smooth.

Word of the day: smooth.

Add oil!!!!

What is that

Posted in   English   at 2011-08-24

I cannot remember that, please forgive me!

why I cannot get liguande.com

Fibanocci Function

Posted in   Study   at 2011-05-18

As we known, fibanocci function f(x) = f(x-1) + f(x-2) when x >1, else x = 0, 1, it is f(x) = 1.
Bellow is my ruby code for this. I have three method.

  • loop
  • recursion
  • block and yield

Loop

    x,y = 0,1
puts "1"
(1..6).each do |i|
z = x + y
puts z
x = y
y = z
end

Recursion

    def f(x)
return 1 if x == 1 or x == 2
return f(x-1) + f(x-2)
end

(1..7).each do |i|
puts f(i)
end

Yield and Block

    def fibonacii(max)
f1,f2 = 1,1
while f1 >= max
yield f1
f1,f2 = f2,f1+f2
end
end

fibonacii(35) {|f| puts f}