I went to bed at half past five last night and went crazy about configuring the vim environment. Finally, I finally completed the fantastic Ruby on Rails development tool. I have installed vim-Ruby in this Vim environment. Of course, you need to
Python and Ruby are currently very popular.Programming Language. They are ideal for building software prototypes. These two languages are also suitable for developing web applications.Program. The latest Ruby version is 1.9.2, and the latest Python
First, in ruby1.8, class variables are shared by all sub-classes and parent classes.Code:
Class intelligentlife @ home_planet = nil def self. home_planet @ home_planet end def self. home_planet = (x) @ home_planet = x end #... end class TerranWe
The ruby language contains a type called the range class, which is a set of a range of some classes. Generally ".. "or "... "To define the range ,".. "indicates the value that contains the defined range ,"... "does not include the value at the end
After reading Ruby for a few days, I found many well-known syntax features in C #. Ruby was available a few years ago:
1. The Params keyword in C #
Class program {static void main (string [] ARGs) {console. writeline (sum (); console. writeline (
Ruby's array is basically used. Compared with arrays in C #, the least habit is to allow negative indexes (somewhat similar to Javascript)
Arr = [3, 4, 5, 6, 7, 8, 9] puts arr [0] #3 puts arr. first #3 puts arr [arr. length-1] #9 puts arr [arr.
An important feature of closures is that variables defined inside a process (method) can be referenced even after the method call is complete! (That is, the lifecycle is extended)
Def method (n) puts "n = # {n}"; # Return proc {| I | n + = I} # key:
Some important differences between Ruby and C # are as follows:
1. Ruby is a dynamic language, and C # Is a static language-that is, after an object is new, Ruby can dynamically add some attributes or methods to the object instance (as does
Complained todayThe blog has not been updated for many days, which affects reading mood. I just need to start it. ^_^
# Part One
Afile = file. New ("C: \ 1.txt"," W ")
Afile. Puts "The 1"
Afile. Puts "The 2"
Afile. Close
# Part Two
Ruby identifiers are used to point to constants, variables, methods, classes, and modules. The first letter of the identifiers helps us determine the scope of the content that the identifiers direct.
Ruby is case sensitive.
Ruby uses a convention
What is jruby?
Jruby is a Ruby interpreter implemented in pure Java. Through jruby, you can directly run Ruby on JVMProgramTo call the Java class library. Many Ruby ides written in Java use jruby to explain the syntax.
Jruby, an open-source Ruby
Objects and attributesThe song object we created has an internal State (such as song title and artist ). This state is private to other objects-other objects cannot access the instance variables of an object. Generally, this is a good thing. This
transfer character meaning:
serial number, for example, \ D [0-9] numeric character \ D [^ 0-9] Except for any number character \ s [\ s \ t \ n \ f blank character \ s [^ \ s \ t \ n \ f] any character except blank character \ W [A-Za-z0-9 _]
I have seen several articles about Ruby on Rails (ROR) recently.ArticleYou can't help but download a copy of it to try it out.
The reference document creates a very simple system and does not take much time, mainly because the scaffold function
Dynamic scripts in recent yearsProgramming LanguageIn China, Python and Ruby are becoming more and more popular, and they are often compared. I think they have their own characteristics:
51cto editing recommendations: Ruby tutorials and tips
1.
A class method is also called a static method. It is called by class name. Instance method. You must create a new instance before using it.
Class Foo def self. bar puts 'class method' end def Baz puts 'instance method' endendfoo. bar # class
Read an object and print it out:
Lines = file. open ('dom. js '). readlinesputs "=================================" lines. each {| Line | puts (line )}
Or:
File. Open ("dom. js") Do | file | while line = file. Gets puts line endend
The
I want to be a professional technical writer, but I am too emotional to write rigorous technology.Article, Always like to show too many emotional colors in your own articles. This series of articles shows my recent feelings from the name, and it is
Matz is a professional software engineer working in netlab. JP, a famous open source company in Japan, and he is also a high-profile open source evangelist in Japan. He participated in several open-source software projects, including cmail. This is
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service