Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
Sevk
@sevk
高级会员
第 681 位会员 / 2012-01-05

嘉兴
47 篇帖子 / 934 条回帖
10 关注者
1 正在关注
37 收藏
Sevk
打赏作者
GitHub Public Repos
  • kk-irc-bot 55

    irc-bot , like a human

  • rustdesk 0

    An open-source remote desktop, and alternative to TeamViewer.

  • rustdesk-server 0

    RustDesk Server Program

  • notepad4 0

    Notepad4 (Notepad2⨯2, Notepad2++) is a light-weight Scintilla based text editor for Windows with ...

  • VB6toRuby-tk 0

    vb6 code to ruby code auto convert

  • qqwry 0

    纯真IP数据库,每天从官方授权方式自动抓取最新文件

  • linux-wifi-hotspot 0

    Feature-rich wifi hotspot creator for Linux which provides both GUI and command-line interface. I...

  • VB6-Compression 0

    VB6 wrappers for modern compression libraries

  • Dism-Multi-language 0

    Dism++

  • HumanSystemOptimization 0

    健康学习到150岁 - 人体系统调优不完全指南

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • 为什么 Ruby 的体积是最小的 at 2021年05月24日
    ➜  ~ type pu
    pu is an alias for nice sudo pacman -Syu
    
    
  • 延迟退休具体改革方案 将广泛听取 996 码农的意见 at 2021年03月01日

    每种职业不同. 环卫工人,日晒雨淋的,肯定要提前退休. 化工厂,天天接触吸入化工元素. 保安,公交司机 程序员 销售员 高中老师 公关 医生 记者 广告策划师 快递员 警察

  • Ruby 低版本安装 charlock_holmes 问题 at 2021年02月22日
    ***************************************************************************************
    *********** icu required (brew install icu4c or apt-get install libicu-dev) ***********
    ***************************************************************************************
    *** extconf.rb failed ***
    

    看这个提示,要安装 libicu 的开发包

  • Ruby 3 发布这么多天了,怎么没人谈谈 rbs,我认为这是最重要的改变 at 2020年12月29日

    就是 IDE 不够智能,不够完美 . 但是开发足够智能的 IDE 也是很难的。

  • Ruby 3.0.0-preview 版发布了 at 2020年11月09日

    def square(x) = x * x

    一行代码就能解决的事,为什么要去定义成方法,为什么要去改变语法造成版本不兼容?看看 C++ 的语法,真让人炸毛。

  • 你知道在 Ruby 中如何查看 String 是否是回文? at 2020年09月15日
    class String
      def palindrome?
        a=self.gsub(/[^\w]/,'').upcase
        a.reverse == a                                                                   
      end
    end
    
    p "1234321".palindrome? # true
    p "123321".palindrome? # true
    p "122321".palindrome? # false
    p "223321".palindrome? # false
    p "11/11/11 11:11".palindrome? # false. 应该是true
    p "A man, a plan, a canal – Panama".palindrome? # false. 应该是true
    
    
  • 你知道在 Ruby 中如何查看 String 是否是回文? at 2020年09月10日
    class String
      def palindrome?
        self.reverse == self                                                             
      end
    end
    
    p "1234321".palindrome? # true
    p "123321".palindrome? # true
    p "122321".palindrome? # false
    p "223321".palindrome? # false
    
    
  • 谁能告诉我 Ruby 的独特之处在哪 at 2020年09月07日

    自己学,慢慢体会. Ruby 最接近 Perl Java Python Golang Lua . 其它语言区别太大,不用比的。

  • 公司有地毯,对码农还是很重要的 at 2020年08月21日

    缺点是只能用吸尘器清理。

  • Ruby 标准库中缺少 rbtree, 严重影响开箱即用,谁能帮忙给核心开发者提议加入 rbtree。 at 2020年07月29日

    Java 的 HashMap(8 以后)的链表树化是通过 红黑树实现

    Java 的 TreeMap 是通过红黑树实现

    Nginx 是用红黑树管理 timer 等

    Linux 进程调度用红黑树管理进程控制块

    等等……
    [ https://zhuanlan.zhihu.com/p/76554186 ]

  • 请求帮助 Ruby [hash] 与 Python [dict] at 2020年06月17日

    json 格式本身没有规定逗号后面能不能多加个空格。加 2 个空格也是符合语法的。

  • 996 能坚持下来的都是会划水的 at 2020年06月15日

    没有耕坏的地,只有累坏的牛。

  • 判断真假的流程为什么可以是多语句? at 2020年05月14日

    可读性永远是第一位的,人机交流的目标是简单易懂。

  • Ruby 中的类型转换 at 2020年04月24日

    实际使用中,把 "hello" 转换为数字的场景有吗?如果有,也应该转换为 0,而不应该显示错误。

  • 请问如何给官方提建议?期待 Ruby 更加美好 at 2020年04月24日

    语言语法的添加和修改,都是毁灭性的. 可以发明一个新语言,比如 Crystal,也可以做一个语言的子集. 如果像 C++ 那样,不停添加新语法,那就太魔幻了,不适合人类。

  • 请问如何给官方提建议?期待 Ruby 更加美好 at 2020年04月21日

    |x| 这个不是原编程。语言特性越多,学习曲线越复杂,最好的语言是自然语言,比如英文,汉语,计算机人机交流是最好的语言。

  • 请问如何给官方提建议?期待 Ruby 更加美好 at 2020年04月20日

    Ruby 的元编程比其它语言优雅。

  • 讨人厌的后缀表达式 at 2020年03月27日

    一行不超过 79 个字符

  • 为啥安装 Nokogiri 枚举每个版本? 如图 at 2020年03月23日

    2016 年...

  • 为啥安装 Nokogiri 枚举每个版本? 如图 at 2020年03月22日

    他们怎么想的,这还正常啊。看了最后一行,状态是 open 的,估计还在修。

    https://github.com/rubygems/rubygems/issues/494#issuecomment-16973114

    https://github.com/tuna/issues/issues/374

    这里有个坑:

    Please consider reverse-proxying https://api.rubygems.org/api/v1/dependencies at /rubygems/api/v1/dependencies so that dependency lists are fetched through this API, instead of calculated locally, by downloading and parsing all gemspec.rz files.
    
    For your reference, here is a Caddyfile that I use to test the feasibility of the reverse proxy:
    
    localhost:8081
    log stderr
    
    proxy /rubygems https://mirrors.tuna.tsinghua.edu.cn {
        except /rubygems/api
    }
    
    proxy /rubygems/api https://api.rubygems.org {
        without /rubygems
    }
    
    (I am fully aware of the "we don't do reverse proxy" policy of this site, so this is only filed in the hope of being useful to all RubyGems mirror users)
    
  • 为啥安装 Nokogiri 枚举每个版本? 如图 at 2020年03月21日

    命令是:

    gem install nokogiri -VN
    
  • Ruby 抓疫情数据 at 2020年03月09日

    兼容 linux 和苹果系统:

    require "url"
    require "json"
    
    url = URL.new("https://view.inews.qq.com/g2/getOnsInfo?name=disease_h5&callback")
    response = url.get.json
    data = JSON.parse response["data"]
    
    puts data["lastUpdateTime"]
    
    def show_data(data)
      for item in data["areaTree"]
        s=(item["name"].to_s + "累计确诊:" + item["total"]["confirm"].to_s + "例,死亡:" + item["total"]["dead"].to_s + "例,治愈:" + item["total"]["heal"].to_s + "例;")
        if Gem.win_platform?
          puts s.encode("gbk")
        else
          puts s
        end                                                                                  
      end
    end
    
    show_data(data)
    
    
  • gem 安装好后,如何导出给另一相同环境但没有网络的系统使用? at 2020年03月05日

    如果有依赖呢?

  • Ruby 刚和热点擦肩而过。。。 at 2020年03月04日

    其实就是什么文章都能写上去,国外没有做限制. 国内可以做个限制就没事了。

  • Ruby 刚和热点擦肩而过。。。 at 2020年03月03日

    被墙了,要不再山寨一个? 😅

  • 声明一个函数而先不定义它的具体功能 at 2019年11月25日

    简单,可以先定义一个空函数:

    #1.rb
    def f(x)
      puts " f()未定义" 
    end
    

    再定义实际使用的函数:

    #2.rb
    def f(x)
      puts "f() 已定义" 
    end
    

    然后在 3.rb 里,require '2.rb' 就可以了。

  • 这是腾讯的加密步骤,怎么用 Ruby 做出来? at 2019年10月30日
    require 'digest'
    
    s = '{"Limit": 1, "Filters": [{"Values": ["\u672a\u547d\u540d"], "Name": "instance-name"}]}'
    
    print Digest::SHA2.new(256).hexdigest(s).downcase
    
    
  • ruby 没有 python 流行是不是因为 ruby 太难了? at 2019年10月21日

    从语法讲,Ruby 简单多了

  • ruby 中怎么实现可变变量 at 2019年10月18日
    h={}
    h['bj']=100;
    h['sh']=200;
    
    $key='bj'
    print h[key]   
    
    
  • ruby 没有 python 流行是不是因为 ruby 太难了? at 2019年10月11日

    因为网络不好,经常打不开相关的网站。 比如下载这个: https://rubyinstaller.org/downloads/ ,200MB 要花 4 小时。

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