Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
Zete
@luikore
高级会员
第 2880 位会员 / 2012-07-16

55 篇帖子 / 3423 条回帖
245 关注者
6 正在关注
32 收藏
GitHub Public Repos
  • triez 140

    fast, efficient, unicode aware HAT trie with prefix / suffix support for Ruby

  • rsec 78

    Parser / Regexp Combinator For Ruby

  • regexp_optimized_union 11

    Regexp.optimized_union(word_list, regexp_options) generates optimized regexp for matching union o...

  • zscan 9

    Improved string scanner

  • stimulus-bind 9

    Enable simple data binding for stimulusjs

  • vscode-hypertab 3

    The Missing Tab Completion for VS Code

  • property-list 1

    Property list (plist) library with all formats support

  • keycap 1

    1.5u keycap for Kailh low profile switch

  • ffi-clang 0

    Ruby FFI bindings for libclang 3.4+.

  • llvm-node 0

    Node LLVM 4.0+ Bindings

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • Teahour.fm 28 期:和 Strikingly 的 CTO Dafeng 聊聊他们和 Y-Combinator 的故事 at 2013年08月21日

    终于抢到沙发了...

  • [9.16 更新两位讲师] RubyConf China 2013 讲师介绍 at 2013年08月20日

    鸭梨表示很大...

  • path 和 url 有什么区别吗? at 2013年08月20日

    url 多会在邮件中用到,不过对于大部分邮件客户端加个 base 设置也能继续用 path

  • 大家来重构 Season 3 at 2013年08月20日

    #9 楼 @quakewang TDD 为求通过测试不择手段... 还可以祭出终极手段把 assert 重定义必通过...

  • 大家来重构 Season 3 at 2013年08月20日

    话说为啥不在 new 的时候就把那个算好...

    class Anagram < Struct.new(:word, :sorted_chars)
      def initialize w
        super w.downcase, w.downcase.chars.sort
      end
    
      def match list
        list.find_all do |e|
          a = Anagram.new e
          a.word != word and a.sorted_chars == sorted_chars
        end
      end
    end
    
  • 大家来重构 Season 3 at 2013年08月20日

    @quakewang Anagram = String 还能省几行...

  • 大家来重构 Season 3 at 2013年08月20日

    楼主这么写挺好的啊,trivial 的问题就 trivial 的解决

  • Ruby 性能真的比 Node 差这么多么? at 2013年08月20日

    #16 楼 @killyfreedom 很难说... 用 rack, rainbow, mongo, grape 这个 Gemfile 里已经东西一大堆了吧?如果就一个很素的功能,用 nodejs 或者 go 也可以啊,不用纠结。

    另外试过 https://github.com/bcg/em-mongo 了没?

  • Ruby 性能真的比 Node 差这么多么? at 2013年08月20日

    其实 V8 在一些嵌入机上没有 mruby 快...

  • Ruby 性能真的比 Node 差这么多么? at 2013年08月19日

    大概主要瓶颈在 mongo 的 driver 实现上,另外 EM 做的 buffer 拷贝排队工作有点太多...

    现在 1.9.3 都 p448 了... 换 ruby 2.1 试试吧?

  • Jammit at 2013年08月19日

    类似的还有 https://github.com/pjb3/gumbo , 默默无闻好久没有更新 然后 google 发布了名字撞车的 html parser 后,下载量突然就上去了...

  • sinatra 操作 db 一般用什么搭配? at 2013年08月19日

    http://recipes.sinatrarb.com/p/models?#article

    好像现在就 AR 和 Mongo 活着

  • ZT 不要复杂化 Vim at 2013年08月19日

    #13 楼 @gene_wu 写个插件,作用是插件瘦身...

  • ZT 不要复杂化 Vim at 2013年08月19日

    插件 20 个-_-

  • win 系统上传到 lin 系统,文件名乱码问题 at 2013年08月15日

    上传完毕以后,把文件名转下码就好了

    require 'fileutils'
    Dir.glob('*') do |f|
      next if f.start_with? '.'
      FileUtils.mv f, f.dup.force_encoding('gbk').encode('utf-8')
    end
    
  • Ruby2.0+ 的内部编码设计,以及 Windows 的问题 at 2013年08月15日

    #9 楼 @kiol 这是 windows + sublime 特有问题... sublime 不该修改 windows 的 console cp 的,chcp 65001 之后啥都干不了...

    在 sublime 设置里加个环境变量试试?RUBYOPTS=-Egbk:utf-8

  • 如何获得数组里面连续的多部分 at 2013年08月15日

    #54 楼 @doitian slice_before cool! .... 不睡觉的人

  • 来分析分析这段 Ruby 代码 at 2013年08月14日

    这是针对特定字符集的编码压缩法

    像第一个 euruko 文字用到的字符只有 "\n )/\\_|", 对应的码点是 [10, 32, 41, 47, 92, 95, 124], 然后找一个简单的可逆函数,可以把上述码点和比较小的区间如 0..15 做映射,然后就能把压缩算法搞出来了。关键就是怎么去搞这么一个函数...

    除了 Euroku-golf, 今年的 ICFP 竞赛也和这个有点关系的:给定一个黑箱函数,你可以用 web api 去检查它的输入和输出的几个例子,然后去猜函数的实现,猜出来最多的队伍获胜

  • 如何获得数组里面连续的多部分 at 2013年08月14日

    #50 楼 @bhuztez 后面是有点,e ⊂ a.each_with_index ...

  • 如何获得数组里面连续的多部分 at 2013年08月14日

    更短的来了...

    a = [1,2,3,5,6,9,10,2,3,4]
    (1..a.size).zip(a).chunk{|l,r|l-r}.map{|_,e|e.map &:last}
    

    或者长一点但简单点的:

    a.each_with_index.chunk{|l,r|l-r}.map{|_,e|e.map &:first}
    
  • 解决粘贴到终端 Vim 缩进错乱 at 2013年08月14日

    #29 楼 @simlegate alias vi='mvim -v'

  • 如何获得数组里面连续的多部分 at 2013年08月14日

    #21 楼 @kikyous 抱歉,水平有限....

  • 如何获得数组里面连续的多部分 at 2013年08月14日

    @blacktulip ...

    Array#split 是 activesupport 添加的。如果不用 activesupport :

    def calc_range list
      last = nil
      flip = false
      list.chunk do |e|
        flip ^= !(last and e == last + 1)
        last = e
        flip
      end.map &:last
    end
    calc_range [1,2,3,5,6,9,10,2,3,4]
    
  • 解决粘贴到终端 Vim 缩进错乱 at 2013年08月14日

    简单实在空格 p

    let mapleader=" "
    map <leader>p "*p
    
  • Ruby2.0+ 的内部编码设计,以及 Windows 的问题 at 2013年08月14日

    #5 楼 @kiol -_- sublime 啊... 大概是 python 的问题...

  • Rails has Two Default Stacks at 2013年08月14日

    #36 楼 @bhuztez 你可以切换连接/表啊,但建表是 db migration 的事,和 mount 有什么关系...

    还有就是 MVC 里 C 不是和 model 一一对应的,orm 里 model 也不是和 table 一一对应的,要把一个表挂到一个 url 上不如直接用数据库自带的 rest api 好了

  • Rails has Two Default Stacks at 2013年08月14日

    #34 楼 @bhuztez 如果数据库是 mongodb 或者 orm 是 datamapper, 那是访问什么就有什么

    在 padrino / rails 里建表和 router 一毛线关系都没有。你是在说怎么把橘子弄成苹果味么...

  • Rails has Two Default Stacks at 2013年08月14日

    #29 楼 @bhuztez 就是改下 url 这么简单。再加个 filter 根据 url 切换 db connection 就可以了...

  • Ruby2.0+ 的内部编码设计,以及 Windows 的问题 at 2013年08月14日

    #2 楼 @bhuztez 表面上看来没有转换,实际上系统在读写文件时悄悄做了转换... 用 ruby 可以全程无编码转换的处理 gbk 文本的

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