Prerequisite: Algorithm , Sorting , Asymptotic complexity(Time & Space Complexity) Introduction : If someone gives you a list to sort and we are not aware of various sorting algorithm, most of us will write the below code, Code: public int[] doSelectionSort(int[] ip) { int temp = 0; for(int i=0;i<ip.length-1;i++) { temp = i; for(int j=i+1;j<ip.length;j++)… Continue reading Selection Sort
Design Patterns
A programmer may write a better program to solve a problem. He may consider the memory management, Asympotatic complexity. An Object oriented programmer will see everything as an object. Once he got the requirements, he can easily see all the objects or entities involved in… Continue reading Design Patterns
Insertion sort
Prerequisite: Algorithm, Sorting, Asymptotic complexity(time complexity, space complexity) Introduction: Insertion sort will take elements from 0 to n and compare & swap it with the left part of the array which is already sorted among the elements, until it find the right place where the element has to be. You may be clear, when look… Continue reading Insertion sort
JMS
(The main objective of this article is to identify the places where JMS is needed) JMS(Java messaging service) is a widely used technology. It has two different mechanism called Queue and Topic(publish-subscribe). A queue may have multiple listeners. But when u push a message, it will be picked up by only one listener whereas in topic, message will… Continue reading JMS
Bubble Sort
Prerequisite: Algorithm, Sorting, Asymptotic complexity(time complexity, space complexity) Introduction: Bubble sort may look same as insertion sort, because the outcome of the bubble sort looks same as insertion sort. In case of sorting in ascending order, Insertion sort will keep taking out the min value at end of the each iteration, whereas bubble sort will take out… Continue reading Bubble Sort
Quick sort
Introduction Pivot, Divide and Conquer, Wall and Randomized Algorithms are the four terminologies we should know when come to quick sort. Pivot value selection Randomly select an element from the array. Here, we are choosing the last element as a pivot. Wall The left side of the wall will always have values that are smaller… Continue reading Quick sort
JQuery ajax GET request call
Below is the example of an jQuery ajax call. It’s making a GET request. <head> <script> $( document ).ready(function() { $( “#mainMenuArea” ).load( “html/mainMenu.html” ); $.ajax({url: “http://localhost:8080/services/usersproducts/allproduct”, success: function(result){ var productArray = result.products $( “#div_appArea” ).append(“<table>”); $( “#div_appArea” ).append(“<tr><th>Mobile No<th><th>Possession Status<th>”); $( “#div_appArea” ).append(“<th>Company Name<th><th>Recommended<th></tr>”); $( “#div_appArea” ).append(“<th>User Product Id<th><th>Recommended<th></tr>”); for(var i in productArray){ $(… Continue reading JQuery ajax GET request call
Immutable objects
An immutable object is an object whose state cannot be modified after its creation. Once object is created, you can not change the properties of it. Immutable object is sort of design pattern. We have to follow certain rules or patterns to create immutable objects. In java, once you initialized an object , you’ll never… Continue reading Immutable objects
JBOSS Fuse application or OSGI Bundle example
When we read about OSGI, we get confused by the various terminologies like modular application, dynamic components, microservices, libraries, reusable components, OSGI bundle, features and etc. So here, in this blog, we are not gonna care about it. We’ll just see an simple application which can be deployed in JBOSS Fuse. What are we gonna… Continue reading JBOSS Fuse application or OSGI Bundle example
JMS Implementation
Java Messaging Service API to send messages between different components. We can see the definition of it in many places.So we’re skipping to define it. We are just going to see the various implementations of sending and receiving messages. As we know, we have two JMS mechanisms, Queue and Topic. Now we will just explore… Continue reading JMS Implementation