Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
Sevk
@sevk
VIP
NO. 681 / 2012-01-05

嘉兴
47 Topics / 934 Replies
10 Followers
1 Following
37 Favorites
Sevk
Reward
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
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 为什么 Ruby 的体积是最小的 at May 24, 2021
    ➜  ~ type pu
    pu is an alias for nice sudo pacman -Syu
    
    
  • 延迟退休具体改革方案 将广泛听取 996 码农的意见 at March 01, 2021

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

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

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

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

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

  • Ruby 3.0.0-preview 版发布了 at November 09, 2020

    def square(x) = x * x

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

  • 你知道在 Ruby 中如何查看 String 是否是回文? at September 15, 2020
    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 September 10, 2020
    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 September 07, 2020

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

  • 公司有地毯,对码农还是很重要的 at August 21, 2020

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

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

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

    Java 的 TreeMap 是通过红黑树实现

    Nginx 是用红黑树管理 timer 等

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

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

  • 请求帮助 Ruby [hash] 与 Python [dict] at June 17, 2020

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

  • 996 能坚持下来的都是会划水的 at June 15, 2020

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

  • 判断真假的流程为什么可以是多语句? at May 14, 2020

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

  • Ruby 中的类型转换 at April 24, 2020

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

  • 请问如何给官方提建议?期待 Ruby 更加美好 at April 24, 2020

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

  • 请问如何给官方提建议?期待 Ruby 更加美好 at April 21, 2020

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

  • 请问如何给官方提建议?期待 Ruby 更加美好 at April 20, 2020

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

  • 讨人厌的后缀表达式 at March 27, 2020

    一行不超过 79 个字符

  • 为啥安装 Nokogiri 枚举每个版本? 如图 at March 23, 2020

    2016 年...

  • 为啥安装 Nokogiri 枚举每个版本? 如图 at March 22, 2020

    他们怎么想的,这还正常啊。看了最后一行,状态是 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 March 21, 2020

    命令是:

    gem install nokogiri -VN
    
  • Ruby 抓疫情数据 at March 09, 2020

    兼容 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 March 05, 2020

    如果有依赖呢?

  • Ruby 刚和热点擦肩而过。。。 at March 04, 2020

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

  • Ruby 刚和热点擦肩而过。。。 at March 03, 2020

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

  • 声明一个函数而先不定义它的具体功能 at November 25, 2019

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

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

    再定义实际使用的函数:

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

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

  • 这是腾讯的加密步骤,怎么用 Ruby 做出来? at October 30, 2019
    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 October 21, 2019

    从语法讲,Ruby 简单多了

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

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

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