Category "java"

How to make this code faster in python (algorithm question)

Today I was browsing for some questions that I saw this: Algorithm - Air Battle C ++ time limit: 1 second Java time limit: 2 seconds Python time limit: 10 secon

How to update the recyclerview when opening the app?

I'm looking for a list of movies in an API, the project is in MVVM and the search is being done perfectly. However, when opening the app, the user has to exit a

Getting reactor.pool.PoolShutdownException during save in database

Service is using org.springframework.r2dbc.core.DatabaseClient with reactor-pool and r2dbc-mysql driver. I'm doing inserts in the database every 5-10 seconds (5

Using Karate, how do I loop though a json to pick up the value for a key based on another key in that json block?

Below is the JSON response I get from which I want to extract y1. Before getting the response, I know x1 already but I don't know y1. So for that particular x k

change the json object value

{ "onboardingInformation": { "apiInvokerPublicKey": "string", "apiInvokerCertificate": "string", "onboardingSecret": "string" }, "notification

Pass value from properties to @Column annotation

Helo, Is it possible to pass value from application.properties to @Column annotation in entity? I tried this: @Column(name = "${foo.column-name}") private Strin

Can't Run Java in VSCode?

What would cause VS Code to not run java debugging or show any output for java? The JAVA_HOME variable is set, in both the user environment and in the VSCode se

Issues while decrypting Initialization Vector IV algorithm

I am tying to implement Intilization vector 4 the issue I am facing is I am able to encrypt my text using intilization vector4 algorithm but when it comes to de

Why does my boolean value remain as false despite meeting the if condition in my setter?

public class Main { public static void main(String[] args) { // test1 where all variables are valid Main test1 = new Main("David", "male", 2

Unsafe object binding checkmarx spring boot application

I'm getting this alert from checkmarx, saying that i have an unsafe object binding when trying to save a comment. I've read that we mustn't save objects directl

Connection refused trying to connect spring boot application in docker

I try to run spring boot application in Docker, Circle CI. Please, check how my .circleci/config.yml file looks like: version: 2.1 jobs: test: docker:

Processing messages with PossDupFlag set with QuickFixJ

In QuickFix/J we can send a ResendRequest message to the Acceptor to request messages to be resent to the Initiator, within a given MsgSeq number range. For exa

Alternative to requestLegacyExternalStorage and MANAGE_EXTERNAL_STORAGE for Public Folders in Android 10/API 29?

I have an Android app on the play store that publishes data to a simple .txt file and lets you share using any other app of your choice. It used to write direct

Task1:Search for people with their social security number. Task 2: Fetch the list of residents based on their gender

I've created an ArrayList of Residents. Each Residents consists of full name, ssn number and gender. I had to sort the elements by ssn number first and then by

Java 17 solution for Spark - java.lang.NoClassDefFoundError: Could not initialize class org.apache.spark.storage.StorageUtils

There are some solutions here Windows Spark Error java.lang.NoClassDefFoundError: Could not initialize class org.apache.spark.storage.StorageUtils The mentioned

sdkmanager throws Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema

I am on MacOS, installed the JDKs 8 ( LTS ) from AdoptOpenJDK to get the android environment up and running and that worked fine! brew cask install adoptopenjdk

Rewrite imperative code of creating and populating Map in a declarative way using Java Stream API

I have this piece of code : Map<String, BillingAccount> billingAccountsMap = new HashMap<>(); for (BillingAccount ba : billingAccounts) { if (ba

should I close the Singleton DB connection object inside AWS lambda?

I've a plain simple aws lambda written in java(No framework involved). Currently, I've used a Singleton instance for DBConnection as I wanted to re-use the earl

How can I mock dependencies which aren't interfaces but subclasses?

I'm not sure if my design is simply stupid, or there's a good way to make it work. Consider the following classes: public abstract class CheckBase { protect

Could not find org.junit.jupiter:junit-jupiter:

I was trying to learn how to use OkHTTP. I importetd the library to my project but when i compile the code it brings out this error. Could not find org.junit.ju