小编vic*_*rio的帖子

如何在java中使用prolog?

请有人帮我举个例子。我想创建一个简单的 Prolog 程序,将两个数字相加,然后 Java 程序将其写入控制台!所以 Prolog 正在添加,Java 程序正在写入结果。我可以在prolog中编写添加,但我不知道如何在java中调用prolog程序。=(请可以创建这个小例子的人写在这里!谢谢!!

java prolog

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

如何在java中阅读ico格式图片?

我有很多.ico格式的图片,我想在我的Java SE项目中使用它们,但它不知道格式.我该如何解决这个问题?

java image ico

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

为什么我的Eclipse在启动时不要求工作空间?

在我的Eclipse中:

Windows - >首选项 - >常规 - >启动和关闭 - >工作区:

并且检查了"启动时提示工作空间",但是只要我启动Eclipse,它就不会要求打开工作空间.

这是为什么?请帮我!谢谢!

eclipse workspace

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

Log4j2-无法识别的转换说明符[xwEx]从转换模式中的位置160开始

我在Maven多模块项目中有一个SpringBoot应用程序,并且正在使用Log4j2进行日志记录。

当我运行带有测试的构建时,某些模块有一个奇怪的日志记录异常,并记录来自未知(不是我的)类的更多行。

这是例外:

2018-06-04 14:16:26,791 main ERROR Error creating converter for xwEx java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.logging.log4j.core.pattern.PatternParser.createConverter(PatternParser.java:583)
    at org.apache.logging.log4j.core.pattern.PatternParser.finalizeConverter(PatternParser.java:639)
    at org.apache.logging.log4j.core.pattern.PatternParser.parse(PatternParser.java:415)
    at org.apache.logging.log4j.core.pattern.PatternParser.parse(PatternParser.java:177)
    at org.apache.logging.log4j.core.layout.PatternLayout$SerializerBuilder.build(PatternLayout.java:377)
    at org.apache.logging.log4j.core.layout.PatternLayout.<init>(PatternLayout.java:129)
    at org.apache.logging.log4j.core.layout.PatternLayout.<init>(PatternLayout.java:59)
    at org.apache.logging.log4j.core.layout.PatternLayout$Builder.build(PatternLayout.java:660)
    at org.apache.logging.log4j.core.layout.PatternLayout$Builder.build(PatternLayout.java:517)
    at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:122)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:958)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:898)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:890)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:890)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:513)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:237)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:249)
    at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:545)
    at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:261)
    at org.springframework.boot.logging.log4j2.Log4J2LoggingSystem.loadConfiguration(Log4J2LoggingSystem.java:176)
    at org.springframework.boot.logging.log4j2.Log4J2LoggingSystem.loadDefaults(Log4J2LoggingSystem.java:159)
    at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:84)
    at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:59)
    at org.springframework.boot.logging.log4j2.Log4J2LoggingSystem.initialize(Log4J2LoggingSystem.java:148)
    at org.springframework.boot.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:303)
    at org.springframework.boot.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:276)
    at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:239)
    at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:212)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) …
Run Code Online (Sandbox Code Playgroud)

logging log4j2 spring-boot

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

一个 Swagger 文件中的多个 API 文档

是否可以有多个(以某种方式分开的)REST API 文档,但只能在一个 swagger yaml 文件中?

或者 swagger yaml 可以只包含一个 API 文档吗?

因为我有 2 个由我开发的 REST API,并且我想要一个通用的 swagger ui 而不是两个,我可以使用像 Tyk 这样的网关来管理它。

rest swagger swagger-2.0 tyk

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

如何控制MIDI通道的音量

我有这个代码:

Synthesizer synthesizer = MidiSystem.getSynthesizer();
synthesizer.open();
Instrument[] instrument = synthesizer.getDefaultSoundbank().getInstruments();
synthesizer.loadInstrument(instrument[29]);
MidiChannel[] channels = synthesizer.getChannels();
MidiChannel channel = channels[1];
channel.programChange(29);
channel.noteOn(noteNumber, 127);
Teszthang.sleep(2000);
channel.noteOff(noteNumber);
Run Code Online (Sandbox Code Playgroud)

所以这是一个例子,以最大音量(127)播放声音2秒.但我想控制频道的音量,比如在2秒之后,音量会在另外2秒内淡出.我怎么能这样做?我知道这些方法:

channel.controlChange(controller, value);
channel.setPolyPressure(noteNumber, pressure);
Run Code Online (Sandbox Code Playgroud)

但这些不会改变任何音量!我不知道如何使用这些方法.如何noteOn()在播放后更改频道的音量?

java midi channel volume fadeout

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

如何按日期列分区oracle表?

我在oracle中有一个表:

CREATE TABLE transaction (
    id INT NOT NULL,
    accountnumber VARCHAR NOT NULL,
    stmtvaluedate DATE NOT NULL,
    ...
)
Run Code Online (Sandbox Code Playgroud)

我想通过stmtvaluedate列对此表进行分区.我的目标是在一个月过后创建一个新分区.

对于它,有什么好的剧本吗?或者我必须创建静态数量的分区?

最好的是:如果一个月过去了,将自动创建一个新分区.

任何人都可以给我一个关于如何在每个月之后按日期列分区表的示例吗?如果自动分区是不可能的,那么我需要一个示例,该示例从现在开始按日期列创建分区,大约每个月.

谢谢!

database oracle date database-partitioning database-scripts

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

如何在mysql中“ident_current”?

我在 MSSQL 中使用此代码:

SELECT IDENT_CURRENT('customers');
Run Code Online (Sandbox Code Playgroud)

当我在 MySQL 中尝试时,它不起作用。我在网上寻找答案,但找不到任何对我有用的东西。上述 TSQL 的 MySQL 等价物是什么?

mysql

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

如何使用jquery删除HTML TABLE中的最后一列?

我有一个HTML TABLE:

<table id="persons" border="1">
    <thead id="theadID">
        <tr>
            <th>Name</th>
            <th>sex</th>
            <th>Message</th>
        </tr>
    </thead>
    <tbody id="tbodyID">
        <tr>
            <td>Viktor</td>
            <td>Male</td>
            <td>etc</td>
        </tr>
        <tr>
            <td>Melissa</td>
            <td>Female</td>
            <td>etc</td>
        </tr>
        <tr>
            <td>Joe</td>
            <td>Male</td>
            <td>etc</td>
        </tr>
    </tbody>
</table>
<input type="button" onclick="deleteLastColumn();" value="do it"/>
Run Code Online (Sandbox Code Playgroud)

我需要一个javascript/jquery代码,它删除表中的最后一列(消息):

function deleteLastColumn() {
    $("#theadID tr th:not(:last-child)......
    $("#tbodyID tr td:not(:last-child)......
}
Run Code Online (Sandbox Code Playgroud)

所以结果应该是这样的:

<table id="persons" border="1">
    <thead id="theadID">
        <tr>
            <th>Name</th>
            <th>sex</th>
        </tr>
    </thead>
    <tbody id="tbodyID">
        <tr>
            <td>Viktor</td>
            <td>Male</td>
        </tr>
        <tr>
            <td>Melissa</td>
            <td>Female</td>
        </tr>
        <tr>
            <td>Joe</td>
            <td>Male</td>
        </tr>
    </tbody>
</table>
Run Code Online (Sandbox Code Playgroud)

我知道有":not(last)"方法,但我找不到任何问题的例子.谁能帮助我?

javascript jquery html-table

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

我是否也应该在 spring 中为子方法添加 @Transactional 注释?

我有一个主要的 DB 处理程序方法,它调用其他方法,这些方法也与 BD 事物一起工作。

我为 main 方法添加了 @Transactional 注释,因为如果出现问题,我想回滚所有内容。

我的问题是:我是否应该也为子方法添加此注释,或者它会知道子方法是从事务性方法调用的。

比如删除方法中出现异常,如何保证写入部分也会回滚:

@Transactional
public void maintDbTings() {
    writing();
    deleting();
}

@Transactional //do I need this?
public void writing() {
    //no exceptions
}

@Transactional //do I need this?
public void deleting() {
    //exception occurs
}
Run Code Online (Sandbox Code Playgroud)

java spring transactions transactional rollback

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