上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 40 下一页
  2015年11月30日
摘要: 1获取字符串某部分s = "My kingdom for a string!"s.slice(3,7) # kingdoms[3,7] # kingdoms[/.ing/] # kings[/str.*/] # strings.slice(3).ord # 107 阅读全文
posted @ 2015-11-30 23:07 c3tc3tc3t 阅读(141) 评论(0) 推荐(0)
摘要: 1 单独处理字符串的字符如果处理的是ASCII码的文档使用string#each_byte注意 没有 string#each方法,String#each_byte 速度比 String#scan快 ,String#scan用于配合正则表达式时使用'foobar'.each_byte { |x| pu... 阅读全文
posted @ 2015-11-30 20:08 c3tc3tc3t 阅读(163) 评论(0) 推荐(0)
摘要: ascii转字符或者字符串转ascii"a".ord # => 97"!".ord # => 33"\n".ord # => 10'a'[0] # => "a"'bad sound'[1] # => "a"'a'[0].ord # => 97'bad sound'[1].ord # => 9... 阅读全文
posted @ 2015-11-30 20:00 c3tc3tc3t 阅读(395) 评论(0) 推荐(0)
摘要: 在一个ruby字符串中包含表但是或者变量。想使用不同的值替换表达式或者变量1 类似java 或者python的printf-style方式template = 'Oceania has always been at war with %s.'template % 'Eurasia' # => "Oc... 阅读全文
posted @ 2015-11-30 14:00 c3tc3tc3t 阅读(174) 评论(0) 推荐(0)
摘要: 1 从一种数据结构中构件字符串hash = { key1: "val1", key2: "val2" }string = ""hash.each { |k,v| string "The number is 5.""The number is #{5}."# => "The number is 5.... 阅读全文
posted @ 2015-11-30 13:25 c3tc3tc3t 阅读(349) 评论(0) 推荐(0)
  2015年11月24日
摘要: 搜了一下原来缺少这个sudo apt-get install lib32z1 lib32ncurses5 lib32stdc++6 阅读全文
posted @ 2015-11-24 21:10 c3tc3tc3t 阅读(839) 评论(0) 推荐(0)
  2015年11月19日
摘要: http://lea.verou.me/demos/nth.html 阅读全文
posted @ 2015-11-19 21:27 c3tc3tc3t 阅读(216) 评论(0) 推荐(0)
  2015年11月13日
摘要: 1 找到ruby执行文件目录$ wherris rubyruby: /usr/lib/ruby /home/rudy/.rbenv/shims/ruby2 设置软链接sudo ln -s /home/rudy/.rbenv/shims/ruby /usr/bin/ruby 阅读全文
posted @ 2015-11-13 15:18 c3tc3tc3t 阅读(227) 评论(0) 推荐(0)
  2015年11月8日
摘要: 转自: http://www.cnblogs.com/elementstorm/archive/2013/04/10/3012679.htmlanon :true //匿名函数声明中function关键字与()之间的空白可以被省略bitwise : true //允许按位运算browser : ... 阅读全文
posted @ 2015-11-08 11:00 c3tc3tc3t 阅读(597) 评论(0) 推荐(0)
  2015年11月7日
摘要: 配置好supervisor路径后 出现了 启动时出现了/usr/bin/env: node: 没有那个文件或目录需要讲.nvm下的node链接到, /usr/bin/目录下sudo ln -s /home/rudy/.nvm/versions/node/v4.2.1/bin/node /usr/bi... 阅读全文
posted @ 2015-11-07 20:50 c3tc3tc3t 阅读(2076) 评论(0) 推荐(0)
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 40 下一页