Intro to the Apache Commons CLI
1. Overview In this tutorial, we’ll explore the Java Apache Commons CLI library. It’s a framework that empowers developers by helping them build the command line interface (CLI) of existing software...
View ArticleJava Dates Tutorial
/*! elementor - v3.19.0 - 28-02-2024 */ .elementor-widget-image{text-align:center}.elementor-widget-image a{display:inline-block}.elementor-widget-image a...
View ArticleCheck if a Number Is a Happy Number in Java
1. Overview We often solve mathematical problems in programming. Determining whether a number is a happy number is an interesting task. In this tutorial, we’ll understand how a happy number is defined...
View ArticleIntroduction to Redpanda
1. Overview In this tutorial, we’ll discuss a potent event streaming platform called Redpanda. It’s a competition to the de facto industry streaming platform Kafka and, interestingly, it’s also...
View ArticleHow to Autowire a Spring Bean in a Servlet Filter
1. Introduction Servlet filters offer a powerful mechanism for intercepting and manipulating incoming requests. However, accessing Spring-managed beans within these filters can pose a challenge. In...
View ArticleCapturing Method Arguments When Running Spock Tests
1. Introduction When we test our code, we sometimes want to capture the parameters passed to our method. In this tutorial, we’ll learn how to capture arguments in a Spock test using Stubs, Mocks, and...
View ArticleRGB Representation as an Integer in Java
1. Introduction The RGB color model is widely used in various applications and devices because it aligns well with how electronic displays work. ‘R’ in RGB stands for Red, ‘G’ for Green, and ‘B’ for...
View ArticleJava Weekly, Issue 533
1. Spring and Java >> Function Calling in Java and Spring AI using the latest Mistral AI API [spring.io] Integrating LLM with external tools: exploring advanced function calling in Java and...
View ArticleParsing HTML Table in Java With Jsoup
1. Overview Jsoup is an open-source library used to scrape HTML pages. It provides an API for data parsing, extraction, and manipulation using DOM API methods. In this article, we will see how to parse...
View ArticleRefresh and Fetch an Entity After Save in JPA
1. Introduction Java Persistence API (JPA) acts as a bridge between Java objects and relational databases, allowing us to persist and retrieve data seamlessly. In this tutorial, we’ll explore various...
View ArticleCommit Offsets in Kafka
1. Overview In Kafka, consumers read messages from partitions. While reading messages, there are some concerns to consider, like determining which messages to read from the partitions or, preventing...
View ArticleFind the Largest Number Possible After Removing k Digits of a Number
1. Overview In this tutorial, we’ll see different algorithms allowing us to find the largest number possible after removing the k digits of a number. First, we’ll explain the problem. Then, we’ll see...
View ArticleCalculate Percentiles in Java
1. Overview When it comes to analyzing data in Java, calculating percentiles is a fundamental task in understanding the statistical distribution and characteristics of a numeric dataset. In this...
View ArticleAdding Elements to a Collection During Iteration
1. Introduction Iterating over a List is a common operation in Java, but adding elements to it while iterating requires careful consideration to avoid exceptions and ensure the correctness of the code....
View ArticleRepresentation of Integers at a Bit Level in Java
1. Overview Java stores numbers in memory as binary. Understanding how integers are represented at the bit level can help us with certain operations. In this tutorial, we’ll look at some of the...
View ArticleQuerydsl vs. JPA Criteria
1. Overview Querydsl and JPA Criteria are popular frameworks for constructing type-safe queries in Java. They both provide ways to express queries statically typed, making it easier to write efficient...
View ArticleDynamically Managing Kafka Listeners in Spring Boot
1. Overview In today’s event-driven architectures, managing data streams effectively is essential. Apache Kafka is a popular choice for this, but integrating it into our applications has its...
View ArticleChecking if a Date Object Equals Yesterday
1. Introduction When working with date and time data in Java applications, it’s often crucial to compare dates for various purposes, such as scheduling tasks, reminders, or reporting. One common...
View ArticleImplement Two-Level Cache With Spring
1. Overview Caching data means our applications don’t have to access a slower storage layer, thereby improving their performance and responsiveness. We can implement caching using any in-memory...
View ArticleCheck if a Given Time Lies Between Two Times Regardless of Date
1. Introduction In Java, there are numerous ways to determine if a particular time lies within the two times without considering dates. In this tutorial, we’ll look at several possible ways to achieve...
View Article