Yesterday I asked the first question in stackoverflow and was despised... This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form "...
The problem is as follows:
I have a CSV
Ror has been blooming abroad for a long time, but it has always been a bit cool in China. Except javaeye, I rarely hear the success stories of domestic ror. On the infoq Chinese site a few days ago, I saw a piece of news from Jeff Xiong. I
1. syntax check (-C)
Execute IN RUBYProgramWhen using the "-c" command, the Ruby interpreter does not execute the program, but checks whether the program is to be executed.CodeCorrectness
Ruby-C eg. Rb
2. Enable warning (-W)
Run the program with
(1) Everything in ruby is an object, including a constant.For example, you can use the. Class Attribute to view the type of an object. You can see that the type of constant 1 is fixnum, and 1 is just an instance of fixnum. You can also use the-37
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
Class
A
Def
SayPuts
"
I'm
"
EndEnd
Class
B
A
Def
Say
#
When super is added, it will not be overloaded and the subclass
Conversion of GBK and UTF-8
Use GBK instead of gb2312, because GBK not only contains simplified Chinese, but also traditional Chinese, is a large character set.
#
Utf8 to GBK
Def
U2g (ucode)Begin
"
# {Iconv. Conv ('gbk', 'utf-8',
I have already introduced something about the ruby language. Next I will start to learn the rails platform that makes Ruby popular.The rails platform can build standard MVC applications. MVC is the controller, view, and model.
The command for
The iterator is a feature of advanced languages and is very easy to use.
For example, array Iteration[1, 2, 3]. Each {| n | puts N. to_s}(1. 100). Each {| n | puts N. to_s} iterates each element
String Iteration"ABDC". each_byte {| CHR | printf "
Today I learned about the closure of Ruby. I mainly read the book "metapromgramming ruby:
Http://book.douban.com/subject/4086938/
In chapter 3, the closed boss at the end of the closure is a question: write your first domain-specific language.
event
I have been reading agile web development with rails over the past few days.
Before reading a book, I thought of the following questions, which need to be found in the book:
How to input validate, such as a required, number, date, range, and
Program:
1: formula (that is, code line, haha)2: Termination of the program
Programs are composed of sub-statements. Use semicolons (;) or line breaks (;) to distinguish between formulas and formulas.In the middle of a row, separate them with
========================================================== ==========================================1. Can the methods in the Controller call each other?2. The @ variable defined in the control method is not an instance variable. It seems that it
/* * $ ID: Ruby. c 571 23: 32: 14z elliotth $ * copyright (c) 2000-2001, thaddeus covert * copyright (c) 2002 Matthias Veit * copyright (c) 2004 Elliott Hughes * this source code is released for free distribution under the terms of the *
Ruby standard type
I. Numbers
Ruby supports integers and floating-point numbers. integers can be of any length.
Integers within a certain range are stored in binary. They belong to the fixnum type. If they exceed this range, they are
The following pattern is commonly used to define method names in ruby.
Def method_name (arg1, arg2) # Some codeend
However, it is often seen in the code of books or other authors that=? !These three special weird symbols serve as the suffix of the
1. system method. System is followed by the command string of the System Shell to be executed as the parameter. This method allows the system program to run in a sub-shell. This is a conventional method for booting external programs in the system
Last week, I received a small Case to import some employee information to the database. I opened the Excel file in the email. The original file format is as follows:
ID FirstName LastName123 Jerry Chou
What I need to do is import the data to the
For example, you write a class named SendMail and put it in a file named send_mail.rb,
If you attempt to reference this class in the same directory
Require "send_mail"
It's a waste of time, we need to add this paragraph
$:
This means that the
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