表'动物':
animal_name animal_type
Tom Cat
Jerry Mouse
Kermit Frog
Run Code Online (Sandbox Code Playgroud)
查询:
SELECT
array_to_string(array_agg(animal_name),';') animal_names,
array_to_string(array_agg(animal_type),';') animal_types
FROM animals;
Run Code Online (Sandbox Code Playgroud)
预期结果:
Tom;Jerry;Kerimt, Cat;Mouse;Frog
OR
Tom;Kerimt;Jerry, Cat;Frog;Mouse
Run Code Online (Sandbox Code Playgroud)
我可以确定第一个聚合函数中的顺序将始终与第二个中的顺序相同.我的意思是我不想得到:
Tom;Jerry;Kermit, Frog;Mouse,Cat
Run Code Online (Sandbox Code Playgroud) 运行由maven构建的具有以下依赖项的项目时:
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>2.7.0</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
我在运行时收到以下错误:
java.lang.SecurityException: class "javax.persistence.Cacheable"'s signer information does not match signer information of other classes in the same package
Run Code Online (Sandbox Code Playgroud)
javax.persistence-2.2.0工件已签名并包含javax.persistence.Cacheable.class注释,而eclipselink-2.7.0工件未签名且包含相同的java类注释.
怎么解决这个问题?
编辑
用版本2.1.1替换javax.persistence artifact 2.2.0版修复了问题(这个没有签名),但我不确定这是正常情况.
什么是Tomcat或TomEE中服务tomcat启动/停止和./catalina.sh运行/停止之间的区别?
他们做的完全一样吗?
我即将迁移某些遗留代码含有较少的过时的警告,第三次三方库.对于Apache commons-cli库(版本:1.3.1),我在官方JavaDoc中检测到GnuParser已弃用,DefaultParser应该使用:
@deprecated自1.3以来,使用
{@link DefaultParser}而不是
但是,以下代码段停止按预期方式工作:
Options options = new Options();
Option optionGSTypes = new Option(
"gst","gs-types", true,
"the supported types, comma-separated: article, category, template, all");
optionGSTypes.setArgs(3);
optionGSTypes.setValueSeparator(',');
options.addOption(optionGSTypes);
// ... other options
// parsed option values are correct, yet this is deprecated
CommandLineParser parser = new GnuParser();
CommandLine commands = parser.parse(options, args);
// ... interpret parsed 'commands' and related actual values via CLI
Run Code Online (Sandbox Code Playgroud)
请注意,setValueSeparator(',')此处用于定义自定义分隔符char , …
java command-line-interface apache-commons apache-commons-cli
所以我有这张桌子:
create table test (
id integer,
rank integer,
image varchar(30)
);
Run Code Online (Sandbox Code Playgroud)
然后一些值:
id | rank | image
---+------+-------
1 | 2 | bbb
1 | 3 | ccc
1 | 1 | aaa
2 | 3 | c
2 | 1 | a
2 | 2 | b
Run Code Online (Sandbox Code Playgroud)
我想按id对它们进行分组,并按照rank排序顺序连接图像名称.在mySQL中,我可以这样做:
select id,
group_concat( image order by rank asc separator ',' )
from test
group by id;
Run Code Online (Sandbox Code Playgroud)
输出将是:
__PRE__有没有办法在postgresql中有这个?
如果我尝试使用array_agg(),名称将不会以正确的顺序显示,显然我无法找到对它们进行排序的方法.(我使用的是postgres 8.4)
分析一个大量使用支持GPU的动画的HTML-5应用程序,我想在--kiosk启动标志启动Chrome/Chromium的环境中不断检查FPS速率.目前,我在60+版本中使用Chromium.
大多数人都知道如何烯或禁用通过选择复选框中的铬/铬此功能FPS meter在正常模式下(参见:[1] ,[2] ).我已经找到了启动标志--show-fps-counter,它在启动时显示了GPU调试框[3].但是,Google提供的官方开发者文档未提及使用键盘快捷键切换FPS仪表工具显示的方法.
所以我的问题是:
--kiosk?如果是这样的话:它是什么?我已经检查/筛选过但未提供有用答案的问题:
基于官方消息来源的任何建议都非常赞赏
我有一个Spring Boot应用程序,我在启动时得到以下消息:
7701 [main] DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor': no URL paths identified
7701 [main] DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor': no URL paths identified
7701 [main] DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.context.annotation.internalRequiredAnnotationProcessor': no URL paths identified
7701 [main] DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.context.annotation.internalCommonAnnotationProcessor': no URL paths identified
7701 [main] DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.context.annotation.internalPersistenceAnnotationProcessor': no URL paths identified
7701 [main] DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'application': no URL paths identified …Run Code Online (Sandbox Code Playgroud) 我想要POStag一个英文句子并做一些处理.我想使用openNLP.我安装了它
当我执行命令
I:\Workshop\Programming\nlp\opennlp-tools-1.5.0-bin\opennlp-tools-1.5.0>java -jar opennlp-tools-1.5.0.jar POSTagger models\en-pos-maxent.bin < Text.txt
Run Code Online (Sandbox Code Playgroud)
它为Text.txt中的输入提供输出POSTagging
Loading POS Tagger model ... done (4.009s)
My_PRP$ name_NN is_VBZ Shabab_NNP i_FW am_VBP 22_CD years_NNS old._.
Average: 66.7 sent/s
Total: 1 sent
Runtime: 0.015s
Run Code Online (Sandbox Code Playgroud)
我希望它安装得当吗?
现在我如何从java应用程序内部执行此操作?我已将openNLPtools,jwnl,maxent jar添加到项目中,但我如何调用POStagging?
我有以下实体类:
@Entity
public class Event {
private OffsetDateTime startDateTime;
// ...
}
Run Code Online (Sandbox Code Playgroud)
然而,持续的,然后从与JPA 2.2结果数据库读取的实体/在信息丢失:所述ZoneOffset的startDateTime改变UTC(在ZoneOffset所使用的数据库的时间戳).例如:
Event e = new Event();
e.setStartDateTime(OffsetDateTime.parse("2018-01-02T09:00-05:00"));
e.getStartDateTime().getHour(); // 9
e.getStartDateTime().getOffset(); // ZoneOffset.of("-05:00")
// ...
entityManager.persist(e); // Stored startDateTime as timestamp 2018-01-02T14:00Z
Event other = entityManager.find(Event.class, e.getId());
other.getStartDateTime().getHour(); // 14 - DIFFERENT
other.getStartDateTime().getOffset(); // ZoneOffset.of("+00:00") - DIFFERENT
Run Code Online (Sandbox Code Playgroud)
我需要使用OffsetDateTime:我无法使用ZonedDateTime,因为区域规则发生了变化(而且还会受到此信息丢失的影响).我无法使用LocalDateTime,因为Event世界上任何地方都会发生这种情况,因为ZoneOffset出于准确性原因我需要原件.我无法使用,Instant因为用户填写了事件的开始时间(事件就像约会).
要求:
需要能够>, <, >=, <=, ==, …
我正在尝试开发一个发送一些广播消息的应用程序,并从其他Android设备接收一些答案.我在从其他设备接收UDP消息时遇到一些麻烦.我应该提一下,这段代码适用于Gingerbread,但是在JellyBean上它不再起作用了,我不知道可能是什么问题.
这是我发送广播消息的地方(我知道其他设备在端口5000上侦听):
private void sendUDPMessage(String msg) {
try {
DatagramSocket clientSocket = new DatagramSocket();
clientSocket.setBroadcast(true);
InetAddress address = InetAddress.getByName(Utils.getBroadcastAddress());
byte[] sendData;
sendData = msg.getBytes();
DatagramPacket sendPacket = new DatagramPacket(sendData,
sendData.length, address, 5000);
clientSocket.send(sendPacket);
clientSocket.close();
} catch (Exception e) {
e.printStackTrace();
}
}
Run Code Online (Sandbox Code Playgroud)
这是我收到它的地方:
private void start_UDP()
{
try {
serverSocketUDP = new DatagramSocket(5000);
}
catch (Exception e) {
Log.i(LOGTAG, "Exception opening DatagramSocket UDP");
}
final byte[] receiveData = new byte[1024];
while(runningUDP) {
Log.d(LOGTAG, "Waiting for Broadcast request in ServerUDP.");
final …Run Code Online (Sandbox Code Playgroud)