Bare and Non Bare Repositories , .git directory and working tree

Understand git clone , svn checkout Vs git cloneThese days I am busy in learning GIT distributed versioning system as our project is going to be sit on it, so I am reading a lot and trying to understand it so that I can take full advantage of it in my project.In my previous post we have seen the working of git clone command and how it is different from svn checkout.
In this post we are going to see some differences between bare and non bare repositories, which one to use when.
A normal GIT Repository basically made up of 2 components -

1. Working directory : In simple terms it is the place where all checked out files reside and file available in this location can be added to git repository by

git add FILE_NAME

.2. .git Directory : In simple terms this directory contains all the administrative related files and data that are required by GIT to support all the commands like git commit, git status , git pull, git push. This directory is always present in the root of your project directory.

So , let’s start looking into the bare and non bare repositories Continue reading

Understand git clone command, difference between svn checkout and git clone

Understand git clone , svn checkout Vs git cloneRecently our project migrated from SVN to GIT Distributed Version Control and later I came to know that it has lot of advantages over SVN. So I started looking into GIT basic terminology like clone , commit , pull , push fetch , rebase , merge , branches and honestly speaking earlier I was very confused but as soon I started going into the depth I found it interesting and something that I have never worked till now. I read lot of books , lot of blogs on basic GIT terminologies and here I am going to write my findings on same, so that it can help newbies like me and most importantly for my future reference.

So whole story begins with how to get the code into your local system Continue reading

Apache Log4j Logging Framework Tutorial, Loggers, Appenders,Layouts

From last few days I was thinking to write about a post on log4j framework and the problems that logo-apche-log4j-logging-frameworka developer faces during its configuration time because I also faced lot of problems when I started working on Apache log4j logging framework. In this post I am going to start from basic ,e.g what is a logging framework ? , Why it is required? How to Configure it in your application ? and most common exceptions that you will get during configuration. So, let’s start.

What is a Logging Framework ?
In simple terms logging is an activity to capture all the junk/temporary data that is generated while an application is running. Why I am saying it as junk because it is like temporary data that you will Continue reading

Java Server and Client Time Zone Difference Problem – Solved

In this post we are going to see the difference between the server and client time zone and how to handle those in our applications i.e server and client time zone difference ??.

Today almost each and every application i.e from standalone scale to enterprise scale deal with Date and Time in their process flow. Whenever client (application user) performs any action in the application we always capture those actions and the date time data of that moment  e.g booking an online ticket , making an online payment etc. Now it is quite possible that your client and server are present at different locations i.e different timezones, generally servers are present at a particular location and client across the globe. So, let’s first look at the definition of server time and client time.
Server Time : In application terminology ,server time is the time of that locale(timezone) where that server is located . For example if my server is located in India then it will come under the IST(Indian Standard Time) timezone.

Client Time : In the same context , client time refers to the timezone of the locale from where my client is accessing the application. For example if my client is accessing from Los Angeles USA, then their timezone will be Pacific Time Zone.

Problem Statement : Here we will assume that my server is present in India and user is accessing the application from USA.
As an user of the application I always want to see the time that belongs to my timezone across the application i.e USA timezone. For example , if I am booking a flight I would like to see the timings for flight as per my timezone not as per  the timezone of server. If your client and server is in the same timezone then you might not face any problem but believe me most of the time it is not going to happen because most of time whenever any web application is launched , it will be open for all the users across the globe except few cases.
Real problem will begin when your application is showing the server time(India Time) to the client(who is in USA). Now we will see how we are going to tackle this problem , I will provide you 2 solutions , in which one of I have already tried and tested and 2nd one Continue reading

String Append Vs Parameter Binding (Advantages)- Part 2

This post is in continuation of my previous post on String Append Vs Parameter Binding. In this post we are going to see the advantages of Parameter Binding over String Append. Generally in our daily to daily coding practice we never consider these advantages and most of the time we try to take a path that is much easier. In taking these easier paths most of the times we compromised the software security , its performance and introduced new bugs , that we might have missed during our testing after development. One of those bugs I have explained in my previous post here.

Below are the advantages that you will get if you rely on Parameter Binding :

Performance : First advantage that we will get if we use parameter binding is having the overall improvement of the application performance. Lets see how it will increase the performance – Today almost all the RDBMS databases supports query execution plan cache , having execution plan in place SQL engine can use the same execution plan again and again , only with different set of values Continue reading

Quartz Scheduler Framework in Java and Integration With Spring Example

In my previous post as we had already discussed basics of Quartz Scheduler Framework ,what are the main components of it and why Quartz Scheduler Framework is so popular across the industry for the jobs where scheduling comes into picture. If you have missed that post you can read it here.

In this post we are going to do our hands dirty as we will do some basic scheduling programming and then we will see how we can integrate quartz and spring. So, first let’s take a look at the perquisites . Here , for this example I am going to use Maven for creating a module and to take care of its dependencies.

Assumption : You are familiar with Spring framework and specifically with dependency injections , so that you can understand each and every step in Quartz and Spring Integration.

1.       Dependencies :   Below is the quartz maven coordinates that you have to add in your pom file , so that we can integrate Quartz and Spring. For our example only 1st dependency is required , but other will also come into play when we will write some complex programs.

<dependency>
    <groupId>org.quartz-scheduler</groupId>
    <artifactId>quartz</artifactId>
    <version>2.2.0</version>
</dependency>
<dependency>
    <groupId>org.quartz-scheduler</groupId>
    <artifactId>quartz-oracle</artifactId>
    <version>2.2.0</version>
</dependency>
<dependency>
    <groupId>org.quartz-scheduler</groupId>
    <artifactId>quartz-weblogic</artifactId>
    <version>2.2.0</version>
</dependency>
<dependency>
    <groupId>org.quartz-scheduler</groupId>
    <artifactId>quartz-jboss</artifactId>
    <version>2.2.0</version>
</dependency>

Now we will write our first component for the framework i.e Job (task that you want to get executed at a particular time interval with a specific frequency ).

2.       Quartz Job :

A Job can be any class that will extend Continue reading

Move your site from 000Webhost to Bluehost

If you have read my earlier post on how to host your domain on 000Webhost.com , then you know what all steps you have to take for the hosting of your site. After few days , I realized that this free hosting is not going to work in long run as I was facing lot of problems and limitations  on 000webhsot.com, so I decided to move to the paid hosting services and currently my blog is running on Blue Host Servers.

Here , I have written a step by step guide on how to move your site from 000Webhost to Bluehost.

If you have problem in any of the step during migration please drop a comment and I will try to resolve your problem.

Happy Migration  :)

GIT Distributed Version Control System and How to Configure

Before we start looking into the details of “How to Install Git on Windows” , we will try to understand what exactly GIT Distributed Version Control System is , what are its advantages and then how to install it.

So, let’s start :

What is GIT ?

In simple terms, GIT is a distributed version control system that’s it. I know just putting a formal definition is not enough and is not sufficient to understand GIT Distributed Version Control System,  let’s break this term into 2 parts , Distributed and Version Control System , and we will try to understand Continue reading

String Append Vs Parameter Binding – MySQL

Today when I started my regular daily job , I came across an interesting problem that was related to sql queries and how they treat special characters. The root of the problem was whenever I tried to search any record on the basis of some condition and if that condition contains special characters then my query was not returning me any record.

Focal Point of this post will be – String Append Vs Parameter Binding comparison

e.g Let assume there is a table (USER_DATA) that contains 3 columns  – Id, UserName and Location and below is some sample data .

ID USER_NAME LOCATION
1 XYZ%ABC USA
2 SAW_UI INDIA
3 RAT’ME NL
4 JACK\MET USA

 

Now suppose if I execute this query

Select * from USER_DATA where USER_NAME like ‘%%A%’;

Here , %A is my search criteria, after this query execution it is not returning me any record.

I was getting Continue reading

PHP Memory Error with WordPress and 000Webhost

From last 2 days i was struggling to resolve memory issues((php memory error with wordpress)) that I am facing whenver i am trying to install any new plugin in my wordpress theme hosted on 000webhost.com. As I am a new bie to this web hosting world i thought it might be a good start to begin with free web hosting providers like 000webhost.com , but now I am thinking that my decision was wrong because it is not going to help me in long run and most of time will be wasted in resolving these stupid errors. Anyways I have decided that I will move my blog to some paid webhosting services provider like bluehost.com , hostgator.com (which one I will choose is not yet decided) , but I will keep everyone posted once i succesfully moved to them.

Anyways the reason behind writing this post is  Continue reading