Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
Bachue Zhou
@ibachue
VIP
NO. 172 / 2011-11-22

七牛
上海
102 Topics / 2375 Replies
43 Followers
9 Following
17 Favorites
这个人很懒。。
GitHub Public Repos
  • quiche-test 1

    测试 quiche

  • go-curl 0

  • mongodb-replica-set-me... 0

    To monitor metrics of MongoDB Replica Set

  • OSX-KVM 0

    Run macOS on QEMU/KVM. With OpenCore + Big Sur + Monterey + Ventura support now! Only commercial ...

  • hello-world-javascript... 0

  • aws-crt-cpp 0

    C++ wrapper around the aws-c-* libraries. Provides Cross-Platform Transport Protocols and SSL/TLS...

  • aws-sdk-java-v2 0

    The official AWS SDK for Java - Version 2

  • hadoop 0

    Apache Hadoop

  • go-fil-markets 0

    Shared Implementation of Storage and Retrieval Markets for Filecoin Node Implementations

  • aws-sdk-cpp 0

    AWS SDK for C++

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 请不要白费生命去比较编程语言 Why Swift Will Never Replace RubyMotion at July 07, 2014

    #5 楼 @tommy__ 你要看看人家具体做的怎么样。很多美国人语言上确实有优势,学的特快,也能做项目,说出去牛逼不?但真的看过人家写的那个代码以后,你就会觉得还是要好好回去把语言学学好了。。会编程,和编好程完全就是两码事。就像有的房子造出来只能用五年,有的房子能用一百年还是很牢固的,能一样嘛。 我个人也不推荐比较语言孰优孰劣,那是因为语言的选取有个人喜好的因素和擅长领域的因素,并不代表学好语言是不重要的。

  • Form Object 的 Validate 在并发时候的有一坑 at July 07, 2014

    我不认为这是个 Bug FormObject 不应该有必要解决这个只有靠 Transaction 才能防御住的问题。另外 Mutex 防线程不防进程啊。

  • rainbows 疑问,求教!!! at July 05, 2014

    上面说和 Unicorn 差不多嘛。。楼主先创建一个config/unicorn.rb,然后把配置文件写进去,对于 Rainbow 特有的选项,放在Rainbows!代码块里,应该是这个意思吧。反正我以前是这么用 Unicorn 的。。

  • rainbows 疑问,求教!!! at July 05, 2014

    #2 楼 @wangping 楼主按文档上的来呀。。

  • rainbows 疑问,求教!!! at July 05, 2014

    楼主用法有错。。

    This module adds Rainbows! to the Unicorn::Configurator Rainbows!-specific configuration options must be inside a the Rainbows! block, otherwise Unicorn::Configurator directives may be used anywhere in the file.

    Rainbows! do
      use :ThreadSpawn # concurrency model to use
      worker_connections 400
      keepalive_timeout 0 # zero disables keepalives entirely
      client_max_body_size 5*1024*1024 # 5 megabytes
      keepalive_requests 666 # default:100
      client_header_buffer_size 2 * 1024 # 2 kilobytes
    end
    
    # the rest of the Unicorn configuration...
    worker_processes 8
    stderr_path "/path/to/error.log"
    stdout_path "/path/to/output.log"
    

    楼主仔细看下代码

    module Rainbows::Configurator
    # ...
      # Configures \Rainbows! with a given concurrency model to +use+ and
      # a +worker_connections+ upper-bound.  This method should be called
      # inside a Unicorn/\Rainbows! configuration file.
      #
      # All other methods in Rainbows::Configurator must be called
      # inside this block.
      def Rainbows!(&block)
        block_given? or raise ArgumentError, "Rainbows! requires a block"
        @block = true
        instance_eval(&block)
        ensure
          @block = false
      end
    # ...
    end
    # :enddoc:
    # inject the Rainbows! method into Unicorn::Configurator
    Unicorn::Configurator.__send__(:include, Rainbows::Configurator)
    

    可以看到Rainbows!方法不是定义在 Rainbows::Configurator 上的 module 级方法,而是实例方法,所以肯定不是这么调用的。

  • [SOLVED] 不明白 Ruby 的方法可见性控制 at July 05, 2014

    不明白楼主的意思 楼主可以自己把代码在本机跑跑看,第二个 B-protected 确实是调用 protected_mth 方法的结果

  • 好书推荐:《如何变得有思想?》《一个寻找作者的读者》作者阮一峰 at July 05, 2014

    #7 楼 @Rei 好吧 不要紧 幸好我还想起了支付密码。。

  • 好书推荐:《如何变得有思想?》《一个寻找作者的读者》作者阮一峰 at July 05, 2014

    #3 楼 @Rei 貌似不能用支付宝手机支付来着?

  • 好书推荐:《如何变得有思想?》《一个寻找作者的读者》作者阮一峰 at July 05, 2014

    买

  • 【吐槽】关于头像的问题。 at July 05, 2014

    很潮?我一直都被人感觉很土。。

  • ajax 算是多线程么? at July 05, 2014

    楼主这是自问自答啊

  • Swiftype, 强大的第三方自定义搜索引擎 at July 03, 2014

    本帖已被官方推号发现

  • 对于 sonrter 童鞋 “晚上加班不算加班?” 帖子的团 800 官方声明 at July 03, 2014

    #19 楼 @springwq 233

  • 对于 sonrter 童鞋 “晚上加班不算加班?” 帖子的团 800 官方声明 at July 03, 2014

    #17 楼 @springwq 不好意思。。这个账号是我注册的。。同步的代码也是我写的

  • do nothing for 2 minutes at July 03, 2014

    有意思。。背景改的更漂亮下也许会更好

  • 对于 sonrter 童鞋 “晚上加班不算加班?” 帖子的团 800 官方声明 at July 03, 2014

    #15 楼 @springwq 不是 Ruby China 的官方账号是手动发的 自动同步的那个账号不是官方的。

  • 当访问到特定端口的时候,启动对应的服务 at June 29, 2014

    #5 楼 @xds2000 Docker 版本的 foreman?

  • Rails migration 文件也应该按模块存放 at June 26, 2014

    #26 楼 @swordray 顾名思义 QA 环境 QA Own

  • Rails migration 文件也应该按模块存放 at June 25, 2014

    #24 楼 @swordray 那 QA 环境用哪个呢?

  • has_secure_password 的问题 at June 24, 2014

    #3 楼 @billy 不对吧 按照这个说法 那如果我给password_confirmation赋不同的值而根本没有被检查 验证也可以过啦?

    [Development]>> user = User.create username: 'bachue'
    D, [2014-06-24T00:10:49.823699 #31046] DEBUG -- :    (0.1ms)  begin transaction
    D, [2014-06-24T00:10:49.836657 #31046] DEBUG -- :    (0.1ms)  rollback transaction
    => #<User id: nil, username: "bachue", password_digest: nil, created_at: nil, updated_at: nil>
    [Development]>> user.password = 'bachue'
    => "bachue"
    [Development]>> user.valid?
    => true
    [Development]>> user.password_confirmation = 'b'
    => "b"
    [Development]>> user.valid?
    => false
    [Development]>> user.save
    D, [2014-06-24T00:11:07.133127 #31046] DEBUG -- :    (0.1ms)  begin transaction
    D, [2014-06-24T00:11:07.134311 #31046] DEBUG -- :    (0.0ms)  rollback transaction
    => false
    
  • has_secure_password 的问题 at June 23, 2014

    看了下源码,在ConfirmationValidator中,validate_each的实现是这样的:

    def validate_each(record, attribute, value)
      if (confirmed = record.send("#{attribute}_confirmation")) && (value != confirmed)
        human_attribute_name = record.class.human_attribute_name(attribute)
        record.errors.add(:"#{attribute}_confirmation", :confirmation, options.merge(attribute: human_attribute_name))
      end
    end
    

    注意,只有在password_confirmation有值的时候才会验证是否一致,否则就直接 pass 了。

  • MongoDB 那些坑 at June 23, 2014

    写的太好了

  • Rails migration 文件也应该按模块存放 at June 23, 2014

    #22 楼 @swordray DBA 不会同意的

  • Mac OS X 10.10 Yosemite Rails 环境 ( For the adventurous ONLY) at June 23, 2014

    和以前有什么差异??

  • MacDown - 开源的 Markdown 编辑器 at June 23, 2014

    安装的时候提示安全警告。。

  • 好消息 Toad for Mac 免费 at June 21, 2014

    #18 楼 @yanguango 快速看下数据??你们有多少条数据竟然能被快速看下呀??另外修改感觉还是直接调 console 写 Ruby 代码来的愉快呢

  • 好消息 Toad for Mac 免费 at June 21, 2014

    #14 楼 @yanguango 看了一下宣传视频 感觉这样的产品也许更应该在编辑器部分上加强体验 良好的补全和提示 语法检查 性能优化建议 也许会更好的满足用户需求呢

  • 好消息 Toad for Mac 免费 at June 21, 2014

    只有命令行操作数据库的 PostgreSQL 命令行确实太难用了。但是作为 Ruby Developer,可以用 REPL 操作 ORM 来操作数据库啊

  • Rails migration 文件也应该按模块存放 at June 21, 2014

    哎 我觉得楼主真幸福。。我们最核心的数据库是用 SQL 直接管理的 根本没有形成像 migration 这么好的机制 几乎不可能重新复刻一个干净的仅包含最基本数据的数据库

  • 使用 HTTP 缓存机制提升系统性能 at June 21, 2014

    看看《HTTP 权威指南》就足够了吧

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