Extreme Programming (XP)

XP was developed by Beck, Cunningham, and Jeffries and is a “lightweight discipline of software development based on principles of simplicity, communication, feedback, and courage”[5]. It is a type of agile software development method, which is focused on software quality, accept changing requirement and frequent release. It is done in small to medium size teams[4]. XP is a collection of ideas and practices drawn from already existing methodologies [4]. On traditional methodology, scope, time and cost are fixed but quality is variable, where is in XP project Scope is variable but time, cost and quality is fixed[3]. This approach allows any changes of requirement keeping the time cost and quality fixed.

XP consists of these phases: Exploration, Planning, Iterations to Release, Productionizing, Maintenance and Death[1].


[Image source: http://www.extremeprogramming.org/map/images/project.gif] (more…)

Selection sorting

Selection sort works by finding the smallest item in the array and exchange in with the first entry. Then, find the next smallest item and exchange in with the second entry, which continue till all array is sorted.

Selection sorting takes (N*N)/2 running time to sort N items.

Tuterial video (more…)

Memory used by Java data types.

This article will try to explain the basic idea about memory used by Primitive data type and some data structure in Java implementation.

Primitive data types

  • boolean 1 byte
  • byte 1 byte
  • char 2 bytes
  • int 4 bytes
  • float 4 bytes
  • long 8 bytes
  • double 8 bytes
  • overhead 16 bytes // overhead includes a reference to the object’s class, garbage collection information and synchronization information
  • padding 4 bytes // memory uses padded on a 64-bit machine
  • reference 8 bytes // reference to different object or data type

Object : Memory used by an object is equal to the memory used by each instance + overhead (16 bytes) + padding (4 bytes). For example

private class ageGender
{
int age=0;
char gender = ''; //"m" for male and "f" for female
}

(more…)

AJAX XmlHttpRequest

Javascript code using AJAX XmlHttpRequest. “send()” function can be executed using normal javascript function call, passing one argument to be sent to send.php through POST.

//Function creating XmlHttpObject
function GetXmlHttpObject(){
var xmlHttp=null;
try{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e){
// Internet Explorer
try{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e){
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}

(more…)

Easy form validation using HTML5

It is possible to pre-define the form input type according to its validation rule using HTML5. This use will will validate the input data with out the use of custom code.
There are 7 different types of input type email, url, number, range, date pickers, search and color.

As in the example below <input> type is set to “email” and required attribute is set to “required“. (more…)