这是我的hibernate配置,但由于某种原因,它无法加载我添加到的那些属性,<property name="hibernateProperties">并且log在启动时说INFO org.hibernate.cfg.Environment - hibernate.properties not found.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
<bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="org.hibernate.dialect.PostgreSQLDialect" />
<property name="url" value="jdbc:postgresql://localhost:5432/testdatabase" />
<property name="username" value="postgres" />
<property name="password" value="password" />
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="myDataSource" />
<property name="packagesToScan" value="org.test"/>
<property name="hibernateProperties">
<value>
hbm2ddl.auto=create
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
hibernate.show_sql=true
</value>
</property>
</bean>
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
</beans>
Run Code Online (Sandbox Code Playgroud)
编辑:完整日志:
2010-08-29 15:27:15,986 [main] INFO org.hibernate.cfg.annotations.Version - …Run Code Online (Sandbox Code Playgroud) 嗨,按照早先的帖子.
鉴于以下列表:
['Jellicle','猫','是','黑','和','白色','Jellicle','猫','是','宁可','小;','Jellicle' ,'猫','是','快乐','和','明亮','和','愉快','到','听','什么时候','他们','caterwaul'. ,'Jellicle','猫','有','开朗','面孔','Jellicle','猫','有','明亮','黑','眼睛;','他们' ,'喜欢','到','练习','他们','空气','和','增添','和','等','为',''','Jellicle','月亮','到','上升.','']
我试图计算每个出现在资本中的单词出现多少次并显示前三个单词.
我对那些不以资本开头的话语感兴趣.
如果一个单词出现多次,有时以资本开头而有时不出现,只计算它与资本的次数.
这就是我的代码目前的样子:
words = ""
for word in open('novel.txt', 'rU'):
words += word
words = words.split(' ')
words= list(words)
words = ('\n'.join(words)).split('\n')
word_counter = {}
for word in words:
if word in word_counter:
word_counter[word] += 1
else:
word_counter[word] = 1
popular_words = sorted(word_counter, key = word_counter.get, reverse = True)
top_3 = popular_words[:3]
matches = []
for i in range(3):
print word_counter[top_3[i]], top_3[i]
Run Code Online (Sandbox Code Playgroud) 如果我发出这样的查询:
select c1, c2, c3
from table
group by c1;
Run Code Online (Sandbox Code Playgroud)
我得到了c1的明显结果,但我如何在组之前对它进行排序(例如c2降序)?
我使用ReinH.com中git rebase -i origin/master提到的在Git 中压缩了一些提交.
压缩一些提交后,有没有办法查看原始提交?是否有可能获得提交的"差异"?我可以获得SHA吗?
如果有可能,跑步后仍然可以git gc吗?
给了我我要使用的DLL。DLL包含功能“发送”。这是我所做的:
#include <stdio.h>
#include <Windows.h>
int main(int argc, char * argv[])
{
HMODULE libHandle;
if ((libHandle = LoadLibrary(TEXT("SendSMS.dll"))) == NULL)
{
printf("load failed\n");
return 1;
}
if (GetProcAddress(libHandle, "send") == NULL)
{
printf("GetProcAddress failed\n");
printf("%d\n", GetLastError());
return 1;
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
GetProcAddress返回NULL,最后一个错误值为127。(未找到过程)
我究竟做错了什么?
我对:visited伪类有一些疑问:
:visited应该将伪类应用于超链接?:visited伪类应该应用于超链接的时间长度?(注意:我不是要解决实际问题,我只是想知道它是如何工作的)
我和一些学生讨论了C编程风格,当我们谈论评论时,其中一个人注意到他没有在C代码中使用C++注释,因为它们是个坏主意.事实证明,这是基于个人经验的多行C++评论,但这不是我第一次听到这种说法.那么,被//认为是有害的,如果是的话,为什么呢?
什么mime类型应该作为WOFF字体?
我服务truetype(ttf)字体as font/truetype和opentype(otf)as font/opentype,但我找不到WOFF字体的正确格式.
我曾尝试font/woff,font/webopen和font/webopentype,但Chrome仍然会抱怨:
"资源被解释为字体,但使用MIME类型application/octet-stream进行传输."
有人知道吗?
宣告TestController与Spring Controller构造型之间的区别是这样的:
import org.springframework.stereotype.Controller;
//...
@Controller
@RequestMapping("/test")
public class TestController
Run Code Online (Sandbox Code Playgroud)
与作为AbstractController的子类,如下所示:
import org.springframework.web.servlet.mvc.AbstractController;
//...
public class TestController extends AbstractController
Run Code Online (Sandbox Code Playgroud) c ×2
spring ×2
agile ×1
browser ×1
coding-style ×1
comments ×1
css ×1
dll ×1
git ×1
hibernate ×1
java ×1
mysql ×1
pseudo-class ×1
python ×1
scrum ×1
spring-mvc ×1
sql ×1
stereotype ×1
user-stories ×1
windows ×1
woff ×1