Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
吕小荣
@xiaoronglv
管理员
第 1638 位会员 / 2012-03-29

上海
200 篇帖子 / 1629 条回帖
238 关注者
0 正在关注
17 收藏
社区清洁工
GitHub Public Repos
  • xiaoronglv.github.io 4

    吕小荣的中文技术博客

  • thoughts 1

    Engineering lessons learned: Ryan Lyu's tech blog

  • golang-ent-playground-... 1

    https://entgo.io/docs/getting-started

  • surge-rules 0

  • docs.nestjs.com 0

    The official documentation https://docs.nestjs.com 📕

  • clash-rules 0

  • chinese-independent-blogs 0

    中文独立博客列表

  • express_projects_with_... 0

    Good open source projects powered by express.js

  • xiaoronglv 0

  • CKA-Exercises 0

    Practice for the Certified Kubernetes Administrator (CKA) Exam

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • 自制监控服务接收 NewRelic RPM 数据 at 2015年11月13日

    这个项目很有意思,哈哈。👍

  • Ruby China 手机客户端 UI 设计稿 at 2015年11月13日

    #5 楼 @huacnlee

    最近要学 iOS,教程里面的附件全部是用 sketch 设计的,那我也咬咬牙买了这个软件吧。

  • Ruby China 手机客户端 UI 设计稿 at 2015年11月13日

    :plus1:

    华顺,你的设计工具用的是不是 sketch?

  • Ruby 是如何解释运行程序的 at 2015年11月13日

    :plus1:

  • Rails 使用 group 后相应属性的显示问题 at 2015年11月11日

    方案 1 使用缓存字段

    departments 增加一个字段用于缓存 gongdan_counter, gongdan_total_durations

    使用异步任务和定时脚本更新这个 gongdan_counter, gongdan_total_durations

    方案 2 使用统计表 departments_gongdan_stats,表结构如下

    • department_id,加唯一索引
    • gongdan_total_count
    • gongdan_total_durations

    使用异步任务和定时脚本更新这个统计表

    方案 3 使用 select 把数据捏在一起,捏在一起的这个字段必须是存在的。

    Gongdan.where(:flag =>2).group("department").select("count(*) as flag")

    http://mednoter.com/group-active-record-querying.html

  • Redis 实现自动输入完成 at 2015年11月11日

    #7 楼 @xiaoronglv 👍

    很多用户用手机刷论坛,看图片的文字会非常吃力。

  • Redis 实现自动输入完成 at 2015年11月11日

    楼主如果把图片换成文本的 code,就更赞了。

    markdown 代码排版格式

    ```ruby
      puts 1
      puts 2
      puts 3
    ```
    
  • Rails 在高并发下的性价比 at 2015年11月11日

    #9 楼 @tangmonk 按你的访问量,估计连 1000 request/second 都达不到。

    可以先把云主机加到 6 台,看一下 newrelic 中的流量,观察一两周,然后根据流量调整实例的数量。

  • Rails 部署后不能启动问题定位方法 at 2015年11月11日

    帮你排个版 😄

    1. list 中有段落时,要缩进四个空格。

    2. 代码请高亮

  • 有人用过阿里云的键值存储 KVStore 么? at 2015年11月11日

    #1 楼 @qhwa 这读写速度好快啊。

  • 都说 Rails 过时了,那么怎样的 Rails 才不会过时? at 2015年11月11日

    活到老学到老,拥抱新技术自己就不会过时。

    幻想学好 Rails 后能够一劳永逸,最容易过时。

    😄

  • 大家是推荐用自动部署来搭建 Rails 服务器,还是自己手动搭建? at 2015年11月11日

    #4 楼 @chairy11 我也以为用 cap 就算自动了,哈哈。

  • Redis 实现自动输入完成 at 2015年11月11日

    搜索提示的排序有两种策略:

    1. 根据 tag 数量:文件加此 tag 时,counter +1

    2. 根据 tag 被用户搜索的次数:用户每搜索一次,这个 tag 的 counter +1。

    我在丁香园的时候,第二种策略用户体验更好一些。

  • 我需要组装一个复杂的对象,不知道有没更好的实现方式 at 2015年11月07日

    Ruby Weekly 曾推荐过一篇关于 Data Ojbect 文章,能帮上楼主的忙吗?

    http://brewhouse.io/2015/07/31/be-nice-to-others-and-your-future-self-use-data-objects.html

    class Card
      include Virtus.model
    
      attribute :url, String 
      attribute :data, String
      attribute :type, String
      attribute :style, String
      attribute :id, Integer
    end
    
    class Header
      include Virtus.model
    
      attribute :title, String
      attribute :menu, String
      attribute :icon, String
    end
    
    
    class Template
      include Virtus.model
    
      attribute :menu, String
      attribute :cards, Array[Card]
    end
    
    
    Card.new(card_params)
    Header.new(head_params)
    Template.new()
    
  • 作为一个软件工程师,你如何调整自己的生活及健康状态? at 2015年11月07日

    身体、家庭都是玻璃球,工作是弹力球,所以工作排到了第五位。

    no1. God

    • Pray

    • Study Bible

    Some of you may be asking, “Why is God so important, even more than your family and yourself?”

    Because God is our strength and refuge, an ever present help in trouble.

    no2. Self

    • Sleep more than 7.5 hours
    • Healthy eating
    • Exercise 1 hour

    Some of you may be asking, “Why do you love yourself so much, even more than your wife, your work?

    Because Health is foundation of everything. Without health, you are unable to take care your family, love your friends and make money.

    no3. Family

    • Do housework for Angela (my wife)

      • take out the trash
      • boil water
      • prepare breakfast
    • Encourage her to exercise/study

    • Delicate moments with Angela

      • go to movies
      • have dinner at Satuday
    • Chat with my Grandpa/Grandma, my father and mother every week.

    no4. Learning

    • reading

    • writing

    • learn how to code like a master

    • review my Anki flashcards

    no5. Work

    design/coding

    no6. Church

    Prepare lunch for Sunday

    Study bible for cell group leading

    Communicate with members in cell group

    no7. Others

    • Shopping
    • Social activities

    • Online SNS tools, such as WeChat moments, Weibo, Zhihu and so on.

    http://mednoter.com/todo-list.html

  • [已有替代方案?] 关于腾讯企业邮箱 at 2015年11月07日

    推荐的 EDM 服务商

    • mailgun +1,国内国外的到大理都很高。
    • sendcloud + 1,国内口碑不错。

    自己搭建 Mail server

    技术工作只是一部分,还要很多额外的工作还包括:

    1. 疏通与各个邮件服务商的关系
    2. SPF
    3. DKMI
    4. IP 预热

    如果想让自己的邮件不进垃圾箱,最佳实践就是:不发垃圾邮件。

  • [已解决] 遇到个问题,对于新人来说感觉很沮丧,因为耗了半天多了都不知道怎么弄。 at 2015年11月05日

    刚起步那段时间学习曲线陡峭,速度总是慢的,日积月累就越来越快了。楼主不要灰心,加油。

  • 关于 Rails 项目的一点问题 at 2015年11月04日

    Vagrant + 1

    http://railscasts.com/episodes/292-virtual-machines-with-vagrant

  • 关于如何搭建一个核心管理服务器的问题 at 2015年11月04日

    可以用动物名(或魔戒人物)作为机器的名字,团队内部沟通起来很方便,也很有趣。

    • dog - mongodb
    • tiger - web server
    • cat - mysql
    • snake - nginx

    这是 Vincent 教给我的,哈哈。

  • Rails 5: ActionController::Parameters 现在返回一个对象而不是一个 Hash 函数 at 2015年11月03日

    :plus1:

    楼主有没有订阅 Ruby Weekly?里面有不少值得翻译的好文章。

  • React vs Ember by Alex Matchneer at EmberNYC meetup at 2015年11月01日

    @nightire 很喜欢你这种认真回答的风格,每篇都可以单独成为一篇精华帖。

  • 用 Markdown 后的一些属性没对 at 2015年11月01日

    请仔细排排版,不知道你在说什么

    排版帮助手册:https://ruby-china.org/markdown

  • 论坛打赌,请众位大神来评判 at 2015年10月31日

    #7 楼 @nowherekai

    RClass 的代码我也读过一部分,还没完全读完读懂。我想把我的问题表达的更具体一些,便于讨论。

    class B
    
    end
    
    b1 = B.new
    b1.instance_eval{
      @a = 1
      @b = 2
    }
    
    b2 = B.new
    b2.instance_eval{
      @c = 1
      @d = 2
    }
    

    同一个类不同对象的实例变量千差万别,key 也皆不同。

    • key 是存在同一个 RClass 中吗?
    • 或者,key 存在每个对象的 eigenclass 的 RClass 中?
  • 论坛打赌,请众位大神来评判 at 2015年10月31日

    我有个疑问:如果对象的实例变量在 Robject 中是个数组,它的 key 在哪呢?

  • 论坛打赌,请众位大神来评判 at 2015年10月31日

    左方:Ruby 的对象是用 hash 实现的(错了。曾经是哈希,现在是数组)

    Ruby 的对象是一堆的实例变量,加上指向类的引用。假如你自己在 Ruby 中定义了一个类,那么这个类的对象在 C 中是通过 Robject Structure 来实现。

    1. 其实例变量的保存形式是数组,不是哈希。(Ruby 1.8.7 其对象的实例变量是个哈希)
    2. klass 指向其类

    As you can see, each klass value points to the Mathematician RClass struc- ture, and each RObject structure has a separate array of instance variables. Both arrays contain VALUE pointers—the same pointer that Ruby uses to refer to the RObject structure. (Notice that one of the objects contains two instance variables, while the other contains only one.)

    右方:Ruby 对象的本质就是对象(这种说法也不太贴切)

    为了性能,一些简单的 value,比如 1, 2, 3, 4, 5,虽然是对象,但 Ruby 不使用任何 structure 来实现。

    As a performance optimization, Ruby saves small integers, symbols, and a few other simple values with- out any structure at all, placing them right inside the VALUE pointer, as shown in Figure 5-5.

    推荐两位阅读《Ruby under a microscope》

  • 完美的 Ruby 图形验证码 Gem - RuCaptcha at 2015年10月30日

    cool!

  • 用 RVM 安装 ruby-2.2.0 出错 at 2015年10月29日

    这个错误我从没有碰到过。在终端中执行 rvm requirements 会列出一堆的依赖,都安装了吗?

    下次记得给代码排版,语法:

    ```bash
    
    ```
    
  • [上海][2015年10月27日] Ruby 聚会召集 at 2015年10月29日

    #32 楼 @tzwm

    Hi, 俊喆,我把你回贴中的照片整理到主贴了,并且声明了出处。

  • RubyConf China 2015 资源汇总 at 2015年10月27日

    #97 楼 @jasl 辛苦了。

  • [已解决] 服务器各项资源都空闲但还是有请求拥塞 at 2015年10月27日

    #12 楼 @birbird

    你的线程数配的太多了,额外增加了很多线程切换的开销。假如你的机器是 4 核,可以这样配置:4 个进程 x 16 个线程。

    PS: Puma 每个进程 130M 左右,4 个进程的内存开销不会超过 1G。

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