ThreadPoolExecutor map method with multiple parameters

ThreadPoolExeuctor from concurrent.futures package in Python 3 is very useful for executing a task (function) with a set of data (parameter) concurrently and this post lists examples on how to pass MULTIPLE parameters to the task being executed.

Floating horizontal scrollbar

How to use a jquery plugin to implement floating horizontal scrollbar, which is especially useful for single page application where partial content of the page (i.g. table of data) are large and dynamically updated and you don’t want to make use of the browser scrollbar for scrolling the partial content.

Java POI excel merge cell and style

Quick code example on how to merge cells with POI and apply cell style to the merged cell.

Java lazy initialization singleton instance pattern

Java lazy initialization singleton instance pattern.

Java sort arrays in descending order

Java sort arrays in descending order.

Java bubble sort implementation

Java bubble sort implementation.

Java binary search implementation

Java binary search implementation.

Java stream distinct by property

Java 8 stream has a distinct() method which could be used to filter out a list of distinct objects, but the distinctness of that method is based on Object.equals(Object). What if you want to filter a list of objects based on any property (field) of the object? The StreamEx library comes as an elegant solution.

Python decorator with class

Python decorators are usually created with function, see another related post, but this post also shows an example on how to create decorators with class.

Spring resttemplate post json with utf-8

In Spring framework RestTemplate is very useful in terms of sending various http requests to RESTful resources and this post shows simple examples on how to set Content-Type, Accept headers, as well as the content encoding, which is especially important when requesting with non-ascii (e.g. CJK languages) data.