Category "java"

Nested if statement is only executing first part

What I want my code to do I want my code to validate user input without using Regex or isDigit operators. If all the requirements of the if statements are found

Exception in thread "main" java.util.zip.ZipException: error in opening zip file When testing the application

In Android Studio the application was running on Real device, it was exported in ABK format .. But after a while, this error appears I read about gradle but did

Kotlin Android Studio: org.junit.ComparisonFailure with NBSP

I have this code @Test fun price_twelve_cupcakes() { val viewModel = OrderViewModel() viewModel.setQuantity(12) viewModel.price.observeForever {}

AfterDeleteEvent from AbstractMongoEventListener is not being triggered when entry is deleted from MongoDb

I have a class that extends AbstractMongoEventListener and overrides onAfterSave and onAfterDelete. The onAfterDelete does not trigger for some reason. The onAf

Unable to save an encrypted password with BCryptPassword in database

I am trying to save an encrypted password in postgreSQL database with BCrypt and I have an error. I saw the other answers on stackoverflow I tried to use those

JavaDoc: specify compatibility up to a specific version?

Similarly to how I can specify the minimum compatible Java version using the @since tag, I'd like to specify in my JavaDoc the maximum compatible version (e.i.

Failed to get correlation key for `citrus_message_correlator_HttpClient`

I have a CitrusEndpoints server configuration @Bean public HttpServer myService() { return CitrusEndpoints. http(). server().

Generating a random number that ends with a certain digit in Java

How does one generate a random number between 0 and 500 that ENDS WITH 5 in Java? I'm fairly new to programming.

Trying to save Night Mode State using Fragment

I am trying to enable Dark Night Mode in my App which is working though but when I restart the app it goes to again Light Mode basically I want to save Dark Nig

Why catch specific Java exceptions unless specific handling is needed?

Here is the code taken from https://dzone.com/articles/9-best-practices-to-handle-exceptions-in-java public void automaticallyCloseResource() { File file =

How to find the number of elements having the same CSS selector in selenium java?

I am using the latest version of selenium with java. I am trying to find the number of elements in a certain web page having the same css selector, but I don't

why nginx error 404 when downloading a file

When I try to download a file on a workbench with 3000+ records, a 404 nginx error crashes. When I try to download a file with fewer entries, everything is ok.

How to remove attribute from item in DynamoDB table?

I have an item whose particular attribute I want to remove using SDK 2.x from DynamoDB. How do I do this? I am using enhanced DynamoDB for table management. Her

Access GlusterFS file system in spring boot application

I am new to GlusterFS. After watching this video https://youtu.be/IGEtVYh0C2o , I have a big picture of how the GlusterFS servers are working. I understand a cl

GraalVM Native Image failing on Springdoc dependency

I am trying to create a sample application using spring boot and GraalVM Native Image, however as soon as I add the dependency for Springdoc the generated execu

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