Ruby中的block概念的理解: 文中給出了Javascript代碼塊與Ruby代碼塊的對比,需要的朋友可以參考下 Ruby 裡的 block一般翻譯成代碼塊,block 剛開始看上去有點奇怪,因為很多語言裡面沒有這樣的東西。事實上它還不錯。 First-class function and Higher-order function First-class function 和 Higher-order
標籤:點這裡https://github.com/opalOpal Opal is a ruby to javascript source-to-source compiler. It also has an implementation of the ruby corelib.Opal is hosted on github, and there is a Freenode IRC channel at #opal, ask questions
標籤:Since the original tech preview release of FastCGI last year, we‘ve been seeing a lot of requests for getting Ruby on Rails running with our FastCGI. Theoretically, since the FastCGI component uses a standard protocol to support
標籤:1.puts "Hello"This write "Hello" to the screen with a new line tailed to.print "Hello"Just like puts, but without new line. 2."You know nothing".lengthThis output the string length."Jon Snow".reverse"wonS noJ""OVERWATCH".downcase #--->
標籤:#!/usr/bin/rubyputs "Hello, Ruby, what is your name?"$name = STDIN.getsputs "Hi, I am "+$namedef welcome(name,a = 9,b = 9,*c) puts "Hi #{name}" c.each{|x| print "#{x}"}# print "a = "+ $a a = 10; b = 11# print "Hi, b" + $b res =
標籤:ruby中有執行個體變數這個文法,有點類似java的對象的屬性,但是ruby中類也有實力變數, class Person @name = ‘hello‘ def initialize(name,age) @name = name @age = age end def self.talk #類方法,類方法可以訪問類的實力變數 puts "#{@name}" end def talk #執行個體方法,只能訪問執行個體的執行個體變數 puts "#{
Jave Web Framework Sweet Spots Java Web 架構的“甜點” 這是一篇很有趣的文檔,所以摘要一下,其實類似閱讀筆記,好像是3/25發布的: 不知怎麼翻譯Sweet Spots,難道翻譯為甜處、甜頭、蜜點、蜜穴? 這時基於對以下人的採訪: JSF Jacob Hookom RIFE Geert Bevin Seam Gavin King Spring MVC Rob Harrop Spring Web Flow Rob Harrop and