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

[email protected]
深圳
185 篇帖子 / 9143 条回帖
728 关注者
0 正在关注
11 收藏
中下水平 Rails 程序员
打赏作者
GitHub Public Repos
  • writings 941

    [Closed] Source code of writings.io

  • alipay 732

    Unofficial alipay ruby gem

  • code_campo 291

    [Closed] Source code of http://codecampo.com

  • asciidoctor-pdf-cjk-ka... 101

    **no longer maintained**

  • asciidoctor-htmlbook 31

    Asciidoctor HTMLBook is an Asciidoctor backend for converting AsciiDoc documents to HTMLBook docu...

  • material-ui 17

  • htmlrenderer 12

  • rich-text-editor 12

  • rails-chatgpt-demo 8

  • rails-app 7

    A Rails project template lets me start new projects quickly.

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • Ruby 是否应该在语法上支持 AOP? at 2012年12月06日

    我不知道 AOP 是什么,以前讨论过几次这个话题,看有没有帮助

    http://ruby-china.org/topics/6681 http://ruby-china.org/topics/4676

  • [提问] 功能测试中的一个迷惑 at 2012年12月04日

    所以很可能是测试没通过,走到了 render :new 这一步

    你把 @post.save 换成 @post.save! ,应该会抛出相应的错误。

  • 怎么实现一个无限层级的数据库 at 2012年12月04日

    #4 楼 @woaigithub 沉寂多时了

  • 怎么实现一个无限层级的数据库 at 2012年12月04日

    mongodb

  • 数据库选择,急寻! at 2012年12月04日

    #4 楼 @as181920 无法想象 mongodb 索引不了,举个例子?

  • 数据库选择,急寻! at 2012年12月04日

    mongodb

  • rails3 实时验证 at 2012年12月03日

    这个验证是用户验证还是数据验证啊。

  • 国内除了图灵现在有电子书可以购买,还有哪里可以买到呢 at 2012年11月30日

    多看 字节社 豆瓣

    技术书都是图灵的。

  • 求指导方向。。 at 2012年11月30日

    #5 楼 @Yujing_Z 哪里?

  • 求教 在 rails 中使用 ajax at 2012年11月29日

    1 状态修改的操作不能用 get,可以被伪造提交 2 likeable 这个属性可以用序列化 Array 方法 3 用 json 数据而不是纯文本,不过对于这个简单应用纯文本也没事 4 "/topics/likeable" 这个 url 没有 id?

  • 求教代码 社区里的代码 费解 at 2012年11月29日

    .data("") 是 jQuery 的 api http://jqapi.com/#p=jQuery.data

  • [一淘 - 杭州] 招 ruby on rails 开发同学 at 2012年11月29日

    #24 楼 @bugreg

  • [一淘 - 杭州] 招 ruby on rails 开发同学 at 2012年11月29日

    #22 楼 @bugreg 这怎么会没有技术含量?

  • 求指导方向。。 at 2012年11月29日
    File.open('filename').each_line do |line|
      color, x, y = line.split
    end
    
  • [上海] 高薪诚聘:后台 Ruby/JRuby 研发工程师 at 2012年11月29日

    #6 楼 @dcy http://ruby-china.org/topics/new

  • rails 在本地测试,启用 production 配置,页面切换有停顿感 at 2012年11月29日

    会不会是 js 一些操作耗时或者读取外部资源耗时?

  • Mongoid model at 2012年11月29日

    MongoDB 没有固定模式,所以要读取一条数据才能确定它有什么字段和类型。

    Mongoid 的话用 ModelName.fields 可以获得自己在 Model 里面定义的字段信息。

  • Sidekiq 的任务计划,仅支持精确定时?! at 2012年11月29日

    whenever,了解下系统的 cron

  • sinatra 写了个电影网站。。欢迎来踩。。。 at 2012年11月28日

    #7 楼 @jfreebird 期待你拼装出一个 Rails。

  • loop 怎么 order at 2012年11月26日

    #8 楼 @sanivbyfish 晕,我以为在说 ActiveRecord。

    mongoid 是 order_by http://mongoid.org/en/origin/docs/options.html#sorting

  • loop 怎么 order at 2012年11月26日

    #6 楼 @sanivbyfish 贴一下你加上 order 后的代码

  • loop 怎么 order at 2012年11月26日

    #4 楼 @sanivbyfish commects 不是一个 associations(has_many)吗?

  • loop 怎么 order at 2012年11月26日

    post.commects.order("xxx DESC").each

    如果所有的 comments 都需要这个 order,可以加 default_scope

  • ror 高手是不是必须得会 gem 开发啊?ruby 苦手路过 at 2012年11月26日

    #2 楼 @beihuiguixian 是的。

  • ror 高手是不是必须得会 gem 开发啊?ruby 苦手路过 at 2012年11月26日

    可以放在 lib/ 下面。

  • 看到彩程设计的 Tower 正式上线了。 at 2012年11月26日

    喜欢 Mailgun 的 api 和文档,Postmark 网站设计太刺了。

  • 编程中可能用到的数学知识。 at 2012年11月25日

    推荐楼主一本书 http://book.douban.com/subject/3288908/ 集体智慧编程

  • 编程中可能用到的数学知识。 at 2012年11月25日

    编程不是目的,编程去解决问题才是目的,所以要知道你要解决什么问题才知道需要用什么知识。

  • Rails 有那么慢吗 at 2012年11月24日

    顺便,我把模板从 erb 换到 slim,发现性能有提升

    - 128000.times do
      = rand(8999)+1000
    
    Server Software:        nginx/1.2.3
    Server Hostname:        localhost
    Server Port:            4000
    
    Document Path:          /
    Document Length:        512450 bytes
    
    Concurrency Level:      10
    Time taken for tests:   6.919 seconds
    Complete requests:      100
    Failed requests:        0
    Write errors:           0
    Total transferred:      51319300 bytes
    HTML transferred:       51245000 bytes
    Requests per second:    14.45 [#/sec] (mean)
    Time per request:       691.885 [ms] (mean)
    Time per request:       69.188 [ms] (mean, across all concurrent requests)
    Transfer rate:          7243.47 [Kbytes/sec] received
    
    Connection Times (ms)
                  min  mean[+/-sd] median   max
    Connect:        0    0   0.1      0       0
    Processing:   454  672 103.5    677     911
    Waiting:      454  670 103.8    673     910
    Total:        454  672 103.5    677     911
    
    Percentage of the requests served within a certain time (ms)
      50%    677
      66%    709
      75%    753
      80%    778
      90%    808
      95%    864
      98%    880
      99%    911
     100%    911 (longest request)
    
    Started GET "/" for 127.0.0.1 at 2012-11-24 22:26:31 +0800
    Processing by MainController#index as */*
      Rendered main/index.html.slim within layouts/application (703.5ms)
    Completed 200 OK in 905ms (Views: 704.9ms | ActiveRecord: 0.0ms)
      Rendered main/index.html.slim within layouts/application (482.9ms)
    Completed 200 OK in 685ms (Views: 484.5ms | ActiveRecord: 0.0ms)
    
  • Rails 有那么慢吗 at 2012年11月24日

    循环放在 View 里面的日志

    Started GET "/" for 127.0.0.1 at 2012-11-24 22:20:45 +0800
    Processing by MainController#index as */*
      Rendered main/index.html.erb within layouts/application (1670.9ms)
    Completed 200 OK in 1873ms (Views: 1672.4ms | ActiveRecord: 0.0ms)
    

    移出后的日志

    Started GET "/" for 127.0.0.1 at 2012-11-24 22:23:24 +0800
    Processing by MainController#index as */*
      Rendered main/index.html.erb within layouts/application (1.6ms)
    Completed 200 OK in 410ms (Views: 3.1ms | ActiveRecord: 0.0ms)
    

    可见效率是有差异的。不过我觉得一般不会用到 128000 这么大的循环,View 按正常写就行了。

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