##What is “Closure”
In computer science, a closure (also lexical closure or function closure) is a function or reference to a function together with a referencing environment—a table storing a reference to each of the non-local variables (also called free variables) of that function. A closure unlike a plain function pointer allows a function to access those non-local variables even when invoked outside of its immediate lexical scope.

阅读全文 »

在安装octogress的时候需要ruby1.9.3, ubuntu 12.04 默认的是1.8, 虽然有1.9.3的源,但是所有的库用的还是1.9.1的,运行octogress的时候出现了很多莫名其妙的错误,用ubuntu自带的rvm安装更是产生无数的问题。求助于goolge, 发现很多讲用ubuntu做ruby on rail开发的都会手动安装rvm和最新版ruby, 但是跟着做了以后,总会在某个地方出现问题。最后发现了一篇How to install Ruby (and RVM) on Ubuntu (for technotards), 终于配置成功了。

阅读全文 »