Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
windwiny
@windwiny
会员
第 5017 位会员 / 2012-12-14

18 篇帖子 / 138 条回帖
0 关注者
0 正在关注
0 收藏
未设置 GitHub 信息。
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • 用 Ruby 做编译原理大作业 at 2017年03月15日

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

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

  • 怎么样列出 dll 文件的所有方法和参数 at 2015年12月27日

    找到 dll 对应的 .h 文件

  • 我用 R at 2015年12月27日

    cool

  • 本人自行删除 at 2015年11月19日

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

  • 千万别构建超过 23 个字符的 Ruby 字符串 at 2015年11月19日

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

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

    you win

  • Ruby 中有要求强制实现的虚函数吗? at 2015年10月25日

    如果用 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 2015年10月11日

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

  • Rails 4-2-stable 参考手册 (Beta) at 2015年08月22日

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

  • Rails 4-2-stable 参考手册 (Beta) at 2015年08月21日

    cool!

  • Ruby 读写 Excel 2007,求大牛指导 at 2015年07月27日

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

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

  • '#' + '@' 会自动多一个 '\' at 2015年02月26日

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

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

    没权限吧

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

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

    在模板上加入 ruby 代码

    require 'pry'
    binding.pry
    

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

  • 安装 bson_ext 出错 at 2014年12月09日

    提示少文件,少开发包

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

    互联网变局域网了

  • Side-project story at 2014年12月01日

    不准确

  • [远程] 招聘 Ruby 实习生 at 2014年11月14日

    有意思

  • 菜逼学 Ruby,关于一个属性 at 2014年11月09日

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

  • ruby 获取由两个字节的 12 个比特位组成的一个整型值 at 2014年10月29日

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

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

    flush?

  • 有必要用 rails_admin 吗? at 2014年09月21日

    active_scaffold 不错

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

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

  • Ruby 2.2.0-preview1 is released at 2014年09月20日

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

  • gets 和 ARGV 的小疑问 at 2014年09月10日

    可能版本不一样吧。

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

  • gets 和 ARGV 的小疑问 at 2014年09月08日

    就是这样的功能

    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 2014年08月20日

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

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

    用 select

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