Enjoy Life

A Ryan Gene Blog!

Tuesday, July 25, 2006

[Code]用Ruby写Fibonacci函数

Ruby是门好语言,使得编程变得非常优雅

下面一个例子很好体现了这点:

很简单地实现了Fibonacci函数


def fib_up_to(max)
i1, i2 = 1, 1
while i1 <= max
yield i1
i1, i2 = i2, i1+i2
end
end

fib_up_to(1000) {|f| print f, " " }


输出:
1 1 2 3 5 8 13 21 34 55 89 ...

posted by Ryan Gene at 9:53 PM 6 comments

[Comment]Blogger体验


Blogger可以让用户自己定义blog的外观,几乎可以做出一个和别人完全不一样的样式,只要有一定的html和css基础,这是我开始用Blogger原因之一。

在此以前一直没用Blogger是因为在中国Blogger是被FENG的,原因就不去追究了。现在找到了一个正常访问Blogger的方法,可能也不是什么新鲜的东西,可以通过www.pkblogs.com/xxxxx来访问(xxxxx表示你的blog名字,例如jinweijie.blogspot.com就可以用www.pkblogs.com/jinweijie来访问)。

另外,Blogger和Picasa集成,以后发照片也很方便。

还有很多。

我想说的是,工具再好,没有内容是不行的,嘿嘿:P

posted by Ryan Gene at 10:21 AM 4 comments

Monday, July 24, 2006

[Life]A Newbie Here

There's a wish, there's a way, finally, I found a way to visit Blogger from China mainland, so i moved here right away.

Actually, in my opinion, MSN space is terrible for bloggers, slow and messy. Many people on MSN spaces forget one thing: Contents is important than those fancy tricks with MSN space, including me.

So, now, I need somewhere to write things, here it is.

Welcome, my friends.

posted by Ryan Gene at 10:39 PM 1 comments

Name:
Location: Shanghai, Shanghai, China

Powered by Blogger
Powered by Writely

Add to Google

Site Feed