Calculate Number of Weekdays Between Two Dates in Java
1. Overview In this tutorial, we’ll look at two different methods in Java for calculating the number of weekdays between two dates. We’ll look at a readable version using Streams and a less readable...
View ArticleRotate a Vertex Around a Certain Point in Java
1. Overview When working with computer graphics and game development, the ability to rotate vertices around a certain point is a fundamental skill. In this quick tutorial, we’ll explore different...
View ArticleList vs. Set in @OneToMany JPA
1. Overview Spring JPA and Hibernate provide a powerful tool for seamless database communication. However, as clients delegate more control to the frameworks, including query generation, the result...
View ArticleHow to Determine if a String Contains Invalid Encoded Characters
1. Introduction Invalidly еncodеd charactеrs can lеad to various issues, including data corruption and sеcurity vulnеrabilitiеs. Hence, ensuring that the data is properly еncodеd when working with...
View ArticleDifference between ZoneOffset.UTC and ZoneId.of(“UTC”)
1. Introduction Date and time information must be processed accurately in Java, and this involves managing time zones. ZoneOffset.UTC and ZoneId.of(“UTC”) are two standard methods that we can use for...
View ArticleCalculating the Power of Any Number in Java Without Using Math pow() Method
1. Introduction Calculating the powеr of a numbеr is a fundamental opеration in mathеmatics. And, while Java provides the convenient Math.pow() mеthod, there may be instances where we prеfеr...
View ArticleImproving Test Coverage and Readability With Spock’s Data Pipes and Tables
1. Introduction Spock is a great framework for writing tests, especially regarding increasing test coverage. In this tutorial, we’ll explore Spock’s data pipes and how to improve our line and branch...
View ArticleEvent Externalization with Spring Modulith
1. Overview In this article, we’ll discuss the need to publish messages within a @Transactional block and the associated performance challenges, such as prolonged database connection times. To tackle...
View ArticleHow to Find the URL of a Service in Kubernetes
1. Overview Networking is an integral part of Kubernetes, with Service being one of its primitive networking objects. Kubernetes Service allows us to expose a network application to the external world....
View ArticleIntroduction to gRPC with Spring Boot
1. Overview gRPC is a high-performance, open-source RPC framework initially developed by Google. It helps to eliminate boilerplate code and connect polyglot services in and across data centers. The API...
View ArticleJava Weekly, Issue 526
1. Spring and Java >> How to use the Java CountDownLatch [vladmihalcea.com] How to use the Java CountDownLatch to write test cases that take concurrency into consideration. A good read as always....
View ArticleMonkey Patching in Java
1. Introduction In software development, we often need to adapt and enhance our systems’ existing functionalities. Sometimes, modifying the existing codebase may not be possible or may not be the most...
View ArticleSet an Environment Variable at Runtime in Java
1. Overview Java provides a simple way of interacting with environment variables. We can access them but cannot change them easily. However, in some cases, we need more control over the environment...
View ArticleConvert Gregorian to Hijri Date in Java
1. Overview The Gregorian and Hijri calendars represent two distinct systems for measuring time. In this tutorial, we’ll look at various approaches to converting a Gregorian Date to a Hijri Date. 2....
View ArticleCreating Unicode Character From Its Code Point Hex String
1. Overview Java’s support for Unicode makes it straightforward to work with characters from diverse languages and scripts In this tutorial, we’ll explore and learn how to obtain Unicode characters...
View ArticleN+1 Problem in Hibernate and Spring Data JPA
1. Overview Spring JPA and Hibernate provide a powerful tool for seamless database communication. However, because clients delegate more control to the frameworks, the resulting generated queries might...
View ArticleRegular Expression for Password Validation in Java
1. Introduction Regarding cybersecurity, password validation is essential in protecting users’ accounts. Moreover, using regular expressions (regex) in Java provides a powerful and dynamic way of...
View ArticleConvert Long to Date in Java
1. Overview When working with dates in Java, we often see date/time values expressed as long values that denote the number of days, seconds, or milliseconds since the epoch, January 1, 1970, 00:00:00...
View ArticleGetting Started With TimescaleDB
1. Overview In this article, we’ll explore TimescaleDB, an open-source time-series database built on top of PostgreSQL. We’ll delve into its features, examine its capabilities, and discuss how to...
View ArticlePrint a Java 2D Array
1. Overview In this tutorial, we’ll get familiar with some ways to print 2D arrays, along with their time and space complexity. 2. Common Ways to Print a 2D Array Java, a versatile programming...
View Article