Railsmine
Ruby and Javascript Playground
Saturday, July 24, 2010
Inisialisasi Array Multidimensi
Array.new memungkinkan untuk menerima block sehingga memungkinkan untuk melakukan inisialisasi Array multidimensi:
a = Array.new(4) { Array.new(4) }
Kode diatas akan menghasilkan Array dua dimensi dengan banyak elemen 4 x 4.
[via
Ruby Quicktips
]
0 comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Popular Posts
Rails 3 Action Mailer Example
Update 2012-02-19: This tutorial has been tested using Rails 3.0.11. Source code is available on Github: https://github.com/kuntoaji/rails_...
ActiveAdmin Tutorial
What is ActiveAdmin? Active Admin is a Ruby on Rails plugin for generating administration sytle interfaces. The goals of this plugin are ea...
The Ruby Way to do URL Validation
As we know, to do URL validation we can use regular expression such as: my_url =~ /^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{...
Tips untuk Belajar Ruby on Rails
Setelah beberapa waktu lalu saya membuat artikel bagaimana cara instalasi Ruby on Rails , ada beberapa tips dari saya untuk mempelajari Ruby...
Active Record And Will Paginate for Non-Rails Application
I'm new to Sinatra and I want to use it together with Active Record and Will Paginate. After hours searching, I've finally found out to use ...
0 comments:
Post a Comment