自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(9)
  • 资源 (1)
  • 问答 (1)
  • 收藏
  • 关注

转载 OpenTextFile

Visual Basic for Applications ReferenceVisual Studio 6.072 out of 190 rated this helpful - Rate this topicOpenTextFile MethodSee Also    Example    Applies To    Specific

2014-10-30 20:17:26 633

原创 IP地址与整数的相互转换

require 'ipaddr'

2014-10-20 16:52:27 722

转载 in Ruby, conversion of float integer into %H %M %S time

How do you convert a float, say 13.5, to the corresponding 24-hour time %H:%M:%S? (13.5 would be 13:30:00, 8.25 would be 8:15:00) I'm still figuring the Time class...it confuses mesec = (13.5 *

2014-10-16 15:02:20 425

转载 how to remove nil and blank string in an array in Ruby

I am new to Ruby and stuck with this issue. Let's say I have an array like this:arr = [1, 2, 's', nil, '', 'd']and I want to remove nil and blank string from it, i.e. final array should be:arr

2014-10-14 10:25:26 423

转载 Seeing numbers in Ruby with r attached to the number

0.1r #=> (1/10)0.1r * 3 #=> (3/10)

2014-10-13 10:30:36 346

转载 the different of Hash.new([]) and Hash.new{[]}

Consider this code:h=Hash.new(0) #new hash pairs will by default have 0 as valuesh[1]+=1 # {1=>1}h[2]+=2 # {2=>2}that's all fine, but:h=Hash.new([]) #empty array as default valueh[1]1 #{1=>

2014-10-09 13:18:33 329

转载 How to get the HTML source of a webpage in Ruby

Use Net::HTTP:require 'net/http'source = Net::HTTP.get('stackoverflow.com', '/index.html')

2014-10-07 09:05:13 550

转载 Ruby: How to find all indices of elements that match a given condition?

Ruby 1.9:arr = ['x', 'o', 'x', '.', '.', 'o', 'x']p arr.each_index.select{|i| arr[i] == 'x'} # =>[0, 2, 6]Code

2014-10-06 23:03:51 427

转载 How to sum values in an array with different hash

I want to sum the total values of the same items in an array.I have a array as[{"a"=>1},{"b"=>2},{"c"=>3},{"a"=>2},{"b"=>4}]I want to get the result as[{"a"=>3},{"b"=>6},{"c"=>3}]Which

2014-10-02 14:49:56 303

AdbeRdr930_zh_CN

ADOBE公司出品的PDF文件阅读器,非常好用!

2012-04-20

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除