Programming tips

Groovy: static propertyMissing and methodMissing methods - limitations and possible issues

Some time ago I have found another interesting Groovy related question on Stack Overflow. This time someone was asking about static variants of popular propertyMissing and methodMissing methods. The official Groovy documentation does not explain how to do it - it only explains how to add any static method through metaClass. Today we are going to learn how to define these methods in two different ways.

Read more →

Programming tips

Count frequency of a digit in a factorial of number using Haskell

Some time ago I was interviewed to one of the Java-based projects and I was asked to solve this pretty interesting puzzle. The question was "how to count frequency of a digit in a factorial of number, let’s say 1000". I tried to solve it using Java 8 Stream API, but I guess you see how bad decision it was. Problems like that can be easily solved with pure functional languages and today we are going to find out how to solve this puzzle with Haskell.

Read more →