Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
jackxu
@jackxu
Member
NO. 19891 / 2015-07-13

2 Topics / 33 Replies
7 Followers
0 Following
3 Favorites
GitHub Public Repos
More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • Rails 中乐观锁与悲观锁的使用 at February 09, 2016

    #7 楼 @pathbox 高并发的情况下,使用悲观锁会造成一部分关联 sql 执行非常之慢,慎用...

  • Rails 小项目的一些分享 at November 17, 2015

    def calc_better_cheap 这个函数一行太长了。。。不好读

  • RubyConf China 2015 资源汇总 at October 27, 2015

    赞~

  • self 关键字求指导 at October 20, 2015

    Ruby 中 self 是 class 中一个具有 scope 的关键字,在 class 中不同的 scope 中其表明的意义也是不同的。位于 class 定义中的 self 都代表的 class 本身,位于 method 定义中的 self 代表的是 class 的 instance,但是这个前提是 method 定义不以 self.method_name 开始,若以 self.method_name 开始定义的话,method 定义中如果使用了 self,此 self 也是 class 本身。举一个例子:

    class Game
       def start_game
         self.start_time = Time.zone.now
         # Without implementation 
       end
       def self.game_areas
         # Without implementation 
       end
    end
    

    start_game 方法中得 self 指代的是 class Game 的 instance,而 game_areas 方法前面的 self 是在 class 中的 scope,self 指代的是 Game 本身,同时,如果 game_areas 方法中还有使用 self 关键字的话,self 同样指代的 Game 本身。

  • Ruby 进程占用内存越来越大 at September 11, 2015

    #32 楼 @jasonshl 可以尝试下我以前尝试过的一些方法~ https://ruby-china.org/topics/27057

  • Gemfile 详解 at September 08, 2015

    #27 楼 @hanfeng1949 thx

  • Ruby 进程占用内存越来越大 at September 08, 2015

    #12 楼 @rei 赞不要猜~

  • Secure Connection Failed at September 04, 2015

    #8 楼 @gengdejie The default rails server -e prouduction -p $PORT start a webrick server that can not accept the ssl connection if you have not configured it with ssl process. You can have a try with this. By the way, it is not recommended to use ssl in the local environment.

  • Secure Connection Failed at September 03, 2015

    Have you tried to use ssl connection in the local? From the error message, it seems there is something wrong with your connection from the browser to the app server.

  • RubyConfChina 2015 大会官网,报名网址,博客上线 at August 31, 2015

    这价钱真是给跪了...大赞良心~

  • 关于 Ruby 内存使用的一些优化和探索 at August 31, 2015

    #2 楼 @chq God 确实可以在配置文件里面设置 memory 和 cpu 的使用极限,但这部分我也没有实际的使用经验,只是知道而已。

  • 关于 Ruby 内存使用的一些优化和探索 at August 31, 2015

    #1 楼 @douxiance 比较长,可以分成两部分来读~

  • 如何将一维数组转换成哈希 at August 28, 2015

    #3 楼 @ywjno Array include Enumerable

    >> Array.ancestors
    [
        [0] Array < Object,
        [1] Enumerable,
        [2] Object < BasicObject,
        [3] Kernel,
        [4] BasicObject
    ]
    
  • Rails Server 内存随着访问量不断增加,但是当访问量降下来的时候,内存并没有释放。 at August 19, 2015

    #1 楼 @huacnlee 请问 Ruby China 在不访问的初始状态每个进程占用大概多少内存,刚开始的时候使用内存应该会稳定上升,到一定程度后稳定下来。还有 ruby 的东西感觉确实很吃内存,unicorn 也是如此...

  • Rails4 + Carrierwave 下實現 JSON 形式的文件上傳 API at August 17, 2015

    #1 楼 @rei 文件读入会被读入内存,但据我的了解这样使用 StringIO 并不会引发内存泄露,只是 request 过多会导致读入内存过多,然而 GC 还来不及回收是吧

  • Ember.js 2.0 正式发布,移除 1.13 废弃的特性 at August 14, 2015

    前端真是一个轮子一个轮子的造...

  • 极简登陆方案? at August 13, 2015

    ominiauth 的方式已经算很简便了...

  • Rails 源码分析之 callback 篇 at August 12, 2015

    给楼主提一个小建议,callback 这个,我个人觉得楼主可以写个完整点的例子,在一个 rails 的 demo 项目里面,一跑起来能出结果,所见即所得,然后大家才会更有兴趣去深入看原理性的东西,这样也更能加深大家对 callback 实现原理的印象。

  • 如何优化含有实效性数据的表的查询速度? at August 12, 2015

    mysql 等很多数据库里面的 partition 可以用啊,我们原来做游戏搞 event 的时候,有些 event 关联的表都是通过 partition 来处理的。

  • Gemfile 详解 at July 30, 2015

    #18 楼 @liukun_lk 感谢,已修~

  • 关于 has_many 的用法 at July 30, 2015

    感觉确实可以重构下,理想的情况下是能够直接 update 原有 table 里面的 permission 的值,而不是在这里做添加和删除来达到 update 操作的效果。当然这还要看你们自己结构和表的结构再决定。还有可以注意下变量的命名。例如数组的命名:per_old_id --> all_old_ids

  • Gemfile 详解 at July 29, 2015

    #12 楼 @limanxian Thank you!

  • Gemfile 详解 at July 29, 2015

    #11 楼 @pathbox 谢谢肯定,若有不足,还望指正~

  • [上海] “来了网” 欢迎爱好 Ruby,好学上进的你加入,我们有上海资深的 Ruby 大咖! at July 28, 2015

    哈哈,不要吓人家,招聘也不容易,搞的人家以后都不敢来了...

  • Gemfile 详解 at July 28, 2015

    #8 楼 @zhaowenchina 确实,是我从自己笔记本拷贝到这里来的时候没有注意,哥们你真细致。已修^_^

  • Gemfile 详解 at July 28, 2015

    #5 楼 @gazeldx 谢谢,已修~

  • Gemfile 详解 at July 27, 2015

    #3 楼 @zhaowenchina 谢谢,已修改,以后打完了还要多检查两遍错别字,哈哈

  • Gemfile 详解 at July 27, 2015

    #1 楼 @justin 谢谢,已经修改过来了

  • 如何看待周末 + 晚上都加班的公司? at July 24, 2015

    在日本的表示这些都弱爆了,多少日本人每天干到晚上十二点回,家里还有老婆孩子的。这有的时候还真是一种文化传统的问题,在日本很多日本人把公司当成家,无加班费也自愿加班学习,虽然可以下班准时走。当然也有很多公司不加班了

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