问题列表 - 第18913页

Maven - 我可以在配置文件定义中引用配置文件ID吗?

我在a中设置了配置文件,pom.xml如下所示:

<profile>
<id><em>profileId1</em></id>
    <build>
        <filters>
            <filter>src/main/filters/<em>profileId1</em>.properties</filter>
        </filters>
// rest of the profile 
</profile>
<profile>
<id><em>profileId2</em></id>
    <build>
        <filters>
            <filter>src/main/filters/<em>profileId2</em>.properties</filter>
        </filters>
// rest of the profile
</profile>
Run Code Online (Sandbox Code Playgroud)

题:

有没有办法从所有配置文件中提取这个部分,这样就不需要为每个配置文件重复它(并可能拼错它)?

java maven-2 maven

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

什么是学习silverlight的最佳方法?

我想学习Silverlight.推荐哪些书籍或网站?

.net silverlight

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

NSZombieEnabled不起作用

当我设置NSZombieEnabled = Yes什么都没有写入控制台.我怎样才能解决这个问题?或者你能告诉我任何其他工具EXC_BAD_ACCESS吗?

iphone objective-c nszombie

15
推荐指数
4
解决办法
9637
查看次数

谷歌喜欢Delphi的编辑/组合控制?

每个人都可能知道我的意思,但澄清控制需要:

  • 用户编辑文本时触发事件.该事件将提供SuggestionList:TStrings,您可以填写匹配/建议.
  • 如果SuggestionList不为空,则应显示下拉列表.
  • 与组合不同,控件不应尝试自动选择/自动完成或以其他方式影响编辑.

那么,是否有这样的Delphi编辑/组合控件?

delphi combobox autocomplete

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

对象类是否也在任何类中出现?

我们知道在java中所有类都扩展了Object.但是Object本身是java中的一个类.这个类也可以自己或任何其他类扩展?

java

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

在C#中确定图像的颜色十六进制值

如果图像是单块颜色,是否可以在C#中确定图像的十六进制颜色值?

我有一堆彩色图表图像,需要将它们放入一个附有必要十六进制值的表中.不幸的是,文件名无法确定这一点.

问候

c# image image-processing

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

Thread.isInterrupted不起作用,Thread.interrupted确实有效

以下程序演示了该问题(最新的JVM和诸如此类):

public static void main(String[] args) throws InterruptedException {
    // if this is true, both interrupted and isInterrupted work
    final boolean withPrint = false;

    // decide whether to use isInterrupted or interrupted.
    // if this is true, the program never terminates.
    final boolean useIsInterrupted = true;

    ExecutorService executor = Executors.newSingleThreadExecutor();
    final CountDownLatch latch = new CountDownLatch(1);
    Callable<Void> callable = new Callable<Void>() {
        @Override
        public Void call() throws Exception {
            Random random = new Random();
            while (true) {
                if (withPrint) { …
Run Code Online (Sandbox Code Playgroud)

java multithreading interrupted-exception

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

如何"展开""递归"结构

不知道如何调用它,但是说你有一个类似下面的类:

class Person
{
    public string Name;
    public IEnumerable<Person> Friends;
}
Run Code Online (Sandbox Code Playgroud)

然后你有一个人,你想要递归地"展开"这个结构,所以你最终得到一个没有重复的所有人的列表.

你会怎么做?我已经做了一些似乎有用的东西,但我很想知道其他人会怎么做,特别是如果Linq内置了一些内容你可以巧妙地使用它来解决这个小问题:)


这是我的解决方案:

public static IEnumerable<T> SelectRecursive<T>(this IEnumerable<T> subjects, Func<T, IEnumerable<T>> selector)
{
    // Stop if subjects are null or empty
    if(subjects == null)
        yield break;

    // For each subject
    foreach(var subject in subjects)
    {
        // Yield it
        yield return subject;

        // Then yield all its decendants
        foreach (var decendant in SelectRecursive(selector(subject), selector))
            yield return decendant;
    }
}
Run Code Online (Sandbox Code Playgroud)

将使用这样的东西:

var people = somePerson.SelectRecursive(x => x.Friends);
Run Code Online (Sandbox Code Playgroud)

c# recursion ienumerable

32
推荐指数
2
解决办法
6186
查看次数

在特定工作表上打开Excel文件

我有一个带有5个工作表的Excel文件,我希望用c#代码打开它,当它打开时,我希望激活工作表编号3.

我怎样才能做到这一点?

c# excel

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

用于测试的嵌入式H2数据库的Spring配置

对于集成测试,您的Spring配置与使用嵌入式h2数据源以及可选的JUnit 相似?

我第一次尝试使用SingleConnectionDataSource基本上可以工作,但是在更复杂的测试中失败了,你需要同时连接多个连接或挂起事务.我认为基于tcp的服务器模式中的 h2 也可以正常工作,但这可能不是内存中临时嵌入式数据库的最快通信模式.

有哪些可能性及其优点/缺点?另外,如何创建表/填充数据库?


更新:让我们指定一些对此类测试很重要的具体要求.

  • 数据库应该是临时的并且在内存中
  • 对于速度要求,连接可能不应使用tcp
  • 如果我可以使用数据库工具在调试期间检查数据库的内容,那将是很好的
  • 我们必须定义数据源,因为我们不能在单元测试中使用应用程序服务器数据源

spring unit-testing h2 embedded-database

41
推荐指数
3
解决办法
7万
查看次数