In Ruby, everything is an object. More precisely, everything in Ruby is a fully functional object. So, in Ruby, the number 4, the fixed-point number 3.14, and the string "Hi" are all objects. Obviously, they are a bit "special" because you don't
1 open and close a file
Class method File.new opens a file and instantiates it as a file object, and his first argument is the filename.
The optional second argument is called the mode string (which is also derived from c). He means to open a file
We may need to clean up when a method is finished. Perhaps an open file needs to be closed, the buffer data should be emptied, and so on. If there is always a single exit point for each method, we can safely place our cleanup code in a location and
Linux operating system: CentOS6.3 64bitruby:ruby-2.0.0-p247
I. Installing the development pack (using the default CentOS update source)
Copy Code code as follows:
# yum Install openssl* openssl-devel zlib-devel gcc gcc-c++ make
Cache and page display, this is the last part of the, I really did not think a serial actually spent a few hours. Tired...
External links and tracking
If you want to link and track external Web site resources, you can use the following helper
First, max_by,min_by the minimum value of the maximum value in the array according to the condition1 " This is a string " 2 arr = Str.split ("")3#"a"4# "string"Second, find finds the first element of a match1 " This is a string " 2 arr = Str.split (
Ruby installation in Linux
Ruby installation package: Http://www.ruby-lang.org/en/downloads/Ruby-1.8.6-p111.tar.gz [you can install any version! The methods are the same. But remember that there are commands for these steps]Unzip and
Net: SMTP is easy to send emails, but it does not support sending attachments directly. You can install mailfactory to implement this function.
1) install mailfactory
Run: Gem install mailfactory
2) supports Chinese
The mailfactory
You need to install a bunch of gems locally since the Remote Installation didn't work or at least not stably.
By assumption that instantrails2.0 is ready on your xp platform, then you cocould go on the following steps:
1 download netbeans6
Class C @ const1 = 1 const2 = 2 @ var3 = 3 def self. m p @ const1, const2, @ var3; end def m2 P @ const1, const2, @ var3; C: M # OK # M # error: undefined local variable or method 'M' end endp C: const2; #2 # When the double colon (: :) method is
0. introduction I encountered a problem yesterday about object state transfer. Let me name it like this. A brief description is: for a person, he has functions such as eating, helping others, and falling in love, but these functions are sequential.
Ruby Study Notes
Ruby usageThe first half of RubyWe are defining, we are creatingFor example, blue_crystal = 1, leaf_records = 5
The second half of RubyPutting things in motionFor example, pipe. catch_a_star
Conclusion: 1. Defining things 2.
Ruby automation came into contact with the company. After writing several examples and applications under the company's framework, I also summarized the comparison and feelings between Ruby and Python development in the past. Of course, I know that
There is a class named open3 in ruby that can be used to execute system commands. However, after Ruby is installed in WINXP, open3 supports Linux by default. If you run the code, the fork () cannot be found () method error.
Fortunately there is a
Fpdf supports Chinese PDF printing, but there are many disappointments. According to my current usage, I have summarized the following points:
1) The pdf_chinese font provided by fpdf writes the GB font into the Code. If we want to introduce other
Last year, the two most popular technologies were integrated: Ajax and Ruby on Rails. They became the focus of discussion at the serverside Java seminar in Las Vegas last weekend. In fact, you can say Ruby and Ajax have been officially
Document directory
Three methods for running Ruby:
Comments and branches
Keywords
Identifier
Data Type
Operator
Basic statement
Exception
Three methods for running Ruby:
Ruby-e 'Ruby statement'
Ruby source file
Irbirb is a ruby
Http://www.songlin51.com/archives/667.html
Ubuntu 12.04 redmine2.1 installation record
When you install gem install rails, you cannot connect to rails.
Solution: Search for railson http://rubygems.org/gems/railsto download rails. gem for
Redis cluster building tutorial and troubleshooting, redis cluster building tutorial
Here, the idea of building a redis pseudo cluster with six nodes on a Linux virtual machine is simple. Six redis instances are enabled on one virtual machine, and
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