Smack api and Openfire server presence error

I am developing a chat application using Smack api and I got stuck at receiving presence packets. Tested with Smack 3.2.2 and 3.3.0. These problems involve only using Openfire server 3.8.1. First :I am sending the presence packet from Spark and receiving it with success second I am updating and sending presence packet from Spark client to my own: <presence id="b8nyI-95"> <sta

Smack API和Openfire服务器存在错误

我正在开发一个使用Smack API的聊天应用程序,并且我被困在接收存在数据包中。 使用Smack 3.2.2和3.3.0进行测试。 这些问题只涉及使用Openfire服务器3.8.1。 首先 :我从Spark发送存在数据包并成功接收数据包 第二我正在更新并从Spark客户端发送状态数据包到我自己的: <presence id="b8nyI-95"> <status>Free to chat</status> <priority>1</priority> <show>chat</sh

Cannot query SQL Server table containing Arabic from my Java app using HQL

I'm working on a Java Swing application where I query a table in a SQL Server database. This table contains some data that is in Arabic, Chinese etc... But the problem is that I am not getting any results while using this query: (var can be Arabic or any other language): from Table T where T.columnName like '%"+var+"%' I did some searching and then tried the following: from Table T where

使用HQL无法从我的Java应用程序查询包含阿拉伯语的SQL Server表

我正在研究一个Java Swing应用程序,我在这里查询SQL Server数据库中的一个表。 这个表格包含阿拉伯文,中文等的一些数据......但问题是我在使用这个查询时没有得到任何结果:(var可以是阿拉伯文或任何其他语言): from Table T where T.columnName like '%"+var+"%' 我做了一些搜索,然后尝试以下内容: from Table T where T.columnName like N'%"+var+"%' 我在NetBeans上收到此错误消息: 线程“AWT-EventQueue-0”中

Missing line when reading using input stream reader

I have a sample EXE which prints below output. EXEs Output: 1 2 3 4 5 Failed equivalent code in java: for (int i = 1; i <= 5; i++){ System.out.println(i); } System.out.println("Failed"); When trying to initiate the EXE using java code and read the output some data goes missing. Find the java for initiating the asset. Java Code: String[] commands = new String[] {"sample.exe" };

使用输入流阅读器读取时缺少行

我有一个示例EXE打印在输出下面。 EXE输出: 1 2 3 4 5 Failed 在java中的等效代码: for (int i = 1; i <= 5; i++){ System.out.println(i); } System.out.println("Failed"); 当试图使用java代码启动EXE并读取输出时,一些数据会丢失。 找到启动资产的Java。 Java代码: String[] commands = new String[] {"sample.exe" }; p = Runtime.getRuntime().exec(commands); InputStream is = p.getInputStream();

Passing a tab character as a command line argument in Java

This question already has an answer here: How to unescape a Java string literal in Java? 10 answers The tab that you defined in code is a single-character string (since "t" is an escape sequence). From the command line you get a two-characters string, as bash doesn't handle "t" as the tab character. To pass that from command line, you can use echo -e which supports

在Java中传递制表符作为命令行参数

这个问题在这里已经有了答案: 如何在Java中使用Java字符串文字? 10个答案 您在代码中定义的tab是单字符字符串(因为“ t”是转义序列)。 在命令行中,您会得到一个两个字符的字符串,因为bash不会将“ t”作为制表符处理。 要从命令行传递它,可以使用echo -e ,它支持t (或n等几种)转义序列: $ java Main "$(echo -en 't')" 如果您传递't'或"t"命令行上,它会导致一个反斜杠后跟一个t要传递给你

How can I use a custom runner when using categories in Junit?

I have a bunch of JUnit tests that extend my base test class called BaseTest which in turn extends Assert . Some of my tests have a @Category(SlowTests.class) annotation. My BaseTest class is annotated with the following annotation @RunWith(MyJUnitRunner.class) . I've set up a Gradle task that is expected to run only SlowTests . Here's my Gradle task: task integrationTests(type: Te

如何在Junit中使用类别时使用自定义运动员?

我有一堆JUnit测试,它们扩展了我的基本测试类BaseTest ,它又扩展了Assert 。 我的一些测试有一个@Category(SlowTests.class)注释。 我的BaseTest类使用以下注释@RunWith(MyJUnitRunner.class)注释。 我已经设置了一个Gradle任务,预计只能运行SlowTests 。 这是我的Gradle任务: task integrationTests(type: Test) { minHeapSize = "768m" maxHeapSize = "1024m" testLogging { events "passed", "

Should all these default threads be Running? And do they keep my JVM alive?

I have a question regarding the threads that my application spawns during execution and on their status. I have a Swing application and I noticed a couple of strange behaviours in some test scenarios, using Java VisualVM. Running my program for 30+minutes doing nothing (just started and leaving it there running) I noticed the following. First of all, in the the Threads tab I see a lot of ali

所有这些默认线程都应该运行吗? 他们是否让我的JVM活着?

我有一个关于我的应用程序在执行期间产生的线程及其状态的问题。 我有一个Swing应用程序,并且在一些测试场景中使用Java VisualVM注意到了一些奇怪的行为。 运行我的程序30+分钟无所事事(刚开始并让它在那里运行)我注意到以下内容。 首先,在“线程”选项卡中,我看到很多活动线程。 读取(除其他外)默认线程,如DestroyJavaVM,Reference Handler,Signal Dispatcher和Java应用程序开始执行时spwaned的线程是什么? 我

Can't pipe Output of Hadoop Command

I want to run the following command: hadoop fs -copyToLocal FILE_IN_HDFS | ssh REMOTE_HOST "dd of=TARGET_FILE" However, when I try, all it does, is create an empty file on the target host and copy it to my local home drive, instead of copying it to the remote location. $ hadoop fs -copyToLocal FILE_IN_HDFS | ssh REMOTE_HOST "dd of=test.jar" 0+0 Datensätze ein 0+0 Datensätze au

无法管道输出Hadoop命令

我想运行以下命令: hadoop fs -copyToLocal FILE_IN_HDFS | ssh REMOTE_HOST "dd of=TARGET_FILE" 但是,当我尝试时,它所做的只是在目标主机上创建一个空文件,并将其复制到本地主驱动器,而不是将其复制到远程位置。 $ hadoop fs -copyToLocal FILE_IN_HDFS | ssh REMOTE_HOST“dd of = test.jar” 0 + 0Datensätzeein 0 + 0Datensätzeaus 0字节(0 B)kopiert,1,10011 s,0,0 kB / s 我想不出任何理由,为什么

Amazon mws ability to take notice of restricted products

当我使用我的账户API密钥时,需要点击哪个端点和哪个API才能分辨是否可以销售给定的产品? According to https://www.amazon.com/gp/help/customer/display.html/ref=hp_left_ac?ie=UTF8&nodeId=200277040, prohibition depends on the country's law.So, no api outputs whether your all products are sellable or not. "For some product categories, sellers may not create product listings without prior a

亚马逊公司有能力注意到受限制的产品

当我使用我的账户API密钥时,需要点击哪个端点和哪个API才能分辨是否可以销售给定的产品? 根据https://www.amazon.com/gp/help/customer/display.html/ref=hp_left_ac?ie=UTF8&nodeId=200277040,禁止取决于国家的法律。因此,没有api输出您的所有产品是否可销售或不。 “对于某些产品类别,卖家不得在未经亚马逊事先批准的情况下创建产品列表;此外,卖家可能需要获得额外的批准才能列出特定类别的某些产品。要请求访问特

Double comparison trick in Java

C++ allows you to combine two integer comparisons in one for range checking, like (unsigned)X < (unsigned)Upper which returns true when 0 <= X < Upper The Java language has no unsigned type. Do you see a way to obtain the same effect, using a single comparison and not too much overhead ? Update : From a comment by @Bathsheba, the char type is unsigned 16 bits and will be fit for

Java中的双重比较技巧

C ++允许您将两个整数比较合并为一个用于范围检查,如 (unsigned)X < (unsigned)Upper 当时,它返回true 0 <= X < Upper Java语言没有无符号类型。 你是否看到一种获得相同效果的方法,使用单一比较而不是太多开销? 更新 : 从@Bathsheba发表的评论中,字符类型是无符号的16位,并且符合我的目的,因为我的整数实际上在短路范围内。 问题仍然是开放的平原int秒。 可能是(X | (Upper - 1 - X)) >= 0某

Realm access from incorrect thread

Background I am using Realm within my app. When data is loaded it then undergoes intense processing therefore the processing occurs on a background thread. The coding pattern in use is the Unit of Work pattern and Realm only exists within a repository under a DataManager. The idea here is that each repository can have a different database/file storage solution. What I have tried Below i

Realm从不正确的线程访问

背景 我在我的应用程序中使用Realm。 当数据加载后,它会经历强烈的处理,因此处理发生在后台线程上。 正在使用的编码模式是工作单元模式,Realm只存在于DataManager下的存储库中。 这里的想法是每个存储库可以有不同的数据库/文件存储解决方案。 我所尝试过的 下面是我在FooRespository类中的一些类似代码的例子。 这里的想法是获得Realm的一个实例,用于查询感兴趣对象的领域,返回它们并关闭领域实例。 请注意,