Finding Union and Intersection of 2 Large Lists


One of my colleague who works on performance tracking and tuning of applications asked for some helped around how to find the union and intersection of large lists. He works mostly on Python and Perl. Being a Java guy, I prepared a sample program for him to do this allowing to determine the size of… Continue reading Finding Union and Intersection of 2 Large Lists

Removing an element from a Collection while iterating over it


Can you remove an element from a collection while iterating over it? Answer: No, you can't. What kind of error will you get in Java if you make an attempt? Compile time or Runtime? Answer: Runtime. The details of the exception will be as below. Check this along with a sample program that I wrote.… Continue reading Removing an element from a Collection while iterating over it

Small Java Program To Convert Unicode Character Filled Sentences To Native or UTF-8 Character Filled Sentences


My colleague John asked for a tool from me last week so that he can finish the translations / localization works that he was doing. To solve it in a lazy way, I did some google around a bit but couldn’t figure out any easy tool that will convert Unicode characters \uxxxx to native locales.… Continue reading Small Java Program To Convert Unicode Character Filled Sentences To Native or UTF-8 Character Filled Sentences

Convert Http URL to Https URL – A Short Sample Code


Here is an example of how you convert an Http URL to a secured URL (Https). Here I am assuming the URL will be fully standard i.e. even the default port 80 will be written after colon as :80 and same for default https port :443. package com.google.test; /** * To compiple: javac -d .… Continue reading Convert Http URL to Https URL – A Short Sample Code