#28 楼 @aptx4869 查了下 wiki: http://zh.wikipedia.org/w/index.php?title=%E5%AE%98%E6%96%B9&redirect=no 貌似不能吃的样子 但是可以潜规则啊
#15 楼 @williamherry 我只是挑缺陷说而已 如果真是一无是处我不会用这么多年并且从此背离 IDE 的
#10 楼 @edgar_wang_cn VimScript 的发明就是个错误 想写个插件还得先学习语言 毫无意义啊
解决所有大大小小问题,让 Vim 更加健壮
这种需求根本没有希望的好不好
Vim 其实问题多了去了 关键是生态环境已经严重落后了 每次上传插件都是在一个网站上以 zip 的方式发布 用户不知道开发进度 不知道什么时候发布了新版本 还缺乏交互
对比下rake secret
前后的结果就知道了嘛
rake secret
前:
# Be sure to restart your server when you modify this file.
# Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
Rabel::Application.config.secret_token = ENV['SECRET_TOKEN']
rake secret
后:
# Be sure to restart your server when you modify this file.
# Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
Rabel::Application.config.secret_token = 'a983e6bd6bf8887301c27220b46ec936bf9ef85de195da7f535a8a5d937f4cdb840dcd69e6b54a8cf894a117bbc3de5ba45b806bbaba5d022e611c789d3ffeca'
checkout 这个项目下来的时候 secret_token 实质上是环境变量中的 Secret Token,但是你当时肯定没有设置过,长度为 0,< 30,所以报错了。rake secret
后重新替你生成了这个文件,自然就符合要求了。
哪个项目?给出地址看看?
#2 楼 @small_fish__ 那这个难度太高了。。。
在外企工作的好处就是 所有书面的东西都是英文 英语就算再差的也会写点了
人工抓拍还是机器抓拍的?
JRuby?
Google 那三篇论文?
确实很少收集诶。。大多只是体会感觉。。。
IE 10 的偷窥功能也很好玩
我也是人人网用户啊 大学一开始就开始用了 上面都是同学
#1 楼 @sevk 在看看 ActiveRecord::Base 的模块
include ActiveRecord::Persistence
extend ActiveModel::Naming
extend QueryCache::ClassMethods
extend ActiveSupport::Benchmarkable
extend ActiveSupport::DescendantsTracker
extend Querying
include ReadonlyAttributes
include ModelSchema
extend Translation
include Inheritance
include Scoping
extend DynamicMatchers
include Sanitization
include AttributeAssignment
include ActiveModel::Conversion
include Integration
include Validations
extend CounterCache
include Locking::Optimistic, Locking::Pessimistic
include AttributeMethods
include Callbacks, ActiveModel::Observing, Timestamp
include Associations
include IdentityMap
include ActiveModel::SecurePassword
extend Explain
# AutosaveAssociation needs to be included before Transactions, because we want
# #save_with_autosave_associations to be wrapped inside a transaction.
include AutosaveAssociation, NestedAttributes
include Aggregations, Transactions, Reflection, Serialization, Store
都是在 include 或者 extend,你怎么能说 include 很少用到呢?
#1 楼 @sevk 这个问题是个很理论很元编程的问题。。而且 include 这个关键字用得非常厉害
module ActionController
class Base < Metal
abstract!
def self.without_modules(*modules)
modules = modules.map do |m|
m.is_a?(Symbol) ? ActionController.const_get(m) : m
end
MODULES - modules
end
MODULES = [
AbstractController::Layouts,
AbstractController::Translation,
AbstractController::AssetPaths,
Helpers,
HideActions,
UrlFor,
Redirecting,
Rendering,
Renderers::All,
ConditionalGet,
RackDelegation,
Caching,
MimeResponds,
ImplicitRender,
Cookies,
Flash,
RequestForgeryProtection,
ForceSSL,
Streaming,
DataStreaming,
RecordIdentifier,
HttpAuthentication::Basic::ControllerMethods,
HttpAuthentication::Digest::ControllerMethods,
HttpAuthentication::Token::ControllerMethods,
# Before callbacks should also be executed the earliest as possible, so
# also include them at the bottom.
AbstractController::Callbacks,
# Append rescue at the bottom to wrap as much as possible.
Rescue,
# Add instrumentations hooks at the bottom, to ensure they instrument
# all the methods properly.
Instrumentation,
# Params wrapper should come before instrumentation so they are
# properly showed in logs
ParamsWrapper
]
MODULES.each do |mod|
include mod
end
# Rails 2.x compatibility
include ActionController::Compatibility
ActiveSupport.run_load_hooks(:action_controller, self)
end
end
看看 ActionController::Base 的代码,几乎都是在 include 各种模块,本身根本没有写什么东西。。
Ruby 的 autoload 特性在这种情况下最实用了。
先拿下等马打对方的上等马 先输了 然后再拿上等马打对方中等马 结果 还是输了
在大项目(时间长 代码量大 人员变动非常厉害)的项目下这种方法是否可能增加很多额外的工作量?它迫使程序员在不熟悉项目的情况下 1. 要做出契约 2. 要修改之前别人做的契约 否则难以做出变动。