Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
ian
@doitian
VIP
NO. 186 / 2011-11-23

皮匠科技
杭州
22 Topics / 849 Replies
42 Followers
1 Following
13 Favorites
GitHub Public Repos
  • live2dviewer 76

    Live2D 模型批量查看器

  • dotfiles-public 14

    My configurations

  • knowledge-base 5

  • ckb-sdk-python 2

  • readwise-scripts 2

  • zotero-actions-tags-sc... 2

    Scripts for the Zotero plugin windingwind/zotero-actions-tags

  • lnd-grpc-tonic-client 2

    Rust lnd client using tonic and tonic-openssl.

  • http-inspector 1

  • dotfiles 1

    dotfiles managed using saltstack

  • userstyles 0

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • Linuxer 们,都用什么发行版 /WM/DE 啊。扯扯淡 at April 02, 2012

    #19 楼 @jinleileiking 本身不占什么内存,倒是我用 ruby em 包装的 dzen2 panel 占了 1.2% 总共 4G

    xmonad memory

  • Patched ruby 1.9.3-p125 for 30% faster rails boot,最新版。 at April 02, 2012

    -j 3是传给 make 的吧,这个 CPU 弱点就可以去喝茶了等着编译完了

  • Linuxer 们,都用什么发行版 /WM/DE 啊。扯扯淡 at April 02, 2012

    arch xmonad

  • 请教一个 Emacs 的问题. at April 01, 2012

    #25 楼 @zw963 用 Exuberant Ctags

  • 请教一个 Emacs 的问题. at April 01, 2012

    lisp 里 ffap 快狠准,估计 ruby 只能找当前目录下的文件玩玩

  • 请教一个 Emacs 的问题. at April 01, 2012

    自己写的话,(ffap-string-at-point) 可以用这个函数抽出当前位置的文件名

  • 请教一个 Emacs 的问题. at April 01, 2012

    #19 楼 @zw963 没绑定的,可以 bind 到 C-x f,直接 M-x ffap 也可以,Emacs 自带的 find file at point。我是 helm-sources 里加的全是找文件和 buffer 的 sources,所以一般我都用 C-u helm-at-point

  • 请教一个 Emacs 的问题. at April 01, 2012

    #13 楼 @yedingding -f 不就不 index methods 了吗?

  • 请教一个 Emacs 的问题. at April 01, 2012
    1. ffap 可以抽取当前光标处所在文件名进行查找
    2. 有 helm/anything 的话,helm-at-point在加前缀的时候会抽取出当前光标所在文件名开始搜索,也就是 C-u helm-at-point
  • linux/osx 大家都用什么比较工具啊。 at April 01, 2012

    Linux 下 kdiff3, vim 的 diff 和 Emacs 的 ediff, Mac 下 DiffMerge 凑合也能用下

  • 聊一下"相关帖子"算法? at April 01, 2012

    还有回复

  • 聊一下"相关帖子"算法? at April 01, 2012

    可以加权下协同过滤,按照用户的喜欢和收藏算贴子的近似度

  • 按一定的概率随机给出键,怎么实现好 at April 01, 2012

    忘了链接 https://gist.github.com/2272325 包括 alias method

  • 按一定的概率随机给出键,怎么实现好 at April 01, 2012

    #24 楼 @fredwu 综合测试了下,包括 benchmark 和 erorr。error 就是实际产生的频率和原来概率分布之间的误差

  • 按一定的概率随机给出键,怎么实现好 at April 01, 2012

    #23 楼 @fredwu 如果分布不平均,而且是构建 1 次,用 n 次的话,排序效果就会很明显,比如概率是 1 个 0.91,9 个 0.01,91% 的情况下只用比较 1 次

  • 按一定的概率随机给出键,怎么实现好 at April 01, 2012

    #21 楼 @fredwu 是整个执行 100000 次,还是只是产生随机变量值的部分执行 100000 次?贴下你的测试代码看看

  • Emacs 按键之乾坤大挪移 at April 01, 2012

    #21 楼 @zw963 seq-count 是个好东西

  • 按一定的概率随机给出键,怎么实现好 at April 01, 2012
    hash = { :a => 0.5, :b => 0.15, :c => 0.2, :d => 0.15 }
    
    cdf = hash.to_a.sort_by {|e| -e.last}
    cumulative_probability = 0
    cdf.each { |e| cumulative_probability = e[1] = e[1] + cumulative_probability }
    cdf.last[1] = 1 # fix float error
    
    marker = rand
    result = cdf.find {|e| marker < e.last }
    result.first
    
    
  • 按一定的概率随机给出键,怎么实现好 at April 01, 2012

    #14 楼 @fredwu CDF 可以提前算,如果 PDF 提前按从大到小排序

    values: :a :c :b :d PDF: 0.5 0.2 0.15 0.15 CDF: 0.5 0.7 0.85 1

    线性搜索会快很多

  • Emacs 按键之乾坤大挪移 at April 01, 2012

    #11 楼 @zw963 我是加了个 yasnippet, 文件末不要有换行

    # name: UPCASE # key: uc # -- ${1:>$(upcase yas/text)}$0

  • Emacs 按键之乾坤大挪移 at April 01, 2012

    #14 楼 @zw963 跟 Xah Lee 的 binding 有得比了

  • Emacs 按键之乾坤大挪移 at March 31, 2012

    #10 楼 @zw963 M-r按得快,M-u绑定在输入下划线,M-l绑定成输入连字符,有 prefix 的时候还是会调用原来的 upcase 和 downcase

  • 大家的 home 目录下都有些什么程序? at March 31, 2012

    自己电脑不都可以sudo吗

  • Emacs 按键之乾坤大挪移 at March 31, 2012

    #7 楼 @doitian 错了是 C-l

  • Emacs 按键之乾坤大挪移 at March 31, 2012

    默认的 M-r 也可以光标不动,屏幕在 top, middle, bottom 三个位置切换,不过我把这个键给 bind 到word-backward-kill了

  • Emacs 按键之乾坤大挪移 at March 31, 2012

    #4 楼 @hbin 我也准备偷走,不过 M-n M-p好像容易冲突

  • 今天终于入手了 mac at March 31, 2012

    #12 楼 @azhao 11 太弱 13 够用了

  • 按一定的概率随机给出键,怎么实现好 at March 31, 2012

    那篇口水比较多 看另一篇吧 http://www.cnblogs.com/miloyip/archive/2010/04/21/1717109.html 用的 javascript

  • [翻译] Emacs 改变了我的人生 (发生在 Emacs 和 Ruby 之间的故事) at March 31, 2012

    #39 楼 @u1331878576 Ruby 是 LSB 这个做标志位,标明是整数还是指针,省到 type 所占的位置, @neutralevil 解释的很清楚了 http://media.pragprog.com/titles/ruby3/ext_ruby.pdf 这个 P10 有详细说明

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