Input and output
In all this series of articles, a large number of Ruby standard output methods are used when writing Ruby code. Among them, the most common is the print and puts methods, the details of its use no longer repeat.
All of these and
Ruby has three classes of variables, one constant, and two strict pseudo variables (pseudo-variables). There are no types for variables and constants. Although there are some drawbacks to the untyped variable, there are more advantages and good
Ruby books are not many, the following are all I collected from the network, download the direct click of the picture can be
Programming Ruby, Second Edition:ruby Primer, second edition, learning Ruby must read
1. Installation RVM
Curl-l Https://get.rvm.io | Bash-s Stable
RVM is a command-line tool that provides management and switching of multiple versions of the Ruby environment, as well as different gemset depending on project management.
If
If you just need to find the text of the string, do not use regular expressions: string[' text '
For simple structures, you can query directly using the string[/re/] approach.
Match = string[/regexp/] # Get content of matched regexp
The calculation of the shortest editing distance is realized by using dynamic programming algorithm.
Copy Code code as follows:
#encoding: Utf-8
#author: Xu Jin
#date: Nov 12, 2012
#EditDistance
#to find the minimum cost by using
A collection of hashing-value pairs, similar to this: "Employee" => "salary". It is similar to an array, except that the index is the type of any object that passes through any key, not an integer index.
Sequential traversal of a hashing or value
Ruby arrays are ordered, any object's?? A collection of integer indices. The elements in each array are associated with an index mentioned.
The array subscript starts at 0, such as C or Java. The negative index assumes the end of the array---that
while (when ...) ) loop
While conditionStatement 1; Statement 2; Statement...End
Single While loop
(statement 1; Statement 2; Statement... ) While condition
Until (until ...) ) loop
Until condition = While not
Large data operation involves data cleaning step or script processing is more convenient, the following introduction pig loading HDFs file calls Ruby script processing data, and then return data flow to the pig processing a simple case.
Note: Ruby
Create class: Class is followed by the name, where the first letter of the class name must be capitalized. When instantiated, it is instantiated with the new method. There are constructors in C #, and constructors have the same name as the class. In
I have nothing to do, with Mechanize do a can download the campus photo album Code.
It's a little shabby .... The main is based on the address of the album to analyze the user ID and photo album ID, and then simulate the request album page, and
Using Git to manage code engineering is a lot more convenient, but when you're done feature branch or finish hotfix, always forget to delete these useless branches, one by one delete really troublesome, repetitive manual labor is not in line with
Active record makes it easy to implement CRUD database basics, in the following sections we use the Orders table in the MySQL database for CRUD operations, this time we look at the creation.
We're supposed to have a model called Order:
Class
Rails Brochure3.8 UsechangeMethod1. Add a field to a tableRails g Migration Add_column_to_d_groups_equip_numclass Addcolumntodgroupsequipnum ] def change add_column:d _groups,: Equip_num,: Integer endend2. modifying table field typesRails g
NetWeaver has a mini JavaScript engine Cl_java_script, the compilation and execution of JS code is done with system call.Only for toys: report SjseuExecution Result: 120In the SAP C4C UI designer, the event handler can be written in Ruby script, and
1." Hello "This write "Hello" to the screen with a new line tailed to.Print " Hello "Just like puts, but without new line.2." You know nothing ". LengthThis output of the string length." Jon Snow ". Reverse"Wons Noj"" Overwatch " . Downcase #--->
Python3 basics-knowledge points and python3
1. Basic syntax
Encoding, identifier, reserved word, comment, line and indent...
2. Variable type
(1) Python3 has six standard data types:
Numbers (number)
The numeric data type is used to store numeric
Use virtualbox + vagrant in win10 to configure the ruby development machine environment, win10virtualbox
Before writing this article, I have tried a variety of alternative methods, such as installing kylin ON THE wmware virtual machine. However,
My path to Python development-web page authorization (SCAN code login), the path to python
Another account has some problems, so I want to use this.
At the beginning, I was not fully familiar with this aspect. I want to write my own ideas. You can
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