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…]

Like this post? Don’t forget to share it!

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…]

Like this post? Don’t forget to share it!

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…]

Like this post? Don’t forget to share it!

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…]

Like this post? Don’t forget to share it!

[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…]

Like this post? Don’t forget to share it!

Web Crawler using jsoup

In this tutorial we will be looking at creating a simple web crawler using jsoup. 1. Declare Maven Dependency In case you don’t know how to create a project, you can read about it create new maven project. 2.  Choose a wepage to crawl In this tutorial we will choose Hollinger NBA Player Statistics. So we … [Read more…]

Like this post? Don’t forget to share it!

Create your first Maven Project with eclipse

In this tutorial we are going to see how to create a simple maven project in eclipse. 1. Download Maven integration plugin Download the maven integration plugin from eclipse marketplace. The plugin makes it easier to create and work with maven projects in eclipse. In the below picture, you can selected the one which shows … [Read more…]

Like this post? Don’t forget to share it!

How to install Maven on Windows

In this tutorial we will show how to install the maven on windows. Installation tools Windows 10 Java 1.8 Maven 3 Steps for Installation 1. Download Maven Download the latest maven zip file from Apache Maven website.  For this tutorial we are going to download apache-maven-3.3.9-bin.zip. Let’s unzip this zip file to a folder maven C:\DeveloperTools\maven3 Here … [Read more…]

Like this post? Don’t forget to share it!

Java web crawler

Crawler Introduction

In this tutorial, you will learn how to crawl a website using java. Before we start to write java web crawler we will see how a simple web crawler is designed. What is a crawler? A web crawler is a program that browses the World Wide Web. Web crawlers are also known as spiders, bots and  automatic … [Read more…]

Like this post? Don’t forget to share it!