Guide to ParameterMessageInterpolator
1. Overview One of the features of Java JSR 380 is allowing expressions while interpolating the validation messages with parameters. When we use Hibernate Validator, there is a requirement that we need...
View ArticleScanner nextLine() Method
1. Overview In this tutorial, we'll briefly look at the nextLine() method of java.util.Scanner class. Furthermore, we'll see an example of its usage. 2. Scanner.nextLine() The nextLine() method of the...
View ArticleHibernate Error “Not all named parameters have been set”
1. Introduction When working with Hibernate, we can use named parameters to safely pass data into an SQL query. We assign values to query parameters at runtime to make them dynamic. More importantly,...
View ArticleA Guide to Spring’s Open Session In View
1. Overview Session per request is a transactional pattern to tie the persistence session and request life-cycles together. Not surprisingly, Spring comes with its own implementation of this pattern,...
View ArticleReading HttpServletRequest Multiple Times in Spring
1. Introduction In this tutorial, we'll learn how to read the body from the HttpServletRequest multiple times using Spring. HttpServletRequest is an interface which exposes getInputStream() method to...
View ArticleGuide to Unix Swap
1. Introduction In this tutorial, we'll introduce the Unix swap space, its advantages, and a few simple commands to manage it. 2. The Unix Swap Space Swap or paging space is basically a portion of the...
View ArticleJava Weekly, Issue 306
1. Spring and Java >> Azure Spring Cloud Is Now In Public Preview [spring.io] A quick look at the Azure runtime platform for Spring Boot and Spring Cloud, developed jointly by Microsoft and...
View ArticleParsing Command-Line Parameters with JCommander
1. Overview In this tutorial, we'll learn how to use JCommander to parse command-line parameters. We'll explore several of its features as we build a simple command-line application. 2. Why JCommander?...
View ArticleGuide to Linux jq Command for JSON processing
1. Overview JSON is a widely used structured data format typically used in most modern APIs and data services. It's particularly popular in web applications due to its lightweight nature and...
View ArticleHow to Determine if a Binary Tree is Balanced
1. Overview Trees are one of the most important data structures in computer science. We're usually interested in a balanced tree, because of its valuable properties. Their structure allows performing...
View ArticleFetchMode in Spring Data JPA
1. Introduction In this short tutorial, we’ll take a look at different FetchMode values we can use in the @org.hibernate.annotations.Fetch annotation. 2. Setting up the Example As an example, we'll use...
View ArticleFind the Smallest Missing Integer in an Array
1. Overview In this tutorial, we'll see different algorithms allowing us to find the smallest missing positive integer in an array. First, we'll go through the explanation of the problem. After that,...
View ArticleThe strictfp Keyword in Java
1. Introduction By default, the floating-point computations in Java are platform-dependent. And so, the floating-point outcome's precision depends on the hardware in-use. In this tutorial, we'll learn...
View ArticleEncrypting and Decrypting Files in Linux
1. Overview Encryption is the process of encoding data with the intent of keeping it safe from unauthorized access. In this quick tutorial, we'll learn how to encrypt and decrypt files in Linux systems...
View ArticleJava Weekly, Issue 307
1. Spring and Java >> Static Data with Spring Boot [reflectoring.io] A good tutorial on externalizing application configuration with @ConfigurationProperties. >> The best way to fix the...
View ArticleDetermine the Execution Time of JUnit Tests
1. Overview Our builds often run a lot of automated test cases for our project. These include unit and integration tests. If the execution of the test suite takes a long time, we may wish to optimize...
View ArticleWhat is a POJO Class?
1. Overview In this short tutorial, we'll investigate the definition of “Plain Old Java Object” or POJO for short. We'll look at how a POJO compares to a JavaBean, and how turning our POJOs into...
View ArticleIs It a Bad Practice to Catch Throwable?
1. Overview In this tutorial, we'll look at the implications of catching Throwable. 2. The Throwable Class In the Java documentation, the Throwable class is defined as “the super-class of all errors...
View ArticleIntroduction to Supervised, Semi-supervised, Unsupervised and Reinforcement...
1. Overview Machine learning consists of applying mathematical and statistical approaches to get machines to learn from data. It consists of four big families of techniques: Supervised learning...
View ArticleGuide to Useful File Manipulation Commands
1. Overview In Linux, everything is a file. So, file manipulations – creating a file, removing a directory, etc. – are very common operations in Linux. In this tutorial, let's see some useful file...
View Article