Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
loveltyoic
@loveltyoic
Member
NO. 7294 / 2013-05-27

[email protected]
合肥
17 Topics / 118 Replies
0 Followers
0 Following
18 Favorites
GitHub Public Repos
  • loveltyoic.github.io 1

  • ouster_example 0

    Ouster sample code

  • llama.cpp 0

    Port of Facebook's LLaMA model in C/C++

  • SemiGlobalMatching 0

    SGM,立体匹配最经典应用最广泛算法,4000+引用,兼顾效率和效果。完整实现,代码规范,注释清晰,博客教学,欢迎star!

  • PatchMatchStereo 0

    PatchMatch,倾斜窗口经典,效果极佳,OpenMVS&Colmap稠密匹配算法。完整实现,代码规范,注释清晰,博客教学,欢迎star!

  • GameAISDK 0

    基于图像的游戏AI自动化框架

  • nerf-pytorch 0

    A PyTorch implementation of NeRF (Neural Radiance Fields) that reproduces the results.

  • colmap 0

    COLMAP - Structure-from-Motion and Multi-View Stereo

  • pytorch-cnn-visualizat... 0

    Pytorch implementation of convolutional neural network visualization techniques

  • aster.pytorch 0

    ASTER in Pytorch

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 用过七牛的来说说你们的安全策略吧 at August 31, 2015

    #3 楼 @liwen_zhang 就在回调逻辑里加限制吧,回调中加入用户的 access_token 之类的,限制用户上传次数。

  • 用过七牛的来说说你们的安全策略吧 at July 28, 2015

    #1 楼 @huobazi 图片审核也是一个问题啊,开始还没想到这个问题呢。 可是不用直传的话又增加了服务器和开发的负担。 感谢分享

  • Ruby VS Scala at May 06, 2015

    #20 楼 @rasefon 是我在 14 楼说的这种用法吗?

  • Ruby VS Scala at May 06, 2015

    求推荐高质量的 scala 社区

  • Ruby VS Scala at May 06, 2015

    在学 scala,觉得模式匹配和 for-comprehension 都很好用,错误处理和 Future 也是很优雅的。 看了这篇,又学到了动态调用 补充一条打开类: Scala:

    //通过隐式转换打开已有类,进行扩展
    implicit class IntFun(i: Int) {
      def fun() = println("have fun")
    }
    
    > 2.fun()
    > have fun
    

    Ruby:

    class Integer
      def fun
        puts "have fun"
      end
    end
    
    > 1.fun
    
  • em-synchrony 中连接池的实现原理 at April 07, 2015

    #1 楼 @yukihiro_matz 嗯,一提到并发就用别的语言去了~ 不过了解一下 Fiber 对理解 actor 模式的实现也是挺有帮助的http://www.blogjava.net/killme2008/archive/2010/04/13/318182.html 不论用什么语言,总是存在共性的。

  • 关于嵌套数组 at March 19, 2015

    a[0]=1,2,3,4,5中的=号赋值其实是更改了a[0]的引用,所以不会影响原来的引用。

  • 关于嵌套数组 at March 19, 2015

    又看了一下文档,像楼主这样声明是有问题的:

    Note that the second argument populates the array with references to the same object. Therefore, it is only recommended in cases when you need to instantiate arrays with natively immutable objects such as Symbols, numbers, true or false.

    To create an array with separate objects a block can be passed instead. This method is safe to use with mutable objects such as hashes, strings or other arrays:

    因此

    a = Array.new(6) { [] }
    

    才是楼主需要的

  • [转王垠] 怎样尊重一个程序员 at March 13, 2015

    #4 楼 @Seabornlee 这是王垠的一篇文章,忘了说明出处,造成误解,抱歉。

  • 定义方法后面加 “=”,意义是什么? at March 13, 2015

    #6 楼 @drine

    current_user = User.find(params[:user_id])
    
  • 定义方法后面加 “=”,意义是什么? at March 13, 2015

    楼主的例子中,定义方法是为了封装@current_user,不要暴露实例变量

  • starry.so 开源出来了 at March 13, 2015

    首页配图很棒。 建议弄个 demo 展示

  • 手机 App 如何保持会话 at March 10, 2015

    嗯,就是这么做吧。 就相当于 cookie 一样。

  • 做一个问卷调查:你是在哪个招聘平台投简历? at March 09, 2015

    拉勾

  • 关于 Rails 片段缓存的问题 at February 26, 2015

    https://ruby-china.org/topics/21488

  • 请问 Parse.com 和 Pubnub.com 的云服务在国内可以访问么?速度咋样? at January 30, 2015

    嗯,在用 leancloud,对于 iOS 的开发者很方便。 想做一个 ruby 的 sdk,开了个头,有意的可以一起完善。 https://github.com/loveltyoic/avos-ruby-sdk

  • Rails 4 使用 CarrierWave 上传图片问题 at January 29, 2015

    看起来不单纯是 CW 的问题,贴代码吧。

  • 路由中 only: [] 是什么意思 at January 29, 2015

    这里其实是为了构造嵌套的形式,的确 res_1 本身不会生成路由,这种情况直接用 namespace 啊。

  • test at January 13, 2015

    支持! 楼主是个对技术非常有热情的好同学!

  • 出一个键盘,Mini Tctile Pro for Mac at December 04, 2014

    楼主点评一下这款键盘呗,为什么卖呢?

  • 如果我要在 rails 里面写一个可能被很多 controller 调用的 public def,我该写在哪儿啊? at December 01, 2014

    写个 helper module,然后在需要的 controller 里 include xxxHelper

  • 两个星号 ** 表示什么 at November 29, 2014

    递归匹配文件夹

  • rails 的编译的原则是什么 at November 28, 2014

    #6 楼 @iml6yu 因为默认加载 layout 了 在 controller 里,layout false, only: 不需要 layou 的 action 名字

  • 求助! http 请求延迟处理响应 at November 25, 2014

    既然是执行完才返回,为什么还要做成后台任务?

  • Newrelic 监测数据的解释 at November 25, 2014

    #6 楼 @hooopo 谢了,试试。

  • Newrelic 监测数据的解释 at November 25, 2014

    嗯,需要研究一下日志。 另外我也用 ab 测试了一下:

    Concurrency Level:      20
    Time taken for tests:   11.950 seconds
    Complete requests:      1000
    Failed requests:        0
    Write errors:           0
    Total transferred:      443000 bytes
    HTML transferred:       117000 bytes
    Requests per second:    83.68 [#/sec] (mean)
    Time per request:       239.000 [ms] (mean)
    Time per request:       11.950 [ms] (mean, across all concurrent requests)
    Transfer rate:          36.20 [Kbytes/sec] received
    
    Connection Times (ms)
                  min  mean[+/-sd] median   max
    Connect:       10  159 657.5     21    7782
    Processing:    14   47  40.7     37     840
    Waiting:       14   47  40.7     37     839
    Total:         27  206 663.0     62    7979
    

    平均 239ms, 为什么会差距这么大呢?

  • Newrelic 监测数据的解释 at November 25, 2014

    #2 楼 @quakewang 首先感谢回复! 这个 API 的代码只是请求另一个 API 并直接返回结果,而且我将结果缓存在 redis 了。 从图中看并没有发起外部请求,那么应该是直接读缓存数据并返回的。 redis 读不会要这么久吧,是否跟服务器性能有关呢?

  • Newrelic 监测数据的解释 at November 25, 2014

    @quakewang 求帮忙看看

  • ActiveRecord 中回调方法的困惑 at November 21, 2014

    #5 楼 @shangrenzhidao #6 楼 @w7938940 https://ruby-china.org/topics/22809,比较深入的看了一下源码,抛砖引玉

  • ActiveRecord 中回调方法的困惑 at November 20, 2014

    从 before_validation 开始搜索

    # File activemodel/lib/active_model/validations/callbacks.rb, line 56
    def before_validation(*args, &block)
      options = args.last
      if options.is_a?(Hash) && options[:on]
        options[:if] = Array(options[:if])
        options[:on] = Array(options[:on])
        options[:if].unshift lambda { |o|
          options[:on].include? o.validation_context
        }
      end
      set_callback(:validation, :before, *args, &block)
    end
    
    # File activesupport/lib/active_support/callbacks.rb, line 600
    def set_callback(name, *filter_list, &block)
      type, filters, options = normalize_callback_params(filter_list, block)
      self_chain = get_callbacks name
      mapped = filters.map do |filter|
        Callback.build(self_chain, filter, type, options)
      end
    
      __update_callbacks(name) do |target, chain|
        options[:prepend] ? chain.prepend(*mapped) : chain.append(*mapped)
        target.set_callbacks name, chain
      end
    end
    
    # File 'activesupport/lib/active_support/callbacks.rb', line 549
    
    def normalize_callback_params(filters, block) # :nodoc:
      type = CALLBACK_FILTER_TYPES.include?(filters.first) ? filters.shift : :before
      options = filters.extract_options!
      filters.unshift(block) if block
      [type, filters, options.dup]
    end
    
    # This is used internally to append, prepend and skip callbacks to the
    # CallbackChain.
    def __update_callbacks(name) #:nodoc:
      ([self] + ActiveSupport::DescendantsTracker.descendants(self)).reverse_each do |target|
        chain = target.get_callbacks name
        yield target, chain.dup
      end
    end
    
    # File activesupport/lib/active_support/callbacks.rb, line 740
    def set_callbacks(name, callbacks)
      send "_#{name}_callbacks=", callbacks
    end
    
  • 1
  • 2
  • 3
  • 4
  • Next
关于 / RubyConf / Ruby 镜像 / RubyGems 镜像 / 活跃会员 / 组织 / API / 贡献者
由众多爱好者共同维护的 Ruby 中文社区,本站使用 Homeland 构建,并采用 Docker 部署。
服务器由 赞助 CDN 由 赞助
iOS 客户端 / Android 客户端 简体中文 / English