-
让windows的netstat -ano 显示IP所属地区区域和进程名
所属栏目:[百科] 日期:2020-12-17 热度:67
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #! /usr/bin/env ruby# =kk=# [email?protected]# coding: utf-8## 需要 QQwry.dat 这个纯真IP库 require 'ipwry.rb'@i = IpLocationSeeker.newdef ad[详细]
-
一键push 到 所有 git 仓库
所属栏目:[百科] 日期:2020-12-17 热度:186
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #!/usr/bin/env ruby# -*- coding: utf-8 -*-def t s p s Thread.new { system s }end`git remote`.each_line do |x| t "git push #{x.strip} master[详细]
-
Ruby 使用 Net::HTTP 一例
所属栏目:[百科] 日期:2020-12-17 热度:119
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 require 'net/http'home = Net::HTTP.new("www.oschina.net",80)response,text = home.get("/code/list",nil)puts text 以上是编程之家(jb51.cc)为你[详细]
-
wxRuby编写的简单计算器
所属栏目:[百科] 日期:2020-12-17 热度:69
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 ?#=====================================================# █ wxRuby Calculator Sample Code#==================================================[详细]
-
Ruby 获取 HTTP 回应的编码和内容
所属栏目:[百科] 日期:2020-12-17 热度:65
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 require 'net/http'response = Net::HTTP.get_response('www.oschina.net,'/code/list')response.code # = "200"response.body.size # = 21835respons[详细]
-
Ruby 在 Windows 下播放声音
所属栏目:[百科] 日期:2020-12-17 热度:146
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 require "win32ole"sound = WIN32OLE.new("MCI.MMcontrol")wav = "c:windowsmediaThe Microsoft Sound.wav"sound.fileName = wavsound.autoEnab[详细]
-
Rails 使用 save 方法创建新纪录
所属栏目:[百科] 日期:2020-12-17 热度:95
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 drop database Contact;create database Contact;use Contact;CREATE TABLE Employee ( id int unsigned not null auto_increment primary key,Name V[详细]
-
Ruby 调用远程对象
所属栏目:[百科] 日期:2020-12-17 热度:164
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 require 'drb'class Counterattr_reader:count def initialize @count = 0 end def increment @count += 1 endendcounter = Counter.newDRb.start_ser[详细]
-
纯Ruby实现的AES加解密算法
所属栏目:[百科] 日期:2020-12-17 热度:58
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 class Array def rot(offset=1) # rotate byte self[offset..-1]+self[0,offset] end def ^(otherArray) zip(otherArray).map { |pair| pair[0]^pair[[详细]
-
Ruby 使用 XPath 遍历 XML 文档
所属栏目:[百科] 日期:2020-12-17 热度:94
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 xml = %{aquarium fish color="blue" size="small" / fish color="orange" size="large" fish color="green" size="small" fish color="red" size="ti[详细]
-
Ruby 冒泡排序
所属栏目:[百科] 日期:2020-12-17 热度:189
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 def bubbleSort(a) swapped = true while swapped == true i = 0 swapped = false while(i a.length-1): temp1 = a[i] temp2 = a[i+1] if (temp1 temp[详细]
-
Rails 的 Controller 调用其他路径的 View 模板
所属栏目:[百科] 日期:2020-12-17 热度:63
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 class HelloController ApplicationController def there if Time.now.hour == 12 render(:file = 'C:here.rhtml') end end def here end end 以上是[详细]
-
完美解决rails中国时区时间设置
所属栏目:[百科] 日期:2020-12-17 热度:75
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 config.active_record.default_timezone = :localconfig.time_zone = 'Beijing' 以上是编程之家(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮[详细]
-
对每个model的field错误信息提取到div的方法
所属栏目:[百科] 日期:2020-12-17 热度:67
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 module ApplicationHelper def error_div(model,field,field_name) return unless model field = field.is_a?(Symbol) ? field.to_s : field errors =[详细]
-
Ruby 使用 TkListbox
所属栏目:[百科] 日期:2020-12-17 热度:144
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 require 'tk'top = TkRoot.new {title "Label and Entry Widget"}list1 = TkListbox.new(top)list1.insert(1," Python")list1.insert(2," Perl")list1[详细]
-
蒙娜丽莎的微笑 Ruby版
所属栏目:[百科] 日期:2020-12-17 热度:118
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #!/usr/bin/env rubyrequire "chingu"include Gosuinclude Chinguclass MonaLisa Chingu::Window def initialize super(600,550,false) self.input =[详细]
-
ruby发送、接收server-ex2007邮件
所属栏目:[百科] 日期:2020-12-17 热度:104
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #Ruby发送、接收server-ex2007邮件require 'net/smtp'require 'net/pop'EXServer = 'server-ex2007.xxx.com.cn' #填写EX2007Server地址def send_mail([详细]
-
Ruby快速排序法
所属栏目:[百科] 日期:2020-12-17 热度:161
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 def partition(data,front,back) lastS1 = front pivot = data[front] frontUnknown = front + 1 while frontUnknown = last do if data[frontUnknown[详细]
-
Ruby 读取 HTML 页面参数
所属栏目:[百科] 日期:2020-12-17 热度:66
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #!/ruby/bin/rubyrequire 'cgi'print "Content-type: text/html nn"cgi = CGI.newprint "Name = "print cgi['Name']print"br"print"br"print "Type[详细]
-
一个简单的可逆的ruby字符串加密解密算法
所属栏目:[百科] 日期:2020-12-17 热度:170
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #encoding: utf-8class Des require 'openssl' require 'base64' ALG = 'DES-EDE3-CBC' KEY = 'uryeiyel' DES_KEY = 'uygbfs3w' class self def encod[详细]
-
Ruby 多次调用远程对象的方法
所属栏目:[百科] 日期:2020-12-17 热度:125
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 require 'drb'class Counterattr_reader:count def initialize @count = 0 end def increment @count += 1 endendclass TrackedCounter Counterattr_r[详细]
-
使用 wxRuby 创建 GUI 应用程序
所属栏目:[百科] 日期:2020-12-17 热度:63
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #!/usr/bin/ruby -wrequire 'wxruby'class TroutApp Wx::App def on_init frame = Wx::Frame.new(nil,-1,'Tiny wxRuby Application') panel = Wx::Sta[详细]
-
幽灵方法:动态生成方法
所属栏目:[百科] 日期:2020-12-17 热度:151
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 class Lawyer def method_missing(method,*args) puts "You called: #{method} (#{args.join(',')})" puts "You also passed it a block" if block_gi[详细]
-
使用 Soxer 创建第一个网页 Hello World
所属栏目:[百科] 日期:2020-12-17 热度:85
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 # Create all needed directoriesmkdir myapp myapp/lib myapp/public myapp/views myapp/content# Download and untar the Soxer source.cd myapp/li[详细]
-
ruby调用webservice的示例代码
所属栏目:[百科] 日期:2020-12-17 热度:97
今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 require 'rubygems'require 'soap/wsdlDriver'url = "http://localhost:3001/hello_message/wsdl"client = SOAP::WSDLDriverFactory.new(url).create_[详细]