Updating from spring 3.1 to spring 4.3

Recently I have been working on an application that was using Java 7 and Spring 3.1.1.  And we upgraded from Java 7 to Java 8.  And once we had Java 8 installed, all the spring beans seemed to work fine with spring 3.1.1. But once we started to use java 8 features in Spring beans, … Read more

Increasing Subsequences – Leetcode

Given an integer array, your task is to find all the different possible increasing subsequences of the given array, and the length of an increasing subsequence should be at least 2 Example Input: [4, 6, 7, 7] Output:  [[4, 6], [4, 6, 7], [4, 6, 7, 7], [4, 7], [4, 7, 7], [6, 7], [6, … Read more

Target Sum – Leetcode

Problem You are given a list of non-negative integers, a1, a2, …, an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose one from + and – as its new symbol. Find out how many ways to assign symbols to make sum of integers equal to … Read more

Largest Palindrome Product – Leetcode

Problem Find the largest palindrome made from the product of two n-digit numbers. Since the result could be very large, you should return the largest palindrome mod 1337. Example: Input: 3  ,  Output: 987 Explanation: 99 x 91 = 9009, 9009 % 1337 = 987 Note:  The range of n is [1,8]. Solution And if … Read more

why string is immutable in java

What is immutable String? String class in java cannot be modified once created.  So let us create two string objects below So once we created the above two strings, the values of these two strings cannot be modified as String class doesn’t provide any method that can allow to modify the value of a String. … Read more

calculate the Hamming distance for two given integers

Problem The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calculate the Hamming distance. Example: Input: x = 8, y = 1 Output: 2 Explanation: number    bits 8 1 0 0 0 1 0 0 0 1 Solution With … Read more

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize= ; support was removed in 8.0

Error Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=m; support was removed in 8.0 Since When After migrating to Java 8 Solution Remove  MaxPermSize  as this is not needed anymore. You should see if you want to define MaxMetaspaceSize -XX:MaxMetaspaceSize=<metaspace size>[g|m|k] By default Metaspace in Java VM 8 is not limited, but for system stability it … Read more

Redirect root domain to subdmain in blogger

If you have already followed all the instructions and pointed your subdomain to blogger and have your subdomain working fine.But now you want your root domain not to show a “page not found”. You can redirect your root domain to the subdomain pointing to blogger.  It is very easy. 1. Go to settings > Basic … Read more

[WARNING] schema_reference: Failed to read schema document ‘?xsd=1’, because ‘http’ access is not allowed due to restriction set by the accessExternalSchema property , java 8

We are using web services in our project. And once we moved from Java 1.7 to Java 1.8, we started to get the error while building the web service client. Easy Solution And the solution to this issue was to create a a file jaxp.properties in the /pathto/jdk1.8.0_111/jre/lib folder. And the contents of the file … Read more