Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
windwiny
@windwiny
Member
NO. 5017 / 2012-12-14

18 Topics / 138 Replies
0 Followers
0 Following
0 Favorites
No GitHub.
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 用 Ruby 做编译原理大作业 at March 15, 2017

    想不想挑战一下自己?把 flex 移植到 ruby 吧

    yacc 的 ruby 版 racc 已经很成熟了,flex 却没有同一级别的代替

  • 怎么样列出 dll 文件的所有方法和参数 at December 27, 2015

    找到 dll 对应的 .h 文件

  • 我用 R at December 27, 2015

    cool

  • 本人自行删除 at November 19, 2015

    recv 有指定长度的,也有超时时间参数

  • 千万别构建超过 23 个字符的 Ruby 字符串 at November 19, 2015

    这文档有点老了,用最新版的 ruby 性能差不了太多

  • 下线 Gravatar 头像功能,改由 letter_avatar 代替,并且没上传头像不允许发帖了 at October 28, 2015

    you win

  • Ruby 中有要求强制实现的虚函数吗? at October 25, 2015

    如果用 mixin 的方式,倒是可以提示你要实现什么

    module Person
      def self.included x
        ms = x.instance_methods(false)
        [:xx, :yy, :zz].each do |xn|
          raise "请实现 #{xn} 接口" unless ms.include?(xn)
        end
      end
    end
    
    class Customer
      def xx;end
      def yy;end
      def zz;end
      include Person
    end
    
    c = Customer.new
    c.xx
    c.yy
    c.zz
    
    
  • Ruby marshal dump 的东西自己也不认得 at October 11, 2015

    win OS 里 File.open 要用 'rb' 模式吧

  • Rails 4-2-stable 参考手册 (Beta) at August 22, 2015

    生成的 pdf 的字体有点怪,有好几种字体,能调整吗?

  • Rails 4-2-stable 参考手册 (Beta) at August 21, 2015

    cool!

  • Ruby 读写 Excel 2007,求大牛指导 at July 27, 2015

    roo 只读,axlsx 只写,rubyXL 支持读写

    不同 gem 支持的文件类型有多有少

  • '#' + '@' 会自动多一个 '\' at February 26, 2015

    实际新生成的字符串没有多 '\',只是 inspect 显示时多出 '\'

  • [已解决] 图片上传遭拒,是 capistrano3 + carrierwave 问题,还是权限问题? at January 23, 2015

    没权限吧

    Errno::EACCES (Permission denied @ dir_s_mkdir - /home/a_project/releases/20150123105103/public/uploads):

  • 当运行 ActiveAdmin 中 Views 下 erb 中的类似 insert_tag renderer_for 语句时发生什么? at January 20, 2015

    在模板上加入 ruby 代码

    require 'pry'
    binding.pry
    

    进入交互模式,执行命令观察结果

  • 安装 bson_ext 出错 at December 09, 2014

    提示少文件,少开发包

  • 我时常感觉整个中文互联网都沉寂了,是我的错觉吗? at December 04, 2014

    互联网变局域网了

  • Side-project story at December 01, 2014

    不准确

  • [远程] 招聘 Ruby 实习生 at November 14, 2014

    有意思

  • 菜逼学 Ruby,关于一个属性 at November 09, 2014

    看代码顺序,后面定义的覆盖前面的

  • ruby 获取由两个字节的 12 个比特位组成的一个整型值 at October 29, 2014

    (('a'.ord & 0b11111) << 7) | ('b'.ord & 0b1111111)

  • ruby 脚本运行结束才可以看到 logger 日志内容 at September 28, 2014

    flush?

  • 有必要用 rails_admin 吗? at September 21, 2014

    active_scaffold 不错

  • 【低级问题】su -c 命令执行和直接执行的区别? at September 21, 2014

    rvm 的问题吧,cd 到一个目录的时候,rvm 还会执行一些东西

  • Ruby 2.2.0-preview1 is released at September 20, 2014

    @ywjno , 哪来的消息,ruby 3.0 ??

  • gets 和 ARGV 的小疑问 at September 10, 2014

    可能版本不一样吧。

    我都是下载 chm 格式的文档,几个版本都有。

  • gets 和 ARGV 的小疑问 at September 08, 2014

    就是这样的功能

    gets(sep=$/) → string or nil click to toggle source 
    gets(limit) → string or nil 
    gets(sep,limit) → string or nil 
    Returns (and assigns to $_) the next line from the list of files in ARGV (or $*), or from standard input if no files are present on the command line. Returns nil at end of file. The optional argument specifies the record separator. The separator is included with the contents of each record. A separator of nil reads the entire contents, and a zero-length separator reads the input one paragraph at a time, where paragraphs are divided by two consecutive newlines. If the first argument is an integer, or optional second argument is given, the returning string would not be longer than the given value in bytes. If multiple filenames are present in ARGV, +gets(nil)+ will read the contents one file at a time.
    
    
  • 读取匹配正则的文件 at August 20, 2014

    一个正则表达式放在双引号里?再当成 readlines 的参数?

    fs=Dir.glob *
    fs.each do |fn|
      if /xxx/ =~ fn
        ...
      end
    end
    
  • ActiveRecord 中的 find_by_sql,为什么不能传参数 at July 30, 2014

    用 select

  • 1
  • 2
  • 3
  • 4
  • 5
  • Next
关于 / RubyConf / Ruby 镜像 / RubyGems 镜像 / 活跃会员 / 组织 / API / 贡献者
由众多爱好者共同维护的 Ruby 中文社区,本站使用 Homeland 构建,并采用 Docker 部署。
服务器由 赞助 CDN 由 赞助
iOS 客户端 / Android 客户端 简体中文 / English