Monthly Archive: April 2017

Reverse sort a map by its values 0

Reverse sort a map by its values

In modern world there are many better ways of reversing a HashMap on the basis of the values. This code belongs to old league but you might find it useful   public static Map...

Making round corners of an Image in Java 0

Making round corners of an Image in Java

An image looks better with round corners and luckily can be easily done using java api. Here is the code : public static BufferedImage makeRoundedCorner(BufferedImage image, int r) { BufferedImage output = new BufferedImage(r,...

How does JIT (just in time) compiler works 0

How does JIT (just in time) compiler works

JIT compilation does require processor time and memory usage. When the JVM first starts up,thousands of methods are called. Compiling all of these methods can significantly affect startup time,even if the program eventually achieves...

Pros and cons of various caching engines 0

Pros and cons of various caching engines

Pros and cons of various caching engines Memcached Pros Has clients in all major languages. Customers can wrte their own clients in any lnaguage Easy to setup in a distributed environment Does not tie...

Converting Set to List using Streams 0

Converting Set to List using Streams

Stream APIs were added in Java 8. You can read more about streams here : Java 8 Streams With single line of code we can convert a set into a list. Other wise we...