java

Java: Possibilities to protect files against manipulation

老子叫甜甜 提交于 2021-02-18 19:24:32
问题 My Java program builds some files (.html and .txt-files) in one directory. To finish a project I'd like to "pack" these files for example to send it to another person. But the other person should not be able to simple "unpack" the file and manipulate the html/txt-Files. Only open the packed file with my Java program. My idea was, to zip the directory with a master password (set in the Java program) protection. After that I can send the zip-file via eMail and the other person will only be able

RobotFramework: Maximum limit of started keywords exceeded

早过忘川 提交于 2021-02-18 19:22:13
问题 I'm new to RobotFramework and I'm trying to do a simple test. Print an "Hello world" using Log keyword and get a value from a java class (I'm using jybot on Ride): *** Settings *** Library robot.MyTest *** Test Cases *** Test1 Log Hello World INFO Get Value *** Keywords *** Get Value Get Value But when I run it, the test won't pass and it will give me this error: Starting test: MyTest.Test1 20140817 01:00:15.683 : INFO : Hello world 20140817 01:00:15.798 : FAIL : Maximum limit of started

Intermediate operation in Java streams [duplicate]

心不动则不痛 提交于 2021-02-18 19:20:05
问题 This question already has answers here : Java 8 Streams peek api (4 answers) Closed 2 years ago . In java 8, I am using Streams to print the output, but size is coming as 0. Why? public class IntermediateryAndFinal { public static void main(String[] args) { Stream<String> stream = Stream.of("one", "two", "three", "four", "five"); Predicate<String> p1 = Predicate.isEqual("two"); Predicate<String> p2 = Predicate.isEqual("three"); List<String> list = new ArrayList<>(); stream.peek(System.out:

Programmatically open app in split screen

时光总嘲笑我的痴心妄想 提交于 2021-02-18 19:19:21
问题 How do I open another app in a split screen in the android N (SDK 24)? In the documentation I found this: Launch New Activities in Multi-Window Mode When you launch a new activity, you can hint to the system that the new activity should be displayed adjacent to the current one, if possible. To do this, use the flag Intent.FLAG_ACTIVITY_LAUNCH_TO_ADJACENT. Passing this flag requests the following behaviour: If the device is in split-screen mode, the system attempts to create the new activity

Programmatically open app in split screen

笑着哭i 提交于 2021-02-18 19:19:12
问题 How do I open another app in a split screen in the android N (SDK 24)? In the documentation I found this: Launch New Activities in Multi-Window Mode When you launch a new activity, you can hint to the system that the new activity should be displayed adjacent to the current one, if possible. To do this, use the flag Intent.FLAG_ACTIVITY_LAUNCH_TO_ADJACENT. Passing this flag requests the following behaviour: If the device is in split-screen mode, the system attempts to create the new activity

Async processing of requests in Java webapp

☆樱花仙子☆ 提交于 2021-02-18 19:19:09
问题 I need to write a web application which receives a lot of HTTP requests and takes a long time (30s to 2min) to process each request (in turn making other network requests) before returning a response. Because there would be a lot of requests coming in and those connections are held open I'm thinking of going down an event driven route, which leads me to think Netty is appropriate. If each request takes a long time to process, is that going to block netty's processing? Or can I receive a

Async processing of requests in Java webapp

久未见 提交于 2021-02-18 19:19:07
问题 I need to write a web application which receives a lot of HTTP requests and takes a long time (30s to 2min) to process each request (in turn making other network requests) before returning a response. Because there would be a lot of requests coming in and those connections are held open I'm thinking of going down an event driven route, which leads me to think Netty is appropriate. If each request takes a long time to process, is that going to block netty's processing? Or can I receive a

Async processing of requests in Java webapp

梦想的初衷 提交于 2021-02-18 19:18:06
问题 I need to write a web application which receives a lot of HTTP requests and takes a long time (30s to 2min) to process each request (in turn making other network requests) before returning a response. Because there would be a lot of requests coming in and those connections are held open I'm thinking of going down an event driven route, which leads me to think Netty is appropriate. If each request takes a long time to process, is that going to block netty's processing? Or can I receive a

Listening socket.io events and updating LiveData (a class of android.arch.lifecycle)in application class android

主宰稳场 提交于 2021-02-18 19:10:28
问题 I am working on a chat application and Currently I am listening and emitting socket events in an Activity. Now i want to listen all the socket events even when chat activity is not in foreground as i want to store all the messages from different users in the local DB at the same time i want to update LiveData to update UI. In order to achieve this I am listening socket events in the Application class as following: public class ChatApplication extends Application { public Socket mSocket;

Undo button for drawings in a JFrame

旧时模样 提交于 2021-02-18 19:10:06
问题 I am drawing some objects on a JFrame such as circles, rectangles and arcs between them. I was wondering how I can implement an Undo button bearing in mind that the ones I found are targeted at text fields and writing in them. I don't have code to show and I wish to receive advice on how to implement it. Is it possible to 'register' the last event that occurred and then delete it? I have a very simple code about deleting the circles for instance. It works only for them and I know that it is