24 Feb '12, 6am

Array - Rubyリファレンスマニュアル:

配列を生成します。size を指定したときにはその大きさの配列を 生成し nil で初期化します。第二引数 val も指定したとき には nil の代わりにそのオブジェクトを全要素にセットします。 (要素毎に val が複製されるわけではないことに注意してください。 全要素が同じオブジェクト val を参照しますtrap::Array )。 ruby 1.7 feature : 二番目の形式では引数に指定した配列を複製し て返します。 p Array.new([1,2,3]) # => [1,2,3] 三番目の形式では、ブロックの評価結果で値を設定します。ブロックは要 素毎に実行されるので、全要素をあるオブジェクトの複製にすることがで きます。 p Array.new(5) {|i| i } # => [0, 1, 2, 3, 4] ary = Array.new(3, "foo") ary.each {|obj| p obj.object_id } # => 537774036 537774036 537774036 ary = Array.new(3) { "foo" } ary.each {|obj| p obj.object_id } # => 537770448 537770436 537770424

Full article: http://www.ruby-lang.org/ja/old-man/html/Array.html#rever...

Tweets

Apple to Build Largest Solar Array

Apple to Build Largest Solar Array

cleantechnica.com 23 Feb '12, 7am

The creators of the iPad, iPhone, and iPod are going to be building America’s largest end-user-owned, onsite solar array a...

YAML - Rubyリファレンスマニュアル

ruby-lang.org 20 Feb '12, 7am

YAML フォーマットの文書を読み込み Ruby のオブジェクトを生成して返します。 引数として IO オブジェクトと文字列を受け付けます。 io や 文字列が複数の YAML ドキュメントを含んでいても、最初のものしか Ruby のオブジェク...

Apple Building 100-Acre Solar Array

Apple Building 100-Acre Solar Array

ecorazzi.com 21 Feb '12, 4pm

Apple Building 100-Acre Solar Array 0 Tweet by Michael dEstries February 21, 2012 Categories: Causes , Environment , Inter...

#Apple finally confirms plans for huge #solar a...

solarindustrymag.com 21 Feb '12, 5pm

Following months of unconfirmed reports, Apple has publicly commented on its plans to construct a large PV array at a new ...

Apple polishes green credentials with giant 20M...

businessgreen.com 21 Feb '12, 1pm

Apple has revealed plans to build a giant 20MW solar array to help power its North Carolina data centre, as part of its la...

20MW Solar Array & Biogas Fuel Cell Touted for Apple's NC Data Center

20MW Solar Array & Biogas Fuel Cell Touted for ...

treehugger.com 21 Feb '12, 7pm

When I posted on Apple's plans to install a large solar array at an NC data center , details were still sketchy. But those...

CEVA Unveils the CEVA-XC4000 - A Low-Power DSP ...

design-reuse.com 21 Feb '12, 11am

"Today's advanced wireless communications landscape is a complex array of evolving standards and protocols that product de...

Scottish consent for first Oyster wave power ar...

renewableenergyfocus.com 20 Feb '12, 3pm

Barclays lends £3.4m to finalise wave power array Barclays Corporate has agreed a £3.4 million loan to wave energy company...

SES Installs PV Array At Eldorado Coffee Roaste...

solarindustrymag.com 19 Feb '12, 9am

Eldorado Coffee Roasters has commissioned a 240.24 kW solar photovoltaic PV system at its worldwide headquarters in Maspet...

Appending to an Array - Ruby Forum:

ruby-forum.com 11 Feb '12, 10am

I am querying a database using DBI and ODBC. After I run the execute, I want to grab each row as an array, and add it to a...