July 09, 2015 by Sandeep Bhardwaj | Tags: Java Concurrency
DelayQueueExample.java import java.util.concurrent.BlockingQueue; import java.util.concurrent.DelayQueue; import java.util.concurrent.Delayed; import java.util.concurrent.TimeUnit; public class DelayQueueExample { public static void main(String[] args) { BlockingQueue<DelayedElement>...
Read moreMarch 31, 2014 by Sandeep Bhardwaj | Tags: Tips & Tricks
Easy steps to delete skype chat history off your mobiles. Sign out of skype from your mobile. Sign into skype on your computer. Go to tools-options- privacy settings. Click on clear history. Sign out of skype from your computer. On your mobile go to settings-applications manager-sky...
Read moreApril 19, 2013 by Sandeep Bhardwaj | Tags: Java Collection
List list; if (collection instanceof List) { list = (List)collection; } else { list = new ArrayList(collection); } Generic way (java 1.5<=) public <E> List<E> collectionToList(Collection<E> collection) { List<E> list; if (collection i...
Read moreMay 11, 2012 by Sandeep Bhardwaj | Tags: Java Collection
Removing duplicate items from a list is pretty simple in java just convert the list to java.util.Set it will automatically remove the duplicate items and create a set for you. Syntax Set<E> alphaSet = new HashSet<E>(<your List>); Example import java.util.ArrayList; imp...
Read moreApril 27, 2012 by Sandeep Bhardwaj | Tags: Liferay
If you wants to include a custom jsp contains a common functionality to all your portlets then follow the below steps. Create a Liferay hook » Custom Jsps and create a jsp under /htm/common/.jsp Now simply use the below code for include the jsp on portlet pages. <%@ taglib uri="http:/...
Read more