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
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • 如何知道 Enumerator 的当前内部指针位置和前一个元素? at 2012年09月16日

    each_with_index?

  • 使用 rails 的 migration 怎样将一个表中数据复制到另一个表 at 2012年09月16日
    1. 你没li.save
    2. 别在 migration 里写这个
  • 讨论一个设计方案 at 2012年09月14日

    你这种需求用 Nodejs 或 Eventmachie/Thin 就比较好实现。 有耗时任务直接新建一个异步的 timer,既不消耗多余的内存,又不影响当前进程,缺点是未执行的任务在重启服务器的时候会丢失,还得去考虑一些持久化的事情。

  • 讨论一个设计方案 at 2012年09月14日

    #12 楼 @fsword 明白了。。你连启动一个 Rails 进程的内存都没有。

  • 如何把字符串 "0.01" 格式化为 "000.01" at 2012年09月14日

    "%06g" % s

    http://www.ruby-doc.org/core-1.9.3/Kernel.html#method-i-sprintf

  • second_level_cache 简介 at 2012年09月13日

    #1 楼 @ywencn iteye 还是 Rails2.3 的。。。 新开发的项目在用。

  • counter_cache 后面的 :inverse_of => :topics 是什么意思? at 2012年09月13日

    http://ruby-china.org/topics/5375

  • 讨论一个设计方案 at 2012年09月13日

    https://github.com/mperham/sidekiq

  • 请教如何删除表记录 at 2012年09月13日

    #6 楼 @zlx_star 如果 migration 跑不通 也可行。

  • 请教如何删除表记录 at 2012年09月12日

    rake db:drop rake db:create rake db:schema:load

  • 有人用 RSense? at 2012年09月12日

    #2 楼 @unionx ^_^

  • Rack:Cache 好像没啥用嘛 at 2012年09月12日

    #4 楼 @edokeh 和 varnish 不冲突的 app server 可以根据业务逻辑,判断是要生成新的页面 render 给反向代理还是只 render 一个状态码。

  • 缓存引起的 Undefined Class/Module 有什么优雅的解决方法? at 2012年09月12日

    自己写了一个序列化/反序列化 AR 对象的方法,没有这个问题了,并且速度有提升。。 最重要的是不会把关联缓存/dirty 属性等存到缓存里。 https://gist.github.com/3447628

  • Cache Digests 最大化緩存策略 at 2012年09月12日

    难道大家不觉得用正则在页面里匹配 render 方法和在注释里声明依赖这种做法很恶心?

  • Rails 是否不是特别适合用来做 API? at 2012年09月11日

    呵呵 呵呵

  • 一个棘手的问题,不能命名属性为 “type” at 2012年09月11日

    #3 楼 @zealinux @kenshin54 说的是这个意思:

    ActiveRecord::Base.set_inheritance_column "tttype"
    

    或者只在某个 Model 上使用:

    User.set_inheritance_column "tttype"
    
  • 祝贺 Cloud Foundry 中文技术社区正式上线 at 2012年09月10日

    不喜欢 cloudfoundry 的最重要原因就是这个域名我记不住,每次都拼错。

  • 小龙女在古墓里为什么不把杨过收为师弟? at 2012年09月09日

    收师弟了小说还怎么往下写啊

  • [北京] 糗事百科 招聘 Python 全职或实习工程师 at 2012年09月08日

    #8 楼 @fire9 因为 @ShiningRay 同学走了?

  • pg_power at 2012年09月07日

    #9 楼 @bhuztez 问一下,你工作是搞什么的?不是 web 开发吧?

  • pg_power at 2012年09月07日

    #7 楼 @bhuztez 这东西有什么优点?

  • pg_power at 2012年09月07日

    #5 楼 @bhuztez 从来不定义外键约束。。。

  • 问个很白痴的问题,怎么知道一个 gem 的最新版本 at 2012年09月07日

    http://rubylution.herokuapp.com/topics/5

  • mongoid 缓存 at 2012年09月05日

    #5 楼 @whatisruby 方向问题就得看文档了。。。

  • mongoid 缓存 at 2012年09月05日

    #5 楼 @whatisruby 拿最简单的 one-one 来举例子吧: User has_one Account Account belongs_to User 在未设置:inverse_of 的情况下:

    u = User.first
    [2] pry(main)> account = u.account
      Account Load (0.5ms)  SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 2 LIMIT 1
    [3] pry(main)> account.user
      User Load (0.6ms)  SELECT `users`.* FROM `users` WHERE `users`.`id` = 3 LIMIT 1
    

    设置了 inverse_of 以后:

    class User < ActiveRecord::Base
      has_one :account, :inverse_of => :user
    end
    
    [1] pry(main)> u = User.first
      User Load (0.3ms)  SELECT `users`.* FROM `users` LIMIT 1
    [2] pry(main)> account = u.account
      Account Load (0.1ms)  SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`user_id` = 3 LIMIT 1
    [3] pry(main)> account.user # No SQL Query
    

    其中,把 user.accout 这一方法看成函数就是 account(a_user) -> a_account 对应的反函数是 user(a_account) 一定返回 a_user

  • 为什么 Mac 是开发者首选的平台? at 2012年09月05日

    第二弹

  • mongoid 缓存 at 2012年09月05日

    #3 楼 @whatisruby 我没用过 mongoid。。不过这东西应该和 AR 里的类似:

    假设 f(x) -> y,那么 f(x) 的反函数是 g(y) inverse_of 的作用是在你第一次运行 f(x) 并得到结果 y 的时候,就把反函数 g(y)-> x 的结果缓存起来了。

  • mongoid 缓存 at 2012年09月05日

    开启了 IdentityMap 吧?

  • 各位怎么管理 css 和 javascript assets at 2012年09月05日

    #21 楼 @jonny 如果真想做到最优要根据用户访问的历史记录来建模。。综合带宽、静态文件大小等因素,求期望。

  • 各位怎么管理 css 和 javascript assets at 2012年09月05日

    #19 楼 @jonny 后台管理的静态文件和前台的分开这是共识吧。。

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