#95 楼 @crazyitman http://book.douban.com/subject/2334288/ 通俗易懂 作者的大话系列都非常赞
其实我让新手看设计模式只是让让他们在写代码之前会考虑怎么组织自己的思想,我刚学的时候我就挺纠结这个问题,问身边的人也没有给出满意的答案。当时的第一感觉就是要把方法写短。在之后的学习中,才意味到什么叫面向对象,把代码中的结构分离,在之后遇到了设计模式,使得对需求的改动对原有的代码不会造成任何影响。其实这对我来说最大的好处是更方便别人维护。我不喜欢我写的代码,别人看到之后有种想辞职的冲动。
@lgn21st 此贴建议加精,理由如下:
#51 楼 @RainFlying #52 楼 @search
让时间去验证把
我 09 年接触 Ruby
的,跟你一样什么都不懂就开始玩儿 ruby,虽然到现在技术也不咋地,但是还是可以分享点经验的,
Ruby
( Programming Ruby
绝对是一本 翻不完 的书,有些只是带过的一句话都是发人深省). 我也是经常遇各种坑,没基础不可怕,可怕的是别人在玩,你玩比别人更嗨皮。
class UtilObserver < ActiveRecord::Observer
observe :model1, :model2
def before_save(record)
record.slug = record.slug_format
end
end
module Model1
def slug_format
self.title.gsub(' ', '-').downcase
end
end
module Model2
def slug_format
self.name.gsub(' ', '-').downcase
end
end
建议: 感觉区域级联的应该交给 js 来处理,如果一定要用 rails 的话可以只给个 task 任务导出当前的省市区固定的 json 格式的文件
比如:https://code.google.com/p/tex-website/source/browse/trunk/Web/Js/LinkageSelect.js?spec=svn6&r=6
现在发现以前在学校很容易找个妹纸谈恋爱是因为都太天真了,现在发现很不容易找个妹纸谈恋爱是因为都太现实了。
交给格式化把。
class Bob
def hey(words)
@parser = WordsParser.new
if @parser.silent?(words) then "Fine. Be that way!"
elsif @parser.shout?(words) then "Woah, chill out!"
elsif @parser.question?(words) then "Sure."
else "Whatever."
end
end
end
Array.wrap(params['foo']).include?('bar')
module Foo
attr_accessor :foo
def foo
@foo ||= 'zzz'
end
end
class Bar
include Foo
end
+1
我觉得电话通知要好点,起码能告诉面试者哪方面不行,希望以后加强技术之后还能再来面试之类的。
人也太多了把
osascript -e 'tell application "Messages" to send "Hello world." to text chat "email | username"'
t[/(\d|:)+\b/] = $&.gsub(':','-')
删掉账号貌似可以把
早知道转移域名这么麻烦就不在那续费了
Our support staff has responded to your request, details of which are described below:
Discussion Notes Support Staff Response Dear Sir Or Madam,
Thank you for your response. We do not charge to transfer a domain name from us to another Registrar. You should contact the company that will receive the domain(s) to start the process and find out what they may require from you. Please note that if you have recently registered your domain or made a change to the registrant contact information, you will not be able to transfer the domain away for a period of 60 days from the registration date or most recent contact change.
To make a domain name available to transfer away from us, you will need to unlock the domain, obtain the domain name authorization code, and remove private registration (if you have selected this option).
To 'lock' or 'unlock' your domain name, follow the directions below:
First, log into your account:
If you have trouble logging in, our Account Retrieval System may help you. You can use this to retrieve your customer number and/or reset your customer account password. You can find this system by selecting 'Click Here' next to 'Forgot Your Password?' on the 'My Account' login page.
Once logged in, follow these steps:
After making changes to the domain’s settings, some features of your domain management will be disabled briefly while the updates are being processed. While you can make changes to nameservers, etc. within a few minutes of unlocking a domain, 48 hours may be required if you are unlocking the domain to transfer to another registrar.
To obtain the Authorization Code for your domain, please follow these directions:
If you do not have private registration enabled on the domain name, this is all that will will need to be done on our side to allow the domain name to be transferred.
If you have privacy enabled on your domain name through Domains by proxy you will need to remove this before the domain name can be transferred away.
The private registration for your domain is managed through Domains By Proxy, while the domain registration is managed by us.
You will need to log into your account with Domains By Proxy in order to cancel the privacy service. We have received the following instructions from Domains By Proxy for canceling private registration service for a domain:
-If you do not remember your Domains by Proxy login information, click on the 'Forgot your password?' link to retrieve your customer number and reset your password
You will then receive an email regarding the cancellation. The domain will no longer appear in your Domains by Proxy account, and the cancellation will not affect any other services on the domain such as DNS or email. Please remember that cancellation of the private registration is not refundable.
If you have any other questions regarding the cancellation of your private registration, please contact the Domains By Proxy support staff using the following URL:
http://domainsbyproxy.com/Support.aspx
Please let us know if we can assist you in any other way.
Regards, Bob C. Online Support Team
已经解决好了。我使用的是软连接,忽视了配置文件中的注释的后果。
原来是没毒