我有一个项目,我在两个地方使用(我不使用git服务器).
当我在第二个地方复制项目时,我必须签入所有文件(但它们没有改变),git给我看了例子
@@ -1,8 +1,8 @@
-#Sat Mar 06 19:39:27 CET 2010
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
+#Sat Mar 06 19:39:27 CET 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Run Code Online (Sandbox Code Playgroud)
我在两个地方做了命令,
git config --global core.autocrlf false
但它没有帮助解决这个问题
自动装配时我有一种奇怪的行为
我有类似这样的代码,它的工作原理
@Controller
public class Class1 {
@Autowired
private Class2 object2;
...
}
@Service
@Transactional
public class Class2{
...
}
Run Code Online (Sandbox Code Playgroud)
问题是我需要Class2实现一个接口,所以我只改变了Class2,所以它现在就像:
@Controller
public class Class1 {
@Autowired
private Class2 object2;
...
}
@Service
@Transactional
public class Class2 implements IServiceReference<Class3, Long>{
...
}
public interface IServiceReference<T, PK extends Serializable> {
public T reference(PK id);
}
Run Code Online (Sandbox Code Playgroud)
用这个代码我得到了一个org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type for Class2.似乎@Transitional注释与接口不兼容,因为如果我删除@Transitional注释或者mplements IServiceReference<Class3, Long>问题消失了并且注入了bean(尽管我需要在这个类中都有).如果我将注释@Transitional放在方法而不是类中,也会发生这种情况.
如果这有帮助,我使用Spring 3.0.2.
与事务方法的接口不兼容?可能是一个Spring bug?
在提交表单时,是否有人知道一个好的Jquery解决方案来检查咒骂单词?
基本上我有一个提交到Twitter的表单,成功通过一个发誓的单词检查它将通过ajax提交.我知道如何在PHP中实现它(对于非启用javascript的用户),我通过一系列预定义的坏词进行了foreach循环,并根据提交的内容检查它们.
我如何用Jquery做类似的事情?
谢谢
我正在使用Paperclip,这是我在模型中删除附件的内容:
def before_save
self.avatar = nil if @delete_avatar == 1.to_s
end
Run Code Online (Sandbox Code Playgroud)
除非@delete_avatar在用户实际上传图像时设置了标志(因此模型同时接收params[:user][:avatar]和params[:user][:delete_avatar].),否则工作正常.这会导致以下错误:
TypeError: can't convert nil into String
from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/storage.rb:40:in `dirname'
from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/storage.rb:40:in `flush_writes'
from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/storage.rb:38:in `each'
from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/storage.rb:38:in `flush_writes'
from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/attachment.rb:144:in `save'
from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/attachment.rb:162:in `destroy'
from /Work/project/src/app/models/user.rb:72:in `before_save'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:347:in `send'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:347:in `callback'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:249:in `create_or_update'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2538:in `save_without_validation'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/validations.rb:1078:in `save_without_dirty'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/dirty.rb:79:in `save_without_transactions'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:229:in `send'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:229:in `with_transaction_returning_status'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:182:in `transaction'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:228:in `with_transaction_returning_status'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:196:in …Run Code Online (Sandbox Code Playgroud) rePython中的一个特别怪异的(非常强大的)模块是re.split() 永远不会在零长度匹配上拆分字符串,例如,如果我想沿着字边界分割字符串:
>>> re.split(r"\s+|\b", "Split along words, preserve punctuation!")
['Split', 'along', 'words,', 'preserve', 'punctuation!']
Run Code Online (Sandbox Code Playgroud)
代替
['', 'Split', 'along', 'words', ',', 'preserve', 'punctuation', '!']
Run Code Online (Sandbox Code Playgroud)
为什么会有这个限制?它是按设计的吗?其他正则表达式的味道是这样的吗?
说,我有3个面板添加到一个框架和第一个面板我想设置金属外观和感觉,对于第二个面板我想要窗户的外观和感觉,对于第三个面板它应该是默认的摇摆风格.
可能吗?
我有以下SQL查询:
select c.id
from (select id from customers) c
Run Code Online (Sandbox Code Playgroud)
这个查询没有实际价值 - 我为了这篇文章的目的大大简化了它.
我的问题:是否有可能在使用HQL的from子句中有子查询.如果没有,我可以先查询客户,有点像sql中的临时表,然后使用结果作为下一个查询的来源?
谢谢
你能建议一些有用的例子吗?我尝试了Authlogic和Devise的成功.
Asp.net MVC 1和Asp.net MVC 2有什么区别?