我从自制软件在 Mac OS 上安装了 Scala(版本 2.12.8)和 Spark(2.4.3)。我的机器上已经安装了 Java 1.8。
当我启动 spark-shell 时,我看到徽标说:
Spark 版本 2.4.3,使用 Scala 版本 2.11.12(Java HotSpot(TM) 64 位服务器 VM,Java 1.8.0_144)
为什么我的机器上安装的是 Scala 版本 2.11.12 而不是 Scala(版本 2.12.8)?
Spark 2.4.3 是否与 Scala 2.11.12 一起提供?
谢谢。
我想将hibernate与spring集成.spring 3文档说你可以通过org.hiberate.SessionFactory的getCurrentSession()访问会话,这应该优先于hibernateDaoSupport方法.
但是我想知道如果我们使用AnnotationSessionFactoryBean,我们怎么能首先得到org.hiberate.SessionFactory的实例呢?我在applicationContext.xml中完成了以下bean声明:
<bean id="annotationSessionFactoryBean" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="packagesToScan" value="com.mydomain"/>
<property name="hibernateProperties">
<props>
<prop key="hibernate.connection.pool_size">10</prop>
<prop key="hibernate.connection.show_sql">true</prop>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
</props>
</property>
</bean>
Run Code Online (Sandbox Code Playgroud)
正在使用会话的DAO:
<bean id="hibernateUserProfileDAO" class="com.springheatmvn.Dao.impl.hibernate.HibernateUserProfileDAO">
<property name="annotationSessionFactoryBean" ref="annotationSessionFactoryBean"/>
</bean>
Run Code Online (Sandbox Code Playgroud)
在我的hibernateUserProfileDAO中,我想得到像这样的当前会话
public class HibernateUserProfileDAO implements UserProfileDAO {
private AnnotationSessionFactoryBean annotationSessionFactoryBean;
public UserProfile getUserProfile() {
Session session = annotationSessionFactoryBean.getCurrentSession();
....
}
Run Code Online (Sandbox Code Playgroud)
但我发现AnnotationFactoryBean中没有公共的getCurrentSession()方法.我发现只有受保护的getAnnotationSession()方法,但它也在Abstract会话工厂类中.
任何人都可以告诉我哪里出错了?
我创建了一个.gitignore来忽略一个名为tola.txt的未跟踪文件,现在当我执行git status时,现在tola.txt已经消失了但.gitignore正在进行未跟踪的文件.我有temp在.gitignore文件中移动了一个条目.gitignore,但这只是一个黑客我相信,我怎么能摆脱这个.gitignore混乱?
root>$ git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# tola.txt
root>$ vim .gitignore
Run Code Online (Sandbox Code Playgroud)
在.gitignore中添加了tola.txt,但现在.gitignore已经成为未受到攻击的人
root>$ git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .gitignore
Run Code Online (Sandbox Code Playgroud) 我是 TS 新手,正在尝试使用它。在我的节点应用程序中,我做了一个控制台登录temp.ts文件
console.log("test");
Run Code Online (Sandbox Code Playgroud)
IntelliJ 给我以下错误:
TS1123: Variable declaration list cannot be empty
Run Code Online (Sandbox Code Playgroud)
但是,当我用节点运行它时,我得到了
>node temp.ts
test1
Run Code Online (Sandbox Code Playgroud)
知道 TS 出了什么问题吗?
更新:只有 IntelliJ 才会发生这种情况。
是否Collections.syncronizedList(new ArrayList())能有效地使ArrayList的载体?如果没有那么它还有什么额外的作用?如果是,那么为什么它首先被引入?
谢谢.
书和作者之间有很多对应的映射
@Enity
public class Book{
private Long id;
private String name;
...
@Id
@Column(name="book_id")
public getId(){
...
}
@ManyToMany(
@JoinTable(name="book_author",
joinColumns = @JoinColumn(name="book_id"),
inverseJoinColumns = @JoinColumn(name="????")
)
public List<Author> getAuthors(){
...
}
}
@Enity
public class Author{
@EmbeddedId;
private AuthorPk authorPk;
...
}
Run Code Online (Sandbox Code Playgroud)
我如何在inverseJoinColumn上进行多对多映射,因为它是一个复合键?
可能重复:
setInterval()仅运行一次函数
我正在使用以下脚本来理解函数上下文的概念.我除了提醒从20开始并重复.但是在显示20之后它就相当了.当使用调用方法并提供o2时,它应该得到值20并从那里重复.
<script type="text/javascript">
var o2 = {
local: 20
}
var local=0;
function someFuncObject(){
alert('Thats method object again ' + this.local++);
}
// window.setInterval(someFuncObject, 2000); //This works perfect!!!
window.setInterval(someFuncObject.call(o2), 2000); // This does not, why?
</script>
Run Code Online (Sandbox Code Playgroud)
另一方面,如果我使用window.setInterval(someFuncObject, 2000);它工作正常并一次又一次地重复.有什么问题?
我有一个函数调用它返回ref对象文字nameObj.我想访问返回的对象中的方法,但我收到js错误.为什么对象setNameObj上没有方法nameObj?
var nameObj=function(){
var _locname;
return {
item:'item1',
getNameObj: function(){
return _locname
},
setNameObj: function(nm){
_locname = nm
}
}
}
console.log(nameObj.setNameObj('tempValue'));
console.log(nameObj.getNameObj());
Run Code Online (Sandbox Code Playgroud) 我是Scala的新手,并试图了解隐含的魔法.我想知道为什么我越来越2mysize与+功能和2 *为长度*的功能?
implicit def addToStr(str: String) = str.size
scala> 2 * "mysize"
res4: Int = 12
scala> 2 + "mysize"
res3: String = 2mysize
Run Code Online (Sandbox Code Playgroud) hibernate ×2
javascript ×2
apache-spark ×1
collections ×1
concurrency ×1
git ×1
java ×1
node.js ×1
scala ×1
spring ×1
spring-mvc ×1
typescript ×1