Consider implementating compareTo and equals method

Java

Consider implementating compareTo and equals method Unlike the other methods the compareTo method is not declared in Object. Rather, it is the sole method in the Comparable interface. It is similar in character to Object’s equals method, except that it permits order comparisons in addition to simple equality comparisons, and it is generic. By implementing Comparable, a class indicates that ... Read More »

jQuery detecting scroll- scroll reaching to the bottom of page

jQuery detecting scroll- scroll reaching to the bottom of page Detecting scroll and executing login based on scrolling has important significance in web development like implementing pagination, where more data gets loaded when user scrolls near the bottom of page. So, first basic question arises as to how to detect scroll. window.onscroll = function(ev) { //execute your logic here } ... Read More »

How to create an asynchronous HTTP call in JAVA

Java

This tutorial explains How to create an asynchronous HTTP call in JAVA. What is asynchronous HTTP call? Asynchronous HTTP Request call allows us to process a HTTP call using non-blocking I/O in seperate thread. The main use for Asynchronous HTTP call is where the client is calling a server with a delayed response, which may results in client blocking the ... Read More »

SSL handshake alert: unrecognized_name Exception

Java

This tutorial explains how to handle SSL handshake alert: unrecognized_name exception while calling an URL over SSL/https . When I tried to connect a web-server over SSL, I was getting the below error continuously. This happened with JDK1.7 and above. Below is the sample Java programme which I was running. Issue : private static String makeSSLCall(final String URL) throws Exception ... Read More »

Using strict mode to write secure Javascript

Using strict mode to write secure Javascript We know that doing read operation from undeclared variable gives error in Javascript, whereas doing write operation to an undeclared variable is fine and the variable gets the global scope (I will discuss this in a different post as to why this happens in Javascript). Now, lets take stock of a situation in ... Read More »