Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
江浩浩
@088pause
Member
NO. 11619 / 2014-02-19

[email protected]
南昌
4 Topics / 12 Replies
2 Followers
1 Following
54 Favorites
GitHub Public Repos
  • cardinal-spline-js 8

    Smooth line through points for JavaScript / HTML5 Canvas

  • GolangWeekly-CN 2

    Golang Weekly 中文摘要

  • gatsby-demosite 0

    gatsby-demosite

  • ruby-blog 0

  • homeland 0

    :circus_tent: Open source discussion website.

  • netlify-plugin-gatsby-... 0

    netlify-plugin-gatsby-cache-50

  • PRS-ATM-APP 0

    An Electron Wrap of https://github.com/Press-One/prs-atm.

  • mailchimp-marketing-ruby 0

  • gastby-demo 0

  • rails 0

    Ruby on Rails

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • Ruby on Rail Guides: ActiveSupport::Cache::RedisCacheStore at April 28, 2020

    搜索的时候查到这篇文章 -> Redis vs. Memcached: In-Memory Data Storage Systems

    发现作者是 Alibaba Cloud,原来阿里云在 Medium 上还有官方账号呢。

  • Ruby on Rail Guides: ActiveSupport::Cache::RedisCacheStore at April 28, 2020

    让它用起来就像一台内存缓存服务器一般 (allowing it to behave much like a Memcached cache server.)

    今日回看才发现这个翻译是错的……由于之前从来没用过 Memcached 作为缓存服务器,中文版这段看的也不仔细,就直接翻译成了缓存服务器。😂 更新了一下。

    2.5 ActiveSupport::Cache::MemCacheStore

    这个缓存存储器使用 Danga 的 memcached 服务器为应用提供中心化缓存。Rails 默认使用自带的 dalli gem。这是生产环境的网站目前最常使用的缓存存储器。通过它可以实现单个共享的缓存集群,效率很高,有较好的冗余。

  • 终止支持 Ruby 2.4 at April 28, 2020

    也就是老旧系统需要人催嘛。不过 Rails 社区大家升级的意愿似乎都挺强的。

  • 请问怎么在部分 action 中跳转已登录用户的 sql 查询(devise) at April 26, 2020

    那条 SQL 查询是放在 ActionController::Base 中,还是 Api::ApiController 中的?

  • Golang Weekly #309 中文摘要 -2020年4月24日 at April 25, 2020

    Pomerium: 一款基于身份识别的安全访问代理 An Identity-Aware Secure Access Proxy — 继 一款模仿 Google BeyondCorp 开发的身份识别访问代理。认为 VPN 有用,但不需要 VPN。Built in Go, naturally. (不知道咋翻译,抱歉) POMERIUM

    hhhh 😂 刚刚仔细看了一下,VPN 翻译的那句我翻译的什么玩意儿。考虑更新了一下,应该是下面这个意思:

    Think VPN access benefits but without the VPN.

    想象一下,它拥有 VPN 访问的优点,但又并不走 VPN。

  • [北京] (推荐朋友入职送苹果 x 限内部员工送 2 部 x) PXN 貔貅 招聘 Ruby 工程师 20k-50k月 不打卡 年终奖丰厚 -外地的同学-先安排电话面试,面试通过 ,复试高铁机票报销-HC 还有欢迎投递简历 at November 14, 2018

    今天的天气特别适合晒一波办公室的新风系统。🌝 可以躲在楼里继续写代码。😷

  • [北京] 幻腾科技寻找 Ruby 后端工程师 at June 14, 2016

    #15 楼 @phantom hhhhhhhhhh 原来是会换工作的,怪不得用平均值正确率会突然跌的没法儿看。那我就试试定期重置咯 key = rz4mwn {"status":0,"message":"OK","prediction_count":"1000","score":"10229"}

    对了,播客的名字错了呀…… 友的聊听友表示不能忍。🌚

  • 基础 Ruby 中 Include, Extend, Load, Require 的使用区别 at December 23, 2015

    纠正一下 Extend 那个例子中的一个问题:例子中最终的输出应该是 # This class is of type: Class。

    由于在类中运行 extend Log 使得 Log 中的方法添加给了 TestClass 这个类。所以在 self.class 的值应该是 TestClass 的类。而在 Ruby 中,我们定义的类都是 Class 的一个实例。所以:

    TestClass.new.class #=> TestClass
    TestClass.class #=> Class
    

    这个问题在英文原链评论区里也有人提到了。另外,还有一个错误。

    并非使用 Extend 时就是类方法

    以下是 $ Ri extend 返回的结果

    === Implementation from Object
    ------------------------------------------------------------------------------
      obj.extend(module, ...)    -> obj
    
    ------------------------------------------------------------------------------
    
    Adds to obj the instance methods from each module given as a parameter.
    
      module Mod
        def hello
          "Hello from Mod.\n"
        end
      end
    
      class Klass
        def hello
          "Hello from Klass.\n"
        end
      end
    
      k = Klass.new
      k.hello         #=> "Hello from Klass.\n"
      k.extend(Mod)   #=> #<Klass:0x401b3bc8>
      k.hello         #=> "Hello from Mod.\n"
    

    这里的说明十分清楚,这是一个实例方法。调用者和返回者都是这个实例,所以当我尝试像下面这样定义时:

    class TestClass
       puts extend(Log) #=> TestClass
    end
    

    返回的结果是 TestClass。

    因此我猜想,我们在类定义中使用的 extend Log 实际是一种简写,实际运行的是self.extend(Log)。

    结论是,并不是说使用 Extend 时就是类方法。而是需要注意到我们实际使用的是一种简写,由于是 self(即类本身) 调用了 Extend 这个方法,才使得添加模块中的方法被设定成了类方法。

    所以如果希望避免这一误会,可以在类定义中使用 self.extend(module, ...) 而非 extend(module, ...)。

  • Ruby 服务器对比 at May 17, 2015

    "still, the author provides no warranty and says that usage is at own risk." 这一句应该可以翻译为:“当然,作者也并不做任何担保,并表示不同应用环境下有其相应的风险。”

  • 什么时候买 kindle 比较合适呢? at May 08, 2014

    最需要的时候永远就是入手的最佳时机。

  • 什么时候买 kindle 比较合适呢? at May 08, 2014

    当你自己觉得要用的时候。天天想着什么时候买才最浪费时间。

  • 为什么最新 Rails Guide 中 Getting Started 中去掉了 Creating the Database 这一节? at April 23, 2014

    #1 楼 @swordray 这样啊,谢谢。

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