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
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • 有条件,就换 Mac at 2012年10月05日

    嗯嗯 楼主说的对

  • 关于 “0 基础” at 2012年10月04日

    #7 楼 @xiaolai http://www.iteye.com/topic/605707

  • 关于 “0 基础” at 2012年10月04日

    #5 楼 @gaicitadie 拦路虎往往并不是高级特性,都是一些很基本的问题,你可以翻翻新手问题里的帖子,看看哪些问题高级?

    真正开发也是一样,实际的核心代码花费不了多少时间,浪费时间的是 debug,是对细节的调整,ruby 不熟悉就会在小问题上浪费大量时间,甚至没办法继续编码。

  • 关于 “0 基础” at 2012年10月04日

    #2 楼 @gaicitadie 同意你的关于底层和应用层的观点,写 ruby 不需要懂 c,即使 ruby 底层是 c 实现的。但你的这些类比不成立。ruby 和 rails 之间的关系不是你说的底层和应用层的关系。

    找几个有 web 开发经验的人,只给他们 rails 文档,让他开发几个应用,看会出现什么问题就知道学 rails 需不需要会 ruby 了。

  • append_features 与 included 的区别? at 2012年10月03日

    #6 楼 @iBachue 1.一点儿幽默感也木有 2.考这么冷门问题的面试官是想干什么呢?拿自己刚刚看到的生僻内容难为别人?还是因为应聘者太强了,其他内容都非常熟悉了?

  • append_features 与 included 的区别? at 2012年10月03日

    这是超纲内容啊!

  • 关于 raise 没有被捕捉的问题 at 2012年10月02日

    这还用明确说明么。。鱼在网里才能被你捕到啊!

  • 离线的服务器如何部署 ruby 环境?! at 2012年09月29日

    #2 楼 @dishonest 不能联网还没 U 盘么?

  • 离线的服务器如何部署 ruby 环境?! at 2012年09月29日

    http://gembundler.com/bundle_package.html

  • Ruby 工程师的薪资等级 at 2012年09月28日

    #7 楼 @help5305fff 是吗是吗

  • 如何批处理执行多个 rakefile? at 2012年09月28日

    Rake is for building, not for scripting...

  • Rails 4 台风即将来袭,请查看安全手册 at 2012年09月28日

    turbolinks 看起来不错

  • 跟大家分享篇文章 at 2012年09月27日

    #6 楼 @xiaolai 我多活了两倍 (18),才接触到计算机。

  • 发现个好玩的东东 at 2012年09月25日

    好像还可以 cowthink

  • 新的搜索好慢 at 2012年09月24日

    以前的相关话题很有用的。

  • SQL 通配符真的很糟糕么 at 2012年09月24日

    #20 楼 @bhuztez 没看懂.....

  • SQL 通配符真的很糟糕么 at 2012年09月24日

    #16 楼 @bhuztez ORM 就不需要指定需要哪些列?

  • 关于 rails 的链接问题<a href=""> <span>Back</span> </a> at 2012年09月23日
    <%= link_to "<span>back</span>".html_safe, posts_path %>
    
  • SQL 通配符真的很糟糕么 at 2012年09月23日

    #10 楼 @luikore 是啊 比如这篇里的例子在不同 Ruby 版本或实现上就会有差别:http://ruby-china.org/topics/5311

  • Ruby 有没有官方 Language Reference? at 2012年09月23日

    这个也不错 http://ruby.runpaint.org/

  • 吐槽一下 ruby 的文档 at 2012年09月23日

    #4 楼 @dfang 你对method(:puts).owner.public_methods.grep /puts/这段代码没理解啊 这段代码只能说明 puts 是 Kernel 的 public 方法。

    Object.new.private_methods.grep /puts/
    => [:puts]
    

    上面说明 puts 是 Object 的私有方法。

    而你在调用 xx.puts 的时候根据方法查找顺序,是调用的 Object#puts,和 Kernel 那个就没任何关系。。

  • 吐槽一下 ruby 的文档 at 2012年09月23日

    这个很好理解嘛,看下面的例子就明白了:

    [28] pry(main)> module Hello
    [28] pry(main)*   def hello
    [28] pry(main)*   end  
    [28] pry(main)* end  
    => nil
    [32] pry(main)> class World
    [32] pry(main)*   include Hello
    [32] pry(main)*   private :hello
    [32] pry(main)* end  
    => World
    [33] pry(main)> World.new.hello
    NoMethodError: private method `hello' called for #<World:0x00000001d10050>
    from (pry):58:in `__pry__'
    [34] pry(main)> 
    

    对于 Kernel 这个 module 来说 puts 是 public 的,但是对于 Object 这个对象来说,puts 是私有方法。

    在方法查找的时候先找到 Object#puts,然后判断为私有,最后抛异常。

    我猜测 Ruby 内部应该大概这么实现的:

    class Object
      include Kernel
      private *Kernel.methods
    end
    
  • 打印数字金字塔 at 2012年09月23日

    #21 楼 @chyanog 淫才啊

  • 了解 Ruby 中的具象状态传输 (REST) at 2012年09月23日

    这文章很一般。。而且标题就搞错了。transfer 居然译成了传输

  • SQL 通配符真的很糟糕么 at 2012年09月23日

    #5 楼 @jjym

    常见误区
    count(1)和count(primary_key) 优于 count(*)
    很多人为了统计记录条数,就使用 count(1) 和 count(primary_key) 而不是 count(*) ,他们认为这样性能更好,其实这是一个误区。对于有些场景,这样做可能性能会更差,应为数据库对 count(*) 计数操作做了一些特别的优化。
    count(column) 和 count(*) 是一样的
    这个误区甚至在很多的资深工程师或者是 DBA 中都普遍存在,很多人都会认为这是理所当然的。实际上,count(column) 和 count(*) 是一个完全不一样的操作,所代表的意义也完全不一样。
    count(column) 是表示结果集中有多少个column字段不为空的记录
    count(*) 是表示整个结果集有多少条记录
    

    ref:http://isky000.com/database/mysql-performance-tuning-sql 我记得《高性能 Mysql》上面也是这么说的。

  • SQL 通配符真的很糟糕么 at 2012年09月23日

    #3 楼 @jjym count(1) 真的比 count(*) 快么?

  • SQL 通配符真的很糟糕么 at 2012年09月23日

    #1 楼 @jjym 是现有 migration 后有 model 的,如果是从 model 生成 migration 就可以根据 model 里设置的 counter_cache 选项来自动设置默认值了。

    也可以一个字段以 count 结尾就给添加默认值?不过这样有点管的太多了吧。

  • Rails 4 会带来什么 at 2012年09月22日

    http://blog.wyeworks.com/2012/9/20/rails-4-in-a-mindnode/

    支持事务隔离级别:https://github.com/rails/rails/commit/392eeecc11a291e406db927a18b75f41b2658253

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