Category "java"

Interview: Find the whole cubes between range of two Integers

I just gave a coding interview on codility I was asked the to implement the following, but i was not able to finish it in 20 minutes, now I am here to get idea

Is there any difference, if I init AES cipher, with and without IvParameterSpec

I was wondering, is there any difference, if I init AES cipher, with and without IvParameterSpec? With IvParameterSpec SecretKeySpec skeySpec = new SecretKeyS

Type Mismatch cannot convert from type Optional<User> to User

I am trying to create a website that allows the user to update, edit, delete, etc., and I have got to the part of Updating or Editing user’s information.

Java NullPointer Custom Validator javax.validation.ConstraintValidator

I have the following Validator that I use to validate an Update Request. @Component public class UpdateDateValidator implements ConstraintValidator<ValidateD

How can I pass and access C data from Java?

I've been doing some programming in Java and some in C but now I need to sort of use both together. Here's the situation, I'm using Hadoop/Hbase to process and

InvalidDefinitionException while using JsonCreator with JsonProperty.Access.READ_ONLY

I'm getting InvalidDefinitionException when trying to use @JsonCreator along with @JsonProperty(value = "version", access = JsonProperty.Access.READ_ONLY) This

The bean 'exampleService.FeignClientSpecification' could not be registered. Bean already defined and overriding is disabled

My feign client class is as below along with the Application class. @FeignClient(name = "ExampleService", configuration = FeignClientConfig.class, url = "http:

How to reduce CPU usage for Java 11 with G1GC on GCP

I have: the application multi thread, low latency OpenJDK 64-Bit Server VM version 11.0.7+10 configuration is Xms=6g Xmx=12g machine is 12CPU started in GCP (Go

Parameter conditions "dietaryrestrictionssearches" not met for actual request parameters: active={304, 305}

my controller and model. I check two checkboxes and it should put those values 30 and 305 into table but I get this message. Any help would be appreciated @Req

How to parse invalid (bad / not well-formed) XML?

Currently, I'm working on a feature that involves parsing XML that we receive from another product. I decided to run some tests against some actual customer dat

Android method performance suddnely slow after upgrade from Marshmallow to Nougat

I have been developing a game, using a Samsung Galaxy S6 running Marshmallow as one of my development devices. After the phone upgraded itself to Nougat, a met

Convert indefinitely running Runnable from java to kotlin

I have some code like this in java that monitors a certain file: private Handler mHandler = new Handler(); private final Runnable monitor = new Runnable() {

In OSGi, how do you gracefully handle initialisation exceptions?

I am using Maven-SCR. By using the @Component and @Service tags, I can have my class instance register the interfaces it provides automatically. On occasion, h

Only using @JsonIgnore during serialization, but not deserialization

I have a user object that is sent to and from the server. When I send out the user object, I don't want to send the hashed password to the client. So, I added @

Android method performance suddnely slow after upgrade from Marshmallow to Nougat

I have been developing a game, using a Samsung Galaxy S6 running Marshmallow as one of my development devices. After the phone upgraded itself to Nougat, a met

Serialize Java 8 Stream with Jersey

How can I serialize a Java 8 java.util.Stream<T> with Jersey. I tried to write a MessageBodyWriter, but I need to know how to compose (decorate) existing

How to set custom environment variables in tomcat?

I have few key- value pair variables in my program which is hard coded now. String pswd = StringUtils.defaultString(System.getProperty("KEY_STORE_PASSWORD"), "

How can I use the singleton pattern in an Android project? [closed]

I know about singleton, but I can't use it in an Android project. I am a beginner in Android. How and where can we use singleton in an Android

MapStruct - Cannot find implementation

Using latest Springboot and MapStruct versions and building with Maven, I am trying to implement the "Start Here" example given in the official MapStruct site

Flutter - getApplicationDocumentsDirectory() : How to get the path in android and iOS

Directory tempDir = await getTemporaryDirectory(); String tempPath = tempDir.path; In android native code, I use getCacheDir() How do i get the getApplicatio