Towers of Hanoi recursive version
Towers of Hanoi is a well known puzzle, very often used to teach recursion. In this post we show how to solve the puzzle recursively. The rules There are three towers/pegs/rods with a number of...
Towers of Hanoi is a well known puzzle, very often used to teach recursion. In this post we show how to solve the puzzle recursively. The rules There are three towers/pegs/rods with a number of...
HackerRank HackerRank is currently my favourite programming site. There is a lot of exercises and they are split in different categories - Algorithms, Java, Functional programming, Databases, ...
A prime number is a natural number with only two divisors: 1 and itself. In this post we’re going to show how to find prime numbers using Sieve of Eratosthenes and explain how it works. How it w...
BeanCurrentlyInCreationException is thrown by Spring Framework when it meets circular reference while setting up application context. Here we show what is it and how to fix it! Beans with circul...
Selection Sort is an intuitive sorting algorithm. It’s not the fastest algorithm, but a good starting point when learning about sorting. Also, due to its simplicity, it can be used to verify implem...
In Clojure the for loop looks quite differently than in most common languages. Here we’re going to show how to do some interesting things with it and how it relates to Java versions. Clojure for...
Binary Search is the fastest algorithm for finding an element in a sorted list. Also it’s easy to implement and very useful. Let’s see how it works and implement! How it works The procedure is ...
This is the form of Dependency Injection that requires almost no boilerplate code, contrary to setter or constructor injections. Let’s see how it works! Spring bean to inject as dependency To s...
This is one of the simplest and cleanest types of Dependency Injection in the Spring Framework. In this post we show how to use it with help of Spring annotations. Spring bean to inject as depen...
In this post we’re going to show how to use Clojure proxy to mock Java classes and provide own functionality for Java methods. Proxy class with no-arg constructor Calls superclass default const...