Get flash to fully experience Pearltrees
Moved from PythonVsRuby : (See also PythonRubyAttrComparison , PythonRubyInitializer ) In RubyLanguage , every object has a method called "method_missing", which is called every time an undefined method is invoked. You can override method_missing, for super-reflective ease in creating things such as facades. Does PythonLanguage have this feature? In Python you would override the method __getattr__(self, name). From this method you can either delegate to another method or throw an exception.
So, how do Python and Ruby compare? They look more similar to each other than either does to Perl. What are the differences? Points of comparison: Overview Heritage and Philosophy Popularity Readability Ease for Beginners Ruby Blocks and Python Lambdas Development Environments Community and Documentation Libraries, Platforms and Applications Performance Opinions : Leaving Python for Ruby / Leaving Ruby for Python (anybody?) Misc.
Playing with my son on Lego NXT requires me to get Ruby in the mix just for fun. Here is the install notes that I used to get everything going. cd /tmp # Ruby Serial svn export http://ruby-serialport.rubyforge.org/svn/trunk ruby-serial cd ruby-serial ruby extconf.rb make sudo make install cd .. # Install libusb svn export https://libusb.svn.sourceforge.net/svnroot/libusb/trunk/libusb libusb cd libusb sh autogen.sh ./configure make sudo make install cd .. # Ruby USB svn export svn://firstname.lastname@example.org/akr/ruby-usb/trunk ruby-usb cd ruby-usb ruby extconf.rb make sudo make install cd .. # Ruby NXT gem install ruby-nxt # Try it in IRB require 'rubygems' require 'nxt_comm' comm = NXTComm.new comm.connected? comm.get_device_info comm.get_firmware_version <p style="text-align:right;color:#A8A8A8"></p>
Ruby Literal Array [1, 2, 3, 4, 5] # 5 elements array [a..z, A..Z] # An array of two ranges [[1,2],[3,4]] # Nested arrays [1..2, [1,2,4], 4, "val" ] # Mixed type Array[1,2,3] # [1, 2, 3] [0,1]*2 # [0, 1, 0, 1] Breaking text into a Ruby array words = %w[Break this into an array of words] # [ "Break" , " this " , ..., "words" ] letters = %w|aa b c d| # [ "aa" , "b" , "c" , "d" ] letters = %W(aa b c d) # [ "aa" , "b" , "c" , "d" ] Instantiate an Ruby array
All that you need to get Ruby-Processing going is Ruby (1.8 or 1.9) and Java (1.5 or 1.6) — and your machine probably came with both of those baked-in. Then, naturally, you’ll need to get your hands on Ruby-Processing itself. It’s available as a Ruby Gem: sudo gem install ruby-processing Ruby-Processing provides you with the rp5 command, which is what you’ll use to run all the Ruby-Processing commands. Try typing rp5 --help to get a brief overview of the options.
$ rvm help # Documentation Index Wondering why you should use RVM? For a start, not only does RVM make installing multiple ruby interpreters / runtimes easy and consistent, it provides features such as gemsets that aren't typically supported out of the box on most ruby installs. RVM also lets you use different rubies in a manner that wont mess with your existing ruby install (unless you tell it to) as well as letting you run multiple different rubies in seperate terminals concurrently! Getting started
About this Book 224 pages Published: Release: P1.0 (2012-07-09) ISBN: 978-1-93435-697-5 NEW : See this video on using Torquebox for high-availability deployment on the JVM .
Since Xcode 4.3 has became a standalone app, it’s no longer installed in the /Developer directory. This cause the MacRuby project template disappear from Xcode 4.3. After some digging in the MacRuby-devel mailing list, I found some workaround to this problem: First, you need to move the MacRuby template files to the user’s shared folder:
Editor's note : To learn what's new and changed in RDT since this article was written, read the developerWorks article " Easy Ruby development, the Eclipse way ." Why Ruby? Why would any self-respecting Java developer care about Ruby? Ruby is a general-purpose scripting language created 10 years ago in Japan.
http://rubycocoa.sourceforge.net/doc/ http://www.rubycocoa.com Ruby is a dream language to write Cocoa code in -- you get automatic garbage collection and an algol syntax, eg: box = [[ NSBox alloc] initWithFrame: NSZeroRect ]; [box setEnabled:NO]; would be written in Ruby as:
It's exciting times for MacRuby developers. MacRuby 0.10 was recently released, and Xcode 4 is finally out. And while Apple has announced that MacRuby will be included in Lion, it will be a private framework, not a public one. For now, you need to include the MacRuby framework inside your application bundle . This post shows you how.