Ruby's input and output and standard library

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's variables

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

Installing Ruby in Linux and Windows environments

First, install Ruby under Linux 1-First, we want to get the latest Ruby release version (currently ruby-1.8.2.tar.gz). Please download it to www.ruby-lang.org/en/20020102.html. 2-then decompression: TAR-ZXF ruby-1.8.2.tar.gz 3-Last Run:

Ruby writes a script that scans all URLs of the current page

A script that scans all URLs in the current page, written in Ruby, is a good example of learning Ruby's friends. #scanweb.rb #用法ruby scanweb.rb www.jb51.net 将当前结果保存在c:\1.txt require 'net/http' filename= File.new('c:\1.txt',"w+") if $*[0]==nil puts "

Matrix multiplication algorithm implemented by Ruby _ruby Special topic

Dynamic programming solves the problem of matrix multiplication, randomly produces matrix sequence, output form ((A1 (A2A3)) (A4A5) results. Code: #encoding: Utf-8 =begin author:xu jin, 4100213 date:oct, Matrixchain to find a optimum order by

An example of the regular Expression _ruby topic in Ruby

Regular expressions are a special sequence of characters that can help match or find other strings or string sets, using patterns that maintain a specialized syntax. The regular expression literal is a pattern between a slash or any delimiter%r as

Detailed analysis of variable _ruby topics in Ruby

Variable holds the location where the data for the program to be used is stored. There are five types of variables supported by Ruby. A brief description and these variables have been experienced in the previous chapters. These five types of

Ruby Learning Notes (2) basic use of Classes _ruby topics

Some important differences between Ruby language and C # are: 1.ruby is a dynamic language, C # is a static language--that is, after the object is new, Ruby can also dynamically add some properties or methods to the object instance (JavaScript is

Ruby Accessor Concept _ruby topics

What is an accessor?We've discussed the real variables before, but not too much discussion. The real variable of an object belongs to its property and is a general difference from other objects from the same class. It is important to read and write

Ruby three kinds of gems to perform periodic tasks introduction to _ruby topics

1.whenever First, the whenever is based on the Linux cron service, so there is no direct way to use the gem on the Windows platform. Whenever should technically be a cron translator, translating the Ruby code into a cron script, and handing the

A simple ruby reversible encryption and decryption class _ruby topic

Implementation code: Copy Code code as follows: Class Des Require ' OpenSSL ' Require ' base64 ' ALG = ' DES-EDE3-CBC ' KEY = "mz4wjs6l" Des_key = "nz4wjs6l" #加密 def encode (str) Des = openssl::cipher::cipher.new (ALG)

Implementation of statistics file lines, words and characters in Ruby _ruby topics

In Ruby we define a WC method that is used to count the number of lines of text, words, and characters that appear in a file, and the Ruby Code program is as follows: Copy Code code as follows: def WC (filename) nline = Nword = NCHAR = 0

Some tips for creating strings in Ruby summary _ruby topics

%{string} is used to create a string enclosed in double quotes%q{string} is used to create a string enclosed in double quotes Copy Code code as follows: Str=A string End_of_string %q! Some String of "Characters"! "Some

Use the Ruby Deployment Tool Mina Rapid Deployment Nodejs Application Tutorials _ruby Topics

A previous article about the use of Git hook deployment application, hook method has a flaw is to go to the server every time to modify the hook corresponding configuration file, this profile is separated from the current warehouse, debugging will

Automatic compiling sass tutorials in ruby environments _ruby topics

Sass for the CSS to give the characteristics of dynamic language, such as variables, inheritance, operations, functions, etc., more convenient for the writing and maintenance of CSS! Sass Installation Because SASS relies on the ruby environment,

Ruby implementation Batch add prefix code sharing _ruby Topic

Recently I got a lot of pictures from the designer, the results are 1.png,2.png such file name, they also need to make these files into a readable file name, do not want one to be modified, so wrote a simple script to achieve a lot of multiple files

Ruby on Rails development from scratch (44)-ActiveRecord Foundation (record creation)

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

Ruby on Rails development from scratch (38)-ActiveRecord Basics (columns and attributes)

One of the objects in the ActiveRecord corresponds to a row of tables in the database, and the object's properties correspond to the columns of the table, and you may notice that our order class does not mention anything about the Orders table

Ruby on Rails development from scratch (37)-ActiveRecord Basics

ActiveRecord is an object-relational mapping (ORM) layer provided by rails, starting with the basics of active record, connecting databases, mapping tables, accessing data, and more. Active record uses basic ORM mode: tables are mapped to classes,

Ruby on Rails development from scratch (Windows) (18)-Automatically generate documents

So the implementation of our shopping cart is complete, and we can use Ruby's rdoc to generate documentation for our programs, like Dotnet,java,python, RDoc can extract the annotations from the class and method declarations in our code to generate

Total Pages: 114 1 .... 63 64 65 66 67 .... 114 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.