Category "java"

Store a variable in Android

Is there any way to have a boolean that goes true when successful login and false when not, and to be able to access it and change its value in the activities?

Adding all elements of an array except the element at index with O(n) complexity

This is what i came thru a problem in some coding test. problem statement was like that we have to add all the elements of an array except the element at the i

bus properties settings ignored

I had cxf.xml file: <beans .... <cxf:bus> <cxf:features> <cxf:logging/> </cxf:features> </cxf:bus> </beans&

why fingerprintsimilarty in my code does not work?

I'm creating an application to recognize the sound of two wave files, for doing this I have found that "Musicg" library is used for that purpose. so I just writ

Count Occurrences of Seven Integers in Array

I have written the code below and it has comments attached. The application is to read seven integers entered by the user. The application then prints out the n

I need to send the request correctly, but I don't know how to get the required values from objects

How to get a new list from the list of objects? I need a new list of objects to POST request this list of objects i get from response: { "success": true, "b

How to determine what Java Jenkins is using to run and point it to the correct location (Java 11)

I've looked all over for this answer but cannot find it, as most of the answers are how to add JDK to Jenkins for usage within a test. I'm looking for how to en

how to display floating window without permission?

i tried to display floating window in android 10 / Core M01 using WindowManger, but i am not able to get "Display over apps" permission:- i tried to use "Windo

Kafka streams - Concatenate Predicate based on dynamic number of conditions

I'm a bit new in Java so I would appreciate advice to deal with multiple conditions in Kafka Predicates. I've the following code which I'm able to have dynamic

Why all java utils for dumping heap are not working? How to dump heap?

I'm tired to trying to dump java heap when I need it. Any time when I could do that none of utils are not able to do that. I'm trying jmap, jvisualvm, jconsole,

What are sealed classes in Java 17?

Today, I updated my Java version from 16 to 17, and I found that sealed classes is a new feature in it. I think it can be declared like this: public sealed clas

How can we test for the N+1 problem in JPA/Hibernate?

I have a N+1 problem, and I’d like to write some kind of automated regression test because it impacts performance very much. I thought about spying the E

Apache Ignite No data inserted while using cache.put method with BinaryObjects

After going through several posts on getting and putting data into a SQL table in appche ignite with the help of BinaryObjects I wrote below code for a test. Th

Updating notifications after being added

I want to update the content for a reminder after it has been added before being received by the user. After setting a reminder through AlarmManager using the d

After upgrade android version getting "Duplicate class android.support.v4.app.INotificationSideChannel"

before android update 3.4 my application run perfectly but after upgrade android my application getting merging error: "Duplicate class android.support.v4.app

How to find the selected id in my List<String> ids arraylist?

Here is my code. I am trying to use JUnit to test the deleteUsers() method, but everytime I write my test, it deletes all the users that I have in the database.

How to resolve class file for com.google.cloud.Service not found

I am Trying to upload JSON data to gcs. As I did not use google cloud previously I started with uploading random String to gcs but I got stuck at the beginning

Is there an equivalent of verifyZeroInteractions() for verifying an exact number of interaction with a mock object?

I would like to verify there were exactly x interactions with might db mock object. Is there something similar to the 'verifyZeroInteractions()' method for doin

spring-boot-starter-data-cassandra-reactive depends on CVE-2020-13946 native-protocol-1.5.0.jar

Small question regarding a SpringBoot project please. Currently with version 2.6.x, I am developing a very small web application storing data inside Cassandra.

Bouncycastle how to envelop the signed digest it in the original document with java?

In connection with this issue: https://github.com/bcgit/bc-java/issues/1021 I am looking for the best method to envelope the signed hash of a document inside th