The scripts written in Ruby run faster, and you decided to use ruby.
Compared with my e-commerce website, I have the opportunity to use it: Get all URLs on a page.
Save the following script as URLScan. RB. Usage: run the CMD command to enter the
# Part One Afile = file.
New ("C: \ 1.txt"," W ")
Afile. Puts "The 1"
Afile. Puts "The 2"
Afile. Close
# Part Two
Afile = file.
New ("C: \ 2.txt"," W ")
Puts "The 1"
Puts "The 2"
Afile. Close
I'm bored and have a look at how Ruby reads and
Recently, I was working on a project using the rails framework and the ruby language. I personally don't feel very useful, and there are many problems with the framework and language.
Today, I encountered a very strange problem.CodeWIN32API is
Ruby Study Notes (1) Abstract: I found a good place to learn Ruby. I try to spend some time learning every day. Read the full text
Ruby Study Notes (2) Abstract: This lesson contains a lot of content. Read the full text.
Ruby Study Notes (3)
Ruby supports arrays and hash. Both arrays and hash are accessed through indexes. The difference is that arrays are indexed by numbers, while hash indexes can be any object, therefore, the array access speed is faster (direct positioning), while
1. = (equal to) and! = (Not equal)
Returns true and flase if the values of the two objects are equal.
A = 1; B = 1.0; A = B # True
2. eql?
Returns true and flase if the values and types of the two objects are equal.
A = 1; B = 1.0; A. eql? (B)
In the previous blog, such code 1 class songlist was used.
2 def [] (key)
3 return @ songs [Key] If key. kind_of? (Integer)
4 return @ songs. Find {| Asong. Name = key}
5 end
6end
In the fourth row, a method such as find can traverse the songs
Preface
Today, when giving a lecture, Mr. Jiang talked about the development concept of Ruby on Rails, that is, happy programming. It is a pleasure to write code.
In the world of study, I don't feel how happy I am. I just don't have to go to work.
Use before_invocation to verify the call permission
API
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Class blogapi Api_method: hello_world,
: Expects => [{"password" = >:string}, {"user" =
How to interview Ruby/rails Daniel by YuanYi | published: July 28,200 8
The Internet has no threshold for reporters. Anyone who wants to become a network reporter, especially a network technology reporter, even does not need to meet the interviewer.
$res = "__"def lamb(&lamb)3.times do puts $res=lamb.call end puts "-------at the end of lamb() : #{$res}"enddef lamb_test lamb { return puts " return in lamb() " } puts "--------at the lamb_test() end"enddef bl3.times do puts $res=
1. Install JDK
Jdk-6u7-windows-i586-p.exe
2. Install instantrails
2.1 decompress the package in any directory.
InstantRails-2.0-win.zip
(Instantrails has a lot of built-in software and has been configured, for example, Ruby 1.8.6 rails 2.0.2 MySQL
No browser is displayed$ Hide_ie = true
How to obtain the path of the current fileFile. dirname (_ file _). to_s
Read files:Method 1:$ Result = 'd: // rs.txt'File. Open ($ result, "R") Do | file |File. each_line do | Line |If line. length>
Ruby keywords yield
The ruby keyword yield is a commonly used keyword in actual programming. Programmers who have just learned the ruby language must first master the usage of this type of basic keywords.
Some basic keywords in ruby are essential
Many Ruby syntaxes and special dynamic features remind me of oracle.
Ruby can execute dynamic code through eval ("2 + 2") = 4
Eval brother banding:
def eval_first puts eval("2+2") end def binding_elsewhere x=20 return binding end def
Self Context
Ruby's self is similar to Java's this, but is quite different. Java methods are referenced in the instance method, so this generally points to the current object. Ruby code is executed row by row, so the context self has different
Ruby On Rails has been a hot topic recently On the Internet. Many people have given him the praise of the "alternative to Java Enterprise Application Development. Even a foreigner said on the Internet that a project with Java4 months was completed
Running environment:
Ruby 1.8.6
Rails 1.2.5
Gem 1.0.1
The gmail server is used here. Because actionMailer in rails does not support TLS (SSL) connections, it is the only transmission method on the Gmail SMTP server. There is a plug-in provided for
The ruby class is a single inheritance creature, so there is a module, implementing multi-inheritance,
Note: The names of modules, constants, and classes start with an uppercase letter.
, Module reference:1. If the referenced module is in the same
Record various problems and solutions encountered during Redmine mail synchronization Configuration
1. How to install RedmineHttp://www.redmine.org/projects/redmine/wiki/RedmineInstall
2. How to configure automatic email receiving and timed
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