Home
Farenda
Cancel

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...

Top 10 sites to practice programming

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, Dat...

Prime numbers - Sieve of Eratosthenes in Java

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...

Spring Circular Reference - BeanCurrentlyInCreationException

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 in Java

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...

Clojure for loop

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 algorithm in Java

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 ...

Spring Field Injection

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...

Spring Constructor Injection

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...

How to mock Java classes in Clojure

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...