Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
Hooopo
@hooopo
管理员
第 8 位会员 / 2011-10-28

[email protected]
nil
北京
160 篇帖子 / 3013 条回帖
360 关注者
0 正在关注
74 收藏
聪明的妖怪录下了唐僧的紧箍咒
打赏作者
GitHub Public Repos
  • oh-my-github-circles 47

    GitHub User Circle Generator Using GitHub Actions

  • hackernews-insight 21

    Hackernews Insight using TiDB Cloud

  • repo-track-pipeline 6

    🔄 A flexible open-source data pipeline for seamlessly syncing data from any repository to your da...

  • oh-my-github-pipeline 6

    🔄 A flexible open-source data pipeline for seamlessly syncing data from any github user to your d...

  • chatgpt-xiaoai 3

    小爱音箱集成LLM,SaaS 服务

  • repo-contributor-circles 1

    GitHub repo contributor circles generator.

  • ossinsight-x 1

    Automatically post trending repos to Twitter every day.

  • mi-service 1

    XiaoMi Cloud Service for mi.com

  • hooopo 0

  • streamlit-echarts-demo 0

    Demo for Streamlit ECharts component

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • [北京] 靠谱创业公司诚招技术主管 at 2012年08月29日

    Awesome.

  • 一个很容易中招的地方 at 2012年08月28日

    stop

  • 有没有遇到 ruby 解释器崩溃的时候? at 2012年08月28日

    #3 楼 @yakjuly 是你用到的某个库的问题。

  • 大家是如何解决并发问题的 at 2012年08月28日

    底下吵成一片,楼主跑了。楼主你快回来说说你的场景到底是什么样子的。

  • 一个很容易中招的地方 at 2012年08月28日
    一流的代码是简单明了,
    

    实在理解不了你的简单明了....

    而不是玩弄语法。
    

    这不叫玩语法,这叫入乡随俗。就像函数式语言里用列表解析是习俗,而嵌套循环就是奇葩。

    好的代码应该是 simple and abstracts repeated patterns (DRY). 我认为 In-logic assignment 做到了。同样的还有 Object.tap、Object.try、Object.blank?、 ||=(这个可以叫做 memoizable assignment partten?) 还有 Rails 里的 find_or_create方法。

    这些都是为了解决实际问题而生的 Ruby Idoim。我用着很 happy,这是一个好特性。

  • 一个很容易中招的地方 at 2012年08月28日

    #28 楼 @zw963 In-logic assignment 是 Ruby Idiom。大家都这么用,甚至流行的 code stye 也推荐。

    多一行代码更清晰一些。。。真不能理解。。。

    刚才随便在 Rails 和 Rubinius 里找了几行,讨论问题还是要回到现实世界:

    https://github.com/rails/rails/blob/master/activerecord/lib/active_record/sanitization.rb#L59 https://github.com/rails/rails/blob/master/activerecord/lib/active_record/reflection.rb#L298 https://github.com/rails/rails/blob/master/activerecord/lib/active_record/nested_attributes.rb#L281 https://github.com/rubinius/rubinius/blob/master/lib/un.rb#L227

  • 一个很容易中招的地方 at 2012年08月28日

    @zw963 @ery

    使用=(赋值符号)的返回作为表达式的值是可以的,但是记得在记得在两边加上括号。
    
    # 好的 - 表明了赋值的意图
    if (v = array.grep(/foo/)) ...
    
    # 不好的
    if v = array.grep(/foo/) ...
    
    # 好的 - 不仅表明了赋值,还表明了正确的优先级
    if (v = self.next_value) == "hello" ...
    

    from:http://ruby-china.org/wiki/coding-style

  • 大家是如何解决并发问题的 at 2012年08月28日

    #25 楼 @bhuztez 没看懂你说的

  • RubyConfChina 2012 预热帖 at 2012年08月28日

    #27 楼 @TingTing 最后面那两位么?标题都是一个风格的。。

  • 大家是如何解决并发问题的 at 2012年08月28日

    #23 楼 @bhuztez 加一个字段啊 status,默认是未完成状态,一分钟后去把状态改成完成状态。也没有并发问题吧

  • 大家是如何解决并发问题的 at 2012年08月28日

    #20 楼 @bhuztez 两级的一次造两个建筑就是在数据库里插入两个条记录,这存在并发问题么

  • 大家是如何解决并发问题的 at 2012年08月28日

    这是一个简单的唯一性验证问题吧,数据库加唯一索引。

    我觉得都是楼主的应用设计问题,楼主把问题描述的无比复杂,我想问一下,你的应用和普通论坛有什么特殊的地方?大家都是多进程啊都并发啊。。

  • [重新描述] 在 DB 挂掉的时刻,怎么保证另一个不需要挂掉 DB 的网页可以正常浏览? at 2012年08月28日

    呵呵

  • 请 18 岁以下的同学举个手 (年龄调查) at 2012年08月26日

    #19 楼 @WilliamZhu 一点也不伤感.......

  • 你一般怎么写链式调用的代码 at 2012年08月26日

    有的编辑器格式化功能会把别人对的很齐的代码给毁了。。

  • 一个很容易中招的地方 at 2012年08月26日

    #8 楼 @zw963 这和重构没关系啊

  • 一个很容易中招的地方 at 2012年08月26日

    前几天看到 Rubinius 的开发者抱怨 MRI2.0 会在后置条件里赋值的时候强制输出 warning: https://twitter.com/brixen/status/233688352552005632

    至于还有这么奇怪的差异可能他还没发现,,,大概是 MRI 里对后置的 if/unless 处理有所不同。而 Rubinius 返回的结果是正常的(没有让我惊讶)。

  • 有什么方法可以在终端显示出数据库查询命令 at 2012年08月26日

    #3 楼 @metal 为了区分,没其他意思

  • 请 18 岁以下的同学举个手 (年龄调查) at 2012年08月26日

    看了标题以为你要开一个十八禁的节点呢

  • 征集今年 RubyConfChina 的分会场即兴话题 at 2012年08月25日

    #30 楼 @camel +1 我也想听这些。

  • 请大家推荐一款简单的在线协作工具 at 2012年08月25日

    http://www.moreofit.com/similar-to/typewith.me/Top_10_Sites_Like_typewith.me/

  • 请大家推荐一款简单的在线协作工具 at 2012年08月25日

    http://typewith.me/

  • [北京] 酷传招聘 Ruby on Rails 全职实习生 / 初级工程师,当然我们也喜欢高手 at 2012年08月24日

    哇

  • apache+passenger vs nginx+unicorn at 2012年08月24日

    protip: "If you really want to make a point about the performance of a particular thing, can you at least pretend you're using science?"

  • 阐述一下关于 Ruby Web Servers 的一些坑爹事实. at 2012年08月23日

    http://unicorn.bogomips.org/KNOWN_ISSUES.html On Ruby 1.8 prior to Ruby 1.8.7-p248, *BSD platforms have a broken stdio that causes failure for file uploads larger than 112K. Upgrade your version of Ruby or continue using Unicorn 1.x/3.4.x.

  • 阐述一下关于 Ruby Web Servers 的一些坑爹事实. at 2012年08月23日

    #2 楼 @bhuztez 作为一个功能完备的 HTTP server 这些都需要吧,即使像静态文件处理,文件压缩什么的实际上都是 web server 来处理的。

  • 关于 sinatra 路由问题 at 2012年08月23日

    #3 楼 @metal 加条件,限制:id 为数字!不懂 sinatra,不过应该是可以的。

  • 关于 sinatra 路由问题 at 2012年08月23日

    看起来是顺序换一下就行了。

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