Category "java"

Android: Check if my app is allowed to run background activities

I have an app that runs a stopwatch service, and I run the service in the foreground. I have a notification showing the timer, that updates each second. The not

How do I randomly output string to multiple labels from array without repeats

I am trying to make a basketball playoff simulator. I have an array for east conference teams and west conference teams. I want to randomly output the team name

How to solve this leetcode problem of phone number pattern

package Code; import java.util.*; public class PhoneNumber { public static void main(String[] args) { int[] digits = { 2, 3 }; // int n = n

Spring Boot gradle build - invalid source release: 11

I am trying to build my spring boot project with this command: ./gradlew build But it continuously throws this error: 'Execution failed for task ':compileJava'

How can send custom error message after git push from local git server by using jgit api

I have been making a local git server by using jgit . Following is my code repository for local git server. https://github.com/masumcse1/mygitserver https://git

How to generalize the implementation the .thenby of excel in Java 8?

I have the following service class: public class SheetSorter { // sorts the sheet public static Sheet sortSheet(Sheet sheet) { List<String[]

Flink Job submission throws java.nio.file.NoSuchFileException while the file actually exists

I tried to submit a flink job that is already packaged in a JAR. Basically it consumes a kafka topic protected by SASL authentication, thus it requires a .jks f

Android UI broken when run

I am facing very strange problem, though I am beginner level on Android. after designed my layout file, when i run this android project by using physical device

MappingSqlQuery pass parameter

String sql = select * from APPLICATION_LABELS where DATE_MODIFIED > '"+ new SimpleDateFormat("dd-MMM-yy").format(lastUpdate) +"'"); MappingSqlQuery&

Springboot 2.6.7 mongodb dependency not working on @SpringBootTest

I've recently upgraded my springboot dependencies from version 2.5.4 to 2.6.7 here my gradle file v2.5.4 plugins { id 'org.springframework.boot' version '2.5.4

What is the difference between jconn4.jar and jconn42.jar?

Basically in the installation SDK of Sybase 16 we have jconn4.jar and jconn42.jar. What is the difference between jconn4.jar and jconn42.jar?

JPA cascading delete fails with custom delete method

I ran into an error with custom delete method in spring data jpa. Basically there's a bag which contains items, and when deleting the bag, all the items in it s

TestNG - Test fixture in the style of pytest

Writing Appium tests with TestNG. I'd like to pass the AppiumDriver to my test methods as an argument, so I don't have to remember to get it in every test. For

sum up an array in the special style of reduction | (i * 2)

I am currently sitting on a java problem I've found online. We have an array which has several thousand, if not millions, of entries. the goal is to efficiently

this application requires the latest version of arcore but installed

I'm using AR for my app. when I want to use AR I got this message: this application requires the latest version of arcore but installed but it installed: de

Compiling error while compiling two java files in the same package that use each other

Suppose we have two .java files in the same directory. Test.java: public class Test { public void func() { System.out.println("Hello World"); }

Display Jackson ObjectMapper configuration

Before I invest energy building a utility to interrogate an ObjectMapper to output its configuration via methods like: objectMapper.getRegisteredModuleIds(); ob

bindBindingsValuesProvidersByContext not found for reference aem unit test

Getting below error when I run a unit test class individually in intellij , if I do mvn clean install -PautoInstallPackage test class passing. java.lang.Runti

LeetCode 7: Reverse Integer | why does it work with a long but not with an int?

I was trying to solve this problem on LeetCode where you have to reverse an integer using a function. The constraint is that if the reversed number goes outside

How to Retrieve OAuth2AuthorizedClient in a request when using WebFlux

I have a back-end(Springboot) application that is connected to Azure AD and a front-end application that accesses it. In the front-end, I am requiring the user