Generate Combinations in Java 1. Introduction In this tutorial, we’ll discuss the solution of the k-combinations problem in Java. First, we’ll discuss and implement both recursive and iterative algorithms to generate all combinations of a given size. Then we’ll review solutions using common Java libraries. 2. Combinations Overview Simply put,… Continue Reading java-combinations-algorithm

The Difference Between map() and flatMap() 1. Overview map() and flatMap() APIs stem from functional languages. In Java 8, you can find them in Optional, Stream and in CompletableFuture (although under slightly different name). Streams represent a sequence of objects, whereas optionals are classes that represent a value that can… Continue Reading java-difference-map-and-flatmap

SLF4J Warning: Class Path Contains Multiple SLF4J Bindings 1. Overview When we use SLF4J in our applications, we sometimes see a warning message about multiple bindings in the classpath printed to the console. In this tutorial, we’ll try to understand why we see this message and how to resolve it.… Continue Reading slf4j-classpath-multiple-bindings

Spring Security Form Login 1. Introduction This article is going to focus on Login with Spring Security. We’re going to build on top of the simple previous Spring MVC example, as that’s a necessary part of setting up the web application along with the login mechanism. Further reading: Spring Security… Continue Reading spring-security-login

Geospatial Support in ElasticSearch 1. Introduction Elasticsearch is best known for its full-text search capabilities but it also features full geospatial support. We can find more about setting up Elasticsearch and getting started in this previous article. Let’s take a look on to how we can save geo-data in Elasticsearch… Continue Reading elasticsearch-geo-spatial

Extra Login Fields with Spring Security 1. Introduction In this article, we’ll implement a custom authentication scenario with Spring Security by adding an extra field to the standard login form. We’re going to focus on 2 different approaches, to show the versatility of the framework and the flexible ways we… Continue Reading spring-security-extra-login-fields