Category "java"

ESC / POS - How to print images with secondary font?

I am using this sample for printing images (with the correct 8 bits shift): Print bitmap full page width in thermal dot printer using ESC/POS in java When I s

How to get value from Kafka JSON message [duplicate]

I use debizium to stream postgresql data to Kafka, and use Java to subscribe Kafka topic. I receive Kafka message and get a JSON string, but

Logging in AWS Lambda with slf4j

I am using a lambda function and writing it in Java. I was looking up logging for Lambda functions when I read the docs and they support log4j -

Choco-Solver: Is there a way to know how many times a constraint is broken during the solving process?

My models is inefficient and taking too long to find valid solutions so I think knowing how many times the constraints are being broken would be useful for test

Apache poi get table from text box

I'm using apache poi for iteration table in docx file. All works fine but if table in text box, my code don't see table - table.size() = 0 XWPFDocument doc =

How to fix incorrect position I get when dispatching an update to ListUpdateCallback using DiffUtil

I have an Android application where the user can modify multiple String items using EditText at the same time, so I need to figure out what have changed in orde

What is ' :: ' double colon in Java? When should I use it? [duplicate]

I'm just a beginner in Java. When should I use double colon? import*; class GFG { public static void main(String[] arg

Converting RecyclerView to ViewPager / PagerAdapter

Background - New to Android, but pretty nifty with moving layouts around, understanding Java, Kotlin and XML. However this task seems to be way above my head.

How to return the key that I wrote if the key was not found

Let's say we have a HashMap named hsm, and I want the value of hsm.get(invalidKey). Because the invalidKey has no mapping it will return for me a null value, bu

Complex aggregation

I have data in a topic that needs to be counted at multiple levels and all code and articles only mention the word count example. An example of the data would

Field mailSender .. required a bean of type 'org.springframework.mail.javamail.JavaMailSender' that could not be found

I'm currently trying to build an email registration process with an email confirmation. I use the JavaMailSender for this. Unfortunately, I am currently getting

Asserting Rest Assured response with Json Unit

I'm currently using rest assured and Json-unit to assert a local json file against the requested rest assured response. I currently have a before class method

Armstrong number in Java

This is my code, it is not producing any output. As I have started my loop from 100 so according to the logic used I should get answer as 153. But nothing is co

int cannot be converted to int []

new to programming here and i keep getting the error message, incompatible types, int cannot be converted to int [], the question is to add R1 & R2 together

How to use AsmVisitorWrapper to visit an array inside an annotation and merge its content with another array

(repository with an example of what I'm trying to do is here) It's my first time using ByteBuddy and I've found myself struggling to merge the contents of two @

exec-maven-plugin: Can I run exec:exec goal without first running the toolchains:toolchain goal?

I've inherited an application that only compiles and runs in Java 1.8. Because I don't want to make Java 1.8 the primary jvm on my machine, I felt that the best

What is the type of a Java empty Optional?

So the thing is I was checking Optional Java class and I noticed this in the public static<T> Optional<T> empty() doc: @param <T> The type of

Set different timezone for each deployable in tomcat

I have a web project which creates 2 separate deployables(.war files). I deployed both in single tomcat, and when I change the JVM timezone in a beanFactoryPost

Netty not working with Java 17 modular JDK

Split package issue for Netty with JDK 17. It is unmodularlized jar which I am trying to include in my modularized project. I added a then incl

How to deserialize BigDecimal value received from kafka broker through debezium CDC mechanism?

I have a couple of microservices developed using spring boot and each has its own Postgres database. These microservices exchange data with a CDC mechanism prov