Category "java"

How to find Z highest subset Sums from the array of N elements

I have an array of numbers, now I want to find all possible subset sums and get the top z elements in it. Example: Input : arr[] = {2, 4, 5}, z = 3 SubsetSums

Canvas center two different paints drawText align with each other

First of all really sorry for my English. I am new to android studio. I want to center two different canvas drawText align with each other. Currently, I just se

Accessing a JSON array inside of a JSON object in Android Studio

I am testing my knowledge and ability with android studio and API's, I have been using volley and I have come across a little problem. The API I have been using

How to rename xs:simpleType during jaxb XJC generation?

I'm using jaxb and xjc to autogenerate java classes from xsd files. Problem: I have two files that show the same simpleType name. And thus get a compilation err

VS code - SonarLint:Simplify the expression produce invalid syntax

I'm getting S1125 for a code smell: MyVO vo; public boolean is() { return vo == null ? false : vo.is(); } Remove the unnecessary boolean literal.sonarlint

VS code - SonarLint:Simplify the expression produce invalid syntax

I'm getting S1125 for a code smell: MyVO vo; public boolean is() { return vo == null ? false : vo.is(); } Remove the unnecessary boolean literal.sonarlint

Add 2 or more constructors in kotlin

how to add 2 or more constructors ?? i know the use of data class in kotlin, but i am not getting what exactly this keyword is in kotlin and why we have to put

Why is IntelliJ not recognising stuff as I type? BlueJ is easily recognising the same code?

I'm an absolute beginner. I learnt a bit of Java in my highschool and we were using BlueJ back then. I wanted to brush up so I started with the simplest code: p

log4j2 logs are not getting logged in auto generated log file under logs folder

Here i am trying to save my logs generated during execution in logs file i have used lo4j2.properties with Testng listener to save my logs , my log4j2.propertie

Upgraded Spring: org.springframework.web.client.UnknownContentTypeException: Could not extract response

So I upgraded Spring from 2.1.15 to 2.2.8 I have @SpringBootTests where I make a rest template and make requests to localhost. Full error is org.springframework

OpenCV Android React Native unknown exception on some functions in imgproc module

I'm trying to use OpenCV in an mobile app written with React Native. For now i only focus on the Android part. I use the official OpenCV for Android release. I

How to select User certificates from edge browser using Playwright with Java

How to select User certificates from edge browser using Playwright with Java. We have different certificate added in browser for each role and we need to select

How to validate phonenumber in Docusign Phone authentication

I have implemented Docusign Remote Signing Process and added phone authentication by setting identity verification for signer signer.setIdentityVerification(rec

Java ERROR: package X is declared in the unnamed module, but module Y does not read it

I am trying to make my javafx project to create an Excel file. One of the first steps for it would be XSSFWorkbook workbook = new XSSFWorkbook(); for which to w

Spring Boot Exception evaluating SpringEL expression

ERROR 4904 --- [nio-8080-exec-1] org.thymeleaf.TemplateEngine : [THYMELEAF][http-nio-8080-exec-1] Exception processing template "index": An error happene

searching in arraylist always not found

no matter what I use indexof() or contains or .equals() changing everything to uppercase or to lowercase It always return false and not found can someone please

I'm trying to add a jsp page in my Spring Boot Aplication. My problem is that every time I try to go to that page I have this:

Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. Tue Apr 26 16:10:15 IRDT 2022 There was an unex

About the use of JPA ElementCollection

I used the ElementCollection annotation on a List object, @ElementCollection(fetch = FetchType.EAGER) @CollectionTable( name = "a", joinC

MacOs Catalina 10.15.5 crashes and report gives no clue

I recently updated my MacOs from Catalina 10.15.4 to 10.15.5 (19F101). I use Android Studio as IDE to develop Android apps using Java programming language. So I

Adding a light to Sceneform node has no effect

I'm following the google developers guide on adding Light to a Node in SceneView: https://developers.google.com/sceneform/develop/build-scene Light spotLightYel