Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
watgon
@watgon
高级会员
第 2184 位会员 / 2012-05-13

2 篇帖子 / 14 条回帖
0 关注者
0 正在关注
0 收藏
很多人把自己的命运寄托在语言的设计者身上,自己没有能力去改进它们,所以他们才会对程序语言顶礼膜拜。
未设置 GitHub 信息。
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • Newrelic 监控的 response 时间 和实际测试时间 差别很大。 at 2013年07月26日

    newrelic 只是 Rails 处理请求的时间,还有很多流程。Newrelic 是监控不来的,不过有个浏览器监控,可以试下。

  • Rails 4.0.0 正式发布了 at 2013年06月26日

    其实,俺想问,俺的帖子咋没了啊。。。

  • -------- at 2013年06月21日

    这个工资,这个要求,是招不到人的。。

  • 敏感词过滤 at 2012年12月19日

    gem 'fast_trie', :require => "trie"

    # encoding: utf-8
    class SegTrie
    
      attr_accessor :trie
    
      def initialize
        self.trie = ::Trie.new
      end
    
      def all_words(str, offset = 0, words= [])
        words_a ||= []
        str ||= ''
        str.length.times do |i|
          self.word(str, i, words_a)
        end
        words_a
      end
    
      def word(str, offset = 0, words_a = [])
        len = 0
        while  offset + len < str.length
          status = self.trie.get(str[offset, (len + 1)])
          if status == 2
            len = len + 1
            words_a.push(str[offset, len])
          elsif status == 1
            len = len + 1
          elsif status == 3
            words_a.push(str[offset, len + 1])
            break
          else
            break
          end
        end
        words_a
      end
    
      def add_words(words)
        words.each_index do |i|
          self.add_word(words[i])
        end
      end
    
      def add_word(word)
        return false if word.blank?
        word.length.times do |i|
          next if i == 0
          self.trie.add(word[0, i], 1) if self.trie.get(word[0, i]).to_i < 1
        end
        status =self.trie.get(word).to_i
        if status == 1
          self.trie.add(word, 2)
        elsif !([2, 3].include?(status))
          self.trie.add(word, 3)
        end
      end
    
      def clear_words
        self.trie = ::Trie.new
      end
    
    end
    
  • 敏感词过滤 at 2012年12月14日

    俺用 trie 实现了个,两万敏感词,一秒钟能过滤二三十万文本

  • 2012年12月22日,如果那一天地球还没有被毁灭,让我们一起向那帮搞 Python 的家伙 “切磋” 一下!- RubyVSPython 2012 年 大决战 at 2012年12月14日

    这个好,俺要去

  • MongoDB + Rails 有什么好的全文搜索的办法吗? at 2012年08月12日

    @richarddong solr 比 Sphinx 的性能差?对比吗?

  • [北京][2012年08月11日] Ruby 活动公告 + 媒体资料 + 小结 at 2012年08月04日

    俺也要报名。

  • [西安][成都][北京] 全球知名 IT 公司 ThoughtWorks 招聘 Ruby 开发 at 2012年07月20日

    似乎很牛的样子。。。

  • [北京] 友盟高薪诚邀优秀 Ruby/Java/Scala/ 前端 / 运维 工程师 at 2012年07月16日

    还招人不?发了邮件没反应啊?

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