#10 楼 @donnior 二叉树查找,不是遍历,所以只能用值和范围来约束,不能对值进行进一步处理 楼下说的更准确,自宫一下
#8 楼 @luikore 疑惑的就是这个“已排序”,试验了一下,果然是必要条件啊
2.1.0dev :009 > array = [2, 4, 8, 16, 32].shuffle
=> [32, 2, 8, 4, 16]
2.1.0dev :010 > array.bsearch {|x| x >= 4} #=> 4
=> 8
2.1.0dev :011 > array.bsearch {|x| x >= 7} #=> 8
=> 8
2.1.0dev :012 > array.bsearch {|x| x >= 9} #=> 16
=> 16
2.1.0dev :013 > array.bsearch {|x| x >= 0} #=> 2
=> 32
2.1.0dev :014 > array.bsearch {|x| x >= 33} #=> nil
=> nil
ssh [email protected] 'echo hello'
不错,不过那个 bsearch 没看懂,似乎比 select 方便些,但是感觉没有特别大的价值
毕业以后来杭州吧,今年我还有一个实习生的名额
#9 楼 @terrywang 这才是靠谱的回答啊
#4 楼 @goinaction k,这种说法让人情何以堪
#5 楼 @shlallen gem 有自己的 load 机制,google 一下吧
$ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.25
- RUBY VERSION: 2.1.0 (2013-02-26 patchlevel -1) [x86_64-linux]
- INSTALLATION DIRECTORY: /home/john/.rvm/gems/ruby-head
- RUBY EXECUTABLE: /home/john/.rvm/rubies/ruby-head/bin/ruby
- EXECUTABLE DIRECTORY: /home/john/.rvm/gems/ruby-head/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/john/.rvm/gems/ruby-head
- /home/john/.rvm/gems/ruby-head@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- :sources => ["http://ruby.taobao.org/"]
- REMOTE SOURCES:
- http://ruby.taobao.org/
# /home/john/.rvm/rubies/ruby-head/bin/gem
...
ENV['GEM_PATH']=ENV['GEM_PATH'] || '/home/john/.rvm/gems/ruby-head:/home/john/.rvm/gems/ruby-head@global'
...
这类问题有个辅助的办法,想办法输出一下 load path:
$ irb
head :001 > puts $LOAD_PATH
/home/john/.rvm/rubies/ruby-head/lib/ruby/site_ruby/2.1.0
/home/john/.rvm/rubies/ruby-head/lib/ruby/site_ruby/2.1.0/x86_64-linux
/home/john/.rvm/rubies/ruby-head/lib/ruby/site_ruby
/home/john/.rvm/rubies/ruby-head/lib/ruby/vendor_ruby/2.1.0
/home/john/.rvm/rubies/ruby-head/lib/ruby/vendor_ruby/2.1.0/x86_64-linux
/home/john/.rvm/rubies/ruby-head/lib/ruby/vendor_ruby
/home/john/.rvm/rubies/ruby-head/lib/ruby/2.1.0
/home/john/.rvm/rubies/ruby-head/lib/ruby/2.1.0/x86_64-linux
现在的项目里面 index.md 文件被我做成 demo 了
#8 楼 @ericguo 是的,确实有些麻烦,所以现在还没有 slide 之间跳转的能力
最近写年终述职,根据自己的需要添加了一些功能——
`!comment`
会变为
<code class="comment">comment</code>
支持演示者视图。Markslide 可以生成打开两个窗口进行联动,其中一个作为“演示者视图”。
使用时,首先在浏览器中打开 index.html。 在键盘上输入字母'q',浏览器将打开辅助显示页面(新窗口打开时可能被浏览器拦截) 辅助页面是 all.html,其中包括了所有的 comments,用户可以将两个窗口放在两个显示屏上 操作辅助页面将同时让主页面联动,反之则不会
应该找点前端同学来参加啊
参加
我到想知道在 android 开发上有没有人做过类似的事情
thinking in java 是个大而全的书,循序渐进同时又有一定深度,我个人感觉《Ruby Programming Language》与之相当,《Programming ruby》某些地方重在 what 而不是 why,所以有些近似度差一些。
Effective Java 是我看过最好的 java 书(没有之一),ruby 社区没有对应的书籍,可能是因为没有人有 joshua 那样的经历吧(ruby 的 sdk 以 matz 为主,语言的设计和最佳编写实践来自同样的思想,java 则比较复杂)。BTW: 有人觉得元编程类似,可能是因为在 ruby 的元编程领域有很多使用者的创造,最后就积累了一些 best pratice,写出来的书就类似 effective java。
另外提一下《松本行弘的程序世界》,这本书偏重讲 why,个人认为 java 类书籍缺少专门讨论这方面的书,当年学语言就是少问了很多 why,所以被人带着跑了很久......
/home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/resolv.rb:1176:in `create': cannot interpret as DNS name: nil (ArgumentError)
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/resolv.rb:1022:in `generate_candidates'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/resolv.rb:1047:in `resolv'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/resolv.rb:513:in `each_resource'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/resolv.rb:406:in `each_address'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/resolv.rb:115:in `block in each_address'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/resolv.rb:114:in `each'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/resolv.rb:114:in `each_address'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/resolv.rb:92:in `getaddress'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/resolv.rb:43:in `getaddress'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/resolv-replace.rb:10:in `getaddress'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/resolv-replace.rb:22:in `initialize'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:877:in `open'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:877:in `block in connect'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/timeout.rb:65:in `timeout'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:876:in `connect'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:861:in `do_start'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:850:in `start'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:1366:in `request'
from /home/john/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:1125:in `get'
from /home/john/.rvm/gems/ruby-2.0.0-p0/gems/faraday-0.8.4/lib/faraday/adapter/net_http.rb:72:in `perform_request'