How to rotate a matrix in place

I had a job interview once, and the guy dropped me a problem, I could not solve the problem. This is partially because I get over emotional whenever I'm expected to live code some algorithm, low self esteem probably, but anyway the problem was something like this You have a square matrix of NxN integers,... Continue Reading →

Using BitmapShader in Android

Recently I had to implement some custom UI controls for one of our customers, and some of these controls involved drawing Bitmaps with rounded corners. Android provides a handy approach to this problem, all the magic can be done with a little help from a class named BitmapShader. With BitmapShader you can draw bitmaps in... Continue Reading →

Merge Sort algorithm in Java

This is a very simple Java implementation of the popular merge sort algorithm. I decided to put this here because I needed to refresh my knowledge of sorting algorithms, problem is I could not find an easy-to-understand implementation online, so I decided to implement my own version and share it in case someone is struggling... Continue Reading →

Never synchronize on Java boxed primitives

This is another pitfall that can easily compromise a whole application if not understood, it involves thread safety, Java objects immutability and boxed primitives. Standard Java classes like Integer and Long are immutable. A class is said to be immutable if it is implemented in such a way that it's value cannot be changed once... Continue Reading →

Blog at

Up ↑