问题列表 - 第42935页

用Spring Annotation替换<constructor-arg>

有一种方法可以用Annotation替换constructor-arg吗?

我有这个构造函数:

public GenericDAOImpl(Class<T> type) {
    this.type = type;
}
Run Code Online (Sandbox Code Playgroud)

我需要在我的Facade中注入:

@Inject
private GenericDAO<Auto, Long> autoDao;
Run Code Online (Sandbox Code Playgroud)

问题是我不知道如何在costructor中传递参数的值.

先感谢您

[更多信息]我试着解释我的问题.

<bean id="personDao" class="genericdao.impl.GenericDaoHibernateImpl">
        <constructor-arg>
            <value>genericdaotest.domain.Person</value>
        </constructor-arg>
</bean>
Run Code Online (Sandbox Code Playgroud)

我想只使用注释转换该代码.有人可以解释一下吗?

java generics spring annotations code-injection

8
推荐指数
1
解决办法
1万
查看次数

在android中控制视频的播放速度

我正在使用VideoView播放保存在res/raw中的视频文件.我无法找到一种方法来控制视频的播放速度.基本上我想在移动滚动条时减少和增加播放.有没有可以解决这个问题?

video android android-videoview

6
推荐指数
2
解决办法
5806
查看次数

从Eclipse推送到github存储库的问题:验证失败

我按照Egit用户指南中的步骤进行操作,但是收到auth失败的错误消息.

我的所作所为:
我已Window > Preferences > Network Connections > SSH2 > Key Management在帐户设置下将公钥复制到GitHub

然后我做
Team > Push...
我进入git@github.com:....uri然后点击下一步.但后来我得到了错误:

**Cannot get remote repository refs  
Reason: git@github.com:....  : Auth fail**
Run Code Online (Sandbox Code Playgroud)

可能是什么问题呢?

谢谢

eclipse git github

9
推荐指数
2
解决办法
4万
查看次数

Scala的类型系统中的错误?

以下scala代码似乎有效:

class A[X]
class C[M[X] <: A[X]]

class Main

new C[A]
Run Code Online (Sandbox Code Playgroud)

我希望编译器在类型A上执行类型推断,但是在我尝试以下操作之后:

new C[A[Int]]
Run Code Online (Sandbox Code Playgroud)

我收到以下错误消息:

(fragment of Main.scala):11: error: this.A[Int] takes no type parameters, expected: one
println( new C[A[Int]] )
Run Code Online (Sandbox Code Playgroud)

scala

5
推荐指数
3
解决办法
1200
查看次数

在save()之后在我的XML文件的开头获得""

我用C#打开一个现有的XML文件,然后我替换那里的一些节点.一切正常.在我保存之后,我在文件的开头得到以下字符:

  (EF BB BF in HEX)
Run Code Online (Sandbox Code Playgroud)

整个第一行:

 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
Run Code Online (Sandbox Code Playgroud)

该文件的其余部分看起来像普通的XML文件.简化的代码在这里:

XmlDocument doc = new XmlDocument();
doc.Load(xmlSourceFile);
XmlNode translation = doc.SelectSingleNode("//trans-unit[@id='127']");
translation.InnerText = "testing";
doc.Save(xmlTranslatedFile);
Run Code Online (Sandbox Code Playgroud)

我正在使用.NET 4.0 的C#Windows窗体应用程序.

有任何想法吗?为什么会这样做?我们可以以某种方式禁用它吗?它适用于Adobe InCopy,它不会像这样打开它.

更新:替代解决方案:

使用XmlTextWriter保存它也可以:

XmlTextWriter writer = new XmlTextWriter(inCopyFilename, null);
doc.Save(writer);
Run Code Online (Sandbox Code Playgroud)

.net c# xml .net-4.0 winforms

31
推荐指数
2
解决办法
3万
查看次数

"寻呼机"一词在SQL Server代理上下文中的含义是什么?

我想知道pagerSQL Server代理上下文的含义.有人可以解释一下吗?

谢谢

sql-server sql-server-agent

1
推荐指数
1
解决办法
1660
查看次数

使用Google Analytics Export API获取网站趋势

我正在开发一个使用Google Analytics Export API的应用程序,我正在尝试获取Google针对您的每个网站帐户显示的"趋势"结果百分比

即上涨35.04%或下跌16.02%

他们如何/在哪里获得这个数字,并且它可以在某个地方的API中使用.

我曾尝试将上个月的平均值与本月/本周的第一周与上周的平均值进行比较等,但我似乎无法获得与Google相同的数字.

有任何想法吗?

先谢谢道格

google-analytics google-analytics-api

4
推荐指数
1
解决办法
913
查看次数

如何使用XPath和DOM替换php中的节点/元素?

说我有以下HTML

$html = '
<div class="website">
    <div>
        <div id="old_div">
            <p>some text</p>
            <p>some text</p>
            <p>some text</p>
            <p>some text</p>
            <div class="a class">
                <p>some text</p>
                <p>some text</p>
            </div>
        </div>
        <div id="another_div"></div>
    </div>
</div>
';
Run Code Online (Sandbox Code Playgroud)

我想#old_div用以下内容替换:

$replacement = '<div id="new_div">this is new</div>';
Run Code Online (Sandbox Code Playgroud)

给出最终结果:

$html = '
<div class="website">
        <div>
            <div id="new_div">this is new</div>
            <div id="another_div"></div>
        </div>
    </div>
';
Run Code Online (Sandbox Code Playgroud)

使用PHP执行此操作是否有简单的剪切和粘贴功能?


最后的工作代码归功于戈登的所有帮助:

<?php

$html = <<< HTML
<div class="website">
    <div>
        <div id="old_div">
            <p>some text</p>
            <p>some text</p>
            <p>some text</p>
            <p>some text</p>
            <div class="a class">
                <p>some …
Run Code Online (Sandbox Code Playgroud)

php xpath dom

9
推荐指数
1
解决办法
1万
查看次数

Android上的C++命令行应用程序?

是否可以为linux创建一个命令行应用程序,然后在带有shell的android上运行它?由于android在linux上运行,我不明白为什么运行它会有任何问题.我知道/ system/bin/*包含了你可以在adb中使用的所有东西,所以这应该是相同的.

c++ shell command-line android

8
推荐指数
1
解决办法
2015
查看次数

F#懒惰像素读数

我想将图像像素延迟加载到3维整数数组.例如,它看起来像这样:

   for i=0 to Width 
     for j=0 to Height
       let point=image.GetPixel(i,j)
       pixels.[0,i,j] <- point.R
       pixels.[1,i,j] <- point.G
       pixels.[2,i,j] <- point.B
Run Code Online (Sandbox Code Playgroud)

如何以懒惰的方式制作?

f# pixel lazy-evaluation

0
推荐指数
1
解决办法
720
查看次数