Tuesday, March 31, 2009

make health better...

Hi all, Hope every one are doing good. Here I have something which is related to your health. Please read more to know more. There are many supplements available to make our health better. I have some good thing here to share with you all. It is called lifessence HGH plus and it the best HGH supplement which is available in the market. This supplement contain top 10 superfoods, very good antioxidants and fifteen other HGH stimulating agents. On the whole, they will result in giving you a better health. These agents will stimulate your pituitary glands to help your body to increase HGH production. Let me tell you what benefits you can get by this supplements. This Lifessence HGH plus spplement makes you to have a better skin, you can get rid of wrinkles and iy you already have wrinkles, you can reduce them. In addtitin tho this, you can improve your muscular system by making muscular development and on the whole, as i said early, a better health. It also comes with money back guarantee so you can try it out once. You can have a look at Lifessence HGH plus review to get a knowledge about it. Hope it will help you a lot in making a better health. I hope it will.

Monday, March 30, 2009

/* COUNT SINGLES */


/** Counts number of occurrences of each single attribute in the
input data.
@return 2-D array where first row represents column numbers
and second row represents support counts. */

protected int[][] countSingles() {
// Dimension and initialize count array
int[][] countArray = new int[numCols+1][2];
for (int index=0;index countArray[index][0] = index;
countArray[index][1] = 0;
}
// Step through input data array counting singles and incrementing
// appropriate element in the count array
for(int rowIndex=0;rowIndex if (dataArray[rowIndex] != null) {
for (int colIndex=0;colIndex countArray[dataArray[rowIndex][colIndex]][1]++;
}
}
// Return
return(countArray);
}

/** sorts count array produced by countSingles method
@param countArray The 2-D array returned by the countSingles
method. */

private void orderCountArray(int[][] countArray) {
int attribute, quantity;
boolean isOrdered;
int index;
do {
isOrdered = true;
index = 1;
while (index < (countArray.length-1)) {
if (countArray[index][1] >= countArray[index+1][1]) index++;
else {
isOrdered=false;
// Swap
attribute = countArray[index][0];
quantity = countArray[index][1];
countArray[index][0] = countArray[index+1][0];
countArray[index][1] = countArray[index+1][1];
countArray[index+1][0] = attribute;
countArray[index+1][1] = quantity;
// Increment index
index++;
}
}
} while (isOrdered==false);
}


/** Defines conversion and reconversion arrays.
@param countArray The 2-D array sorted by the ordercountArray
method.*/

protected void defConvertArrays(int[][] countArray) {
// Dimension arrays
conversionArray = new int[numCols+1][2];
reconversionArray = new short[numCols+1];
// Assign values
for(int index=1;index conversionArray[countArray[index][0]][0] = index;
conversionArray[countArray[index][0]][1] = countArray[index][1];
reconversionArray[index] = (short) countArray[index][0];
}

}



/** Recasts the contents of the data array so that each record is
ordered according to ColumnCounts array and excludes non-supported
elements.*/

public void prune() {
short[] itemSet;
int attribute;
// Step through data array using loop construct
for(int rowIndex=0;rowIndex // Check for empty row
if (dataArray[rowIndex]!= null) {
itemSet = null;
// For each element in the current record find if supported with
// reference to the conversion array. If so add to "itemSet".
for(int colIndex=0;colIndex attribute = dataArray[rowIndex][colIndex];
// Check support
if (conversionArray[attribute][1] >= minSupport) {
itemSet = reallocInsert(itemSet,(short) conversionArray[attribute][0]);
}
}
// Return new item set to data array
dataArray[rowIndex] = itemSet;
}
}

isPrunedFlag=true;
// Reset number of one item sets field
numOneItemSets = getNumSupOneItemSets();
}

/** Sets the number of one item sets field (numOneItemSets to
the number of supported one item sets. */

public void setNumOneItemSets() {
numOneItemSets=getNumSupOneItemSets();
}

/** Gets number of supported single item sets .
@return Number of supported 1-item sets */

protected int getNumSupOneItemSets() {
int counter = 0;
// Step through conversion array incrementing counter for each
// supported element found
for (int index=1;index < conversionArray.length;index++) {
if (conversionArray[index][1] >= minSupport) counter++;
}
// Return
return(counter);
}

/** Reconverts given item set according to contents of reconversion array.
@param itemSet the given itemset.
@return the reconverted itemset. */

protected short[] reconvertItemSet(short[] itemSet) {
// If no conversion return orginal item set
if (reconversionArray==null) return(itemSet);
// If item set null return null
if (itemSet==null) return(null);
// Define new item set
short[] newItemSet = new short[itemSet.length];
// Copy
for(int index=0;index newItemSet[index] = reconversionArray[itemSet[index]];
}
// Return
return(newItemSet);
}

/** Reconvert single item if appropriate.
@param item the given item
@return the reconvered item. */

protected short reconvertItem(short item) {
// If no conversion return orginal item
if (reconversionArray==null) return(item);
// Otherwise rerturn reconvert item
return(reconversionArray[item]);
}

/** Resizes given item set so that its length is increased by one
and new element inserted.
@param oldItemSet the original item set
@param newElement the new attribute to be inserted
@return the combined item set */

protected short[] reallocInsert(short[] oldItemSet, short newElement) {
// No old item set
if (oldItemSet == null) {
short[] newItemSet = {newElement};
return(newItemSet);
}
// Otherwise create new item set with length one greater than old
// item set
int oldItemSetLength = oldItemSet.length;
short[] newItemSet = new short[oldItemSetLength+1];
// Loop
int index1;
for (index1=0;index1 < oldItemSetLength;index1++) {
if (newElement < oldItemSet[index1]) {
newItemSet[index1] = newElement;
// Add rest
for(int index2 = index1+1;index2 newItemSet[index2] = oldItemSet[index2-1];
return(newItemSet);
}
else newItemSet[index1] = oldItemSet[index1];
}
// Add to end
newItemSet[newItemSet.length-1] = newElement;
// Return new item set
return(newItemSet);
}

/** Resizes given item set so that its length is increased by one
and appends new element
@param oldItemSet the original item set
@param newElement the new attribute to be appended
@return the combined item set */

protected short[] realloc1(short[] oldItemSet, short newElement) {
// No old item set
if (oldItemSet == null) {
short[] newItemSet = {newElement};
return(newItemSet);
}
// Otherwise create new item set with length one greater than old
// item set
int oldItemSetLength = oldItemSet.length;
short[] newItemSet = new short[oldItemSetLength+1];
// Loop
int index;
for (index=0;index < oldItemSetLength;index++)
newItemSet[index] = oldItemSet[index];
newItemSet[index] = newElement;
// Return new item set
return(newItemSet);
}

/** Resizes given array so that its length is increased by one element
and new element added to front
@param oldItemSet the original item set
@param newElement the new attribute to be appended
@return the combined item set */

protected short[] realloc2(short[] oldItemSet, short newElement) {
// No old array
if (oldItemSet == null) {
short[] newItemSet = {newElement};
return(newItemSet);
}
// Otherwise create new array with length one greater than old array
int oldItemSetLength = oldItemSet.length;
short[] newItemSet = new short[oldItemSetLength+1];
// Loop
newItemSet[0] = newElement;
for (int index=0;index < oldItemSetLength;index++)
newItemSet[index+1] = oldItemSet[index];
// Return new array
return(newItemSet);
}

/** Removes the nth attribute from the given item set.
@param oldItemSet the given item set.
@param n the index of the element to be removed .
@return Revised item set with nth element removed. */

protected short[] removeElementN(short [] oldItemSet, int n) {
if (oldItemSet.length <= n) return(oldItemSet);
else {
short[] newItemSet = new short[oldItemSet.length-1];
for (int index=0;index for (int index=n+1;index newItemSet[index-1] = oldItemSet[index];
return(newItemSet);
}
}


/** Given an unordered itemSet, sort the set
@param itemSet the given item set. */

protected void sortItemSet(short[] itemSet) {
short temp;
boolean isOrdered;
int index;
do {
isOrdered = true;
index = 0;
while (index < (itemSet.length-1)) {
if (itemSet[index] <= itemSet[index+1]) index++;
else {
isOrdered=false;
// Swap
temp = itemSet[index];
itemSet[index] = itemSet[index+1];
itemSet[index+1] = temp;
// Increment index
index++;
}
}
} while (isOrdered==false);
}



/** Invokes combinations method to calculate all possible
combinations of a given item set.
@param inputSet the given item set.
@return array of arrays representing all possible combinations (may be null
if no combinations). */

protected short[][] combinations(short[] inputSet) {
if (inputSet == null) return(null);
else {
short[][] outputSet = new short[getCombinations(inputSet)][];
combinations(inputSet,0,null,outputSet,0);
return(outputSet);
}
}

/** Recursively calculates all possible combinations of a given item
set.
@param inputSet the given item set.
@param inputIndex the index within the input set marking current
element under consideration .
@param sofar the part of a combination determined sofar during the
recursion .
@param outputSet the combinations collected so far, will hold all
combinations when recursion ends.
@param outputIndex the current location in the output set.
@return revised output index. */

private int combinations(short[] inputSet, int inputIndex, short[] sofar, short[][] outputSet, int outputIndex) {
short[] tempSet;
int index=inputIndex;
// Loop through input array
while(index < inputSet.length) {
tempSet = realloc1(sofar,inputSet[index]);
outputSet[outputIndex] = tempSet;
outputIndex = combinations(inputSet,index+1,copyItemSet(tempSet),outputSet,outputIndex+1);
index++;
}
// Return
return(outputIndex);
}

/** Gets the number of possible combinations of a given item set.
@param set the given item set.
@return number of possible combinations. */

private int getCombinations(short[] set) {
int counter=0, numComb;
numComb = (int) Math.pow(2.0,set.length)-1;
// Return
return(numComb);
}

/** Makes a copy of a given itemSet.
@param itemSet the given item set.
@return copy of given item set. */

protected short[] copyItemSet(short[] itemSet) {
// Check whether there is a itemSet to copy
if (itemSet == null) return(null);
// Do copy and return
short[] newItemSet = new short[itemSet.length];
for(int index=0;index newItemSet[index] = itemSet[index];
}
// Return
return(newItemSet);
}

/** Outputs stored input data set; initially read from input data file, but
may be reordered or pruned if desired by a particular application. */

public void outputDataArray() {
if (isPrunedFlag) System.out.println("DATA SET (Ordered and Pruned)\n" +
"-----------------------------");
else {
if (isOrderedFlag) System.out.println("DATA SET (Ordered)\n" +
"------------------");
else System.out.println("DATA SET\n" + "--------");
}
// Loop through data array
for(int index=0;index outputItemSet(dataArray[index]);
System.out.println();
}
}

/** Outputs a given item set.
@param itemSet the given item set. */

protected void outputItemSet(short[] itemSet) {
// Check for empty set
if (itemSet == null) System.out.print(" null ");
// Process
else {
// Reconvert where input dataset has been reordered and possible
// pruned.
short[] tempItemSet = reconvertItemSet(itemSet);
// Loop through item set elements
int counter = 0;
for (int index=0;index if (counter == 0) {
counter++;
System.out.print(" {");
}
else System.out.print(" ");
System.out.print(tempItemSet[index]);
}
System.out.print("} ");
}
}


/** Outputs conversion array */
public void outputConversionArrays() {
System.out.println("Conversion Array = ");
for(int index=1;index System.out.println("(" + index + ") " + conversionArray[index][0] +
" = " + conversionArray[index][1]);
}
// Reconversion array
System.out.println("Reonversion Array = ");
for(int index=1;index System.out.println("(" + index + ") " + reconversionArray[index]);
}
}

protected void outputMenu() {
System.out.println();
System.out.println("-C = Confidence (default 80%)");
System.out.println("-F = File name");
System.out.println("-N = Number of classes (Optional)");
System.out.println("-S = Support (default 20%)");
System.out.println();
// Exit
System.exit(1);
}

/** Outputs command line values provided by user. */

protected void outputSettings() {
System.out.println("SETTINGS\n--------");
System.out.println("File name = " + fileName);
System.out.println("Support (default 20%) = " + support);
System.out.println("Confidence (default 80%) = " + confidence);
System.out.println();
}


/** Outputs current support and confidence settings. */

public void outputSuppAndConf() {
System.out.println("Support = " + twoDecPlaces(support) + " ,Confidence="+twoDecPlaces(confidence));
}

body oil...make u healthy...

It is very essential and mandatory for us to take care of our health. Hope every one know the saying "health is wealth". I have written a short poem which goes like, "Health is, not wealth, for hospitals". There fore, if we don’t care about our health, we will loose every thing and ultimately it will end up in unhealthy life. So, we have to take measures such that our body stays fit and healthy. There is lot of products available to make everything which I was mentioning till the previous sentence. Well, let me tell you what the product is. It is none other than the body oil, which gives a physical relief to our body. This oil is very cheap and you can get lot more other oils like baby oils and so on in this web site. It is guaranteed and comes with 30 day money back guarantee. This is the best body oil deal you can get in the internet. So, you can buy with without any worries and experience the difference in your body and soul. Do not wait any more and hurry up to get your body oil.

/* TWO DECIMAL PLACES */

/* TWO DECIMAL PLACES */
/** Converts given real number to real number rounded up to two decimal
places.
@param number the given number.
@return the number to two decimal places. */

protected double twoDecPlaces(double number) {
int numInt = (int) ((number+0.005)*100.0);
number = ((double) numInt)/100.0;
return(number);
}


}


FPtree1.java

import java.io.*;
public class FPtree1 extends TotalSuppTree {

/** FP-tree node structure comprising a FPgrowthItemPrefixSubtreeNode in
which to store counts and a reference to a child branch. */
protected class FPtreeNode {
/** The FP tree node. */
private FPgrowthItemPrefixSubtreeNode node = null;
/** The reference to the child branch (levels in FP-tree branches are
stored as a arrays of FPtreeNode structures. */
private FPtreeNode[] childRefs = null;

/** Default constructor. */
protected FPtreeNode() {
}

/** Single argument constructor.
@param newNode the reference to a new node to be included in the

FP-tree.*/
protected FPtreeNode(FPgrowthItemPrefixSubtreeNode newNode) {
node = newNode;
}
}

/** Prefix subtree structure. A set enumeration tree in which to store
itemsets together with support values. */

private class FPgrowthItemPrefixSubtreeNode {
/** The attribute identifier. */
private short itemName;
/** The support count. */
private int itemCount;
/** The backward link to the parent node in FP tree. */
private FPgrowthItemPrefixSubtreeNode parentRef = null;
/** The forward link to the next node in a linked list of nodes with
same attribute identifier starting with an element in the header table
*/
private FPgrowthItemPrefixSubtreeNode nodeLink = null;

/** Default constructor. */
private FPgrowthItemPrefixSubtreeNode() {
}

/** Three argument constructor.
@param name the itemset identifier.
@param support the support value for the itemset.
@param backRef the backward link to the parent node. */

private FPgrowthItemPrefixSubtreeNode(short name, int support,
FPgrowthItemPrefixSubtreeNode backRef) {
itemName = name;
itemCount = support;
parentRef = backRef;
}
}

/** Header table. */

protected class FPgrowthHeaderTable {
/** The 1-itemset (attribute) identifier. */
protected short itemName;
/** The forward link to the next node in the link list of nodes. */
protected FPgrowthItemPrefixSubtreeNode nodeLink = null;

// Constructors
protected FPgrowthHeaderTable (short columnNum) {
itemName = columnNum;
}
}

/** Structure in which to store ancestor itemSets, i.e. nodes in an FP-tree
that preceed the nodes identified by following a trail of links from a
particular item in the header table. */

private class FPgrowthSupportedSets {
/** The itemSet label. */
private short[] itemSet = null;
/** The associated support value for the given itemset. */
private int support;
/** The reference to the next node in a linked list. */
private FPgrowthSupportedSets nodeLink = null;

/** Three argument constructor.
@param newitemSet the given itemSet label.
@param newSupport the associated support value for the given itemset.
@param newNodeLink the reference to the next node in a linked list. */

private FPgrowthSupportedSets(short[] newitemSet, int newSupport,
FPgrowthSupportedSets newNodeLink) {
itemSet = newitemSet;
support = newSupport;
nodeLink = newNodeLink;
}
}

/** Structure in which to store counts. */
private class FPgrowthColumnCounts {
/** The column/attribute ID number. */
private short columnNum;
/** The associated support value. */
private int support=0;

/** One argument constructor.
@param column the column/attribute ID number. */

private FPgrowthColumnCounts(int column) {
columnNum = (short) column;
}

/** Two argument constructor.
@param column the column/attribute ID number.
@param sup the associatec support value. */

private FPgrowthColumnCounts(int column, int sup) {
columnNum = (short) column;
support = sup;
}
}

/** Start reference for FP-tree. */
protected FPtreeNode rootNode = null;
/** Start reference for header table. */
protected FPgrowthHeaderTable[] headerTable;
/** Start reference for supportedSets linked list (temporary storage
only).*/
private static FPgrowthSupportedSets startTempSets = null;


/** Temporary storage for an index into an array of FP-tree nodes.
Used when reassigning child reference arrays. */
private int tempIndex = 0;

/** Number of nodes created. */
private int numberOfNodes;

/** Constructor to process command line argument.
@param args the command line arguments. */

public FPtree1(String[] args) {
super(args);

// Initialise root node
rootNode = new FPtreeNode();

// Create header table
headerTable = new FPgrowthHeaderTable[numOneItemSets+1];

// Populate header table
for (int index=1;index headerTable[index] = new FPgrowthHeaderTable((short) index);
}
}

/** Top level method to commence the construction of the FP-Tree. */

public void createFPtree() {
// Create header table
headerTable = new FPgrowthHeaderTable[numOneItemSets+1];

// Populate header table
for (int index=1;index headerTable[index] = new FPgrowthHeaderTable((short) index);
}

// Process datatable, loop through data table (stored in data array)
// For each entry add the entry to the FP-tree.
for (int index=0;index // Non null record (if initial data set has been reordered and
// pruned some records may be empty
if (dataArray[index] != null)
addToFPtree(rootNode,0,dataArray[index],1,headerTable);
}
}

/** Searches through current list of child refs looking for given item set.
If reference for current itemset found increments support count and
proceed down branch, otherwise adds to current level.
@param ref the current location in the FP-tree ( rootNode at start).
@param place the current index in the given itemset.
@param itemSet the given itemset.
@param support the associated support value for the given itemset.
@param headerRef the link to the appropriate place in the header table. */

private void addToFPtree(FPtreeNode ref, int place, short[] itemSet,
int support, FPgrowthHeaderTable[] headerRef) {

if (place < itemSet.length) {
if (!addToFPtree1(ref,place,itemSet,support,headerRef))
addToFPtree2(ref,place,itemSet,support,headerRef);
}
}

/** Searches through existing branch and if itemset found updates the
support count and returns true, otherwise return false.
@param ref the current FP-tree node reference.
@param place the current index in the given itemset.
@param itemSet the given itemset.
@param support the associated support value for the given itemset.
@param headerRef the link to the appropriate place in the header table.
@return true if given itemset exists in FP-tree, and false otherwise. */

private boolean addToFPtree1(FPtreeNode ref, int place, short[] itemSet,
int support, FPgrowthHeaderTable[] headerRef) {

// Loop
if (ref.childRefs != null) {
for (int index=0;index // If item is already in list of child refs
// increment count and proceed down branch.
if (itemSet[place] == ref.childRefs[index].node.itemName) {
ref.childRefs[index].node.itemCount =ref.childRefs[index].node.itemCount + support;
addToFPtree(ref.childRefs[index],place+1,itemSet,support,
headerRef);
return(true);
}
// Child refs ordered so break when passed
// point where item should be
if (itemSet[place] < ref.childRefs[index].node.itemName)
return(false);
}
}

// Default

return(false);
}


/** Adds new node to FP-tree. Adds first attribute in itemSet and then
rest of sequence.
@param ref the current FP-tree node reference.
@param place the current index in the given itemset.
@param itemSet the given itemset.
@param support the associated support value for the given itemset.
@param headerRef the link to the appropriate place in the header table. */

private void addToFPtree2(FPtreeNode ref, int place, short[] itemSet,
int support, FPgrowthHeaderTable[] headerRef) {

// Create new Item Prefix Subtree Node
FPgrowthItemPrefixSubtreeNode newPrefixNode = new
FPgrowthItemPrefixSubtreeNode(itemSet[place],support,ref.node);
// Create new FP tree node incorporating new Item Prefix Subtree Node
FPtreeNode newFPtreeNode = new FPtreeNode(newPrefixNode);
// Add link from header table
addRefToFPgrowthHeaderTable(itemSet[place],newPrefixNode,headerRef);
// Add into FP tree
ref.childRefs = reallocFPtreeChildRefs(ref.childRefs,newFPtreeNode);
// Proceed down branch with rest of itemSet
addRestOfitemSet(ref.childRefs[tempIndex],newPrefixNode,place+1,itemSet,
support,headerRef);
}


/** Continues adding attributes in current itemset to FP-tree.
@param ref the current FP-tree node reference.
@param backRef the backwards link to the previous node.
@param place the current index in the given itemset.
@param itemSet the given itemset.
@param support the associated support value for the given itemset.
@param headerRef the link to the appropriate place in the header table. */

private void addRestOfitemSet(FPtreeNode ref, FPgrowthItemPrefixSubtreeNode backRef,
int place, short[] itemSet, int support,
FPgrowthHeaderTable[] headerRef) {

// Process if more items in item set.
if (place // Create new Item Prefix Subtree Node
FPgrowthItemPrefixSubtreeNode newPrefixNode = new
FPgrowthItemPrefixSubtreeNode(itemSet[place],support,backRef);
// Create new FP tree node incorporating new Item Prefix Subtree
// Node
FPtreeNode newFPtreeNode = new FPtreeNode(newPrefixNode);
// Add link from header table
addRefToFPgrowthHeaderTable(itemSet[place],newPrefixNode,headerRef);
ref.childRefs = reallocFPtreeChildRefs(ref.childRefs,newFPtreeNode);
// Add into FP tree
addRestOfitemSet(ref.childRefs[tempIndex],newPrefixNode,place+1,
itemSet,support,headerRef);
}
}

/* Add reference to header table*/

/** Adds reference to new FP-tree node to header table moving old reference
so that it becomes a link from the new FP-tree node.
@param columnNumber the given attribute.
@param newNode the newly created FP-tree node.
@param headerRef the reference to the header table . */

private void addRefToFPgrowthHeaderTable(short columnNumber,
FPgrowthItemPrefixSubtreeNode newNode,
FPgrowthHeaderTable[] headerRef) {
FPgrowthItemPrefixSubtreeNode tempRef;

// Loop through header table
for (int index=1;index // Found right attribute in table?
if (columnNumber == headerRef[index].itemName) {
tempRef = headerRef[index].nodeLink;
headerRef[index].nodeLink = newNode;
newNode.nodeLink = tempRef;
break;
}
}
}




/* Start mining */

/** Top level "FP-growth method" to mine the FP tree. */

public void startMining() {

System.out.println("Mining FP-tree");

startMining(headerTable,null);

}

/** Commences process of mining the FP tree. Commence with the bottom
of the header table and work upwards. Working upwards from the bottom of
the header table if there is a link to an FP tree node :

@param tableRef the reference to the current location in the header table
(commencing with the last item).
@param itemSetSofar the label fot the current item sets as generated to
date (null at start). */

private void startMining(FPgrowthHeaderTable[] tableRef,
short[] itemSetSofar) {
int headerTableEnd = tableRef.length-1;
FPgrowthColumnCounts[] countArray = null;
FPgrowthHeaderTable[] localHeaderTable = null;
FPtreeNode localRoot;
int support;
short[] newCodeSofar;

// Loop through header table from end to start, item by item

for (int index=headerTableEnd;index>=1;index--) {
// Check for null link
if (tableRef[index].nodeLink != null) {
// process trail of links from header table element
startMining(tableRef[index].nodeLink,tableRef[index].itemName,
itemSetSofar);
}
}
}

/** Commence process of mining FP tree with respect to a single element in
the header table.
@param nodeLink the firsty link from the header table pointing to an FP-tree
node.
@param itemName the label associated with the element of interest in the
header table.
@param itemSetSofar the item set represented by the current FP-tree. */

protected void startMining(FPgrowthItemPrefixSubtreeNode nodeLink,
short itemName, short[] itemSetSofar) {

// Count support for current item in header table and store a
// T-tree data structure
int support = genSupHeadTabItem(nodeLink);
short[] newCodeSofar = realloc2(itemSetSofar,itemName);
addToTtree(newCodeSofar,support);

// Collect ancestor itemSets and store in linked list structure
startTempSets=null;
generateAncestorCodes(nodeLink);

// Process Ancestor itemSets
if (startTempSets != null) {
// Count singles in linked list
FPgrowthColumnCounts[] countArray = countFPgrowthSingles();
// Create and populate local header table
FPgrowthHeaderTable[] localHeaderTable =
createLocalHeaderTable(countArray);
if (localHeaderTable != null) {
// Prune ancestor itemSets
pruneAncestorCodes(countArray);
// Create new local root for local FP tree
FPtreeNode localRoot = generateLocalFPtree(localHeaderTable);
// Mine new FP tree
startMining(localHeaderTable,newCodeSofar);
}
}
}

/* Generarte support for header table single item */

/** Counts support for single attributes in header table by following node
links.
@param nodeLink the start link from the header table.
@return the support valye for the item set indicated by the header table. */

private int genSupHeadTabItem(FPgrowthItemPrefixSubtreeNode nodeLink) {
int counter = 0;

// Loop

while(nodeLink != null) {
counter = counter+nodeLink.itemCount;
nodeLink = nodeLink.nodeLink;
}

// Return
return(counter);
}

/** Generates ancestor itemSets are made up of the parent nodes of a given
node. This method collects such itemSets and stores them in a linked list
pointed at by startTempSets.
@param ref the reference to the current node in the prefix tree containing
itemsets together with support values.*/

private void generateAncestorCodes(FPgrowthItemPrefixSubtreeNode ref) {
short[] ancestorCode = null;
int support;

// Loop

while(ref != null) {
support = ref.itemCount;
ancestorCode = getAncestorCode(ref.parentRef);
// Add to linked list with current support
if (ancestorCode != null) startTempSets =
new FPgrowthSupportedSets(ancestorCode,support,
startTempSets);
// Next ref
ref = ref.nodeLink;
}
}

/** Generate the ancestor itemSet from a given node.
@param ref the reference to the current node in the prefix tree containing
itemsets together with support values. */

private short[] getAncestorCode(FPgrowthItemPrefixSubtreeNode ref) {
short[] itemSet = null;
if (ref == null) return(null);
// Else process
while (ref != null) {
itemSet = realloc2(itemSet,ref.itemName);
ref = ref.parentRef;
}

// Return
return(itemSet);
}

/** Removes elements in ancestor itemSets (pointed at by
startTempSets ) which are not supported by referring to count
array (which contains all the current supported 1 itemsets).
@param countArray the array of FPgrowthColumnCounts structures
describing the single item sets (in terms of labels and associated
support), contained in a linked list of FPgrowthSupportedSets
which in turn describe the ancestor nodes in an FP-tree that preceed the
nodes identified by following a trail of links from a particular item in
the header table. */

private void pruneAncestorCodes(FPgrowthColumnCounts[] countArray) {
FPgrowthSupportedSets ref = startTempSets;

// Loop through linked list of ancestor paths

while(ref != null) {
for(int index=0;index if (countArray[ref.itemSet[index]].support < minSupport)
ref.itemSet = removeElementN(ref.itemSet,index);
}
ref = ref.nodeLink;
}
}


/** Counts frequent 1 item sets in ancestor itemSets linked list and place
into an array.
@return array of FPgrowthColumnCounts structures describing the
single item sets (in terms of labels and associated support), contained in
a linked list of FPgrowthSupportedSets which in turn describe the
ancestor nodes in an FP-tree that preceed the nodes identified by following
a trail of links from a particular item in the header table. */

private FPgrowthColumnCounts[] countFPgrowthSingles() {
int index, place=0;
FPgrowthSupportedSets nodeLink = startTempSets; // Start of linked list

// Dimension array, assume all attributes present, then it will
// be possible to index in to the array.

FPgrowthColumnCounts[] countArray = new
FPgrowthColumnCounts[numOneItemSets+1];
// Initialise array
for (index=1;index new FPgrowthColumnCounts(index);

// Loop through linked list of ancestor itemSets

while (nodeLink != null) {
// Loop through itemSet
for (index=0;index place = nodeLink.itemSet[index];
countArray[place].support = countArray[place].support +
nodeLink.support;
}
nodeLink = nodeLink.nodeLink;
}



// Return
return(countArray);
}

/* Create local header table */

/** Creates a local header table comprising those item that are supported
in the count array.
@param countArray the support for the 1 item sets.
@return a FPgrowth header table. */

private FPgrowthHeaderTable[]
createLocalHeaderTable(FPgrowthColumnCounts[] countArray) {
int index;
FPgrowthHeaderTable[] localHeaderTable;

localHeaderTable = localHeadTabUnordered(countArray);

// Order according single item support

//orderLocalHeaderTable(localHeaderTable,countArray);

// Return

return(localHeaderTable);
}

/* Create new local header table */

/** Create a new local header table, but unorderd.
@param countArray the csupport for the 1 item sets.
@return a FPgrpwth header table. */

private FPgrowthHeaderTable[]
localHeadTabUnordered(FPgrowthColumnCounts[] countArray) {
int counter = 1;

// Loop through array and count supported one item sets
for (int index=1;index if (countArray[index].support >= minSupport) counter++;
}

// Build new Header Table array containing only supported items

if (counter == 1) return(null);
FPgrowthHeaderTable[] localHeaderTable =
new FPgrowthHeaderTable[counter];

// Populate header table

int place=1;
for (int index=1;index if (countArray[index].support >= minSupport) {
localHeaderTable[place] = new
FPgrowthHeaderTable((short) countArray[index].columnNum);
place++;
}
}

// Return

return(localHeaderTable);
}

/* Order local header table */

/** Orders local header table (currently unused).
@param localHeaderTable the FPgrpwth header table to be ordered.
@param countArray the csupport for the 1 item sets. */

private void orderLocalHeaderTable(FPgrowthHeaderTable[] localHeaderTable,
FPgrowthColumnCounts[] countArray) {
boolean isOrdered;
FPgrowthHeaderTable temp;
int index, place1, place2;

//loop through table
do {
index = 1;
isOrdered=true;
while (index < (localHeaderTable.length-1)) {
place1 = localHeaderTable[index].itemName;
place2 = localHeaderTable[index+1].itemName;
if (countArray[place1].support > countArray[place2].support) {
isOrdered=false;
// Swap
temp = localHeaderTable[index];
localHeaderTable[index] = localHeaderTable[index+1];
localHeaderTable[index+1] = temp;
}
// increment index
index++;
}
} while (isOrdered==false);
}


/** Generates a local FP tree
@param tableRef reference to start of header table containing links to
an FP-tree produced during the FP-tree generation process.
@rerurn reference to the start of the generated FP-tree*/

private FPtreeNode generateLocalFPtree(FPgrowthHeaderTable[] tableRef) {
FPgrowthSupportedSets ref = startTempSets;
FPtreeNode localRoot = new FPtreeNode();

// Loop

while(ref != null) {
// Add to conditional FP tree
if (ref.itemSet != null) addToFPtree(localRoot,0,ref.itemSet,
ref.support,tableRef);
ref = ref.nodeLink;
}

// Return

return(localRoot);
}


/** Resizes the given array of FP-tree nodes so that its length is
increased by one element and new element inserted.
@param oldArray the given array of FP-tree nodes.
@param newNode the given node to be added to the FP-tree
@return The revised array of FP-tree nodes. */

private FPtreeNode[] reallocFPtreeChildRefs(FPtreeNode[] oldArray,
FPtreeNode newNode) {

// No old array

if (oldArray == null) {
FPtreeNode[] newArray = {newNode};
tempIndex = 0;
return(newArray);
}

// Otherwise create new array with length one greater than old array

int oldArrayLength = oldArray.length;
FPtreeNode[] newArray = new FPtreeNode[oldArrayLength+1];

// Insert new node in correct order.

for (int index1=0;index1 < oldArrayLength;index1++) {
if (newNode.node.itemName < oldArray[index1].node.itemName) {
newArray[index1] = newNode;
for (int index2=index1;index2 newArray[index2+1] = oldArray[index2];
tempIndex = index1;
return(newArray);
}
newArray[index1] = oldArray[index1];
}

// Default

newArray[oldArrayLength] = newNode;
tempIndex = oldArrayLength;
return(newArray);
}

/** Commences process of outputting the prefix sub tree to the screen,
starting at header table. */

public void outputItemPrefixSubtree() {
int flag;
System.out.println("PREFIX SUBTREE FROM HEADER TABLE");
for(int index=1;index System.out.println("Header = " +
reconvertItem(headerTable[index].itemName));
flag = outputItemPrefixTree(headerTable[index].nodeLink);
if (flag!=1) System.out.println();
}
System.out.println();
}

/** Commences process of outputting a local prefix sub tree to the screen.
@param tableRef the reference to the local header table. */

private void outputItemPrefixSubtree(FPgrowthHeaderTable[] tableRef) {
int flag;
System.out.println("PREFIX SUBTREE FROM LOCAL HEADER TABLE");
for(int index=1;index System.out.println("Header = " +
reconvertItem(tableRef[index].itemName));
flag = outputItemPrefixTree(tableRef[index].nodeLink);
if (flag!=1) System.out.println();
}
System.out.println();
}

/** Outputs the given prefix sub tree.
@param ref the reference to the given branch.
@return a counter representing the current "node number" (used in
output). */

private int outputItemPrefixTree(FPgrowthItemPrefixSubtreeNode ref) {
int counter = 1;

// Loop

while (ref != null) {
System.out.print("(" + counter + ") " +
(reconvertItem(ref.itemName)) + ":" + ref.itemCount + " ");
counter++;
ref = ref.nodeLink;
}

return(counter);
}



/** Commences process of outputting FP-tree to screen. */

public void outputFPtree() {
System.out.println("FP TREE");
outputFPtreeNode1();
System.out.println();
}

/** Commences process of outputting a given branch of an FP-tree to the
screen.
@param ref the reference to the given FP-tree branch. */

private void outputFPtreeNode(FPtreeNode ref) {
System.out.println("LOCAL FP TREE");
outputFPtreeNode2(ref.childRefs,"");
System.out.println();
}

/** Continues process of outputting FP-tree to screen. */

private void outputFPtreeNode1() {
outputFPtreeNode2(rootNode.childRefs,"");
}

/** Outputs a given level in an FP-tree to the screen.
@param ref the reference to the given FP-tree level.
@param nodeID the root string for the node ID. */

private void outputFPtreeNode2(FPtreeNode ref[],String nodeID) {
if (ref == null) return;

// Otherwise process

for (int index=0;index System.out.print("(" + nodeID + (index+1) + ") ");
outputItemPrefixSubtreeNode(ref[index].node);
outputFPtreeNode2(ref[index].childRefs,nodeID+(index+1)+".");
}
}
/** Outputs the given prefix sub tree node.
@param ref the reference to the given node. */

public void outputItemPrefixSubtreeNode(FPgrowthItemPrefixSubtreeNode ref) {
System.out.print((reconvertItem(ref.itemName)) + ":" + ref.itemCount);
if (ref.nodeLink != null) {
System.out.println(" (ref to " +
(reconvertItem(ref.nodeLink.itemName)) + ":" +
ref.nodeLink.itemCount + ")");
}
else System.out.println(" (ref to null)");
}
}

Ttreenode.java

import java.io.*;
import java.util.*;

/** Methods concerned with Ttree node structure. Arrays of these structures
are used to store nodes at the same level in any sub-branch of the T-tree. */

public class TtreeNode {

/** The support associate with the itemset represented by the node. */
public int support = 0;

/** A reference variable to the child (if any) of the node. */
public TtreeNode[] childRef = null;

/** The number of nodes in the T-tree. */
public static int numberOfNodes = 0;

public TtreeNode() {
numberOfNodes++;
}
/** One argument constructor.
@param sup the support value to be included in the structure. */
public TtreeNode(int sup) {
support = sup;
numberOfNodes++;
}

public static int getNumberOfNodes() {
return(numberOfNodes);
}
}

TotalSupptree.java


import java.io.*;
import java.util.*;

public class TotalSuppTree extends reorder {

// Data structures
/** The reference to start of t-tree. */
protected TtreeNode[] startTtreeRef;

/** The number of frequent sets (nodes in t-tree with above minimum
support) generated so far. */
protected int numFrequentsets =0;
/** The number of updates required to generate the T-tree. */

/** Processes command line arguments. */
public TotalSuppTree(String[] args) {
super(args);
}

/** Commences process of adding an itemset with its support value to a
T-tree when using a T-tree either as a storage mechanism, or when adding to
an existing T-tree.
@param itemSet The given itemset. Listed in numeric order .
@param support The support value associated with the given itemset. */

public void addToTtree(short[] itemSet, int support) {
// Determine index of last elemnt in itemSet.
int endIndex = itemSet.length-1;

// Add itemSet to T-tree.
startTtreeRef = addToTtree(startTtreeRef,numOneItemSets+1,
endIndex,itemSet,support);
}

/** Inserts a node into a T-tree. Recursive procedure.
@param linkRef the reference to the current array in Ttree.
@param size the size of the current array in T-tree.
@param endIndex the index of the last attribute in the itemset,
which is also used as a level counter.
@param itemSet the given itemset.
@param support the support value associated with the given itemset.
@return the reference to the revised sub-branch of t-tree. */

protected TtreeNode[] addToTtree(TtreeNode[] linkRef, int size, int endIndex,
short[] itemSet, int support) {
// If no array describing current level in the T-tree or T-tree
// sub-branch create one with "null" nodes.
if (linkRef == null) {
linkRef = new TtreeNode[size];
for(int index=1;index linkRef[index] = null;
}

// If null node at index of array describing current level in T-tree
// (T-tree sub-branch) create a T-tree node describing the current
// itemset sofar.
int currentAttribute = itemSet[endIndex];
if (linkRef[currentAttribute] == null)
linkRef[currentAttribute] = new TtreeNode();

// If at right level add support
if (endIndex == 0) {
linkRef[currentAttribute].support =
linkRef[currentAttribute].support + support;
return(linkRef);
}

// Otherwise proceed down branch and return
linkRef[currentAttribute].childRef =
addToTtree(linkRef[currentAttribute].childRef,
currentAttribute,endIndex-1,itemSet,support);
// Return
return(linkRef);
}

/** Commences process of outputting T-tree structure contents to screen. */
public void outputTtree() {
int number = 1;

// Loop

for (short index=1; index < startTtreeRef.length; index++) {
if (startTtreeRef[index] !=null) {
String itemSetSofar =
new Short(reconvertItem(index)).toString();
System.out.print("[" + number + "] {" + itemSetSofar);
System.out.println("} = " + startTtreeRef[index].support);
outputTtree(new Integer(number).toString(),itemSetSofar,
startTtreeRef[index].childRef);
number++;
}
}
}


/** Continue process of outputting T-tree. Operates in a recursive
manner.
@param number the ID number of a particular node.
@param itemSetSofar the label for a T-tree node as generated sofar.
@param linkRef the reference to the current array level in the T-tree. */

private void outputTtree(String number, String itemSetSofar,
TtreeNode[] linkRef) {
// Set output local variables.
int num=1;
number = number + ".";
itemSetSofar = itemSetSofar + " ";

// Check for empty branch/sub-branch.
if (linkRef == null) return;

// Loop through current level of branch/sub-branch.
for (short index=1;index if (linkRef[index] != null) {
String newItemSet = itemSetSofar + (reconvertItem(index));
System.out.print("[" + number + num + "] {" + newItemSet);
System.out.println("} = " + linkRef[index].support);
outputTtree(number + num,newItemSet,linkRef[index].childRef);
num++;
}
}
}
/** Outputs T-tree frequent sets. Operates in a recursive manner.
@param number the number of frequent sets so far.
@param itemSetSofar the label for a T-treenode as generated sofar.
@param size the length/size of the current array level in the T-tree.
@param linkRef the reference to the current array level in the T-tree.
@return the incremented number the number of frequent sets so
far. */

private int outputFrequentSets(int number, String itemSetSofar, int size,
TtreeNode[] linkRef) {

// No more nodes

if (linkRef == null) return(number);

// Otherwise process

itemSetSofar = itemSetSofar + " ";
for (short index=1; index < size; index++) {
if (linkRef[index] != null) {
if (linkRef[index].support >= minSupport) {
String newItemSet = itemSetSofar + (reconvertItem(index));
System.out.println("[" + number + "] {" + newItemSet +
"} = " + linkRef[index].support);
number = outputFrequentSets(number + 1,newItemSet,index,
linkRef[index].childRef);
}
}
}

// Return

return(number);
}

/** Commences the process of counting and outputing number of supported
nodes in the T-tree.A supported set is assumed to be a non null node in
the T-tree. */

public void outputNumFreqSets() {

// If empty tree (i.e. no supported sets) do nothing
if (startTtreeRef== null) System.out.println("Number of frequent " +
"sets = 0");
// Otherwise count and output
else System.out.println("Number of frequent sets = " +
countNumFreqSets());
}

/* COUNT NUMBER OF FRQUENT SETS */
/** Commences process of counting the number of frequent supported
sets contained in the T-tree. */

protected int countNumFreqSets() {
// If empty tree return 0
if (startTtreeRef == null) return(0);

// Otherwise loop through T-tree starting with top level
int num=0;
for (int index=1; index <= numOneItemSets; index++) {
// Check for null valued top level Ttree node.
if (startTtreeRef[index] !=null) {
if (startTtreeRef[index].support >= minSupport)
num = countNumFreqSets(index,
startTtreeRef[index].childRef,num+1);
}
}

// Return
return(num);
}

/** Counts the number of supported nodes in a sub branch of the T-tree.
@param size the length/size of the current array level in the T-tree.
@param linkRef the reference to the current array level in the T-tree.
@param num the number of frequent sets sofar. */

protected int countNumFreqSets(int size, TtreeNode[] linkRef, int num) {

if (linkRef == null) return(num);
for (int index=1; index < size; index++) {
if (linkRef[index] != null) {
if (linkRef[index].support >= minSupport)
num = countNumFreqSets(index,
linkRef[index].childRef,num+1);
}
}

// Return

return(num);
}

/** Commences the process of determining and outputting the storage
requirements (in bytes) for the T-tree. */

public void outputStorage() {

// If empty tree (i.e. no supported sets) do nothing
if (startTtreeRef == null) return;

/* Otherwise calculate storage */
System.out.println("T-tree Storage = " + calculateStorage() +
" (Bytes)");
}


/* CALCULATE STORAGE */
/** Commences process of calculating storage requirements for T-tree. */

protected int calculateStorage() {
// If emtpy tree (i.e. no supported sets) return 0
if (startTtreeRef == null) return(0);

/* Step through top level */
int storage = 4; // For element 0
for (int index=1; index <= numOneItemSets; index++) {
if (startTtreeRef[index] !=null) storage = storage + 12 +
calculateStorage(0,startTtreeRef[index].childRef);
else storage = storage+4;
}
// Return
return(storage);
}

/** Calculate storage requirements for a sub-branch of the T-tree.
@param localStorage the storage as calculated sofar.
@param linkRef the reference to the current sub-branch of the T-tree. */

private int calculateStorage(int localStorage, TtreeNode[] linkRef) {

if (linkRef == null) return(0);

for (int index=1; index < linkRef.length; index++) {
if (linkRef[index] !=null) localStorage = localStorage + 12 +
calculateStorage(0,linkRef[index].childRef);
else localStorage = localStorage + 4;
}

/* Return */

return(localStorage+4); // For element 0
}


}

SAMPLE CODING OF APRIORI


/** Commences process of outputting T-tree structure contents to screen. */
public void outputTtree() {
int number = 1;

// Loop

for (int index=1; index < startTtreeRef.length; index++) {
if (startTtreeRef[index] !=null) {
System.out.print("[" + number + "] {" + index);
System.out.println("} = " + startTtreeRef[index].support);
outputTtree(new Integer(number).toString(),
new Integer(index).toString(),
startTtreeRef[index].childRef);
number++;
}
}
}

/** Continue process of outputting T-tree.Operates in a recursive
manner.
@param number the ID number of a particular node.
@param itemSetSofar the label for a T-tree node as generated sofar.
@param linkRef the reference to the current array level in the T-tree. */

private void outputTtree(String number, String itemSetSofar,
TtreeNode[] linkRef) {
// Set output local variables.
int num=1;
number = number + ".";
itemSetSofar = itemSetSofar + " ";

// Check for empty branch/sub-branch.
if (linkRef == null) return;

// Loop through current level of branch/sub-branch.
for (int index=1;index if (linkRef[index] != null) {
System.out.print("[" + number + num + "] {" + itemSetSofar +
index);
System.out.println("} = " + linkRef[index].support);
String newitemSet = itemSetSofar +
new Integer(index).toString();
outputTtree(number + num,newitemSet,linkRef[index].childRef);
num++;
}
}
}

/** Commences process of outputting contents of a given T-tree branch to
screen.
@param linkRef the reference to the start of the branch*/

public void outputTtreeBranch(TtreeNode[] linkRef) {
int number = 1;

// Check for empty tree

if (linkRef == null) return;

// Loop

for (int index=1; index if (linkRef[index] !=null) {
System.out.print("[" + number + "] {" + index);
System.out.println("} = " + linkRef[index].support);
outputTtree(new Integer(number).toString(),
new Integer(index).toString(),linkRef[index].childRef);
number++;
}
}
}


/** Commences the process of counting and outputing number of supported
nodes in the T-tree.A supported set is assumed to be a non null node in
the T-tree. */

public void outputNumFreqSets() {

// If empty tree (i.e. no supported sets) do nothing
if (startTtreeRef== null) System.out.println("Number of frequent " +
"sets = 0");
// Otherwise count and output
else System.out.println("Number of frequent sets = " +
countNumFreqSets());
}

/** Commences process of counting the number of frequent sets contained in the T-tree. */

protected int countNumFreqSets() {
// If empty tree return 0
if (startTtreeRef == null) return(0);

// Otherwise loop through T-tree starting with top level
int num=0;
for (int index=1; index <= numOneItemSets; index++) {
// Check for null valued top level Ttree node.
if (startTtreeRef[index] !=null) {
if (startTtreeRef[index].support >= minSupport)
num = countNumFreqSets(index,
startTtreeRef[index].childRef,num+1);
}
}

// Return
return(num);
}

/** Counts the number of supported nodes in a sub branch of the T-tree.
@param size the length/size of the current array level in the T-tree.
@param linkRef the reference to the current array level in the T-tree.
@param num the number of frequent sets sofar. */

protected int countNumFreqSets(int size, TtreeNode[] linkRef, int num) {

if (linkRef == null) return(num);

for (int index=1; index < size; index++) {
if (linkRef[index] != null) {
if (linkRef[index].support >= minSupport)
num = countNumFreqSets(index,
linkRef[index].childRef,num+1);
}
}

// Return

return(num);
}


/** Commences the process of outputting T-tree statistics */

public void outputTtreeStats() {
System.out.println("T-TREE STATISTICS\n-----------------");
System.out.println(calculateStorage() + " (Bytes) storage");
System.out.println(countNumFreqSets() + " frequent sets");


}


/** Commences the process of determining and outputting the storage
requirements (in bytes) for the T-tree. */

public void outputStorage() {

// If empty tree (i.e. no supported sets) do nothing
if (startTtreeRef == null) return;

/* Otherwise calculate storage */
System.out.println("T-tree Storage = " + calculateStorage() +
" (Bytes)");
}

/** Commences process of calculating storage requirements for T-tree. */

protected int calculateStorage() {
// If emtpy tree (i.e. no supported sets) return 0
if (startTtreeRef == null) return(0);

/* Step through top level */
int storage = 4; // For element 0
for (int index=1; index <= numOneItemSets; index++) {
if (startTtreeRef[index] !=null) storage = storage + 12 +
calculateStorage(0,startTtreeRef[index].childRef);
else storage = storage+4;
}
// Return
return(storage);
}

/** Calculate storage requirements for a sub-branch of the T-tree.
@param localStorage the storage as calculated sofar .
@param linkRef the reference to the current sub-branch of the T-tree. */

private int calculateStorage(int localStorage, TtreeNode[] linkRef) {

if (linkRef == null) return(0);

for (int index=1; index < linkRef.length; index++) {
if (linkRef[index] !=null) localStorage = localStorage + 12 +
calculateStorage(0,linkRef[index].childRef);
else localStorage = localStorage + 4;
}

/* Return */

return(localStorage+4); }

Sunday, March 29, 2009

Compare pharmacy prices

Today's business world has been seriously affected by global economic crisis and recession. We can not put an immediate end to this but we can save our self from this crisis by doing business in smart way. You can compare the prices and go for the cheapest one so that you can make good money and profitable business. This post would surely help all the people who do business with pharmacy products. Let me share few tit bits about Tramadol. For those who do not about tramadol, here are 10 Things You Should Know About Tramadol. Hope you have got an idea about tramadol. To compare the prices and find the online pharmacy ratings you can view tramadolbluebook. Using this book, you can compare the prices and you can save money. You can buy the lowest price tramadol and you can get them in over night shipping from FedEx. For Better filling with Tramadol, you can visit this site and can get lot of more information on this. This Tramadol blue book was founded by medical practitioner during the year two thousand six, in order to help the consumers save money by buying low price pain relief drugs and a safe pain relief drug. This blue book helps you in checking the credits of online pharmacies and through this; you can compare the price of various pharmacies and go for the one which suits you.

Multicasting...

The problem of multicasting, that is, disseminating the same information from a single source to many receivers, is a well studied problem at the network level and at the application level. Although IP level multicast has not been widely adopted, gains can be made by deploying multicast enabled applications on the internet. Potential multicast applications include multimedia distribution and news/event notification. When constructing application-level multicast routes, we are able to leverage the availability of gathered topology information. Peer-to-peer overlay networks provide an attractive option because of the topology information that is either available at the overlay level or can be inferred by what is known, and several such models exist.
Multicast distribution routes are represented by a rooted, directed spanning tree. The problem of determining such a rooted tree which covers all subscribers is complicated by the need to balance network resources while optimizing the serving of the communication group. In order to enable real-time or near real-time delivery for bandwidth intensive multicast communication streams (such as a live video broadcast), the multicast distribution tree must have a bounded out-degree in order to allow for smooth playback/presentation of the material for subscribers.
This leads us to study the minimum average-latency degree-bounded directed spanning tree problem, a well known NP-hard problem. Recent works propose approximate solutions to this problem. Our work differs from previous work in that we focus on the additional constraint of minimizing the depth or hop count from the source in the message distribution.
Hop count and time-to-live (TTL) bounds are important in the design of communication protocols, particularly at the application-level, in order to minimize congestion in unstructured networks. Here we present a new heuristic algorithm, called DBSPT, that improves upon previous solutions, both in terms of empirical evaluation and theoretical worst-case approximation factors for degree and depth-bounded minimum average-latency spanning trees. We present an empirical analysis in which we compare our DBSPT algorithm against other solutions to the problem including the SPT- Dijkstra’s algorithm and MST-Prim’s Algorithm. Our algorithm consistently outperforms all previous algorithms in terms of Average Latency, Average Depth and Average Hop Count.

depth latency specification...

HARDWARE SPECIFICATION
Processor : Any Processor above 500 MHz.
Ram : 128Mb.
Hard Disk : 10 GB.
Compact Disk : 650 Mb.
Input device : Standard Keyboard and Mouse.
Output device : VGA and High Resolution Monitor.

SOFTWARE SPECIFICATION
Language: Java1.5

Front End Tool: Swing

Operating System: Windows 98.

depth latency...

Simulate algorithm with topology

• All the defined algorithms are applied to the topology that was created in the beginning.
• Every algorithm defines the spanning tree.
• This spanning tree is a degree-bounded directed spanning tree.

Analysis the Results

• The various issues like average latency, average hop counts, Maximum latency, depth, etc. are calculated for every algorithm.
• The DBSPT algorithm is also analysed.Various empirical calculations and worst-case approximation factors are analyzed.
• The results show that the DBSPT algorithm is the most efficient of all.

Saturday, March 28, 2009

diet pill

Hi everybody. Over weight is the main problem for most of the people around the world. This is just because of the fast food culture and oily foods available in the market. Most of us think that putting on weight is not at all a problem but to speak the truth it is the major problem. We do not realize this hard truth. I also thought like you till a few months back. Recently I spoke with my friend who is doing a doctor practice in Russia and he let me know the problems that will occur due to over weight. The major problems are heart stroke, heart attack, and some blood diseases. So I searched the internet for the diet pills to reduce my weight and I found atro phex. You can find the reviews about the pill in atro phex reviews. I do not have any problems with this pill and I lose 10 lbs in two weeks time. If you are satisfied with these reviews you can also try this to reduce your weight and lead a normal healthy life.

AIDS, spreading through kiss???

We all know that spreading of AIDS is mainly due to three reasons, and the main reason is the sexual intercourse. Using the condoms while making love prevents us from the killing disease. This is what all the awareness programs taught us. But a local doctor in India had announced that there is a possibility of spreading the disease through deep kissing. But he didn’t produce any proofs for this. However making love only with our partner will never cause any problem.

Thursday, March 26, 2009

good site for career education

Hi everybody, good evening to you all. Today the technology has developed a lot, so that we get everything from the internet. Now, I am going to suggest you a website that helps you in choosing the best career education for you. I found this website yesterday while I was searching the internet to find the best course and the college to educate my brother. I found a lot of useful information in this website. online degree is the website that helps you in shaping your career. They have listed the top colleges in the city to go in for the admission. They also give you valuable suggestions to choose the course or degree that suits you the best. With their valuable suggestions, I got a very good idea about the career education of my brother, if you searching the best source to find the best school or college in the city, then this will be the right place for you.

networked...

Hi every body. I would like to share a technical article with you all. Hope this will help many people who are involved in research and development in the field of technology. Even a kid knows about the technical advancements that are taking place in every corner of the world. One of the most important fields that took a drastic development in the recent years is computer technology. And in computer technology, the networks have become a very big area and new up gradations are taking place every week in networks. Many research and development are being done in networks and other sub ordinate net working areas like wireless networking, neural networks, grid computing, quantum computing and lot more highly technical networking words. All this are done for the sake of only one thing. It is nothing but a better and sophisticated life. With the essence of networks, we can do our works fast and share the resources world wide and move ahead with our steps forward and we never want to look back. Such an advancement in the field os networking is called as AdvancedMC and AdvancedTCA . You can look at the sites given here to more much better about what they mean actually. You can get lot of very useful information about these networking technical terms.

WILLIAM SHAKESPEARE – PART 1

Revered for generations as possibly the greatest writer in the English language, William Shakespeare was a poet, playwright, and actor. He was born in Stratford-upon-Avon where he spent his childhood and youth. After he had become a successful dramatist and a wealthy businessman, he retired to it.

Soon after he left school, Shakespeare married Anne Hathaway, and then he probably went to London to seek his fortune, where he managed to get a minor job in the theater and learned the art of acting. The company of players he joined is not known. He may have connected with more than one, but the most probable company was that which had as its patron the Earl of Pembroke.

Shakespeare became a competent actor. A contemporary witness told that he played the parts of kings. It is also felt by some scholars that he reserved for himself such roles as Adam in as you like it and as the ghost in Hamlet.

Shakespeare also learned to write plays. By 1592, he was quite successful. Those of his early period include The Comedy of Errors, Titus Andronicus, the Spanish Tragedy, and Henry VI, Parts 1, 2, and 3. Similar themes followed in Richard III and Henry VII. From 1592, the theaters were closed almost continuously for two years because of the bubonic plague.

CHRISTOPHER MARLOWE...

An English dramatist, Christopher Marlowe was born in Canterbury, the son of a shoemaker. He graduated from 1583, earning his master's degree in 1587. He went directly from the university to London to make his may in the theater. In any event, during the late 1580s and early 1590s, he was perhaps the most talented of the group of writers known as "The University Wits." their work revolutionized Elizabethan drama during these years and paved the way for the great dramatists of the next two decades.

His work was the single greatest influence on William Shakespeare (see No.11), who made one of his rare overt person al reference to Marlowe.

The chronology of Marlowe's work has not been definitely established, but Tamberlaine (1587), probably comes first, Like all Marlowe’s work. This play is concerned with what is perhaps the major conflict of the Renaissance mind: the clash between reason and faith.

Tamberlaine takes the side of reason, presenting with epic enthusiasm the rise from Scythian shepherd to "the sweet fruition of an earthly crown" of Tamberlaine. He achieved this distinction, not because he was born to it, nor because he was God's anointed, but because he used his great personal talents, with ruthless disregard for others.

Marlowe's second play, The Tragical History of Doctor Faustus (1588), was certainly the greatest tragedy before Shakespeare. It achieved this stature by balancing Marlowe's admiration for the man ambitious of power, Knowledge, and beauty with the powerful conviction that a man who achieved these ends, not by God's gift, but by the unaided efforts, not by the unaided efforts of his intelligence and will, used damnable means, Doctor Faustus is an example of the Renaissance humanist. At the end of Marlowe’s play he was damned.

Doctor Faustus was probably followed by the Jew of Malta (1589-90) and Edward II (1591), from which Shakespeare borrowed extensively had some part in several other plays, and in addition, was a considerable lyric poet.

His most famous non-dramatic poem is the unfinished Hero and Leander. He died in a tavern braw, perhaps deliberately murdered, at the age of 29

MIGUEL DE CERVANTES…

The great Spanish, poet, and dramatist, Miguel de Cervantes was born at Alcala de Henares. He was educated under the famous humanist Juan Lopez de Hoyos. On the arrival of Cardinal Giulio Acquaviva in Madrid (1568), Cervantes was appointed to an office in the Papal numcio’s household to console Philip II on the loss of his son Don Carlos. In this post, he accompanied his master to Rome.

Leaving this service in 1570, Cervantes spent the next five years as a soldier. In the naval Battle of Lepanto (1571), his left hand was permanently injured, earning him the nickname of el manco de Lepanto. He continued fighting against the Turks until 1575, when he sailed from Naples to Spain, but he was captured at sea by pirates. After his release in 1582, he returned to Madrid, where he settled down to a career of writing.

Cervantes’ best-known poetical work is the Galatea, a pastoral narrative tale, first published in 1585. Although the proof Cervantes has overshadowed his poetry, of which he was so proud, there are verses of great beauty in the Galatea, and in El Viage al Parnaso.

As a dramatist Cervantes worked hard, though unsuccessfully, and only he himself thought highly of his plays. In the Adjunto al Parnaso he enumerates the best among the number, El Trato de Arget, La Numania, and La Conjusa, of which the last named is perhaps the best.

It is, however, as a novelist that Cervantes has become immortal. Successive writers have endeavored to discover in Don Quixote a great philosophical satire, but the truth of Cervantes’ own assurance is now generally admitted. His sole desire was to write an amusing book to give the coup de grace to the absurd books of chivalry imitating Amadis that had done so much to give a bad name to Spanish literature. The book must have been started later than 1591, but the suggestion that he wrote it in a jail in Argamasilla de Alba rests on interpretation of a remark made by Cervantes in the prologue, In any case, it was famous in manuscript form for some time before a license was granted in 1604 to print the first part.

The book seems to have been first sold at the beginning of the year 1605. Lope de Vega wrote slightingly of it shortly before: but the public read it with avidity. Five (or six, if there really was a Barcelona edition of 1605) editions appeared before the end of 1605.

In 1613, Cervantes issued his twelve Novelas Exemplares, short stories written at considerable intervals. Abounding in wit and vivacity, rivaling even Don Quixote itself, they have maintained their popularity to the present day. Cervantes’ last work was Los Trabajos de Persilesy Sigismunda, written in 1616, and dedicated to the Count de Lemos, was signed four days before the author’s death.

safety...

Hope many of you know a saying which goes like "engineers build the world". It is very true. Just because of the engineering field, the world runs effectively and efficiently. Without the gift of engineering and technology, we would not have got all the sophistication which we have for today. Thanks to all the scientists and engineers who lost their sleep, life and in some cases wife just for all the richness and sophistications we have for this very day.
Engineering is a good field. At the same time, there is lot of dangers also involved in it. We can expect any kind of hazard, risk and danger from any form and from any part of engineering. So, we have to safe guard our self by wearing work boots which saves our legs from all the hazards which are down in earth and waiting for making our legs a waste one. To save our hands from dangers, we should wear work gloves such that we can provide guards to our hands. In addition to this, we should also have knowledge of Carhartt and the use of it. No matter what we do or where we do or when we do. Unless we have safety ensured for us, we should better stay not doing it.

FRANCOIS RABELAIS…

Francois Rabelais was born in Chinon and studied at Fontenay-le-Comte, where Greek studies under Bude directged his interest toward humanism. His friends included were Pierre Amy, Geoffroy d’Estissac, and Andre Tiraqueau.

Having received his baccalaureate in medicine at Montpellier (1530), he lectured on the Aphorisms of Hippocrates and the Ars Medico of Galen. While serving as physician at the Pont du Rhone Hospital at Lyons, Rabelais wrote a remarkable letter to Erasmus (1532).

At Lyons, the avowed center of the French Renaissance, Rabelais began his great work which made him “the founder of modern French prose.” The protagonists of the narrative, the giants Gargantua and Pantagruel, continue their adventures through five books: Pantagruel (1532), Gargantua (1535), the Third Book (546), the Fourth Book (1552), and the Fifth Book (1562).

Pantagruel’s eulogy of Debt, and Gargantua’s letter to his son, sometimes called “the triumphal human of the Renaissance,” voice the liberated intelligence of the age.

Rabelais was a skillful and successful physician. He edited Galen and Hippocrated. However, his dissectionb of a cadaver is more consistent with his empiricism and more significant to medical history.

HE believed that life should be lived to the fullest, both on the physical and the intellectual planes. He felt that all that frustrates or mutilates nature is evil.

In his earlier work, Rabelais appears sympathetic to the religious reformers, yet in Book III he flays “the demoniac Calvinists.” Rabelais style, as buoyantly exuberant as life itself, “overflows his page.”

Rabelais made at least three visits to Rome in the service of his patron the Cardinal Jean du Bellay (1534, 1535, and 1549). During his final stay, he wrote La Sciomachie, a series of letters describing his patron’s celebration of the birth of the Duke of Orleans.

The hostility of the Sorbonne, roundly satirized in Book I, doubtless accounts for his prolonged absence from the Lyons hospital; and his temporary replacement in 1535.

After Rabelais’ appointment as curate of Meudon by du Bellay (1551), the publicastion of the Fourth Book. Condemned by the Sorbonne and by Parliament, again placed him in jeopardy. He soon resigned his charge and there is no further account of his activities.

In Rabelais’ opinion, life was the greatest teacher, experience the eternal solvent. Rabelaisian realism, wholesome and sane, inspired the common sense of Montaigne and Moliere.

Rabelais reasoned that in the pursuit of the aim there is no medievalism, no asceticism in the sublime freedom of the Abbey of Thelema: “Do as thou wilt.”

Saturday, March 7, 2009

longest truck

Bacteria in women’s hands…


Bacteria are living everywhere in the world. In a recent study it is found that the women’s hands contain more bacteria when compared to that of the men. The main reason is that the men’s hands are more acidic in nature than the women’s hands. The other reasons are cosmetics, nature of the skin, sweat and oil gland production. Due to these reasons the hands of the women found to have 4742 species of bacteria. That too every woman has different species of bacteria. Even if they wash the hands, the bacteria are not killed. Now the scientists are researching for the ways to eliminate these bacteria completely.

distance education, next to you...

Today, the importance of education is understood by every one. People travel one end to other end of the globe to procure a certain course of education. But, in this busy world, not every one get a chance to fly abroad or to move far to study a particular course. There are lots of people who are very eager to learn new things but still they were all not able to study because of the distance as a constraint.

For such people who want to learn things through distance education program, here is a college called ashworth college which offers distance learning courses and distance education programs for the people who are expecting a home study career education. The ashworth college brings many people's educational dreams come true by providing this distance education courses in it. If you have any plans of doing such educations, the ashworth college is the best and only choice you can go for. I think this news sounds great news for all the people who want themselves dip in to the ocean of education. Even I myself feel very great to share this education oriented news to one and all. Wishing you all a very good luck in your studies.

Thursday, March 5, 2009

Mouse

There are lots of input devices available. Few of the input devices are keyboard, mouse, scanner, microphone etc. Among all of these, mouse has become the most important and user friendly input device. That too after the evolution of graphical user interface (GUI in short), the impact of mouse became huge.

The importance increased such that some people may go crazy if their computer's mouse doesn't work in some fine day. Some people have a belief that without mouse, nothing is possible in a computer. But the truth is different. We can operate all the applications without using a mouse. The keyboard is more than enough to operate a computer.

The point is that we have to remember various short cuts and thus it again becomes like command user interface. Powerful software is one, which can be operated by key board and mouse and / or keyboard/mouse.

Curse...err...


This is not about curse... This article is about cursor. Cursor is one of the best inventions made by man in computers. Cursor shows us where we are and the work progression in any word processing applications. I see cursor as the heart beat of a computer. It's blinking doesn't looks like blinking but beating.
When we see the cursor blinking or beating in the screen, we can come to a conclusion that the computer or the application in which we are working is alive. Imagine any word processor without a cursor. It will look like a fan without blades, tower without antenna and a guy without... fingers I mean.

Don’t eat too fast

If we really like the food we will finish it off as early as possible and also will ate till our stomach gets full. Now the Japan scientists have found the danger of this habit. Those people, who eat like this, have three times more chance to get the obesity than the normal people. They have experimented this with around 4000 people and proved it. So eating slowly and modestly will help us to avoid the obesity. Hope you all like this information.





my traffic rate




Hire Me Direct
 
ss_blog_claim=47b8cd0f86a684cfdfc7f370edf4619d