websocket+ 轮询 (不支持 websocket 的浏览器)
如果没有行业限制,前期用 ruby,后期改 java
五年!!! 好久
看完了,但没笑
DNS 也非常蹦
Now, 你得用 github 或者代码说话。
PS: 这是我司的招聘文案,有兴趣请发简历到
[email protected]
.
#1 楼 @317583395 一只用 tower,觉得它的编辑器并不好用 ,ueditor
虽然代码写得很烂,但还是比较符合国情的,但现在也不更新了。打算用ckeditor
或者tinymce
上算法的时间复杂度一样,有更优解吗?
erlang
nodejs
呢?
ruby
和 python
哪个更好招人?
curl -X PUT -d "user[name]=yang" "http://localhost" | python -m json.tool
老老实实curl
先,不过curl
常用的就那么几个,十分钟足够了吧。
#3 楼 @rubyist518 aha. thanks
全局 + 1
# redis.rb
# redis conig
REDIS_CONFIG = YAML.load(File.open(Rails.root.join('config/redis.yml'))).symbolize_keys
default_config = REDIS_CONFIG[:default].symbolize_keys
redis_config = default_config.merge(REDIS_CONFIG[Rails.env.to_sym].symbolize_keys) if REDIS_CONFIG[Rails.env.to_sym]
$redis = Redis.new(redis_config)
# @see https://github.com/resque/redis-namespace
$namespaced_redis = Redis::Namespace.new(redis_config[:namespace], redis: $redis) if redis_config[:namespace]
# redis -> object
# @see https://github.com/nateware/redis-objects
# require 'connection_pool'
# Redis::Objects.redis = ConnectionPool.new(size: 5, timeout: 5) { $redis }
# To clear out the db before each test and development
begin
$redis.flushdb if Rails.env == 'test'
$redis.flushdb if Rails.env == 'development'
rescue Exception => e
p '-' * 20
p "Error trying with $redis.flushdb: #{e.message}"
p 'You may need to start the redis-server with `sudo service redis-server start`'
p 'If the redis-server is not installed, please `sudo apt-get install redis-server`.'
p 'You are not using linux? See you.'
p '-' * 20
rails_pid = Process.pid # thanks @rubyist518
cmd = "kill -SIGINT #{rails_pid}"
`#{cmd}`
end
# config/redis.yml
default:
host: localhost
port: 6379
driver: hiredis
development:
db: 0
namespace: app_development
test:
db: 1
namespace: app_test
production:
db: 2
host: 127.0.0.1
namespace: app_production
简单条件find_by
(finds the first record matching some conditions),无order
时等价于where().first
,比较简单;复杂的where().take
(retrieves a record without any implicit ordering) or where().first
(finds the first record ordered by the primary key) or where().last
(finds the last record ordered by the primary key).
具体参考 rails guides
更喜erlang
params[:excel].tempfile
这个才是拿文件
那得看你的协议,通常加长度是为了协议数据的完整性。TCP 不能保证。
joins
or includes
不谢
arr.sort { |a, b| a.better_v <=> b.better_v }.reverse
arr.sort { |a, b| b.better_v <=> a.better_v }
大爱 redis ttl
书单里面,买买买