在Eclipse的Package Explorer中,我想更改已修改的文件和包的字体颜色(由Git插件管理,这些文件前面有>
).
我去了首选项>常规>外观>颜色和字体,但我无法找到控制这种情况的选项(如果有的话).
或者,是否有任何黑暗的主题,在深色背景下不显示深色文字?
我正在尝试使用以下示例中显示的代码:
创建DiskFileItem时出现java.lang.NullPointerException
我的Test方法包含以下代码:
final File TEST_FILE = new File("C:/my_text.txt");
final DiskFileItem diskFileItem = new DiskFileItem("fileData", "text/plain", true, TEST_FILE.getName(), 100000000, TEST_FILE.getParentFile());
diskFileItem.getOutputStream();
System.out.println("diskFileItem.getString() = " + diskFileItem.getString());
Run Code Online (Sandbox Code Playgroud)
文本文件存在于此位置,但上述代码中的最后一行不输出文件内容.
知道为什么吗?
NB
以下是打印文件内容:
BufferedReader input = new BufferedReader(new FileReader(TEST_FILE));
String line = null;
while (( line = input.readLine()) != null){
System.out.println(line);
}
Run Code Online (Sandbox Code Playgroud) 我使用Spring 3.1 + Hibernate 4.
我创建了以下内容sessionFactory
:
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="myDataSource" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.hbm2ddl.auto">validate</prop>
</props>
</property>
<property name="packagesToScan" value="com.my.company"/>
</bean>
Run Code Online (Sandbox Code Playgroud)
如您所见,上面sessionFactory
是针对Hibernate 4的.
我试图HibernateTemplate
通过Java代码创建一个(org.springframework.orm.hibernate3.HibernateTemplate
),但我不知道如何做到这一点.sessionFactory
我试过以下代码:
@Resource(name="sessionFactory")
public void setSessionFactory(LocalSessionFactoryBean sessionFactory) {
this.hibernateTemplate = new HibernateTemplate(sessionFactory.getObject());
}
Run Code Online (Sandbox Code Playgroud)
但是我收到以下错误消息:
org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'sessionFactory' must be of type [org.springframework.orm.hibernate4.LocalSessionFactoryBean], but was actually of type [org.hibernate.internal.SessionFactoryImpl]
Run Code Online (Sandbox Code Playgroud)
你能说明怎么做吗?
我知道如何做到这一点的外部存储库,但不是我的本地库,因为我没有<repository>
在我的我的本地库settings.xml
.
我为我的子项目使用快照版本,所以当我重新构建父项目时,我希望maven从我的本地存储库获取所有子项目快照版本,不仅每天一次(这似乎是默认情况下发生的事情)但总是.
在FireFox 18上测试我的代码.
我正试图在一个主要的p:dataTable
桌子上找到圆角......
为此我正在使用jQuery插件Corner.
我在xhtml的末尾添加了以下脚本部分:
<script>
$(".ui-datatable table").corner();
</script>
Run Code Online (Sandbox Code Playgroud)
然而,桌角不会圆润.
该表的xhtml是:
<p:dataTable var="row" value="#{myBean.rows}">
<p:column headerText="">
<h:outputText value="#{row.name}" />
</p:column>
<p:column headerText="Address">
<h:outputText value="#{row.address}" />
</p:column>
<p:column headerText="10 mins">
<h:outputText value="#{row.gt10min}" />
</p:column>
<p:column headerText="20 mins">
<h:outputText value="#{row.gt20min}" />
</p:column>
<p:column headerText="30 mins">
<h:outputText value="#{row.gt30min}" />
</p:column>
</p:dataTable>
Run Code Online (Sandbox Code Playgroud)
jQuery链接到xhtml,因为当我尝试它时,效果应用于其他元素.
我在这里错过了什么?
是否有可能通过我正在使用的jQuery插件或其他jQuery插件实现这种效果?
哈斯克尔有多懒惰?
为什么以下不知道何时停止?
sum ([n^2 | n <- [1..], odd (n^2), n^2 < 100])
Run Code Online (Sandbox Code Playgroud) 的坎函子 Hom(-,-)
是在第二的第一个参数和协变逆变.
这个事实能否以某种方式提供另一种解释为什么Scala的Function1 [-T1,+ R]具有相同的属性?
我已经在这里看到了这种说法,但是在两个概念之间的联系应该被解释的时候,挥舞着它的那么多手把它吹走了.
方法参数String*
和Array[String]
?之间有区别吗?
安慰:
scala> def main(args: Array[String]): Unit = {}
main: (args: Array[String])Unit
scala> def main(args: String*): Unit = {}
main: (args: String*)Unit
Run Code Online (Sandbox Code Playgroud)
代码1:
object Example {
def main(args: Array[String]): Unit = {
println("Hello")
}
}
>> Hello
Run Code Online (Sandbox Code Playgroud)
代码2:
object Example {
def main(args: String*): Unit = {
println("Hello")
}
}
>> Exception in thread "main" java.lang.NoSuchMethodException: Example.main([Ljava.lang.String;)
at java.lang.Class.getMethod(Class.java:1786)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:126)
Run Code Online (Sandbox Code Playgroud) 为什么有可能发生变异scala.collection.immutable.SortedMap
和scala.collection.immutable.TreeMap
?
scala> import scala.collection.immutable.SortedMap
import scala.collection.immutable.SortedMap
scala> var sm = SortedMap(3 -> 'x', 1 -> 'x', 4 -> 'x')
sm: scala.collection.immutable.SortedMap[Int,Char] = Map(1 -> x, 3 -> x, 4 -> x)
scala> sm += (2 -> 'x')
scala> sm
res1: scala.collection.immutable.SortedMap[Int,Char] = Map(1 -> x, 2 -> x, 3 -> x, 4 -> x)
Run Code Online (Sandbox Code Playgroud)
另外,我没有看到
http://www.scala-lang.org/api/current/index.html#scala.collection.immutable.SortedMap
和
http://www.scala-lang.org/api/current/index.html#scala.collection.immutable.TreeMap
定义+=
,它是如何存在的?