Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
Hooopo
@hooopo
Admin
NO. 8 / 2011-10-28

[email protected]
nil
北京
160 Topics / 3013 Replies
360 Followers
0 Following
74 Favorites
聪明的妖怪录下了唐僧的紧箍咒
Reward
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
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 有条件,就换 Mac at October 05, 2012

    嗯嗯 楼主说的对

  • 关于 “0 基础” at October 04, 2012

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

  • 关于 “0 基础” at October 04, 2012

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

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

  • 关于 “0 基础” at October 04, 2012

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

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

  • append_features 与 included 的区别? at October 03, 2012

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

  • append_features 与 included 的区别? at October 03, 2012

    这是超纲内容啊!

  • 关于 raise 没有被捕捉的问题 at October 02, 2012

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

  • 离线的服务器如何部署 ruby 环境?! at September 29, 2012

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

  • 离线的服务器如何部署 ruby 环境?! at September 29, 2012

    http://gembundler.com/bundle_package.html

  • Ruby 工程师的薪资等级 at September 28, 2012

    #7 楼 @help5305fff 是吗是吗

  • 如何批处理执行多个 rakefile? at September 28, 2012

    Rake is for building, not for scripting...

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

    turbolinks 看起来不错

  • 跟大家分享篇文章 at September 27, 2012

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

  • 发现个好玩的东东 at September 25, 2012

    好像还可以 cowthink

  • 新的搜索好慢 at September 24, 2012

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

  • SQL 通配符真的很糟糕么 at September 24, 2012

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

  • SQL 通配符真的很糟糕么 at September 24, 2012

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

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

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

  • Ruby 有没有官方 Language Reference? at September 23, 2012

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

  • 吐槽一下 ruby 的文档 at September 23, 2012

    #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 September 23, 2012

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

    [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 September 23, 2012

    #21 楼 @chyanog 淫才啊

  • 了解 Ruby 中的具象状态传输 (REST) at September 23, 2012

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

  • SQL 通配符真的很糟糕么 at September 23, 2012

    #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 September 23, 2012

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

  • SQL 通配符真的很糟糕么 at September 23, 2012

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

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

  • Rails 4 会带来什么 at September 22, 2012

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

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

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