Skip to content
Advertisement

Tag: java

Delete multiple Redis stream id with Jedis

how can i delete multi redis stream id with jedis? they have a methods calls “xdel” – what is the type that i need to send to the method to delete multi key? i declare List but the method didnt get this type. i got this error – Answer Jedis xdel method takes varags of StreamEntryID. So you can do

arranging the records in customised way

Sort Procedure First sort by the delivered date & in case of multiple records on same date sort by delivered time (Note: if a record has both ordered and Delivered Date ,it should be sorted by Delivered date only) 08-JUN: 03.00, 08-JUN: 04.00 Then look at the ordered date without delivered date which also exists for 08-JUN & sort by

Android: CalendarView and Button not able to share data

I’m creating an application that lets user to list down school assignment and the deadline. In the OnClickListerner, the “selectedDate” is highlighted as an error. Is there a way to solve the issue? Answer The selectedDate is defined in another scope so it is not visible for OnClickListerner. You can move it to the onCreate method scope.

What is the purpose of placing a HashSet inside of a HashMap?

For example: private HashMap<Integer, HashSet> variableName; I understand that HashMap implements Map and doesn’t allow duplicate keys and HashSet implements Set and doesn’t allow for duplicate values, but what is the purpose of placing a HashSet inside of a HashMap? Do they not achieve similar tasks by themselves (though in different ways and with different performance)? What functionality does doing

Java Quick Sort Performance

I was doing sorting array problems and found one of the quick sorting solution extremely fast, and the only difference is the two lines of code in function 1Partition. Wondering why the following two lines of code in 1Partition can greatly improve the performance: Here’s the full source code: } Answer I guess you are doing the question on a

Interface CDI wildfly external projects

So my idea is to have 3 projects: com.tests.interfaces com.tests.services com.tests.schedulers com.tests.interfaces basically is: com.tests.services is: I am deploying the “services” project and it works fine using wildfly 24.0.0. Then I am trying to have another .war project called: com.tests.schedulers which looks like this: But it cant be deployed and this is the relevant part of wildfly’s (same server to

Given two strings, determine if they share a common substring

This is my first Question here, I need to know why the following code does not pass Sample test case 2 in hacker rank-> Algorithms-> Strings-> Two Strings: The question is here: https://www.hackerrank.com/challenges/two-strings/problem Sample test case 2: 2 my code gives: No No but the expected output is: Yes No Answer I’m assuming one of the test cases uses a

Is there a way to hide all elements in JFrame

I’m currently working on Java application and I’m using JFrame and inside of JFrame i have some buttons, labels and textfields. I’m in need of hiding all the elements that are in JFrame. I don’t need to hide JFrame itself, only the elements in it so I can display some others. Is there a way to hide them all without

Advertisement