Category "java"

How do you check if the Second Dimension of a 2D array is null?

Lets say for example you have a 2D Array field[60][]. How exactly can you check if the second part of the Array is null? Is there any way to do something simili

How to load video in OpenCV (Java)

I'm trying to load a video file in OpenCV Java, and have narrowed down my issue to the following code: import org.opencv.core.Core; import org.opencv.videoio.Vi

Getting conversion issue after migrating jackson-databind from 2.11.4 to 2.12.13.2

We have recently migrated jackson-databind from 3.11.4 to 3.12.13.2 version and springframework from 5.2.19.RELEASE to 5.2.22.RELEASE. after the migration we s

Getting 401 Unauthorized Even when the user is authenticated (Spring Security)

I am working on a simple project with 2 defined roles Admin and User,The admin role has authority to view users by thier usernames but when I login as an admin

When running Swing application with the Spring Framework, Unit tests do not work

I am developing a project through the spring framework. I am using JUnit to run unit tests, swing for the GUI. When I run the system, the GUI opens and I can ac

Why does getInterpreter().adaptivePredict in generated parser return incorrect value?

I am creating custom language (EO language) plugin for IntelliJ. I use antlr4 adapter and I've already generated parser and lexer. I am working on syntax highli

How to modify values inside JSON object in Java

I have a JSON Object which looks like this. { "result":{ "issue_date":"20-02-2011", "father/husband":"Chopra", "name":"Variyar", "i

How to solve: The minCompileSdk (31) specified in a dependency's AAR metadata

One or more issues found when checking AAR metadata values: The minCompileSdk (31) specified in a dependency's AAR metadata (META-INF/com/android/build/gradle/a

How to add customer header to Request?

I'm caught in a situation where I need to manually add a header(Authorization) to the request. The catch is that I only need to add that header to requests comi

How to update the password in Spring SecurityContext?

Using Spring Boot 2.6.4. Here is my SecurityConfig class: @Configuration public class SecurityConfig extends WebSecurityConfigurerAdapter { @Autowired Secur

Questions regarding CRUD operations

I am new to Android Studio and I am training to do a CRUD. When I try to insert a plant in the database, the message "Plant inserted" does not appear. Do you ha

Unrecognized VM option 'UseConcMarkSweepGC' when running sample project

I have followed the instructions for getting started with codenameone in IntelliJ, yet when I set up my first project, based on the sample app I get this error:

How to solve a partition problem using recursion only

I got a partition problem for which I need advice. I'm given a 1D array whose length is even. I need to write a boolean method to determine whether the array ca

Screen recorder app not detecting my screen size (width and height)

Source: here With the following segment of code all my Android devices record with a maximum width of 960 rather than the device width. val metrics = resour

Animation yoyo keep run when typing Edittext

when typing edit text yoyo animation keep run how to keep typing show animation Once ? text_send.addTextChangedListener(new TextWatcher() { @Ove

How to write Junit for clone method catch block

My respected java developer friends. i am trying test and cover the catch block of clone method. I have wasted one week but didn't find any solution to cover c

JAVA How do I read an input from the user containing math operators and numbers in one expression?

I have an assignment that asks me to create a Basic calculator, by taking an input from the user in one expressions as in "4 - 1" or "5 + 3", and I need to chec

Avoid timeout in Elasticsearch re-indexing in Java

Below code returned a timeout in client (Elasticsearch Client) when number of records are higher. CompletableFuture<BulkByScrollResponse> future = new Com

How to retrieve MySQL column content stored as mediumblob?

In a project that was passed on to me there is a MySQL database that is used to store lots of data. Each database has a table that contains lots of text snippet

Java font size changes from win 10 to win 11

We have a large Java application that looks fine with Win 10. When we test it on Win 11, about 1/2 the controls have a much smaller font than the others. This i