Big O Notation

Definition The big o notation is simplified analysis of an algorithm’s efficiency. It is also known as Landau’s Symbol. Big O Notation is used in Computer Science and Mathematics to describe the Asymptotic behavior of functions. Let’s study some of Big O Notation characteristics; Big O Notation enlightens about the complexity of a target algorithm

Binary Tree

Binary Tree Definition Binary tree is a non-linear data structure that is composed of two nodes at most. This is where its name comes from. However, it is not necessarily for a Binary Tree to have maximum two nodes. However, it can be even zero. Furthermore, there is also an implementation of Binary Tree called

Creating a Java keystore

create a keystore file $JAVA_HOME/bin/keytool -genkey -alias tugrulaslan.net -keyalg RSA -keystore keystore.jks -keysize 2048 Generate a certificate signing request (CSR) for an existing Java keystore $JAVA_HOME/bin/keytool -certreq -alias tugrulaslan.net -keysto re keystore.jks -file tugrulaslan.net.csr Import a root or intermediate CA certificate to an existing Java keystore $JAVA_HOME/bin/keytool -import -trustcacerts -alias root -file intermediate.crt -keystore keystore.jks

Bubble Sort

Description Given an array the Bubble sort will sort them in the increasing order, it repeatedly compares adjacent items. If the item on the left is greater, it swaps it with the right item. Basically the greater items are shifted towards the right direction. Furthermore, the second iteration is stopped because the last items are

Java Object equals, hashCode, Hashing Collections and Hash Code Collision

Introduction In this blog post I’ll be focusing on something very fundamental and assumed as easy in the concept, but fairly the subject requires more focus and better apprehending. Besides that I am quite sure you’ll learn many interesting related to this topic. Object equals and hashCode Methods equals and hashCode methods are shipped with

Builder Pattern in Java

The Builder pattern eliminates building the complexity of the target object as well as eases the construction by providing such methods that will assemble the object same as building a set of blocks. By implementing the Builder pattern, there won’t be any need of larger constructors, parameter objects or custom types. Furthermore, the Builder pattern

Immutable Objects in Java

Immutability of an object indicates that once an object is constructed with given values, its state and values cannot be altered. In case of any value change must result in new object creation. Out of box Java offers some Immutable objects for instance java.lang.String, java.lang.Integer, java.lang.Float, java.math.BigDecimal. Immutable objects make generally a good use in

JSF Input text placeholder

In the Tag description add the pt entry and its corresponding web address <html xmlns=”http://www.w3.org/1999/xhtml” xmlns:h=”http://java.sun.com/jsf/html” xmlns:pt=”http://xmlns.jcp.org/jsf/passthrough”> in the input text declaration <h:inputText styleClass=”form-control” pt:placeholder=”Enter Search Value” required=”true” requiredMessage=”Please enter search value” value=”#{orderController.keyword}” id=”keywordSearch”/>

Java XML Parser

Using Dom4J <dependency> <groupId>dom4j</groupId> <artifactId>dom4j</artifactId> <version>1.6.1</version> </dependency> XMLParser.java import org.apache.commons.lang.StringUtils; import org.dom4j.Document; import org.dom4j.DocumentHelper; import org.dom4j.io.OutputFormat; import org.dom4j.io.XMLWriter; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.xml.sax.InputSource; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.transform.OutputKeys; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import java.io.StringReader; import java.io.StringWriter; import java.io.StringWriter; public class XMLFormatter { private static Logger