In computer science, binary search (English: Binary search), also known as binary search (English: Half-interval search), logarithmic search (English: Logarithmic search), is an ordered array to find a certain element of the search algorithm. The
Single-piece method
Ruby allows you to add a method to a single object, a method that only takes effect on a single object, called a single piece method
Sample code
str = "Just a regular string"
def str.title?
Self.upcase = = Self
With RBENV to manage multiple versions of the Ruby environment, we also need a tool to manage multiple versions of gems (such as rails), which is bundler, the project background is not in detail, need to understand directly to the official website
In rails, the process of sending a request (/users) is as follows:1), Browser send request (/users)2), rails routes will route the request to the Users_controller index method3), Users_controller callback use user model to get all user4, user model
Proc Objects
Proc are objects that are converted by blocks. There are four ways to create a proc, respectively:
Sample code
# Law one
inc = Proc.new {| x | x + 1}
Inc.call (2) #=> 3
# method two
inc = Lambda {| x | x + 1}
Inc.call (2) # =>
Object-orientedis a very confusing language. It's all about being object-oriented and making people think you're trendy. Ruby claims to be an object-oriented scripting language, but what is "object-oriented"?We've got all kinds of answers, but all
Ruby handles strings like numbers. We enclose them in single quotes (' ... ') or double quotes ("...").
Ruby> "ABC"
"ABC"
Ruby> ' abc '
"ABC"
Single and double quotes have different effects in some cases. A string enclosed in double quotes
Have seen "Ruby design mode" before, but gradually forgot. Now bought a big talk design pattern, it does not look so boring, by the way the code in Ruby implementation.
Simple Factory mode:
#-*-Encoding:utf-8-*-#运算类 class Operation
When an HTTP response is a format that is different from the one in which it exists (XML and JSON), some additional formatting needs to be parsed, creating a format that you are accustomed to, and using it in a category. Idiomatic formats should be
Generalization, the basic data types in Ruby are all class types, but for the convenience of writing and reading, it provides a simpler way to write basic data types.
Type of a value
Integers support binary, octal, decimal, hexadecimal, which
1. The class variable name begins with @@ 开始 and a class variable is shared by all instance objects of this class; the instance variable name begins with the @, each instance object has its own different instance variables;
2, class variables must
Rails accelerates and simplifies the development of Web applications, but it's not mature enough, especially at high-end enterprise-level features. On the other hand, the Java platform and its virtual machines, libraries, and application servers
Note: Ruby Windows Installer Pack please go to http://rubyinstaller.org/download installation.
Installed a Ruby193, wrote the first Ruby program, to record their own learning bit.First in Ruby's new folder, sample, and then add a new file, name
(i) Conditional judgmentthe condition is judged as the basic type:
Copy Code code as follows:
If expression
Code
End
If the expression is not false or nil, then the Code section can be executed, so if it is false or nil for
Ruby provides two levels of access to the network, at the bottom you can access the operating system, it allows you to implement the client and server for the connection-oriented and connectionless protocol basic socket support.
Ruby Unified
JRuby 1.7.26 was released.Home: http://www.jruby.org/: Http://www.jruby.org/downloadJRuby 1.7.26 is the 30th updated version since JRuby 1.7.0. The main release target for version 1.7 is to fix any missing compatibility issues using
Download Rubyinstaller.
Link: http://rubyinstaller.org/downloads/. Run the installation directly
Note You need to add the following in the environment variable: \ruby\bin
Test command: Ruby-v
Install RubyGems.
Part II Third-party frameworks and Libraries the first part of this book takes a deep dive into II main LIBRARIES:DR B and Rinda
Chapter3:ringydingy
including 6 parts:
Installation
Getting Started with
Ruby web performance response time and rubyweb Response Time
You can calculate the loading time of a single web page.
Require 'watir-webdriver 'require 'watir-webdriver-performance 'B = watir: Browser. new: chromeb. goto "http: // 172.17.3.54: 230/
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