Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
耿
@angelfan
Member
NO. 15307 / 2014-10-10

[email protected]
上海
13 Topics / 100 Replies
6 Followers
4 Following
41 Favorites
Reward
GitHub Public Repos
  • CodeDaily 6

    每天积累一点

  • DayDayUp 5

    good good study, day day up

  • machine-learning 2

  • asana_import 1

    redmine plugin for importing asana project scv

  • redis-activesupport 0

    Redis stores for ActiveSupport

  • redis-rails 0

    Redis stores for Ruby on Rails

  • path_listener 0

  • chiziblog 0

    yami

  • go-common 0

    哔哩哔哩 bilibili 网站后台工程 源码

  • treasure_box 0

    vue treasure_box

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 收到 12306 的邮箱,让我大吃一惊 at September 15, 2016

    恩 你看的没错 😅

  • 在 Swift 下实现了 Rails 风格的路由库 at August 30, 2016

    @jasl 3Q

  • 在 Swift 下实现了 Rails 风格的路由库 at August 29, 2016

    初次看Journey真的有种望而却步的赶脚 不知道大大是如何看源码的 有什么技巧可以分享嘛

  • 尝试理解 ActionDispatch::Routing::RouteSet at August 29, 2016

    @lilijreey 之前看源码的时候就发现这个梗了,不过当时只是想先去了解大致的流程 刚刚去看了一下 Racc 的文档 然后一脸懵逼啊 这边有个例子 HelloRacc

  • 调试工具你们是 pry 党还是 byebug 党? at August 23, 2016

    pry + puts(某些情况下 pry 不好用)

  • 请问怎么用 Ruby 实现 1000!的末尾有多少个连续的 0 at July 01, 2016

    楼上正解

  • 微信开发者工具 Linux 版 at June 21, 2016

    不好意思 我来搞破坏了 所以他变成 -1 了 没有恶意,只是想测试一下

  • leetcode:Count of Smaller Numbers After Self at June 15, 2016

    正好翻到了这题 从提交的执行时间看 树状数组用的时稍微少了一点,其实和 merge sort 时间复杂度是一样的

    def count_smaller(nums)
      idxes = {}
      nums.sort.each_with_index {|v, i| idxes[v] ||= i + 1}
      i_nums = nums.map {|n| idxes[n] }
    
      ft = FenwickTree.new(nums.size)
      ans = Array.new(nums.size)
    
      (0..(nums.size-1)).to_a.reverse.each do |i|
        ans[i] = ft.sum(i_nums[i] - 1)
        ft.add(i_nums[i], 1)
      end
    
      ans
    end
    
    class FenwickTree
      attr_accessor :n, :sums
    
      def initialize(n)
        @n = n
        @sums = Array.new(n + 1) { 0 }
      end
    
      def add(x, val)
        while x <= n
          sums[x] += val
          x += lowbit(x)
        end
      end
    
      def lowbit(x)
        x & -x
      end
    
      def sum(x)
        res = 0
        while x > 0
          res += sums[x]
          x -= lowbit(x)
        end
        res
      end
    end
    
  • 错误:can't add a new key into hash during iteration (RuntimeError) at May 13, 2016
    a = {a: 1, b: 2}
    a.each { |k, v| a[v] = a[k] } # will raise "can't add a new key into hash during iteration"
    a.dup.each { |k, v| a[v] = a[k] } # works
    
  • [上海] 寻找有工匠精神的大牛加入技术强队 - Ruby - Rails at May 13, 2016

    :plus1:

  • 带 Namespace 的 Polymorphic 关联如何查询 at April 27, 2016
    module B
      class Stuff < Base
        has_many :resources, -> (object) { unscope(where: :resourceable_type).where(resourceable_type: object.class.name.split("::").last)) } as: :resourceable
      end
    end
    

    可以这样试试

  • [上海] 噗印 (个性定制品电商) 招募 Ruby、Devops 工程师 . 坐标:[漕河泾开发区]. 薪资靠谱,前景佳~ at April 18, 2016

    👍

  • 你见过的或写过的最精致的 Ruby 代码长什么样? at March 12, 2016

    https://github.com/pjones/effrb

  • Draper 使用帮助 (即 draper README 翻译) at March 12, 2016

    解决 view-model 感觉 presenter 看起来更纯粹 Draper 很好用,也选择了用它,不过也推荐看一下 http://thepugautomatic.com/2014/03/draper/

  • 哪里有 Ruby Rails 的培训呀? at March 08, 2016

    墙内 http://happypeter.github.io/rails-tricks/ 墙外 https://www.youtube.com/channel/UCSI77lJlzlCFPLdV1RSAoYQ 配套代码 https://github.com/railscasts

  • Ruby 处理 PDF 的开源项目大家有了解么? at March 03, 2016

    https://github.com/markets/awesome-ruby#pdf

  • [上海][2016年3月1日] Ruby 聚会召集 at February 24, 2016

    👍

  • RSpec 在 controller 测试 post get 方法 调用时, 怎么设置 headers ?? at February 22, 2016

    rspec 在 controller 测试 post get 方法 调用时,怎么设置 headers => rspec when controller test post get method call, how to set headers 把中文用 google 翻译成英文 然后再贴到 google 里搜索 http://stackoverflow.com/questions/9654465/how-to-set-request-headers-in-rspec-request-spec

  • 斗鱼弹幕助手 (Ruby 版本) at February 15, 2016

    :plus1:

  • 关于扩展字段的设计问题 at December 15, 2015

    https://github.com/railscasts/403-dynamic-forms 希望对你能有点帮助

  • [上海] 噗印--个性化电商团队招聘 Ruby 开发工程师 (薪酬、福利优厚) at October 09, 2015

    公司很棒

  • 函数的返回值你用 return 吗? at August 10, 2015

    rubocop 推荐不写 return

  • 征集大家意见,关于回帖用树形方式展示,类似 HackerNews at August 10, 2015

    👎 感觉可以嵌套一层

  • [上海] 随心所想,个性化定制的(优印)招募 Ruby 工程师 2 人 at July 13, 2015

    支持

  • autocomplete: 'off'火狐中不起作用 at June 24, 2015

    #1 楼 @hooopo 感谢!

  • 如何根据经纬度获取地址名称 at June 20, 2015

    #1 楼 @flowerwrong #2 楼 @huacnlee 感谢!

  • 使用 Rails 构建 API 实践 at June 02, 2015

    很棒,支持了

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