This article mainly introduces the Ruby Traverse folder at the same time to compute the file md5sum, this article directly gives the implementation code, the need for friends can refer to the
?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
This article introduces all sorts of algorithms that Ruby realizes, this article gives the realization method of bubble sort, insertion sort, Selection sort, Shell sort and so on, the friend who needs can refer to the following
Complexity of Time:
This article mainly introduces the method_missing of Ruby Meta programming, this article introduces a phenomenon that causes death cycle when using method_missing, the friend who need can refer to the following
We know the top-level domain, what is
How to learn ruby at high speed ? The quickest way to learn a language.variables, constants, variable types, operators.Logical statements such as if, else, switch, for, foreach, does while, break, and so on. What languages do you want to learn? What
Ruby on Rails can be installed in two ways.
1. Direct Installation
We can download Ruby on Rails from the official website.: Http://rubyonrails.org/
After the download is complete, you can directly install it. It cannot be installed in a path
This example will show you how to escape and un-escape a value to be encoded in a URI and within HTML.
Require 'cgi' # Escapename = "Ruby? " Value = "Yes" URL = "Http://example.com /? "+ CGI. Escape (name) + '=' + CGI. Escape (value) +" & Var = t" #
ArticleDirectory
Ruby source code
Windows
Linux
Here, you can download the latest Ruby version suitable for you. The current stable version is 1.8.6. Read the ruby open source license before downloading it. Ruby
Source
In Ruby, you check with nil? if an object is nil:article = nilarticle.nil? # => true
empty?Checks if an element-like a string or an array F. E.-Is empty:
# Array[].empty? #=> true# String"".empty? #=> true
Rails adds the
First, let's clarify this sentence. In Ruby, the methods are dividedpublic,privateAndprotectedThree, onlypublicMethod can be used as the controller action.
The error code is as follows:
Controlle
class ArticlesController
View show.html.
Let's take a look at a question. This is a question on codewars. I have seen it very early, but I won't write it. When I saw this question again, I had just read the Yuan programming book and thought it was time to solve it. Not much nonsense. Let's
Last night, I finally met the legendary village chief. The village chief was the webmaster of rubycn. It took a long time to use Ruby. This talent started to understand Ruby and read the blog of the village chief. the other is Xin Rick, who works in
In Ruby, you can call constructor to create an object.
Song1 = song. New ("Ruby ")
Ruby rarely processes single quotes. Except for a few exceptions, the literal content entered into the string constitutes the value of this string.
Ruby handles
Zhou haihan 2010.7.12
Ubuntu 10.04 has the following problems when installing Ruby and rails:
'Require ': no such file to load -- mkmf (loaderror)
Installation Process:
Install ruby1.9.1
Zhouhh @ zhh64 :~ $ Sudo apt-Get install
In Ruby, everything is an object. This is very popular for users who like to use highly object-oriented languages (such as Smalltalk, Eiffel or clos. For example, 1, 2, 3, or 10.8 are all objects, rather than the original type in Java or C ++.
The. vcproj file is no stranger to Visual Studio (VC ++) users, and. vcxproj is released after vs2010, The. vcproj file is changed
. Vcxproj. They are all XML-based files, so there are many libraries for parsing them. Here I will use libxml.
The
Deploy the Ruby server and ruby# Create a project directory/Opt/logs/TV-cibn-cms# Install rbenv and ruby 1.9.3 IN ruby# Install and compile related packagesYum install-y gcc openssl-devel libyaml-devel readline-devel zlib-develSu-ruby #/home/ruby#
Tutorial on creating and using hash in Ruby and ruby hash
Hash is a set of key-value pairs similar to "employee" => "salary. Hash indexes are completed by any key of any object type, rather than an integer index. Others are similar to arrays.
The
Ruby-implemented file self-deletion code sharing, ruby-implemented code sharing
Because the File Deletion mechanism in windows is different from that in unix like, so does not guarantee that the following code can be used in windows. Which of the
Python Data Type & character encoding, python Data Type
I. Number
Integer int
x=10 #x=int(10)print(id(x),type(x),x)
Float
salary=3.1 #salary=float(3.1)print(id(salary),type(salary),salary)
Ii. String
name='hantao'
# Value by index (forward and
Ruby metaprogramming examples
I like ruby metaprogramming very much. puppet And chef use many ruby language features to define a new deployment language.I would like to share some of the scenarios used in actual projects with limited capabilities.
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