Ruby executes shell commands, often "," but this is a little bit of a problem, that is, this is a new sub-process, which means that if you use the ", then the entire method can only execute the shell once, if the following also depends on the
Discover SharpDevelop also supports Ruby, especially if you can directly use the WinForm control directly in the require"mscorlib"require"System.Windows.Forms, version=2.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089"require"System.Drawing,
Ruby InstallationInstalling Ruby from source code under Windows is a very hard errand that can be http://rubyinstaller.org/from theor http://railsinstaller.org/ download the packaged installer. Ruby Configuration
Configuring environment
Transfer from https://ruby-china.org/topics/26120Because of the flexibility of Ruby, how good use, in fact, is more skillful, in fact, summed up, can be categorized as followsregular business, not the last resort, do not use meta-programming, do not
Brief introductionStackprof is a sampling-based tuning tool, what are the benefits of sampling? The advantage is that you can use it online and grab part of the data based on the built-in algorithm, affecting only a fraction of the performance. It
In a nutshell, it isClass can instantiate module noEverything else is the same.A little difference in inheritanceClass is a keyword that uses Application Scenarios for moduleAs a namespace, put the general const or their own class as mixin, put the
Sometimes, we need the server to control the remote server to do some things, while stable and reliable, will not suddenly hang out or anything.Then Ruby is a great tool.# encoding:utf-8#!/usr/bin/ruby# encoding:utf-8# Port 1990# Browser access:
The difference between recursion and iteration Recursion: 1) recursion is the invocation of itself within a procedure or function; 2) When using recursion, there must be a definite recursive end condition called a recursive exit. Iteration: Use the
The syntax for instance variables in Ruby is somewhat similar to the properties of Java objects, but the classes in Ruby also have strength variables,Class person @name = ' Hello ' def initialize (name,age) @name = name @age = Age End def
This is the source code in the book.File.foreach ('1.txt') do |x| if (($. = = 1) | | x =~/eig/). (($. = = 3) | | x =~/nin/) Then Print x endendWhere 1.txt content is as followsFirstsecondthirdfourthfifthsixthseventheigthninthtenthRead the
Code blocks are more or less exposed in other languages, such as Perl sort{$a $b}keys, the incoming code block is sorted by value, the closure is used in swift, further learning training closure, capturing The code style, such as value, has a deep
What Proc and Lambda have in common:
Similar syntaxproc.new{|n| N**2}lambda{|n| N**2}
Can be called with the. Call methodHello_proc = proc.new{puts "hello!"}Hello_proc.call #Hello!Hello_lambda = lambda{puts "hello!"}Hello_lambda.call
Ruby-2.1.1-#downloading rubygems-2.2.3% total% Received% xferd Average speed Time Time currentDload Upload Total spent0 0 0 0 0 0 0 0--:--:--0:00:01--:--:--0curl: (+) The requested URL returned Error:4 Found notThe requested URL does not exist: '
I,
Definition:
HSH = hash. New
HSH = hash [1 => "A", 2 => "B"]
HSH = {"1" => "A", 2 => "B "}
Any object is supported as the key, and you are used to using symbol.
Ii. Common Methods
#!/usr/bin/ruby def printResult(args) print args
Explanation of the method_missing method in the Ruby metaprogramming dream, rubymethod_missing
I recently read some articles (such as this article) to promote the use of method_missing in Ruby.
Many people are in a fire with method_missing, but they
Explain in depth the quick usage of Block code in Ruby and explain the rubyblock code.
BlockDefinition
some_array.each { |value| puts value + 3 }sum = 0other_array.each do |value| sum += value puts value / sumend
A block is somewhat like the body
Tutorial on web Information capturing using Ruby program, rubyweb
Websites no longer simply cater to human readers. Many websites now support APIs that allow computer programs to obtain information. Screen capture-time-saving technology for parsing
Delete merged git branch scripts in Ruby, rubygit
It is much easier to use Git to manage code projects. However, after completing the feature branch or hotfix, you always forget to delete these useless branches one by one, repetitive manual work
Parse Ruby variables in detail, and parse Ruby variables in detail
The location where the variable holds the data of the program to be used.
Ruby supports five types of variables. In the previous section, we have gone through a brief description and
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.