首页 软件开发 代码片段 ruby ( Page 22 )

ruby 388

#Ruby
Ruby 的 UDP 客户端一例

require 'socket' s = UDPSocket.new s.send("hello", 0, 'localhost', 1234)

2015-03-16 730

#Ruby
打印Ruby所有类在阵列

ObjectSpace.each_object(Class).to_a ObjectSpace.each_object(Class).to_a ObjectSpace.each_o…

2015-03-15 439

#Ruby
hello

asd

2015-03-15 837

#Ruby
去掉文件里重复的行

old = File.open(ARGV[0]).collect new = File.open(ARGV[1],"a+") for i in 0..old.length-1 ne…

2015-03-15 161

#Ruby
Ruby 调用 IE 解析页面,并获取解析结果

require 'win32ole' web_browser = WIN32OLE.new('InternetExplorer.Application') web_browser.…

2015-03-15 953

#Ruby
ruby用 3行代码发送 gmail

g = GmailSender.new('xxxxx@gmail.com', 'password') #next unless File.exist? fn #g.attach(f…

2015-03-14 420

#Ruby
判断 拼音的正则

#区分拼音和英文的代码 #拼音正则1 R = /(b|p|m|f|d|t|n|l|g|k|h|j|q|x|zh|ch|sh|r|z|c|s|y|w)(a|o|e|i|u|ao|iu…

2015-03-14 300

#Ruby
Ruby 使用 TkEntry

require 'tk' top = TkRoot.new {title "Label and Entry Widget"} lb1=TkLabel.new(top){ text …

2015-03-14 662

#Ruby
排除Rails与Postgres整合时的错误

unix_socket_directory = '/var/pgsql_socket'

2015-03-14 215

#Ruby
快捷完成复杂的公式运算——自定义公式并自动计算的Ruby应用

class CustomFunctionsManager attr_accessor :functions def initialize(dataFilePath) @dateF…

2015-03-13 790

#Ruby
Ruby 检查 HTTP 请求的返回代码

require 'net/http' # The library we need host = 'www.example.com' # The web server path = …

2015-03-12 225

#Ruby
ruby 查询 QQwry.dat ip 库的 IpLocationSeeker 类

#!/usr/bin/env ruby # -*- coding: utf-8 -*- # require 'rubygems' #gem install qqwry requir…

2015-03-12 725
1 20 21 22 23 24 33