Category "java"

How to use PDFTemplate of OpenPDF in PDFTable

I want to create a Header of a page which contains a table wit current and total number of pages. As far as I understand OpenPDF, I have to use the PageEventHel

Sobel edge implementation issue

For a class I have to implement the sobel edge detector in java, and do I did. But something isnt right, and after 3 hours trying to figure it out I still haven

Which version of Java do I need for this

I'm trying to use R and the R package rjdbc to connect to an Oracle database. Unfortunately, due to my company's strict IT department, every step of the proces

Creating a Trace Table

I need to write a trace table which is supposed to look like this picture To create the trace table I have to modify the following code with System.out.println

can't run jdk-8u202-windows-x64.exe ... nothing happens ... what do I do?

I'm supposed to install JDK and JRE 8. I tried running file I downloaded from Oracle: jdk-8u202-windows-x64.exe When I try running it, nothing happens, no error

Tuple to Json (with Java & EntityManager)

For a project, i needed to fetch records from a SQL database into a list of objects (using java for backend). The exchange between the backend and the frontend

How to run JUnit5 suite using the @Suite annotation

I'm trying to figure this out for over a year now but I can't run JUnit5 suites unless I use the JUnit4 @RunWith annotation, which brings me some other issues.

On Java 17 WindowBuilder was not able to show the GUI. .wbp-component.xml description for component javax.swing.JFrame

I'm using Eclipse 2021-9 version and already have Window builder installed. this error happens when I click the designer tab. WindowBuilder was not able to sho

File Selector (.txt)

I've been trying to get a code to list all the .txt files which are stored in a directory of a mobile phone. It's my first time with Android Studio, so it's har

How to use a Spring WebClient to parse specific data from an external API?

I'm attempting to use the Spring WebFlux WebClient to retrieve data from the openweathermap API. I've done this using a RestTemplate no problem, but want to und

MySQL - Fetch millions of data in chunk with constantly changing data

Below is the schema of my table A. CREATE TABLE A ( NAME VARCHAR(255), CREATED_AT DATETIME DEFAULT CURRENT_TIMESTAMP, UPDATED_AT DATETIME DEFA

Does the semantics of java volatile guarantee that wrong results will not appear? (Two threads write first and then read)

volatile x=y=0 Thread1 x=1 r1=y Thread2 y=1 r2=x r1 and r2 are local variables Question1: Is the result of r1==r2==0 illegal and does not appear? All stateme

Firestore Recyclerview item doesn't update when doing add, update, delete data

I have a problem when doing add, update, and delete with my firestore recyclerview. The problem is my recyclerview item updating automatically when doing add, u

Parse Huge xml file in spring boot and load to oracle

I have a requirement to load huge xml file having 1 million records and load to the oracle table. Each record has starting and end tags as and there are many a

How to distinguish regular organizations from non-profit ones with Google API?

We have an app that's getting license info about our clients' Google organizations. We've been using SKU IDs before but now we've faced with non-profit organiza

How to write test cases for Service layer using Junit 4 and mockito

My Repository layer is returning list object, But in my service layer i am filtering out all other and return a single Object. when i try to create test cases i

Sort a Map<Integer, Map<Integer, Integer>> by value length

I want to sort a Map by value length. For example, I have this code: public static void main(String[] args) { Map<Integer, Map<Integer, Integer>>

Getting exception when trying to add entry to PROTOSTREAM based cache in Wildfly

I want to use an Infinispan cache with a PROTOSTREAM marshaller in my app running on Wildfly 26.0.1. I found the following post on StackOverflow, where both @My

How i can duplicate a record with your dependents in spring boot

In my use case I need to create an endpoint that duplicates a record and its dependents by copying the data from the current record to a new record creating new

How to add eye symbol in JPasswordField?

How can I add an eye symbol in my java application using java swing?