<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-16671681</id><updated>2012-02-16T18:38:28.805-08:00</updated><title type='text'>Window 2 World</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://kodalis.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://kodalis.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>srikanth</name><uri>http://www.blogger.com/profile/04234053570810422671</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>25</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-16671681.post-9140959641736783879</id><published>2008-06-30T10:25:00.000-07:00</published><updated>2009-09-19T11:15:10.973-07:00</updated><title type='text'>Simple RSS Reader</title><content type='html'>&amp;lt;html&amp;gt; &amp;lt;title&amp;gt;RSS Reader&amp;lt;/title&amp;gt; &amp;lt;head&amp;gt;  &amp;lt;script language=&amp;quot;JavaScript&amp;quot;&amp;gt;&lt;br /&gt;   var xmlHttp = null;      var t_channel = 'channel';   var t_title = 'title';   var t_link = 'link';   var t_description = 'description';&lt;br /&gt;   var t_pubDate = 'pubDate'   var t_lastBuildDate = 'lastBuildDate'&lt;br /&gt;   var t_item = 'item';&lt;br /&gt;   var t_tableHTML;&lt;br /&gt;   var objChannelNodeList;&lt;br /&gt;   // messages   var NOT_A_VALID_RSS_FEED = 'Not a valid RSS Feed';   var GOT_ERROR = 'Got error please try again';   var GETTING_DATA = 'Getting Data Please wait';&lt;br /&gt;   // colors   var CLR_PROCESSING=&amp;quot;orange&amp;quot;;   var CLR_ERROR=&amp;quot;red&amp;quot;;   var CLR_SUCCESS=&amp;quot;green&amp;quot;;   var CLR_BORDER=&amp;quot;skyblue&amp;quot;;&lt;br /&gt;     function getFirstChildText(objNode,tag){    if(objNode.getElementsByTagName(tag).length&amp;gt;0){     return objNode.getElementsByTagName(tag)[0].firstChild.nodeValue;    }else{     return '&amp;amp;nbsp;';    }   }&lt;br /&gt;   function getRSSData(){    try{     if(xmlHttp.readyState==4){      t_tableHTML = '&amp;lt;table cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;3&amp;quot; border=&amp;quot;1&amp;quot; bordercolor='+CLR_BORDER+'&amp;gt;';      var resXML = xmlHttp.responseXML;      if(!resXML){       throw NOT_A_VALID_RSS_FEED;      }      var objChannelNodeList = resXML.getElementsByTagName(t_channel);      if(objChannelNodeList.length==0){       throw NOT_A_VALID_RSS_FEED;      }&lt;br /&gt;      for(i=0;i&amp;lt;objChannelNodeList.length;i++){&lt;br /&gt;       var titleText = getFirstChildText(objChannelNodeList[i],t_title);       var linkText = getFirstChildText(objChannelNodeList[i],t_link);       var descText = getFirstChildText(objChannelNodeList[i],t_description);       var publishDate = getFirstChildText(objChannelNodeList[i],t_pubDate);       if(publishDate==''){        publishDate = getFirstChildText(objChannelNodeList[i],t_lastBuildDate);       }       if(publishDate!=''){        titleText = titleText + '[ &amp;lt;font color='+CLR_SUCCESS+'&amp;gt;' + publishDate + '&amp;lt;/font&amp;gt; ]';       }       constructRows(titleText,linkText,descText);           for(j=0;j&amp;lt;objChannelNodeList[i].getElementsByTagName(t_item).length;j++){        var itemTitleText = getFirstChildText(objChannelNodeList[i].getElementsByTagName(t_item)[j],t_title);        var itemLinkText = getFirstChildText(objChannelNodeList[i].getElementsByTagName(t_item)[j],t_link);        var itemDescText = getFirstChildText(objChannelNodeList[i].getElementsByTagName(t_item)[j],t_description);        constructRows(itemTitleText,itemLinkText,itemDescText);&lt;br /&gt;       }// end of : item for      }// end of channel for&lt;br /&gt;     t_tableHTML = t_tableHTML + '&amp;lt;/table&amp;gt;';&lt;br /&gt;     setText(t_tableHTML);&lt;br /&gt;     }else{// end of xml http ready state      gettingDataPleaseWait(xmlHttp.readyState);     }    }catch(e){     gotErrorPleaseTry(e);    }   }   function gettingDataPleaseWait(state){     t_tableHTML = '&amp;lt;table cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot;&amp;gt;';      var t_txtMsg = GETTING_DATA;     for(msgDots=0;msgDots&amp;lt;state;msgDots++){      t_txtMsg = t_txtMsg + ' ...';     }     t_tableHTML =  t_tableHTML + '&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;font color='+CLR_PROCESSING+'&amp;gt;' + t_txtMsg + '&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;';     t_tableHTML = t_tableHTML + '&amp;lt;/table&amp;gt;';&lt;br /&gt;     setText(t_tableHTML);        }   function gotErrorPleaseTry(e){    t_tableHTML = '&amp;lt;table cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot;&amp;gt;';     t_tableHTML = t_tableHTML +  '&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;font color='+CLR_ERROR+'&amp;gt;';    if(e){     if(e.message){      t_tableHTML = t_tableHTML + GOT_ERROR + ' [&amp;lt;b&amp;gt;' + e.message + '&amp;lt;/b&amp;gt;]';     }else{      t_tableHTML = t_tableHTML + GOT_ERROR + ' [&amp;lt;b&amp;gt;' + e + '&amp;lt;/b&amp;gt;]';     }    }else{     t_tableHTML = t_tableHTML + GOT_ERROR;    }    t_tableHTML = t_tableHTML + '&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;';    t_tableHTML = t_tableHTML + '&amp;lt;/table&amp;gt;';&lt;br /&gt;    setText(t_tableHTML);       }   function constructRows(itemTitleText,itemLinkText,itemDescText){    t_tableHTML = t_tableHTML + '&amp;lt;tr&amp;gt;';    t_tableHTML = t_tableHTML + '&amp;lt;td&amp;gt;&amp;lt;a href=&amp;quot;' + itemLinkText + '&amp;quot;&amp;gt;' + itemTitleText + '&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;';        if(!document.theForm.chkDebug.checked){ // trim images     var t_tempDes = new String(itemDescText);     itemDescText = t_tempDes.replace('&amp;lt;img','&amp;lt;imge');    }&lt;br /&gt;    t_tableHTML = t_tableHTML + '&amp;lt;td&amp;gt;' + itemDescText + '&amp;lt;/td&amp;gt;';    t_tableHTML = t_tableHTML + '&amp;lt;/tr&amp;gt;';   }   function setText(strHtmlText){&lt;br /&gt;    document.getElementById('DisplayArea').innerHTML='';    document.getElementById('DisplayArea').innerHTML=strHtmlText;&lt;br /&gt;   }   function startProcess()   {    try{     gettingDataPleaseWait(1);          var runningUserAgent = new String(navigator.userAgent);&lt;br /&gt;     var URL='';     if(document.theForm.selURL.selectedIndex&amp;gt;0){      URL = document.theForm.selURL[document.theForm.selURL.selectedIndex].value;     }else{      URL = document.theForm.txtURL.value;     }     // append some random number to avoid cache      if(URL!=''){      URL = new String(URL)       var curDate = new Date();      if(URL.indexOf(&amp;quot;?&amp;quot;)!=-1){       URL = URL + '&amp;amp;date=' + curDate.getTime();      }else{       URL = URL + '?date=' + curDate.getTime();      }     }else{      throw 'Invalid URL'     }&lt;br /&gt;     if(runningUserAgent.indexOf('MSIE')!=-1){//IE      xmlHttp=new ActiveXObject(&amp;quot;Msxml2.XMLHTTP&amp;quot;);      if(!xmlHttp){       xmlHttp=new ActiveXObject(&amp;quot;Microsoft.XMLHTTP&amp;quot;);            }     }     else if(runningUserAgent.indexOf('Firefox')!=-1){         netscape.security.PrivilegeManager.enablePrivilege(&amp;quot;UniversalBrowserRead&amp;quot;);      xmlHttp=new XMLHttpRequest();       }else{      throw 'Currently supports only IE or Firefox'     }&lt;br /&gt;     xmlHttp.open(&amp;quot;GET&amp;quot;,URL,true);     xmlHttp.send(null);&lt;br /&gt;     if(xmlHttp!=null){      xmlHttp.onreadystatechange=getRSSData;     }&lt;br /&gt;    }catch(e){     gotErrorPleaseTry(e)    }   }// end of : ajaxFunction function  &amp;lt;/script&amp;gt; &amp;lt;/head&amp;gt; &amp;lt;body&amp;gt;  &amp;lt;form name=&amp;quot;theForm&amp;quot;&amp;gt;   &amp;lt;div id=&amp;quot;RSS Source Area&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;table cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot;&amp;gt;     &amp;lt;tr&amp;gt;      &amp;lt;td align=&amp;quot;left&amp;quot;&amp;gt;       &amp;lt;select name=&amp;quot;selURL&amp;quot;&amp;gt;        &amp;lt;option value=&amp;quot;&amp;quot;&amp;gt;Select RSS Feed&amp;lt;/option&amp;gt;        &amp;lt;option value=&amp;quot;http://www.ibnlive.com/xml/top.xml&amp;quot;&amp;gt;IBN Top Stories&amp;lt;/option&amp;gt;        &amp;lt;option value=&amp;quot;http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/latest_published_stories/rss.xml&amp;quot;&amp;gt;BBC Latest&amp;lt;/option&amp;gt;&lt;br /&gt;        &amp;lt;option value=&amp;quot;http://www.ndtvprofit.com/RSS/SectionRssfeed.aspx?ts=Markets&amp;quot;&amp;gt;NDTV Profit Business&amp;lt;/option&amp;gt;       &amp;lt;/select&amp;gt;      &amp;lt;/td&amp;gt;      &amp;lt;td&amp;gt;&amp;amp;nbsp;or&amp;amp;nbsp;&amp;lt;/td&amp;gt;      &amp;lt;td&amp;gt;&amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;txtURL&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;      &amp;lt;td&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;      &amp;lt;td&amp;gt;Images&amp;amp;nbsp;:&amp;amp;nbsp;&amp;lt;/td&amp;gt;&lt;br /&gt;      &amp;lt;td align=&amp;quot;left&amp;quot;&amp;gt;&amp;lt;input type=&amp;quot;checkbox&amp;quot; name=&amp;quot;chkDebug&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;      &amp;lt;td&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;      &amp;lt;td align=&amp;quot;left&amp;quot;&amp;gt;&amp;lt;input type=&amp;quot;button&amp;quot; name=&amp;quot;getRSS&amp;quot; value=&amp;quot;Get Data&amp;quot; onClick=&amp;quot;javaScript:startProcess();&amp;quot;/&amp;gt;     &amp;lt;/tr&amp;gt;    &amp;lt;/table&amp;gt;   &amp;lt;/div&amp;gt;   &amp;lt;br/&amp;gt;   &amp;lt;div id=&amp;quot;DisplayArea&amp;quot;&amp;gt;   &amp;lt;/div&amp;gt;&lt;br /&gt;  &amp;lt;/form&amp;gt; &amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16671681-9140959641736783879?l=kodalis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kodalis.blogspot.com/feeds/9140959641736783879/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16671681&amp;postID=9140959641736783879' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/9140959641736783879'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/9140959641736783879'/><link rel='alternate' type='text/html' href='http://kodalis.blogspot.com/2008/06/simple-rss-reader.html' title='Simple RSS Reader'/><author><name>srikanth</name><uri>http://www.blogger.com/profile/04234053570810422671</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16671681.post-169353207213379888</id><published>2008-06-17T10:38:00.000-07:00</published><updated>2008-06-17T10:39:14.839-07:00</updated><title type='text'>Maven + Eclipse Java Project Setup Quick Steps</title><content type='html'>How to create a project .jar , .war file structure using Maven &lt;br /&gt;&lt;br /&gt;1) Create a folder D:\mavenProject &lt;br /&gt;2) Traverse to that Directory : CD D:\ mavenProject &lt;br /&gt;3) Execute (for .jar): mvn archetype:create -DgroupId=com.abc.example -DartifactId=exampleLogic &lt;br /&gt;4) Execute (for .war): mvn archetype:create -DgroupId=com.abc.example -DartifactId=exampleWeb -DarchetypeArtifactId=maven-archetype-webapp &lt;br /&gt;&lt;br /&gt;Now we can independently build .jar and .war files by excecuting mvn celan install , command on respective folders. &lt;br /&gt;&lt;br /&gt;i.e on D:\mavenProject\exampleLogic and D:\mavenProject\exampleWeb &lt;br /&gt;&lt;br /&gt;The .jar file and .war file will be installed in the maven local repository. &lt;br /&gt;&lt;br /&gt;Note : the maven local repository is configured in settings.xml located @ &amp;lt;maven Installaion directory&amp;gt;\conf &lt;br /&gt;&lt;br /&gt;Say suppose our exampleLogic .jar is used in exampleWeb then we can add that as dependency in the .pom file of exampleWeb as follows &lt;br /&gt;&lt;br /&gt;&amp;lt;dependency&amp;gt; &lt;br /&gt;&amp;lt;groupId&amp;gt;com.abc.example&amp;lt;/groupId&amp;gt; &lt;br /&gt;&amp;lt;artifactId&amp;gt;exampleLogic&amp;lt;/artifactId&amp;gt; &lt;br /&gt;&amp;lt;version&amp;gt;1.0-SNAPSHOT&amp;lt;/version&amp;gt; &lt;br /&gt;&amp;lt;/dependency&amp;gt; &lt;br /&gt;&lt;br /&gt;In this case first we have to build the .jar file and then we have to build the .war file &lt;br /&gt;&lt;br /&gt;If the .jar file is not installed in the local maven repository and mvn clean install is executed on exampleWeb then we will receive an error. &lt;br /&gt;&lt;br /&gt;If we want to run a single command to clean and install both the logic and web project we can create a .pom file in the D:\mavenProject as follows &lt;br /&gt;&lt;br /&gt;&amp;lt;project&amp;gt; &lt;br /&gt;&amp;lt;name&amp;gt;Maven Example&amp;lt;/name&amp;gt; &lt;br /&gt;&amp;lt;url&amp;gt;http://localhost:8080/&amp;lt;/url&amp;gt; &lt;br /&gt;&amp;lt;modelVersion&amp;gt;4.0.0&amp;lt;/modelVersion&amp;gt; &lt;br /&gt;&amp;lt;groupId&amp;gt;com.abc.example&amp;lt;/groupId&amp;gt; &lt;br /&gt;&amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt; &lt;br /&gt;&amp;lt;artifactId&amp;gt;mavenExample&amp;lt;/artifactId&amp;gt; &lt;br /&gt;&amp;lt;packaging&amp;gt;pom&amp;lt;/packaging&amp;gt; &lt;br /&gt;&amp;lt;modules&amp;gt; &lt;br /&gt;&amp;lt;module&amp;gt;exampleLogic&amp;lt;/module&amp;gt; &lt;br /&gt;&amp;lt;module&amp;gt;exampleWeb &amp;lt;/module&amp;gt; &lt;br /&gt;&amp;lt;/modules&amp;gt; &lt;br /&gt;&amp;lt;/project&amp;gt; &lt;br /&gt;&lt;br /&gt;How to configure the created project to work with eclipse. &lt;br /&gt;&lt;br /&gt;1) Create a folder D:\workspaceExample &lt;br /&gt;2) CD D:\mavenProject\exampleLogic : the following commands have to be executed from a folder having .pom file &lt;br /&gt;3) Execute : mvn eclipse:add-maven-repo -Declipse.workspace=D:\workspaceExample &lt;br /&gt;Note : This will create M2_REPO variable for the given workspace &lt;br /&gt;4) Execute mvn -Dwtpversion=1.0 eclipse:eclipse from D:\mavenProject\exampleLogic &lt;br /&gt;Note : This will create .class and .project files for Eclipse for ExampleLogic project. &lt;br /&gt;5) Execute mvn -Dwtpversion=1.0 eclipse:eclipse from D:\mavenProject\exampleWeb &lt;br /&gt;Note : This will create .class and .project files for Eclipse for ExampleLogic project. &lt;br /&gt;6) Open the workspace (D:\workspaceExample) from eclipse &lt;br /&gt;7) Select File &amp;gt; Import &amp;gt; General &amp;gt; Existing Projects into workspace&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16671681-169353207213379888?l=kodalis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kodalis.blogspot.com/feeds/169353207213379888/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16671681&amp;postID=169353207213379888' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/169353207213379888'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/169353207213379888'/><link rel='alternate' type='text/html' href='http://kodalis.blogspot.com/2008/06/maven-eclipse-java-project-setup-quick.html' title='Maven + Eclipse Java Project Setup Quick Steps'/><author><name>srikanth</name><uri>http://www.blogger.com/profile/04234053570810422671</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16671681.post-8750117176795508010</id><published>2007-12-23T09:16:00.000-08:00</published><updated>2007-12-23T09:44:20.451-08:00</updated><title type='text'>range validation in javascript</title><content type='html'>function rangeObject(minValue,maxValue){&lt;br /&gt;    this.minValue = minValue;&lt;br /&gt;    this.maxValue = maxValue;&lt;br /&gt;    this.getMinValue = function(){&lt;br /&gt;     return this.minValue;&lt;br /&gt;    }&lt;br /&gt;    this.getMaxValue = function(){&lt;br /&gt;     return this.maxValue;&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    this.validate = function(){&lt;br /&gt;     t_str_min = new String(this.minValue);&lt;br /&gt;     t_str_max = new String(this.maxValue);&lt;br /&gt;     t_str_min = t_str_min.replace(' ','');&lt;br /&gt;     t_str_max = t_str_max.replace(' ','');&lt;br /&gt;     if(t_str_min.length==0 ||&lt;br /&gt;      t_str_max.length==0){&lt;br /&gt;        return false;&lt;br /&gt;&lt;br /&gt;     }else if(isNaN(this.minValue) || isNaN(this.maxValue)){&lt;br /&gt;       return false;&lt;br /&gt;     }else{&lt;br /&gt;       this.minValue = parseInt(this.minValue); &lt;br /&gt;       this.maxValue = parseInt(this.maxValue); &lt;br /&gt;       if(this.minValue&gt;this.maxValue){&lt;br /&gt;      return false;&lt;br /&gt;       }else{ &lt;br /&gt;        return true; &lt;br /&gt;       }&lt;br /&gt;     } &lt;br /&gt;    }&lt;br /&gt;    this.isOverlaped = function(tRangeObject){&lt;br /&gt;     var secondMinValue = tRangeObject.getMinValue(); &lt;br /&gt;     var secondMaxValue = tRangeObject.getMaxValue(); &lt;br /&gt;     if((secondMinValue &lt;= this.minValue &amp;&amp; &lt;br /&gt;      this.minValue &lt;= secondMaxValue)&lt;br /&gt;      || (secondMinValue &lt;= this.maxValue &amp;&amp; &lt;br /&gt;      this.maxValue &lt;= secondMaxValue)&lt;br /&gt;      || (secondMinValue &lt;= this.maxValue &amp;&amp; &lt;br /&gt;      this.maxValue &lt;= secondMaxValue)&lt;br /&gt;      || (this.minValue&lt;=secondMinValue &amp;&amp;&lt;br /&gt;      this.maxValue &gt;=secondMaxValue )){&lt;br /&gt;      return true;&lt;br /&gt;     }else{&lt;br /&gt;      return false; &lt;br /&gt;     }&lt;br /&gt;    }&lt;br /&gt;    this.getValues = function(){&lt;br /&gt;     return this.minValue + ' : ' + this.maxValue;&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;   }&lt;br /&gt;   function checkOverlap(noOfRows){&lt;br /&gt;    var rangeObjectArray = new Array();&lt;br /&gt;    for(i=1;i&lt;=noOfRows;i++){&lt;br /&gt;     var t_min = eval('document.theForm.' + 'rMIN_' + i).value;&lt;br /&gt;     var t_max = eval('document.theForm.' + 'rMAX_' + i).value;&lt;br /&gt;     var tempRangeObject = new rangeObject(t_min,t_max);&lt;br /&gt;     rangeObjectArray.push(tempRangeObject);&lt;br /&gt;    }&lt;br /&gt;    for(j=0;j &lt; rangeObjectArray.length;j++){&lt;br /&gt;     var t_validStr='';&lt;br /&gt;     if(!rangeObjectArray[j].validate()){&lt;br /&gt;      t_validStr = t_validStr + 'values entered in row ' + (j+1) + ' not valid \n';&lt;br /&gt;     }&lt;br /&gt;     if(t_validStr!=''){&lt;br /&gt;      alert(t_validStr);&lt;br /&gt;      return false; &lt;br /&gt;     }&lt;br /&gt;    }   &lt;br /&gt;    for(j=0;j &lt; rangeObjectArray.length;j++){&lt;br /&gt;     for(k=j+1;k &lt; rangeObjectArray.length;k++){&lt;br /&gt;      if(rangeObjectArray[j].isOverlaped(rangeObjectArray[k])){&lt;br /&gt;       alert(rangeObjectArray[j].getValues() + ' ::: ' + rangeObjectArray[k].getValues() + ' are overlapped');&lt;br /&gt;       return false;&lt;br /&gt;      }&lt;br /&gt;     }   &lt;br /&gt;    }  &lt;br /&gt;    return true; &lt;br /&gt;   }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16671681-8750117176795508010?l=kodalis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kodalis.blogspot.com/feeds/8750117176795508010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16671681&amp;postID=8750117176795508010' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/8750117176795508010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/8750117176795508010'/><link rel='alternate' type='text/html' href='http://kodalis.blogspot.com/2007/12/range-validation-in-javascript.html' title='range validation in javascript'/><author><name>srikanth</name><uri>http://www.blogger.com/profile/04234053570810422671</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16671681.post-5606488662160065054</id><published>2007-09-01T10:33:00.000-07:00</published><updated>2007-09-01T10:36:04.496-07:00</updated><title type='text'>small sorting example in oralce pl/sql</title><content type='html'>PROCEDURE prc_test(a VARCHAR2) &lt;br /&gt;   IS &lt;br /&gt;   TYPE v_test IS TABLE OF VARCHAR2(2) INDEX BY VARCHAR2(2); &lt;br /&gt;   v_v_test v_test; &lt;br /&gt;   i VARCHAR2(2); &lt;br /&gt;   BEGIN &lt;br /&gt;        v_v_test('AB') := 'A'; &lt;br /&gt;        v_v_test('AA') := 'C'; &lt;br /&gt;        v_v_test('BA') := 'B'; &lt;br /&gt;         --DBMS_OUTPUT.PUT_LINE('test .... ' || v_v_test.COUNT); &lt;br /&gt;         --DBMS_OUTPUT.PUT_LINE('test .... ' || v_v_test.FIRST); &lt;br /&gt;         --DBMS_OUTPUT.PUT_LINE('test .... ' || v_v_test.LAST); &lt;br /&gt;        -- DBMS_OUTPUT.PUT_LINE('test .... ' || v_v_test.NEXT(1)); &lt;br /&gt;        -- DBMS_OUTPUT.PUT_LINE('test .... ' || v_v_test.NEXT(2));         &lt;br /&gt;        i := v_v_test.FIRST;  -- get subscript of first element &lt;br /&gt;        DBMS_OUTPUT.PUT_LINE('test .... ' || i);                             &lt;br /&gt;        WHILE i IS NOT NULL LOOP &lt;br /&gt;           -- do something with courses(i) &lt;br /&gt;           i := v_v_test.NEXT(i);  -- get subscript of next element &lt;br /&gt;           DBMS_OUTPUT.PUT_LINE('test .... ' || i);                               &lt;br /&gt;        END LOOP; &lt;br /&gt;          &lt;br /&gt;        NULL; &lt;br /&gt;   END;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16671681-5606488662160065054?l=kodalis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kodalis.blogspot.com/feeds/5606488662160065054/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16671681&amp;postID=5606488662160065054' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/5606488662160065054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/5606488662160065054'/><link rel='alternate' type='text/html' href='http://kodalis.blogspot.com/2007/09/small-sorting-example-in-oralce-plsql.html' title='small sorting example in oralce pl/sql'/><author><name>srikanth</name><uri>http://www.blogger.com/profile/04234053570810422671</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16671681.post-3736267776278028235</id><published>2007-03-17T12:00:00.000-07:00</published><updated>2007-03-17T12:01:41.022-07:00</updated><title type='text'>oracle table , sys ref cursor usage in procedure</title><content type='html'>--------------------------------------------- &lt;br /&gt;getting values from a cursor to a table type &lt;br /&gt;-------------------------------------------- &lt;br /&gt;&lt;br /&gt;-- following things can be defined in package specification &lt;br /&gt;&lt;br /&gt;-- define record &lt;br /&gt;&lt;br /&gt;  TYPE studentDetails IS RECORD( &lt;br /&gt;       v_student_id NUMBER(8), &lt;br /&gt;       v_student_name VARCHAR2(25)); &lt;br /&gt;&lt;br /&gt;-- define table [nested table] &lt;br /&gt;&lt;br /&gt;TYPE studentDetailsTab IS TABLE OF studentDetails INDEX BY BINARY_INTEGER; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-- followng things will be inside package body and inside a procedure in a declaration section &lt;br /&gt;&lt;br /&gt;-- define a cursor &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   CURSOR cur_student_details(p_class_id NUMBER) &lt;br /&gt;   IS &lt;br /&gt;   SELECT student_id, &lt;br /&gt;          student_name         &lt;br /&gt;   FROM  student_table &lt;br /&gt;   WHERE class_id = p_class_id; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-- define a variable of type studentDetailsTab &lt;br /&gt;&lt;br /&gt; v_t_studentDetailsTab studentDetailsTab; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-- follwoing things comes in the procedure body &lt;br /&gt;-- open the cursor and fetch the values into the table type &lt;br /&gt;&lt;br /&gt;  OPEN cur_student_details(v_t_classid); &lt;br /&gt;  FETCH cur_student_details BULK COLLECT INTO v_t_studentDetailsTab; &lt;br /&gt;  CLOSE cur_student_details; &lt;br /&gt;&lt;br /&gt;-- looping throgh the table type &lt;br /&gt;&lt;br /&gt;IF v_t_studentDetailsTab.COUNT &gt; 0 THEN &lt;br /&gt;   FOR tempIter IN v_t_studentDetailsTab.FIRST..v_t_studentDetailsTab.LAST &lt;br /&gt;   LOOP &lt;br /&gt;        DBMS_OUTPUT.PUT_LINE('student id ' || v_t_studentDetailsTab(tempIter).v_student_id); &lt;br /&gt;        DBMS_OUTPUT.PUT_LINE('student name ' || v_t_studentDetailsTab(tempIter).v_student_name); &lt;br /&gt;   END LOOP;         &lt;br /&gt;END IF; &lt;br /&gt;&lt;br /&gt;-------------------------------------------------- &lt;br /&gt;getting values from a SYS_REFCURSOR to table type &lt;br /&gt;-------------------------------------------------- &lt;br /&gt;&lt;br /&gt;-- cosider there is a function returnting the sys_refcursor in some other package &lt;br /&gt;&lt;br /&gt;FUNCTION FNC_STUDENTDETAILS(p_class_id NUMBER, &lt;br /&gt;                                p_sql_code OUT PLS_INTEGER, &lt;br /&gt;                                p_sql_errm OUT VARCHAR2) RETURN sys_refcursor IS &lt;br /&gt;&lt;br /&gt;v_cur_studentdetails  sys_refcursor; &lt;br /&gt;BEGIN &lt;br /&gt;   open v_cur_studentdetails FOR &lt;br /&gt;   SELECT student_id, &lt;br /&gt;          student_name         &lt;br /&gt;   FROM  student_table &lt;br /&gt;   WHERE class_id = p_class_id; &lt;br /&gt;&lt;br /&gt;   return v_cur_studentdetails; &lt;br /&gt;        &lt;br /&gt;END; &lt;br /&gt;  EXCEPTION &lt;br /&gt;    WHEN OTHERS THEN &lt;br /&gt;      p_sql_code := SQLCODE; &lt;br /&gt;      p_sql_errm := SQLERRM; &lt;br /&gt;      RETURN v_cur_studentdetails; &lt;br /&gt; END FNC_STUDENTDETAILS; &lt;br /&gt;&lt;br /&gt;-- how to use it &lt;br /&gt;-- following things can be defined in package specification &lt;br /&gt;&lt;br /&gt;-- define record &lt;br /&gt;&lt;br /&gt;  TYPE studentDetails IS RECORD( &lt;br /&gt;       v_student_id NUMBER(8), &lt;br /&gt;       v_student_name VARCHAR2(25)); &lt;br /&gt;&lt;br /&gt;-- define table [nested table] &lt;br /&gt;&lt;br /&gt;TYPE studentDetailsTab IS TABLE OF studentDetails INDEX BY BINARY_INTEGER; &lt;br /&gt;&lt;br /&gt;--- define the following in package body , package declaration section &lt;br /&gt;&lt;br /&gt; v_t_student_details SYS_REFCURSOR; &lt;br /&gt; v_t_studentDetailsTab studentDetailsTab; &lt;br /&gt;&lt;br /&gt;-- call the following in the procdure body &lt;br /&gt;&lt;br /&gt; v_t_student_details := &lt;pakcagename&gt;.FNC_STUDENTDETAILS(v_t_classid,p_errcd,p_errm); &lt;br /&gt;                        &lt;br /&gt; -- fetch student details &lt;br /&gt; FETCH v_t_student_details BULK COLLECT INTO v_t_studentDetailsTab; &lt;br /&gt; -- we can check &lt;br /&gt; IF v_t_student_details%NOTFOUND THEN &lt;br /&gt;        null; -- do some thing &lt;br /&gt; END IF;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16671681-3736267776278028235?l=kodalis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kodalis.blogspot.com/feeds/3736267776278028235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16671681&amp;postID=3736267776278028235' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/3736267776278028235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/3736267776278028235'/><link rel='alternate' type='text/html' href='http://kodalis.blogspot.com/2007/03/oracle-table-sys-ref-cursor-usage-in.html' title='oracle table , sys ref cursor usage in procedure'/><author><name>srikanth</name><uri>http://www.blogger.com/profile/04234053570810422671</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16671681.post-1062458929982883197</id><published>2007-03-17T11:57:00.000-07:00</published><updated>2007-03-17T12:06:04.730-07:00</updated><title type='text'>using a oracle array type as out parameter in a stroed procedure and using that in java program</title><content type='html'>create types in oracle &lt;br /&gt;&lt;br /&gt;1) create or replace TYPE IDHolderList IS TABLE OF NUMBER; &lt;br /&gt;2) create public synonym S_IDHOLDERLIST for IDHOLDERLIST; -- incase of multiple schemas create this public synonym &lt;br /&gt;&lt;br /&gt;3) write the procedure &lt;br /&gt;&lt;br /&gt;        PROCEDURE prc_test(v_IDList OUT s_IDHolderList) &lt;br /&gt;        IS &lt;br /&gt;          BEGIN -- START OF PROCEDURE &lt;br /&gt;&lt;br /&gt;              v_IDList.EXTEND; &lt;br /&gt;              v_IDList(v_IDList.COUNT) := 1; &lt;br /&gt;              v_IDList.EXTEND; &lt;br /&gt;              v_IDList(v_IDList.COUNT) := 2; &lt;br /&gt;&lt;br /&gt;          END prc_test; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4) java code &lt;br /&gt;&lt;br /&gt;        // sepcial imports needed &lt;br /&gt;        import oracle.jdbc.OracleCallableStatement; &lt;br /&gt;        import oracle.jdbc.OracleTypes; &lt;br /&gt;        import oracle.sql.ARRAY; &lt;br /&gt;        import java.math.BigDecimal; &lt;br /&gt;&lt;br /&gt;        // sample code &lt;br /&gt;        Connection objConnection = getConnection(); &lt;br /&gt;        OracleCallableStatement objCall = null; &lt;br /&gt;        objCall = (OracleCallableStatement)objConnection.prepareCall("call prc_test(?)"); &lt;br /&gt;        objCall.registerOutParameter(3,OracleTypes.ARRAY,"S_IDHOLDERLIST"); &lt;br /&gt;        objCall.execute(); &lt;br /&gt;        ARRAY simpleArray = objCall.getARRAY(3); &lt;br /&gt;        if(simpleArray!=null){ &lt;br /&gt;                BigDecimal[] values = (BigDecimal[])simpleArray.getArray(); &lt;br /&gt;        } &lt;br /&gt;&lt;br /&gt;        &lt;br /&gt;&lt;br /&gt;few clarifications about oracle collection types &lt;br /&gt;------------------------------------------------ &lt;br /&gt;&lt;br /&gt;PL/SQL offers these collection types: &lt;br /&gt;&lt;br /&gt;Index-by tables, also known as associative arrays, let you look up elements using arbitrary numbers and strings for subscript values. (They are similar to hash tables in other programming languages.) &lt;br /&gt;  &lt;br /&gt;Nested tables hold an arbitrary number of elements. They use sequential numbers as subscripts. You can define equivalent SQL types, allowing nested tables to be stored in database tables and manipulated through SQL. &lt;br /&gt;&lt;br /&gt;Varrays (short for variable-size arrays) hold a fixed number of elements (although you can change the number of elements at runtime). They use sequential numbers as subscripts. You can define equivalent SQL types, allowing varrays to be stored in database tables. They can be stored and retrieved through SQL, but with less flexibility than nested tables. &lt;br /&gt;&lt;br /&gt;Arrays in other languages become VARRAYs in PL/SQL. &lt;br /&gt;&lt;br /&gt;Sets and bags in other languages become nested tables in PL/SQL. &lt;br /&gt;&lt;br /&gt;Hash tables and other kinds of unordered lookup tables in other languages become associative arrays in PL/SQL. &lt;br /&gt;&lt;br /&gt;------------- &lt;br /&gt;&lt;br /&gt;Choosing Between Nested Tables and Associative Arrays &lt;br /&gt;Both nested tables and associative arrays (formerly known as index-by tables) use similar subscript notation, but they have different characteristics when it comes to persistence and ease of parameter passing. &lt;br /&gt;&lt;br /&gt;Nested tables can be stored in a database column, but associative arrays cannot. Nested tables are appropriate for important data relationships that must be stored persistently. &lt;br /&gt;&lt;br /&gt;Associative arrays are appropriate for relatively small lookup tables where the collection can be constructed in memory each time a procedure is called or a package is initialized. They are good for collecting information whose volume is unknown beforehand, because there is no fixed limit on their size. Their index values are more flexible, because associative array subscripts can be negative, can be nonsequential, and can use string values instead of numbers when appropriate. &lt;br /&gt;&lt;br /&gt;PL/SQL automatically converts between host arrays and associative arrays that use numeric key values. The most efficient way to pass collections to and from the database server is to use anonymous PL/SQL blocks to bulk-bind input and output host arrays to associative arrays. &lt;br /&gt;&lt;br /&gt;Choosing Between Nested Tables and Varrays &lt;br /&gt;Varrays are a good choice when the number of elements is known in advance, and when the elements are usually all accessed in sequence. When stored in the database, varrays retain their ordering and subscripts. &lt;br /&gt;&lt;br /&gt;Each varray is stored as a single object, either inside the table of which it is a column (if the varray is less than 4KB) or outside the table but still in the same tablespace (if the varray is greater than 4KB). You must update or retrieve all elements of the varray at the same time, which is most appropriate when performing some operation on all the elements at once. But you might find it impractical to store and retrieve large numbers of elements this way. &lt;br /&gt;&lt;br /&gt;Nested tables can be sparse: you can delete arbitrary elements, rather than just removing an item from the end. Nested table data is stored out-of-line in a store table, a system-generated database table associated with the nested table. This makes nested tables suitable for queries and updates that only affect some elements of the collection. You cannot rely on the order and subscripts of a nested table remaining stable as the table is stored and retrieved, because the order and subscripts are not preserved when a nested table is stored in the database.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16671681-1062458929982883197?l=kodalis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kodalis.blogspot.com/feeds/1062458929982883197/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16671681&amp;postID=1062458929982883197' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/1062458929982883197'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/1062458929982883197'/><link rel='alternate' type='text/html' href='http://kodalis.blogspot.com/2007/03/using-oracle-array-type-as-out.html' title='using a oracle array type as out parameter in a stroed procedure and using that in java program'/><author><name>srikanth</name><uri>http://www.blogger.com/profile/04234053570810422671</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16671681.post-5710659756160049393</id><published>2007-03-17T11:55:00.000-07:00</published><updated>2007-03-17T11:56:31.001-07:00</updated><title type='text'>struts validation</title><content type='html'>using struts validation frame work as well as the validation method in validatorform &lt;br /&gt;=====================================================================================&lt;br /&gt;1) add the validation rules in the validation framework &lt;br /&gt;2) for more validations override the validation method of the ValidatorForm as follows &lt;br /&gt;&lt;br /&gt;public ActionErrors validate(ActionMapping map,HttpServletRequest req){ &lt;br /&gt;&lt;br /&gt;// get the validation errors from the frame work &lt;br /&gt;ActionErrors objActionErros =  super.validate(map,req); &lt;br /&gt;&lt;br /&gt;// start custom validations &lt;br /&gt;String strPageNumber = req.getParameter("page"); &lt;br /&gt;if(strPageNumber!=null &amp;&amp; !strPageNumber.eqlus("2")){ &lt;br /&gt;        if(objActionErros==null){ &lt;br /&gt;                        objActionErros = new ActionErrors(); &lt;br /&gt;                } &lt;br /&gt;        objActionErros.add("errors",new ActionError("errors.wrongpage"));// this key will be in the message resource file &lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;return objActionErros; &lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16671681-5710659756160049393?l=kodalis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kodalis.blogspot.com/feeds/5710659756160049393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16671681&amp;postID=5710659756160049393' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/5710659756160049393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/5710659756160049393'/><link rel='alternate' type='text/html' href='http://kodalis.blogspot.com/2007/03/struts-validation.html' title='struts validation'/><author><name>srikanth</name><uri>http://www.blogger.com/profile/04234053570810422671</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16671681.post-8364182393872519</id><published>2007-03-17T11:51:00.000-07:00</published><updated>2007-03-17T11:54:57.602-07:00</updated><title type='text'>Quality process</title><content type='html'>------------------ &lt;br /&gt;A) Proposal STAGE &lt;br /&gt;------------------ &lt;br /&gt;1) proposal &lt;br /&gt;&lt;br /&gt;2) Estimation [can use functional point estimation] [consider fixed bid , time and management] &lt;br /&gt;&lt;br /&gt;------------------------------------------------------- &lt;br /&gt;B) Once Proposal/Estimation is approved start  Analysis &lt;br /&gt;------------------------------------------------------- &lt;br /&gt;&lt;br /&gt;1) prepare the document for project [called as PDSP] , which contains details about harware requirements, &lt;br /&gt;   configuration management tool , Quaility person ,Quality audit frequencey, other trimmings for the quality &lt;br /&gt;   policy of the company in specific to the project &lt;br /&gt;&lt;br /&gt;2) should start maintaining the Trancebility matrix [horizantal , vertical tracebility matrix] &lt;br /&gt;   horizantal will contain functional points against deliverables [HLD,SRS,LLDs,UTCs,ITCs,STCs]         &lt;br /&gt;   Vertical will contain functional points against functional points to get an idea of impact of change &lt;br /&gt;   in one functionality on other &lt;br /&gt;&lt;br /&gt;3) preparing check lists for variuos artifacts &lt;br /&gt;&lt;br /&gt;4) Software requirement specification [SRS] &lt;br /&gt;&lt;br /&gt;---------------------------------------------- &lt;br /&gt;C) Once architecture is approved start Design &lt;br /&gt;---------------------------------------------- &lt;br /&gt;&lt;br /&gt;1) High Level Document [Architecture] [HLD] &lt;br /&gt;&lt;br /&gt;2) If one have to choose between technologies one has to prepare a sheet for comparing them for taking a decision &lt;br /&gt;&lt;br /&gt;   the reoport is called Decision Analysis Report [DAR] &lt;br /&gt;&lt;br /&gt;3) Low Level Document [should be done for all the use cases] &lt;br /&gt;&lt;br /&gt;4) Unit Test Cases &lt;br /&gt;&lt;br /&gt;5) Integration Test Cases[integrating modules or with other projects] &lt;br /&gt;&lt;br /&gt;6) System Test Cases [functionality test cases] &lt;br /&gt;&lt;br /&gt;---------------------------------------------- &lt;br /&gt;D) Once Design is approved start Construction &lt;br /&gt;---------------------------------------------- &lt;br /&gt;&lt;br /&gt;1) coding , code review &lt;br /&gt;&lt;br /&gt;2) unit testing , capturing unit test results &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;------------------------------------------ &lt;br /&gt;D) Once construction is done start testing &lt;br /&gt;------------------------------------------ &lt;br /&gt;&lt;br /&gt;1) integration testing , capture results , raise defects , fix and release &lt;br /&gt;&lt;br /&gt;2) system testing , capture results , raise defects , fix and release &lt;br /&gt;&lt;br /&gt;3) user acceptance testing , capture results , raise defects , fix and release &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Each one of the above should follow the following steps &lt;br /&gt;&lt;br /&gt;i)  Preparation &lt;br /&gt;&lt;br /&gt;ii) each artifcat will have a check list, the check list has to be filled with self review &lt;br /&gt;&lt;br /&gt;iii)external Review [in some cases it will goto SME (System Mater Expert) review ] &lt;br /&gt;&lt;br /&gt;iv) all the review/testing defects should be captured and fixed &lt;br /&gt;&lt;br /&gt;v) Rework [again goes back to review/testing until every thing is ok] &lt;br /&gt;&lt;br /&gt;vi)  Each deliverable should go after FIR (Final Inspection Report) from Quality person &lt;br /&gt;&lt;br /&gt;Vii) after each page there will be a casual analysis meeting for discussing where more &lt;br /&gt;    defects are coming and how to reduce them [training or adding items to check lists etc] &lt;br /&gt;    and the strategy for the upcoming phase &lt;br /&gt;&lt;br /&gt;Viii) every discussion either with customer or internal should have Minutes of Meeting and open items for action captured &lt;br /&gt;&lt;br /&gt;ix) every artifact , evidence (like customer mail , Minutes of meeting) should be in configuration management tool &lt;br /&gt;&lt;br /&gt;x) In the above Phases one should ensure to get the best practices , resuable components. &lt;br /&gt;&lt;br /&gt;------------------------------------------------------- &lt;br /&gt;E) Once UAT (user acceptence) is done start Maintanance &lt;br /&gt;------------------------------------------------------- &lt;br /&gt;&lt;br /&gt;1) raising tickets , closing , tracking time&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16671681-8364182393872519?l=kodalis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kodalis.blogspot.com/feeds/8364182393872519/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16671681&amp;postID=8364182393872519' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/8364182393872519'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/8364182393872519'/><link rel='alternate' type='text/html' href='http://kodalis.blogspot.com/2007/03/quality-process.html' title='Quality process'/><author><name>srikanth</name><uri>http://www.blogger.com/profile/04234053570810422671</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16671681.post-115847776269096901</id><published>2006-09-17T00:22:00.000-07:00</published><updated>2006-09-17T00:22:42.696-07:00</updated><title type='text'>General Talk about Java Memory</title><content type='html'>Basically Heap and Stack are the same thing.  The difference is how they are used/accessed.  They both are an area of memory where you store something.  With a heap, you access what you are storing in any order you want and they stay there until you remove them.  &lt;br /&gt;&lt;br /&gt;With a stack, you normally access them in the reverse order you put them on the stack and they are automatically removed as you access them.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Both of 'em are sources from which memory is allocated. Stack is automatic, which is created when memory is in scope, and destroyed when it is out of scope. Heap is manual and created and destroyed when requested. On stack, the local variables (unless they are static or register data members), function parameters are stored on stack. On heap normally global variables, static local variables, any data allocated by using calls like new will be stored.&lt;br /&gt;&lt;br /&gt;---------------------&lt;br /&gt;&lt;br /&gt;jre=jvm+some classes(like awt,swing...)&lt;br /&gt;&lt;br /&gt;and if u wonder what is the use of providing jre...the answer is if u develop an application in java and u want to give it to the client then u also need to provide runtime environment also so jre is given for redistribution to the clients to whoom u make a s/w product...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;jre= targeted for execution i.e. jvm+some classes(like awt,swing...)+runtime libraries.&lt;br /&gt;&lt;br /&gt;jdk= mainly targeted for java development i.e. compilation (javac+others) + jvm + libraries.&lt;br /&gt;&lt;br /&gt;u can find jvm in both jre and jdk. &lt;br /&gt;&lt;br /&gt;-----------------------&lt;br /&gt;&lt;br /&gt;We conclude our discussion of storage class and scope by breifly describing how the memory of the computer is organized for a running program. When a program is loaded into memory, it is organized into three areas of memory, called  segments: the  text segment,  stack segment, and  heap segment. The text segment (sometimes also called the code segment) is where the compiled code of the program itself resides. This is the machine language representation of the program steps to be carried out, including all functions making up the program, both user defined and system.&lt;br /&gt;&lt;br /&gt;The remaining two areas of system memory is where storage may be allocated by the compiler for data storage. The stack is where memory is allocated for automatic variables within functions. A stack is a Last In First Out (LIFO) storage device where new storage is allocated and deallocated at only one ``end'', called the Top of the stack.&lt;br /&gt;&lt;br /&gt;When a program begins executing in the function  main(), space is allocated on the stack for all variables declared within  main(). If  main() calls a function,  func1(), additional storage is allocated for the variables in  func1() at the top of the stack. Notice that the parameters passed by  main() to  func1() are also stored on the stack. If  func1() were to call any additional functions, storage would be allocated at the new Top of stack. When  func1() returns, storage for its local variables is deallocated, and the Top of the stack returns to to position. If  main() were to call another function, storage would be allocated for that function at the Top. As can be seen, the memory allocated in the stack area is used and reused during program execution. It should be clear that memory allocated in this area will contain garbage values left over from previous usage.&lt;br /&gt;&lt;br /&gt;The heap segment provides more stable storage of data for a program; memory allocated in the heap remains in existence for the duration of a program. Therefore, global variables (storage class external), and static variables are allocated on the heap. The memory allocated in the heap area, if initialized to zero at program start, remains zero until the program makes use of it. Thus, the heap area need not contain garbage. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ref : http://java.sun.com/docs/books/vmspec/2nd-edition/html/Overview.doc.html&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Runtime Data Areas&lt;br /&gt;------------------&lt;br /&gt;&lt;br /&gt;The Java virtual machine defines various runtime data areas that are used during execution of a program. Some of these data areas are created on Java virtual machine start-up and are destroyed only when the Java virtual machine exits. Other data areas are per thread. Per-thread data areas are created when a thread is created and destroyed when the thread exits.&lt;br /&gt;&lt;br /&gt;The pc Register&lt;br /&gt;---------------&lt;br /&gt;&lt;br /&gt;The Java virtual machine can support many threads of execution at once. Each Java virtual machine thread has its own pc (program counter) register. At any point, each Java virtual machine thread is executing the code of a single method, the current method for that thread. If that method is not native, the pc register contains the address of the Java virtual machine instruction currently being executed. If the method currently being executed by the thread is native, the value of the Java virtual machine's pc register is undefined. The Java virtual machine's pc register is wide enough to hold a returnAddress or a native pointer on the specific platform.&lt;br /&gt;&lt;br /&gt;Java Virtual Machine Stacks&lt;br /&gt;---------------------------&lt;br /&gt;&lt;br /&gt;Each Java virtual machine thread has a private Java virtual machine stack, created at the same time as the thread.A Java virtual machine stack stores frames.it holds local variables and partial results, and plays a part in method invocation and return. Because the Java virtual machine stack is never manipulated directly except to push and pop frames, frames may be heap allocated. The memory for a Java virtual machine stack does not need to be contiguous.&lt;br /&gt;&lt;br /&gt;The Java virtual machine stack size limit may be set on virtual machine start-up using the "-oss" flag. The Java virtual machine stack size limit can be used to limit memory consumption or to catch runaway recursions.&lt;br /&gt;&lt;br /&gt;The following exceptional conditions are associated with Java virtual machine stacks:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If the computation in a thread requires a larger Java virtual machine stack than is permitted, the Java virtual machine throws a StackOverflowError. &lt;br /&gt;&lt;br /&gt;If Java virtual machine stacks can be dynamically expanded, and expansion is attempted but insufficient memory can be made available to effect the expansion, or if insufficient memory can be made available to create the initial Java virtual machine stack for a new thread, the Java virtual machine throws an OutOfMemoryError. &lt;br /&gt;&lt;br /&gt;Heap&lt;br /&gt;----&lt;br /&gt;&lt;br /&gt;The Java virtual machine has a heap that is shared among all Java virtual machine threads. The heap is the runtime data area from which memory for all class instances and arrays is allocated. &lt;br /&gt;&lt;br /&gt;The heap is created on virtual machine start-up. Heap storage for objects is reclaimed by an automatic storage management system (known as a garbage collector); objects are never explicitly deallocated. The Java virtual machine assumes no particular type of automatic storage management system, and the storage management technique may be chosen according to the implementor's system requirements. The heap may be of a fixed size or may be expanded as required by the computation and may be contracted if a larger heap becomes unnecessary. The memory for the heap does not need to be contiguous. &lt;br /&gt;&lt;br /&gt;A Java virtual machine implementation may provide the programmer or the user control over the initial size of the heap, as well as, if the heap can be dynamically expanded or contracted, control over the maximum and minimum heap size(start-up using the "-ms" and "-mx")&lt;br /&gt;&lt;br /&gt;The following exceptional condition is associated with the heap:&lt;br /&gt;&lt;br /&gt;If a computation requires more heap than can be made available by the automatic storage management system, the Java virtual machine throws an OutOfMemoryError.&lt;br /&gt;&lt;br /&gt;Method Area&lt;br /&gt;-----------&lt;br /&gt;&lt;br /&gt;The Java virtual machine has a method area that is shared among all Java virtual machine threads. The method area is analogous to the storage area for compiled code of a conventional language or analogous to the "text" segment in a UNIX process.&lt;br /&gt;&lt;br /&gt;The method area is created on virtual machine start-up. Although the method area is logically part of the heap, simple implementations may choose not to either garbage collect or compact it.&lt;br /&gt;&lt;br /&gt;The following exceptional condition is associated with the method area:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If memory in the method area cannot be made available to satisfy an allocation request, the Java virtual machine throws an OutOfMemoryError. &lt;br /&gt;&lt;br /&gt;Runtime Constant Pool&lt;br /&gt;---------------------&lt;br /&gt;&lt;br /&gt;A runtime constant pool is a per-class or per-interface runtime representation of the constant_pool table in a class file.&lt;br /&gt;It contains several kinds of constants, ranging from numeric literals known at compile time to method and field references that must be resolved at run time. The runtime constant pool serves a function similar to that of a symbol table for a conventional programming language, although it contains a wider range of data than a typical symbol table. &lt;br /&gt;&lt;br /&gt;Native Method Stacks&lt;br /&gt;--------------------&lt;br /&gt;&lt;br /&gt;An implementation of the Java virtual machine may use conventional stacks, colloquially called "C stacks," to support native methods, methods written in a language other than the Java programming language.&lt;br /&gt;&lt;br /&gt;Frames&lt;br /&gt;------&lt;br /&gt;&lt;br /&gt;A frame is used to store data and partial results, as well as to perform dynamic linking , return values for methods, and dispatch exceptions.&lt;br /&gt;&lt;br /&gt;A new frame is created each time a method is invoked. A frame is destroyed when its method invocation completes, whether that completion is normal or abrupt (it throws an uncaught exception). Frames are allocated from the Java virtual machine stack  of the thread creating the frame. Each frame has its own array of local variables,its own operand stack, and a reference to the runtime constant pool of the class of the current method.&lt;br /&gt;&lt;br /&gt;Note that a frame created by a thread is local to that thread and cannot be referenced by any other thread.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The ClassFile Structure&lt;br /&gt;-----------------------&lt;br /&gt;&lt;br /&gt;A class file consists of a single ClassFile structure: &lt;br /&gt;&lt;br /&gt;    ClassFile {&lt;br /&gt;        u4 magic;&lt;br /&gt;        u2 minor_version;&lt;br /&gt;        u2 major_version;&lt;br /&gt;        u2 constant_pool_count;&lt;br /&gt;        cp_info constant_pool[constant_pool_count-1];&lt;br /&gt;        u2 access_flags;&lt;br /&gt;        u2 this_class;&lt;br /&gt;        u2 super_class;&lt;br /&gt;        u2 interfaces_count;&lt;br /&gt;        u2 interfaces[interfaces_count];&lt;br /&gt;        u2 fields_count;&lt;br /&gt;        field_info fields[fields_count];&lt;br /&gt;        u2 methods_count;&lt;br /&gt;        method_info methods[methods_count];&lt;br /&gt;        u2 attributes_count;&lt;br /&gt;        attribute_info attributes[attributes_count];&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;Virtual Machine Start-up&lt;br /&gt;------------------------&lt;br /&gt;The Java virtual machine starts up by creating an initial class, which is specified in an implementation-dependent manner, using the bootstrap class loader. The Java virtual machine then links the initial class, initializes it, and invokes its public class method void main(String[]). The invocation of this method drives all further execution. Execution of the Java virtual machine instructions constituting the main method may cause linking (and consequently creation) of additional classes and interfaces, as well as invocation of additional methods. &lt;br /&gt;&lt;br /&gt;Threads&lt;br /&gt;-------&lt;br /&gt;To synchronize threads the language uses monitors, a mechanism for allowing one thread at a time to execute a region of code. The behavior of monitors is explained in terms of locks. There is a lock associated with each object.&lt;br /&gt;&lt;br /&gt;The synchronized statement performs two special actions relevant only to multithreaded operation:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;After computing a reference to an object but before executing its body, it locks a lock associated with the object.&lt;br /&gt;&lt;br /&gt;After execution of the body has completed, either normally or abruptly, it unlocks that same lock. As a convenience, a method may be declared synchronized; such a method behaves as if its body were contained in a synchronized statement. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Threads&lt;br /&gt;-------&lt;br /&gt;&lt;br /&gt;A variable is any location within a program that may be stored into. This includes not only class variables and instance variables, but also components of arrays. Variables are kept in a main memory that is shared by all threads. Because it is impossible for one thread to access parameters or local variables of another thread, it does not matter whether parameters and local variables are thought of as residing in the shared main memory or in the working memory of the thread that owns them. &lt;br /&gt;Every thread has a working memory in which it keeps its own working copy of variables that it must use or assign. As the thread executes a program, it operates on these working copies. The main memory contains the master copy of every variable. There are rules about when a thread is permitted or required to transfer the contents of its working copy of a variable into the master copy or vice versa.&lt;br /&gt;&lt;br /&gt;check the link : http://java.sun.com/docs/books/vmspec/2nd-edition/html/Threads.doc.html&lt;br /&gt;Book : The JavaTM Virtual Machine Specification, Second Edition&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16671681-115847776269096901?l=kodalis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kodalis.blogspot.com/feeds/115847776269096901/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16671681&amp;postID=115847776269096901' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/115847776269096901'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/115847776269096901'/><link rel='alternate' type='text/html' href='http://kodalis.blogspot.com/2006/09/general-talk-about-java-memory.html' title='General Talk about Java Memory'/><author><name>srikanth</name><uri>http://www.blogger.com/profile/04234053570810422671</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16671681.post-115847769657944773</id><published>2006-09-17T00:20:00.000-07:00</published><updated>2006-09-17T00:21:36.580-07:00</updated><title type='text'>MS SQL SERVER PROCEDURE FOR TREE STRUCTURE</title><content type='html'>This MS SQL SERVER procedure is used to get the list of all children , childrens children so on... for a given parent&lt;br /&gt;&lt;br /&gt;CREATE PROCEDURE TEST&lt;br /&gt;    @id numeric(10)&lt;br /&gt;AS&lt;br /&gt;begin&lt;br /&gt;    create table #temp(parentid numeric(10) , level int,process bit,root numeric(10))&lt;br /&gt;    -- 0 level&lt;br /&gt;    insert into #temp values(@id,0,0,0)&lt;br /&gt;    declare @level int&lt;br /&gt;        set @level=0&lt;br /&gt;        select top 1 @id = parentid from #temp where level = @level and process=0;&lt;br /&gt;&lt;br /&gt;        while(@id is not null)&lt;br /&gt;        begin&lt;br /&gt;            update #temp set process =1  where parentid = @id and level = @level and process = 0;&lt;br /&gt;            insert into #temp select GRP_ID_N,@level+1,0,@id from USR_GRPS where parent_grp_id_n = @id&lt;br /&gt;            select top 1 @id = parentid from #temp where level = @level and process=0;&lt;br /&gt;             if @@rowcount = 0 &lt;br /&gt;             begin&lt;br /&gt;                set @id = null&lt;br /&gt;                set @level = @level + 1&lt;br /&gt;                select top 1 @id = parentid from #temp where level = @level and process=0;&lt;br /&gt;             end&lt;br /&gt;         end&lt;br /&gt;&lt;br /&gt;         select * from #temp&lt;br /&gt;&lt;br /&gt;end&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16671681-115847769657944773?l=kodalis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kodalis.blogspot.com/feeds/115847769657944773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16671681&amp;postID=115847769657944773' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/115847769657944773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/115847769657944773'/><link rel='alternate' type='text/html' href='http://kodalis.blogspot.com/2006/09/ms-sql-server-procedure-for-tree.html' title='MS SQL SERVER PROCEDURE FOR TREE STRUCTURE'/><author><name>srikanth</name><uri>http://www.blogger.com/profile/04234053570810422671</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16671681.post-115496169472900580</id><published>2006-08-07T07:33:00.001-07:00</published><updated>2006-09-17T00:18:32.973-07:00</updated><title type='text'>Working with Oracle , JAVA Array Types</title><content type='html'>1) create an array type in oracle&lt;br /&gt;----------------------------------&lt;br /&gt;&lt;br /&gt;create or replace type NUM_ARRAY as table of number(10);&lt;br /&gt;&lt;br /&gt;2)create oracle procedure&lt;br /&gt;--------------------------&lt;br /&gt;&lt;br /&gt;CREATE OR REPLACE PROCEDURE TEST_procedure(p_array in num_array,ERR_MSG OUT VARCHAR2)&lt;br /&gt;IS&lt;br /&gt;BEGIN&lt;br /&gt;  for i in 1 .. p_array.count&lt;br /&gt;  loop&lt;br /&gt;    insert into  TESTTABLE values('T' || i,'TEST');&lt;br /&gt;  end loop;&lt;br /&gt;  commit;&lt;br /&gt;EXCEPTION&lt;br /&gt; WHEN OTHERS THEN&lt;br /&gt; BEGIN&lt;br /&gt;  ROLLBACK;&lt;br /&gt;    ERR_MSG := SQLERRM(SQLCODE);-- send the error message back if there any exeptions.&lt;br /&gt; END;&lt;br /&gt;END;&lt;br /&gt;&lt;br /&gt;3)java program&lt;br /&gt;---------------&lt;br /&gt;import java.sql.Connection;&lt;br /&gt;import java.sql.SQLException;&lt;br /&gt;&lt;br /&gt;import oracle.jdbc.driver.OraclePreparedStatement;&lt;br /&gt;import oracle.sql.ARRAY;&lt;br /&gt;import oracle.sql.ArrayDescriptor;&lt;br /&gt;&lt;br /&gt;import org.hibernate.HibernateException;&lt;br /&gt;&lt;br /&gt;public class CallSP{&lt;br /&gt; public static void main(String args[]){&lt;br /&gt;&lt;br /&gt; try {&lt;br /&gt;  int intArray[] = { 1,2,3,4,5,6 };&lt;br /&gt;                // from any connection pool get the connection&lt;br /&gt;         Connection conn =HibernateUtil.currentSession().connection();&lt;br /&gt;&lt;br /&gt;      OraclePreparedStatement ps =&lt;br /&gt;                  (OraclePreparedStatement)conn.prepareStatement&lt;br /&gt;                  ( "begin TEST_procedure(:x,:outparam); end;" );&lt;br /&gt;&lt;br /&gt;   ArrayDescriptor descriptor =&lt;br /&gt;    ArrayDescriptor.createDescriptor( "NUM_ARRAY", ps.getConnection());&lt;br /&gt;&lt;br /&gt;   ARRAY array_to_pass =  new ARRAY( descriptor, conn, intArray );&lt;br /&gt;              ps.setARRAY( 1, array_to_pass );&lt;br /&gt;                 ps.registerOutParameter(2,Types.VARCHAR); &lt;br /&gt;   ps.execute();&lt;br /&gt;   String  strResult =  ps.getString(2);&lt;br /&gt;               &lt;br /&gt;  } catch (HibernateException e) {&lt;br /&gt;   e.printStackTrace();&lt;br /&gt;  } catch (SQLException e) {&lt;br /&gt;   e.printStackTrace();&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt; }&lt;br /&gt;}// end of : CallSP class&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16671681-115496169472900580?l=kodalis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kodalis.blogspot.com/feeds/115496169472900580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16671681&amp;postID=115496169472900580' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/115496169472900580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/115496169472900580'/><link rel='alternate' type='text/html' href='http://kodalis.blogspot.com/2006/08/working-with-oracle-java-array-types_07.html' title='Working with Oracle , JAVA Array Types'/><author><name>srikanth</name><uri>http://www.blogger.com/profile/04234053570810422671</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16671681.post-114639385503485849</id><published>2006-04-30T03:38:00.000-07:00</published><updated>2006-04-30T03:44:15.046-07:00</updated><title type='text'>Java Script OOPS</title><content type='html'>This post is an extract from a site given below. It covers how objects , functions can be used to do Object oriented programming in Java Script.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Objects&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;There are two basic ways to create an object:&lt;br /&gt;&lt;br /&gt;var obj = new Object();&lt;br /&gt;&lt;br /&gt;And...&lt;br /&gt;&lt;br /&gt;var obj = {};  // knonw as object literal syntax&lt;br /&gt;&lt;br /&gt;Once created, an object's properties can again be accessed in one of two ways:&lt;br /&gt;&lt;br /&gt;obj.name = "tester"&lt;br /&gt;var name = obj.name;&lt;br /&gt;&lt;br /&gt;And...&lt;br /&gt;&lt;br /&gt;obj["name"] = "tester";&lt;br /&gt;var name = obj["name"]; &lt;br /&gt;&lt;br /&gt;These are also semantically equivalent.The second method has the advantage that the name of the property is provided as a string, which means it can be calculated at run-time.It can also be used to set and get properties with names that are reserved words:&lt;br /&gt;&lt;br /&gt;obj.for = "Simon"; // Syntax error&lt;br /&gt;obj["for"] = "Simon"; // works fine&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Functions&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;JavaScript lets you create anonymous functions.&lt;br /&gt;&lt;br /&gt;var avg = function() {&lt;br /&gt;    var sum = 0;&lt;br /&gt;    for (var i = 0, j = arguments.length; i &lt; j; i++) {&lt;br /&gt;        sum += arguments[i];&lt;br /&gt;    }&lt;br /&gt;    return sum / arguments.length;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This highlights a potential problem with anonymous functions: how do you call them recursively if they don't have a name? The answer lies with the arguments object, which in addition to acting as a list of arguments also provides a property called arguments.callee. This always refers to the current function, and hence can be &lt;br /&gt;used to make recursive calls&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Inner functions&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;JavaScript function declarations are allowed inside other functions. &lt;br /&gt;&lt;br /&gt;function betterExampleNeeded() {&lt;br /&gt;    var a = 1;&lt;br /&gt;    function oneMoreThanA() {&lt;br /&gt;        return a + 1;&lt;br /&gt;    }&lt;br /&gt;    return oneMoreThanA();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Closures&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;function makeAdder(a) {&lt;br /&gt;    return function(b) {&lt;br /&gt;        return a + b;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;x = makeAdder(5);&lt;br /&gt;y = makeAdder(20);&lt;br /&gt;x(6)&lt;br /&gt;?&lt;br /&gt;y(7)&lt;br /&gt;?&lt;br /&gt;&lt;br /&gt;The name of the makeAdder function should give it away: it creates new 'adder' functions, which when called with one argument add it to the argument that they were created with.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Custom objects&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;first way&lt;br /&gt;------------&lt;br /&gt;&lt;br /&gt;function makePerson(first, last) {&lt;br /&gt;    return {&lt;br /&gt;        first: first,&lt;br /&gt;        last: last&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;function personFullName(person) {&lt;br /&gt;    return person.first + ' ' + person.last;&lt;br /&gt;}&lt;br /&gt;function personFullNameReversed(person) {&lt;br /&gt;    return person.last + ', ' + person.first&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;second way&lt;br /&gt;-------------&lt;br /&gt;function makePerson(first, last) {&lt;br /&gt;    return {&lt;br /&gt;        first: first,&lt;br /&gt;        last: last,&lt;br /&gt;        fullName: function() {&lt;br /&gt;            return this.first + ' ' + this.last;&lt;br /&gt;        },&lt;br /&gt;        fullNameReversed: function() {&lt;br /&gt;            return this.last + ', ' + this.first;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;third way&lt;br /&gt;------------&lt;br /&gt;function Person(first, last) {&lt;br /&gt;    this.first = first;&lt;br /&gt;    this.last = last;&lt;br /&gt;    this.fullName = function() {&lt;br /&gt;        return this.first + ' ' + this.last;&lt;br /&gt;    }&lt;br /&gt;    this.fullNameReversed = function() {&lt;br /&gt;        return this.last + ', ' + this.first;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;fourth way&lt;br /&gt;-------------&lt;br /&gt;function personFullName() {&lt;br /&gt;    return this.first + ' ' + this.last;&lt;br /&gt;}&lt;br /&gt;function personFullNameReversed() {&lt;br /&gt;    return this.last + ', ' + this.first;&lt;br /&gt;}&lt;br /&gt;function Person(first, last) {&lt;br /&gt;    this.first = first;&lt;br /&gt;    this.last = last;&lt;br /&gt;    this.fullName = personFullName;&lt;br /&gt;    this.fullNameReversed = personFullNameReversed;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;fifth way , prototype way&lt;br /&gt;------------------------------&lt;br /&gt;function Person(first, last) {&lt;br /&gt;    this.first = first;&lt;br /&gt;    this.last = last;&lt;br /&gt;}&lt;br /&gt;Person.prototype.fullName = function() {&lt;br /&gt;    return this.first + ' ' + this.last;&lt;br /&gt;}&lt;br /&gt;Person.prototype.fullNameReversed = function() {&lt;br /&gt;    return this.last + ', ' + this.first;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;prototype expalnation&lt;br /&gt;------------------------&lt;br /&gt;Person.prototype is an object shared by all instances of Person. It forms part of a lookup chain: any time you attempt to access a property of Person that isn't set, JavaScript will check Person.prototype to see if that property exists there instead. As a result, anything assigned to Person.prototype becomes available to all instances of that constructor via the this object.&lt;br /&gt;&lt;br /&gt;This is an incredibly powerful tool. JavaScript lets you modify something's prototype at any time in your program, which means you can add extra methods to existing objects at runtime:Interestingly, you can also add things to the prototype of built-in JavaScript objects.&lt;br /&gt;&lt;br /&gt;Source : http://simon.incutio.com/slides/2006/etech/javascript/js-reintroduction-notes.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16671681-114639385503485849?l=kodalis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kodalis.blogspot.com/feeds/114639385503485849/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16671681&amp;postID=114639385503485849' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/114639385503485849'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/114639385503485849'/><link rel='alternate' type='text/html' href='http://kodalis.blogspot.com/2006/04/java-script-oops.html' title='Java Script OOPS'/><author><name>srikanth</name><uri>http://www.blogger.com/profile/04234053570810422671</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16671681.post-114344455338671555</id><published>2006-03-26T23:23:00.000-08:00</published><updated>2006-03-26T23:32:11.356-08:00</updated><title type='text'>Struts Intro</title><content type='html'>MVC&lt;br /&gt;---&lt;br /&gt;Many clever developers realized that JavaServer Pages AND servlets could be used together to deploy web applications. The servlets could help with the control-flow, and the JSPs could focus on the nasty business of writing HTML. In due course,using JSPs and servlets together became known as Model 2 (meaning, presumably, that using JSPs alone was Model 1). &lt;br /&gt;&lt;br /&gt;Of course, there is nothing new under the Sun ... and many have been quick to point out that JSP's Model 2 follows the classic Model-View-Controller design pattern &lt;br /&gt;&lt;br /&gt;In the original SmallTalk Model-View-Controller framework, an application is seen as having three distinct parts. The problem domain is represented by the Model. The output to the user is represented by the View. And, the input from the user is represented by Controller. &lt;br /&gt;&lt;br /&gt;In Smalltalk MVC, the View updates itself from the Model, via the "Observer" pattern. The original MVC pattern is like a closed loop: The View talks to the Controller, which talks to the Model, which talks to the View.But, a direct link between the Model and the View is not practical for web applications, so we modify the classic MVC arrangement so that it would look less like a loop and more like a horseshoe with the controller in the middle. &lt;br /&gt;&lt;br /&gt;The Model: System State and Business Logic JavaBeans&lt;br /&gt;The View: JSP Pages and Presentation Components&lt;br /&gt;The Controller: ActionServlet and ActionMapping&lt;br /&gt;&lt;br /&gt;Scope&lt;br /&gt;-----&lt;br /&gt;page - Beans that are visible within a single JSP page, for the lifetime of the current request. (Local variables of the service method) &lt;br /&gt;&lt;br /&gt;request - Beans that are visible within a single JSP page, as well as to any page or servlet that is included in this page, or forwarded to by this page. (Request attributes) &lt;br /&gt;&lt;br /&gt;session - Beans that are visible to all JSP pages and servlets that participate in a particular user session, across one or more requests. (Session attributes) &lt;br /&gt;&lt;br /&gt;application - Beans that are visible to all JSP pages and servlets that are part of a web application. (Servlet context attributes) &lt;br /&gt;&lt;br /&gt;ActionForm&lt;br /&gt;-----------&lt;br /&gt;If you declare such beans in your Struts configuration file , the Struts controller servlet will automatically perform the following services for you, before invoking the appropriate Action method: Check for an instance of a bean of the appropriate class, under the appropriate key, in the appropriate scope (request or session). &lt;br /&gt;If there is no such bean instance available, a new one is automatically created and added to the appropriate scope (request or session). &lt;br /&gt;For every request parameter whose name corresponds to the name of a property in the bean, the corresponding setter method will be called. This operates in a manner similar to the standard JSP action &lt;jsp:setProperty&gt; when you use the asterisk wildcard to select all properties. The updated ActionForm bean will be passed to the execute method of an Action class [ org.apache.struts.Action ], so that the values can be made available to your system state and business logic beans. &lt;br /&gt;&lt;br /&gt;The validate method is called by the controller servlet after the bean properties have been populated, but before the corresponding action class's execute method is invoked. &lt;br /&gt;&lt;br /&gt;controller&lt;br /&gt;----------&lt;br /&gt;&lt;br /&gt;For those of you familiar with MVC architecture, the ActionServlet represents the C -the controller. The job of the controller is to: process user requests, &lt;br /&gt;determine what the user is trying to achieve according to the request, &lt;br /&gt;pull data from the model (if necessary) to be given to the appropriate view, and &lt;br /&gt;select the proper view to respond to the user. &lt;br /&gt;&lt;br /&gt;Think of your ActionForm beans as a firewall between HTTP and the Action. Use the validate method to ensure all required properties are present, and that they contain reasonable values. An ActionForm that fails validation will not even be presented to the Action for handling.&lt;br /&gt;&lt;br /&gt;DynaActionForms are not a drop-in replacement for ActionForms. If you need to access DynaActionForm properties in your Action, you will need to use the map-style accessor, like myForm.get("name"). If you actively use the ActionForm object in your Action, then you may want to use conventional ActionForms instead. &lt;br /&gt;&lt;br /&gt;The required knowledge has been encapsulated in a Java class named ActionMapping , the most important properties are as follows: &lt;br /&gt;&lt;br /&gt;type - Fully qualified Java class name of the Action implementation class used by this mapping. &lt;br /&gt;name - The name of the form bean defined in the config file that this action will use. &lt;br /&gt;path - The request URI path that is matched to select this mapping. See below for examples of how matching works and how to use wildcards to match multiple request URIs. &lt;br /&gt;unknown - Set to true if this action should be configured as the default for this application, to handle all requests not handled by another action. Only one action can be defined as a default within a single application. &lt;br /&gt;validate - Set to true if the validate method of the action associated with this mapping should be called. &lt;br /&gt;forward - The request URI path to which control is passed when this mapping is invoked. This is an alternative to declaring a type property. &lt;br /&gt;&lt;br /&gt;Internationalization&lt;br /&gt;--------------------&lt;br /&gt;for making struts to work with specific locale we can change the value for the key "Action.LOCALE_KEY" (which is stored in the session) or we have to change the locale settings in the browser and then hit the corresponding site.&lt;br /&gt;&lt;br /&gt;errors in the request&lt;br /&gt;----------------------&lt;br /&gt;The framework stores the errors in the request, and so when you redirect, they disappear. The usual work around is to save the ActionErrors to the session yourself, and then move them from the session back to the request in the Action to which you are redirecting. If you do a lot of this, the routine could be made part of a base Action, a servlet subclass, or RequestProcessor in Struts 1.1.&lt;br /&gt;&lt;br /&gt;Note : extracted from Apache site.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16671681-114344455338671555?l=kodalis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kodalis.blogspot.com/feeds/114344455338671555/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16671681&amp;postID=114344455338671555' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/114344455338671555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/114344455338671555'/><link rel='alternate' type='text/html' href='http://kodalis.blogspot.com/2006/03/struts-intro.html' title='Struts Intro'/><author><name>srikanth</name><uri>http://www.blogger.com/profile/04234053570810422671</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16671681.post-114233618201983939</id><published>2006-03-14T03:29:00.000-08:00</published><updated>2006-03-14T03:37:57.080-08:00</updated><title type='text'>JUnit intro</title><content type='html'>Following is the description about JUnit&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Test suite&lt;/b&gt; &lt;br /&gt;A TestSuite is a Composite of Tests. It runs a collection of test cases. Here is an example using the dynamic test definition. &lt;br /&gt;&lt;br /&gt; TestSuite suite= new TestSuite();&lt;br /&gt; suite.addTest(new MathTest("testAdd"));&lt;br /&gt; suite.addTest(new MathTest("testDivideByZero"));&lt;br /&gt;&lt;br /&gt; Alternatively, a TestSuite can extract the tests to be run automatically. To do so you pass the class of your TestCase class to the TestSuite constructor. &lt;br /&gt;&lt;br /&gt; TestSuite suite= new TestSuite(MathTest.class);&lt;br /&gt;&lt;br /&gt; This constructor creates a suite with all the methods starting with "test" that take no arguments.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Test Case&lt;/b&gt;&lt;br /&gt;A test case defines the fixture to run multiple tests. To define a test case&lt;br /&gt;&lt;br /&gt;1) implement a subclass of TestCase&lt;br /&gt;&lt;br /&gt;2) define instance variables that store the state of the fixture&lt;br /&gt;&lt;br /&gt;3) initialize the fixture state by overriding setUp&lt;br /&gt;&lt;br /&gt;4) clean-up after a test by overriding tearDown.&lt;br /&gt;&lt;br /&gt;5) For each test implement a method (starting with "test") which interacts with the fixture.Verify the expected results with assertions.(example assert methdos overloaded asserEquals,assertNotSame,assertTrue,assertNull)&lt;br /&gt;&lt;br /&gt;AssertionFailedError is thrown when an assertion failed. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Running Test Cases&lt;/b&gt;&lt;br /&gt;we can run the test cases in the following three ways&lt;br /&gt;&lt;br /&gt;1)Once the methods are defined you can run them. The framework supports both a static type safe and more dynamic way to run a test. In the static way you override the runTest method and define the method to be invoked. A convenient way to do so is &lt;br /&gt;with an anonymous inner class. &lt;br /&gt;&lt;br /&gt; TestCase test= new MathTest("add") {&lt;br /&gt;        public void runTest() {&lt;br /&gt;            testAdd();&lt;br /&gt;        }&lt;br /&gt; };&lt;br /&gt; test.run();&lt;br /&gt;&lt;br /&gt;2)The dynamic way uses reflection to implement runTest. It dynamically finds and invokes a method. In this case the name of the test case has to correspond to the test method to be run. &lt;br /&gt;&lt;br /&gt; TestCase test = new MathTest("testAdd");&lt;br /&gt; test.run();&lt;br /&gt;&lt;br /&gt;3)The tests to be run can be collected into a TestSuite. JUnit provides different test runners which can run a test suite and collect the results. A test runner either expects a static method suite as the entry point to get a test to run or it will extract the suite automatically. &lt;br /&gt;&lt;br /&gt; public static Test suite() {&lt;br /&gt;      suite.addTest(new MathTest("testAdd"));&lt;br /&gt;      suite.addTest(new MathTest("testDivideByZero"));&lt;br /&gt;      return suite;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;b&gt;small example&lt;/b&gt;&lt;br /&gt;package testapp;&lt;br /&gt;public class Example {&lt;br /&gt;   public boolean testOne(String str){&lt;br /&gt;        if(str.equalsIgnoreCase("yes")){&lt;br /&gt;            return true;&lt;br /&gt;        }else{&lt;br /&gt;            return false;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    public boolean testTwo(int i,int j){&lt;br /&gt;        if(i&gt;j){&lt;br /&gt;            return true;&lt;br /&gt;        }else{&lt;br /&gt;            return false;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;package testapp;&lt;br /&gt;&lt;br /&gt;import junit.framework.*;&lt;br /&gt;&lt;br /&gt;public class ExampleTest extends TestCase {&lt;br /&gt;   &lt;br /&gt;    Example instance;&lt;br /&gt;    &lt;br /&gt;    public ExampleTest(String testName) {&lt;br /&gt;        super(testName);&lt;br /&gt;    }&lt;br /&gt;    protected void setUp() throws Exception {&lt;br /&gt;        instance = new Example();&lt;br /&gt;    }&lt;br /&gt;    protected void tearDown() throws Exception {&lt;br /&gt;        instance = null;&lt;br /&gt;    }&lt;br /&gt;    public static Test suite() {&lt;br /&gt;        //TestSuite suite = new TestSuite(ExampleTest.class);&lt;br /&gt;        // eihter use the above line or the following three lines  &lt;br /&gt;        TestSuite suite = new TestSuite();&lt;br /&gt;        suite.addTest(new ExampleTest("testOne"));&lt;br /&gt;        suite.addTest(new ExampleTest("testTwo"));&lt;br /&gt;        return suite;&lt;br /&gt;    }&lt;br /&gt;    public void testOne() {&lt;br /&gt;        String str = "";&lt;br /&gt;        boolean expResult = true;&lt;br /&gt;        boolean result = instance.testOne(str);&lt;br /&gt;        assertEquals(expResult, result);&lt;br /&gt;    }&lt;br /&gt;    public void testTwo() {&lt;br /&gt;        int i = 0;&lt;br /&gt;        int j = 0;&lt;br /&gt;        boolean expResult = true;&lt;br /&gt;        boolean result = instance.testTwo(i, j);&lt;br /&gt;        assertEquals(expResult, result);&lt;br /&gt;    }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16671681-114233618201983939?l=kodalis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kodalis.blogspot.com/feeds/114233618201983939/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16671681&amp;postID=114233618201983939' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/114233618201983939'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/114233618201983939'/><link rel='alternate' type='text/html' href='http://kodalis.blogspot.com/2006/03/junit-intro.html' title='JUnit intro'/><author><name>srikanth</name><uri>http://www.blogger.com/profile/04234053570810422671</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16671681.post-114008526834183951</id><published>2006-02-16T02:13:00.000-08:00</published><updated>2006-02-16T02:21:08.350-08:00</updated><title type='text'>Foreign Key Reference for Composite Key</title><content type='html'>Example 1&lt;br /&gt;---------&lt;br /&gt;&lt;br /&gt;when you have a unique constraint on the column we can use it as a foreign key even though it is a part of a composite key&lt;br /&gt;&lt;br /&gt;CREATE TABLE TEST &lt;br /&gt;( &lt;br /&gt;a INT UNIQUE, &lt;br /&gt;b INT UNIQUE, &lt;br /&gt;c VARCHAR2(1), &lt;br /&gt;CONSTRAINT PK_test PRIMARY KEY (a, b ) &lt;br /&gt;) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;CREATE TABLE test_child &lt;br /&gt;( &lt;br /&gt;child_a INT REFERENCES TEST(a), &lt;br /&gt;child_b INT , &lt;br /&gt;child_c VARCHAR2(1) &lt;br /&gt;&lt;br /&gt;) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Example 2&lt;br /&gt;---------&lt;br /&gt;the following example shows how to have composite foreign kye on child table referencing composite key on base table.&lt;br /&gt;&lt;br /&gt;CREATE TABLE TEST &lt;br /&gt;( &lt;br /&gt;a INT, &lt;br /&gt;b INT, &lt;br /&gt;c VARCHAR2(1), &lt;br /&gt;CONSTRAINT PK_test PRIMARY KEY (a, b ) &lt;br /&gt;) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;CREATE TABLE TEST_CHILD &lt;br /&gt;( &lt;br /&gt;child_a INT , &lt;br /&gt;child_b INT , &lt;br /&gt;child_c VARCHAR2(1)) &lt;br /&gt;&lt;br /&gt;ALTER TABLE TEST_CHILD ADD CONSTRAINT fk_child_test FOREIGN KEY (child_a, child_b) &lt;br /&gt;REFERENCES TEST(a,b)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16671681-114008526834183951?l=kodalis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kodalis.blogspot.com/feeds/114008526834183951/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16671681&amp;postID=114008526834183951' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/114008526834183951'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/114008526834183951'/><link rel='alternate' type='text/html' href='http://kodalis.blogspot.com/2006/02/foreign-key-reference-for-composite.html' title='Foreign Key Reference for Composite Key'/><author><name>srikanth</name><uri>http://www.blogger.com/profile/04234053570810422671</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16671681.post-113983309901586822</id><published>2006-02-13T04:15:00.000-08:00</published><updated>2006-02-21T03:54:38.983-08:00</updated><title type='text'>Pattern Def &amp; Examples</title><content type='html'>&lt;table cellspacing=0 cellpadding=0 border=1 bordercolor="skyblue" width="100%"&gt;&lt;tr&gt;&lt;th align="left" colspan="2"&gt;Creational Patterns&lt;/th&gt;&lt;/tr&gt;&lt;!-- start --&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;AbstractFactory&lt;/td&gt;&lt;td&gt;is used to return one of several groups of classes. In some cases it actually returns a Factory for that group of classes.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Factory on top of factories&lt;/td&gt;&lt;/tr&gt;&lt;!-- end --&gt;&lt;!-- start --&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;FactoryMethod&lt;/td&gt;&lt;td&gt;is used to choose and return an instance of a class from a number of similar classes based on data you provide to the factory.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;getting an object of a chess coin depending on the argument passed the peice is a base abstract class , and Pawn, Rook e.t.c are sub classes of piece with implementation to all the methods in the Piece class , Factory class has to be constructed so that it returns a required peice depending on the argument passed ,this is like run time type polymorphisam&lt;/td&gt;&lt;/tr&gt;&lt;!-- end --&gt;&lt;!-- start --&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;Builder&lt;/td&gt;&lt;td&gt;assembles a number of objects to make a new object, based on the data with which it is presented. Frequently, the choice of which way the objects are assembled is achieved using a Factory.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Separate the construction of a complex object from its representation so that the same construction process can create different representations.Example for Builder pattern is a Computer Assembly. A computer is nothing but the bundling of various components like FDD, HDD, Monitor etc. But when an user buys a computer someone assemble all these components and given to us. Remember that here the building process is completely hidden from the client or user&lt;/td&gt;&lt;/tr&gt;&lt;!-- end --&gt;&lt;!-- start --&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;Prototype&lt;/td&gt;&lt;td&gt;copies or clones an existing class rather than creating a new instance when creating new instances is more expensive.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;clone , java cloning&lt;/td&gt;&lt;/tr&gt;&lt;!-- end --&gt;&lt;!-- start --&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;Singleton&lt;/td&gt;&lt;td&gt;is a pattern that insures there is one and only one instance of an object, and that it is possible to obtain global access to that one instance.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;DB Connection , returning single DB Connection always&lt;/td&gt;&lt;/tr&gt;&lt;!-- end --&gt;&lt;tr&gt;&lt;th align="left" colspan="2"&gt;Structural Patterns&lt;/th&gt;&lt;/tr&gt;&lt;!-- start --&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;Adapter&lt;/td&gt;&lt;td&gt;used to change the interface of one class to that of another one.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;WindowAdapter , window adapter in java gives dummy implementation for all the event methods so that the deriving classes no need to write implementation for each and every method. i.e consider an abtract class having severla abstract methods.so any concrete sub class has to override all the methods of of that abstract class or atleast it has to give the dummy implementation. To avoid dummy implementation in several sub classes , an adapter class will be written to give dummy implementation to all the methods of the abstract class and all the sub classes will extend that adapter instead of abstract class , and gives implementation to only the required methods , and can ignore the remaining methods.&lt;/td&gt;&lt;/tr&gt;&lt;!-- end --&gt;&lt;!-- start --&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;Bridge&lt;/td&gt;&lt;td&gt;intended to keep the interface to your client program constant while allowing you to change the actual kind of class you display or use. You can then change the interface and the underlying class separately.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;If the Java code parses the xml using the JAXP API, the unerlying parsers can be changed without changing the code , the parsers will adher to the JAXP API&lt;/td&gt;&lt;/tr&gt;&lt;!-- end --&gt;&lt;!-- start --&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;Composite&lt;/td&gt;&lt;td&gt;a collection of objects, any one of which may be either itself a Composite, or just a primitive object.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;File Systems : Directories , Files : directorires can have direcotries and files and so ... on , this is a complex structure&lt;/td&gt;&lt;/tr&gt;&lt;!-- end --&gt;&lt;!-- start --&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;Decorator&lt;/td&gt;&lt;td&gt;a class that surrounds a given class, adds new capabilities to it, and passes all the unchanged methods to the underlying class.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Milk , choclate Milk , Double Choclate Milk , Rose Milk : choclate , double choclate , rose are decorations another example is Button , Bevel border button etc.&lt;/td&gt;&lt;/tr&gt;&lt;!-- end --&gt;&lt;!-- start --&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;Facade&lt;/td&gt;&lt;td&gt;which groups a complex object hierarchy and provides a new, simpler interface to access those data.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt; same Remote to switch on light , tv , fan&lt;/td&gt;&lt;/tr&gt;&lt;!-- end --&gt;&lt;!-- start --&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;Flyweight&lt;/td&gt;&lt;td&gt;which provides a way to limit the proliferation of small, similar class instances by moving some of the class data outside the class and passing it in during various execution methods.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;String class in java , if we delcare two string variables with the same value , they both refer to the same memory location.&lt;/td&gt;&lt;/tr&gt;&lt;!-- end --&gt;&lt;!-- start --&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;Proxy&lt;/td&gt;&lt;td&gt;which provides a simple place-holder class for a more complex class which is expensive to instantiate.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;RMI , uses stub and skeleton to implement the proxy pattern.&lt;/td&gt;&lt;/tr&gt;&lt;!-- end --&gt;&lt;tr&gt;&lt;th align="left" colspan="2"&gt;Behavioral Patterns&lt;/th&gt;&lt;/tr&gt;&lt;!-- start --&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;Chain of Resp&lt;/td&gt;&lt;td&gt;allows an even further decoupling between classes, by passing a request between classes until it is recognized.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;servlet Filters,It decouples the sender of the request to the receiver. The only link between sender and the receiver is the request which is sent. Based on the request data sent, the receiver is picked.&lt;/td&gt;&lt;/tr&gt;&lt;!-- end --&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;Command&lt;/td&gt;&lt;td&gt;provides a simple way to separate execution of a command from the interface environment that produced it&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;implementation of AWT event handling in JAVA, ActionListner A classic example of this is a restaurant. A customer goes to restaurant and orders the food according to his/her choice. The waiter/ waitress takes the order (command, in this case) and hands it to the cook in the kitchen.The cook can make several types of food and so, he/she prepares the ordered item and hands it over to the waiter/waitress who in turn serves to the customer The order is an object which depends on the command. The food item will change as soon as the command changes. This is loose-coupling between the client and the implementation.&lt;/td&gt;&lt;/tr&gt;&lt;!-- end --&gt;&lt;!-- start --&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;Interpreter&lt;/td&gt;&lt;td&gt;provides a definition of how to include language elements in a program.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;The Interpreter Pattern defines a grammatical representation for a language and an interpreter to interpret the grammar.Regular Expression in Java , REs will have thier own sytnax and implementation even though RE is in JAVA.Another example , suppose user enters 123.78 and we have to translate it into "rupees on hundread and twenty three and paise seveny eight only"&lt;/td&gt;&lt;/tr&gt;&lt;!-- end --&gt;&lt;!-- start --&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;Iterator&lt;/td&gt;&lt;td&gt;formalizes the way we move through a list of data within a class.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;The Iterator pattern is one, which allows you to navigate through a collection of data using a common interface without knowing about the underlying implementation. eX : Moving through list&lt;/td&gt;&lt;/tr&gt;&lt;!-- end --&gt;&lt;!-- start --&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;Mediator&lt;/td&gt;&lt;td&gt;defines how communication between classes can be simplified by using another class to keep all classes from having to know about each other.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;List Left , Lest Right , CommangButton , Text Box talk thorugh a mediator class , meditor should be in all classes and Meditator shold know all classes ------- flights with base control&lt;/td&gt;&lt;/tr&gt;&lt;!-- end --&gt;&lt;!-- start --&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;Memento&lt;/td&gt;&lt;td&gt;Memento&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;For most applications, it is often very useful to provide mechanisms that allow the users to undo an operation or to recover from a state that violates constraints specified by the application. The standard method is to store the previous states via cloning a copy of all changed objects. But this is often infeasible since the overhead of storing these clones would be too much. An alternative is to create only partial clone, storing only the attributes that are required for the undo operation. The concept is very simple, but is problematic since the attributes usually have restricted access due to encapsulation. To get around this, the idea is to have the class itself provide a helper object with the important data, a memento. When given back a memento, the class can then reset its state according the information contained within the memento&lt;/td&gt;&lt;/tr&gt;&lt;!-- end --&gt;&lt;!-- start --&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;Observer&lt;/td&gt;&lt;td&gt;defines the way a number of classes can be notified of a change,&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically. ex : Threads&lt;/td&gt;&lt;/tr&gt;&lt;!-- end --&gt;&lt;!-- start --&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;State&lt;/td&gt;&lt;td&gt;provides a memory for a class’s instance variables.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;The State pattern allows an object to change its behavior when its internal state changes. This pattern can be observed in a vending machine. Vending machines have states based on the inventory, amount of currency deposited, the ability to make change, the item selected, etc. When currency is deposited and a selection is made, a vending machine will either deliver a product and no change, deliver a product and change, deliver no product due to insufficient currency on deposit, or deliver no product due to inventory depletion&lt;/td&gt;&lt;/tr&gt;&lt;!-- end --&gt;&lt;!-- start --&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;Strategy&lt;/td&gt;&lt;td&gt;encapsulates an algorithm inside a class&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Strategy1 , Strategy2 , Strategy3 exists depending on some algorithm we select one of them&lt;/td&gt;&lt;/tr&gt;&lt;!-- end --&gt;&lt;!-- start --&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;Template&lt;/td&gt;&lt;td&gt;provides an abstract definition of an algorithm&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;The Template Method defines a skeleton of an algorithm in an operation, and defers some steps to subclasses. Home builders use the Template Method when developing a new subdivision. A typical subdivision consists of a limited number of floor plans with different variations available for each. Within a floor plan, the foundation, framing, plumbing, and wiring will be identical for each house. Variation is introduced in the later stages of construction to produce a wider variety of models&lt;/td&gt;&lt;/tr&gt;&lt;!-- end --&gt;&lt;!-- start --&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;Visitor&lt;/td&gt;&lt;td&gt;adds function to a class&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;The Visitor pattern represents an operation to be performed on the elements of an object structure without changing the classes on which it operates. This pattern can be observed in the operation of a taxi company. When a person calls a taxi company (accepting a visitor), the company dispatches a cab to the customer. Upon entering the taxi the customer, or Visitor, is no longer in control of his or her own transportation, the taxi (driver) is&lt;/td&gt;&lt;/tr&gt;&lt;!-- end --&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16671681-113983309901586822?l=kodalis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kodalis.blogspot.com/feeds/113983309901586822/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16671681&amp;postID=113983309901586822' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/113983309901586822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/113983309901586822'/><link rel='alternate' type='text/html' href='http://kodalis.blogspot.com/2006/02/pattern-def-examples.html' title='Pattern Def &amp; Examples'/><author><name>srikanth</name><uri>http://www.blogger.com/profile/04234053570810422671</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16671681.post-113837141697008857</id><published>2006-01-27T06:13:00.000-08:00</published><updated>2006-01-27T06:16:56.986-08:00</updated><title type='text'>To Get Machine Name , IP Address , User Name in the network</title><content type='html'>The following program gives the Machine Name , IP Address , User Name of the windows network in which we run this program&lt;br /&gt;&lt;br /&gt;package NET;&lt;br /&gt;&lt;br /&gt;import java.io.BufferedReader;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;import java.io.InputStreamReader;&lt;br /&gt;&lt;br /&gt;import java.net.InetAddress;&lt;br /&gt;import java.net.UnknownHostException;&lt;br /&gt;import java.util.Iterator;&lt;br /&gt;import java.util.TreeMap;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;class TestNet {&lt;br /&gt; &lt;br /&gt; TreeMap objTreeMap;&lt;br /&gt;  &lt;br /&gt;    TestNet() {&lt;br /&gt;     &lt;br /&gt;     objTreeMap = new TreeMap();&lt;br /&gt;     &lt;br /&gt;     getAllNamesIPAddress();&lt;br /&gt;     printAll();&lt;br /&gt;        &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void getAllNamesIPAddress(){&lt;br /&gt;        try {&lt;br /&gt;            Process objProcess = Runtime.getRuntime().exec("net view");&lt;br /&gt;&lt;br /&gt;            InputStreamReader objInputStreamReader = new InputStreamReader(objProcess.getInputStream());&lt;br /&gt;&lt;br /&gt;            BufferedReader objBufferedReader = new BufferedReader(objInputStreamReader);&lt;br /&gt;&lt;br /&gt;            String strLine;&lt;br /&gt;            String[] strSysUsrName;&lt;br /&gt;&lt;br /&gt;            while ((strLine = objBufferedReader.readLine()) != null) {&lt;br /&gt;&lt;br /&gt;                if ((strLine.length() &gt; 0) &amp;&amp; (strLine.charAt(0) == '\\')) {&lt;br /&gt;                 strSysUsrName = strLine.trim().split(" ");&lt;br /&gt;                    if (strSysUsrName.length &gt; 1) {&lt;br /&gt;                     &lt;br /&gt;                     String strIPAddress = getIPAddress(strSysUsrName[0].substring(2,strSysUsrName[0].length()));&lt;br /&gt;                     StringBuffer strBuffUserName = new StringBuffer("");&lt;br /&gt;                     for(int intIterStrLine=1;intIterStrLine&lt;strSysUsrName.length;intIterStrLine++){&lt;br /&gt;                      &lt;br /&gt;                      if(intIterStrLine&gt;1){&lt;br /&gt;                       strBuffUserName.append(" "); &lt;br /&gt;                      }&lt;br /&gt;                      &lt;br /&gt;                      strBuffUserName.append(strSysUsrName[intIterStrLine]);&lt;br /&gt;                     }&lt;br /&gt;                     objTreeMap.put(strLine,strIPAddress);&lt;br /&gt;                     //objTreeMap.put(strBuffUserName.toString().trim().toLowerCase(),strIPAddress);&lt;br /&gt;                        //System.out.println(strIPAddress + ":" + strBuffUserName.toString().trim());&lt;br /&gt;                        &lt;br /&gt;                    }&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            &lt;br /&gt;&lt;br /&gt;        } catch (IOException eIOException) {&lt;br /&gt;            eIOException.printStackTrace();&lt;br /&gt;        }&lt;br /&gt;     &lt;br /&gt;    }&lt;br /&gt;    private String getIPAddress(String strSystemName) {&lt;br /&gt;        String strIPAddress = "";&lt;br /&gt;&lt;br /&gt;        try {&lt;br /&gt;            strIPAddress = InetAddress.getByName(strSystemName).getHostAddress();&lt;br /&gt;        } catch (UnknownHostException e) {&lt;br /&gt;            e.printStackTrace();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        return strIPAddress;&lt;br /&gt;    }&lt;br /&gt;    private void printAll(){&lt;br /&gt;     //System.out.println("Total Users : " + objTreeMap.size());&lt;br /&gt;     Iterator objIterator = objTreeMap.keySet().iterator();&lt;br /&gt;     &lt;br /&gt;     while(objIterator.hasNext()){&lt;br /&gt;      &lt;br /&gt;      String strKey =(String)objIterator.next();&lt;br /&gt;      System.out.println(strKey + " : " + objTreeMap.get(strKey));&lt;br /&gt;     }&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    public static void main(String[] args) {&lt;br /&gt;        TestNet objTestNet = new TestNet();&lt;br /&gt;    }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16671681-113837141697008857?l=kodalis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kodalis.blogspot.com/feeds/113837141697008857/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16671681&amp;postID=113837141697008857' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/113837141697008857'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/113837141697008857'/><link rel='alternate' type='text/html' href='http://kodalis.blogspot.com/2006/01/to-get-machine-name-ip-address-user.html' title='To Get Machine Name , IP Address , User Name in the network'/><author><name>srikanth</name><uri>http://www.blogger.com/profile/04234053570810422671</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16671681.post-113808599656058777</id><published>2006-01-23T22:56:00.001-08:00</published><updated>2006-01-23T22:59:56.560-08:00</updated><title type='text'>Cricket Field Settings</title><content type='html'>&lt;pre&gt;&lt;br /&gt;                   e                h                 &lt;br /&gt;                                                    &lt;br /&gt;                                                    &lt;br /&gt;                                                    &lt;br /&gt;                                                    &lt;br /&gt;                        2                     j     &lt;br /&gt;                      43 1  d                       &lt;br /&gt;                   5                                &lt;br /&gt;                 6       # i      c                 &lt;br /&gt;                         #                          &lt;br /&gt;                 7       #        b                 &lt;br /&gt;                  8                                 &lt;br /&gt;                                                    &lt;br /&gt;                    9         a                     &lt;br /&gt;                                                    &lt;br /&gt;                                                    &lt;br /&gt;                                                &lt;br /&gt;                                                &lt;br /&gt;                 f                g             &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;1  wicket keeper&lt;br /&gt;2  first slip&lt;br /&gt;3  second slip&lt;br /&gt;4  third slip&lt;br /&gt;5  gully +&lt;br /&gt;6  point +*~&lt;br /&gt;7  cover +&lt;br /&gt;8  extra cover +&lt;br /&gt;9  mid-off +*&lt;br /&gt;a  mid-on +*&lt;br /&gt;c  square leg +~&lt;br /&gt;d  leg slip&lt;br /&gt;e  third man&lt;br /&gt;f  long off&lt;br /&gt;g  long on&lt;br /&gt;h  fine leg&lt;br /&gt;i  bat-pad&lt;br /&gt;&lt;br /&gt;+  deep (near boundary)&lt;br /&gt;*  silly (near batsman)&lt;br /&gt;~  backward (more 'up')&lt;br /&gt;#  Track&lt;br /&gt;&lt;br /&gt;j  deep backward square leg&lt;br /&gt;&lt;br /&gt;source : http://www.cricinfo.com/link_to_database/ABOUT_CRICKET/EXPLANATION/EXPLANATION_OF_CRICKET.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16671681-113808599656058777?l=kodalis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kodalis.blogspot.com/feeds/113808599656058777/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16671681&amp;postID=113808599656058777' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/113808599656058777'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/113808599656058777'/><link rel='alternate' type='text/html' href='http://kodalis.blogspot.com/2006/01/cricket-field-settings_24.html' title='Cricket Field Settings'/><author><name>srikanth</name><uri>http://www.blogger.com/profile/04234053570810422671</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16671681.post-113808453781602148</id><published>2006-01-23T22:32:00.000-08:00</published><updated>2006-01-23T22:35:37.833-08:00</updated><title type='text'>For Searching the existence of a Class file in .Jar &amp; .War Files</title><content type='html'>The following program searches for the exitence of a class file in the Jar and War files located under given folder and subfolders.&lt;br /&gt;&lt;br /&gt;-------&lt;br /&gt;package JarFileSearch;&lt;br /&gt;&lt;br /&gt;import java.io.File;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;&lt;br /&gt;import java.util.Enumeration;&lt;br /&gt;import java.util.Vector;&lt;br /&gt;import java.util.jar.JarEntry;&lt;br /&gt;import java.util.jar.JarFile;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;class ClassFileSearch {&lt;br /&gt;    Vector objJarFilesVector;&lt;br /&gt;    String strFolderName;&lt;br /&gt;    String strClassName;&lt;br /&gt;    Vector objVector;&lt;br /&gt;&lt;br /&gt;    ClassFileSearch(String strFolderName, String strClassName) {&lt;br /&gt;        objJarFilesVector = new Vector();&lt;br /&gt;        this.strFolderName = strFolderName;&lt;br /&gt;        this.strClassName = strClassName;&lt;br /&gt;        this.objVector = new Vector();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public static void main(String[] args) {&lt;br /&gt;        String strInFolderAndSubFolders = "C:/srikanth";&lt;br /&gt;        String strClassName = "DateUtility.class";&lt;br /&gt;&lt;br /&gt;        long l_startTime = System.currentTimeMillis();&lt;br /&gt;        ClassFileSearch objClassFileSearch = new ClassFileSearch(strInFolderAndSubFolders,&lt;br /&gt;                strClassName);&lt;br /&gt;        System.out.println("searching for " + strClassName +&lt;br /&gt;            " file in .jar and .war files available under " +&lt;br /&gt;            strInFolderAndSubFolders);&lt;br /&gt;        objClassFileSearch.findAllJarFiles(objClassFileSearch.getFile());&lt;br /&gt;        objClassFileSearch.findExitenceOfClass();&lt;br /&gt;&lt;br /&gt;        long l_endTime = System.currentTimeMillis();&lt;br /&gt;        System.out.println("Time Taken (in millis)" +&lt;br /&gt;            (l_endTime - l_startTime));&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public File getFile() {&lt;br /&gt;        return new File(this.strFolderName);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void findExitenceOfClass() {&lt;br /&gt;        FindRun[] objFindRun = new FindRun[objJarFilesVector.size()];&lt;br /&gt;&lt;br /&gt;        for (int i = 0; i &lt; objJarFilesVector.size(); i++) {&lt;br /&gt;            objFindRun[i] = new FindRun(strClassName,&lt;br /&gt;                    (String) objJarFilesVector.get(i));&lt;br /&gt;            objFindRun[i].start();&lt;br /&gt;&lt;br /&gt;            //System.out.println("searching --&gt; " + (String)objJarFilesVector.get(i));&lt;br /&gt;            try {&lt;br /&gt;                objFindRun[i].join();&lt;br /&gt;            } catch (InterruptedException e) {&lt;br /&gt;                e.printStackTrace();&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void findAllJarFiles(File objFile) {&lt;br /&gt;        File[] objFileArray = objFile.listFiles();&lt;br /&gt;&lt;br /&gt;        for (int i = 0; i &lt; objFileArray.length; i++) {&lt;br /&gt;            if (objFileArray[i].isDirectory()) {&lt;br /&gt;                findAllJarFiles(objFileArray[i]);&lt;br /&gt;            } else {&lt;br /&gt;                String[] strArray = objFileArray[i].getName().split("\\.");&lt;br /&gt;&lt;br /&gt;                if ((strArray != null) &amp;&amp; (strArray.length &gt; 0)) {&lt;br /&gt;                    if (strArray[strArray.length - 1].equalsIgnoreCase("jar") ||&lt;br /&gt;                            strArray[strArray.length - 1].equalsIgnoreCase(&lt;br /&gt;                                "war")) {&lt;br /&gt;                        objJarFilesVector.add(objFileArray[i].getAbsolutePath());&lt;br /&gt;&lt;br /&gt;                        //objVector.add(new Thread(new FindRun(strClassName,objFileArray[i].getAbsolutePath())));&lt;br /&gt;                        //((Thread)objVector.get(objVector.size()-1)).start();&lt;br /&gt;                    }&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        } // end of: for&lt;br /&gt;    }&lt;br /&gt;} // end of : ClassFileSearch class&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;class FindRun extends Thread {&lt;br /&gt;    String strClassName;&lt;br /&gt;    String strJarName;&lt;br /&gt;&lt;br /&gt;    FindRun(String strClassName, String strJarName) {&lt;br /&gt;        this.strClassName = strClassName;&lt;br /&gt;        this.strJarName = strJarName;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void run() {&lt;br /&gt;        try {&lt;br /&gt;            JarFile objJarFile = new JarFile(new File((String) strJarName));&lt;br /&gt;            Enumeration objEnumeration = objJarFile.entries();&lt;br /&gt;&lt;br /&gt;            while (objEnumeration.hasMoreElements()) {&lt;br /&gt;                JarEntry objJarEntry = (JarEntry) objEnumeration.nextElement();&lt;br /&gt;&lt;br /&gt;                if (objJarEntry.getName().indexOf(strClassName) &gt; 0) {&lt;br /&gt;                    System.out.println(strJarName + " * " +&lt;br /&gt;                        objJarEntry.getName());&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            //System.out.println("searching ..." + strJarName);&lt;br /&gt;        } catch (IOException eIOException) {&lt;br /&gt;            eIOException.printStackTrace();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;} // end of : FindRun Class&lt;br /&gt;------&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16671681-113808453781602148?l=kodalis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kodalis.blogspot.com/feeds/113808453781602148/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16671681&amp;postID=113808453781602148' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/113808453781602148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/113808453781602148'/><link rel='alternate' type='text/html' href='http://kodalis.blogspot.com/2006/01/for-searching-existence-of-class-file.html' title='For Searching the existence of a Class file in .Jar &amp; .War Files'/><author><name>srikanth</name><uri>http://www.blogger.com/profile/04234053570810422671</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16671681.post-113757917530353724</id><published>2006-01-18T02:12:00.000-08:00</published><updated>2006-01-18T03:23:55.233-08:00</updated><title type='text'>JavaScript Event Handling</title><content type='html'>The captureEvents() method doesn't have any effect until you assign a function to handle the desired events. To capture all click events on a page, for example, you would need to define a function that handles the event, and then assign the function reference to the event handler. Here's an example:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function processClicks(e) {&lt;br /&gt;  // statements to handle the click events&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;window.captureEvents(Event.CLICK); // click is an event&lt;br /&gt;window.onclick = processClicks; // onclick is an event handler&lt;br /&gt;&lt;br /&gt;Without specifying a function to handle click events at the window level, all click events would simply be captured at that level, but would not have any influence because a captured event does not proceed to the intended target event handler&lt;br /&gt;------------------------&lt;br /&gt;-- for cross browsers---&lt;br /&gt;------------------------&lt;br /&gt;&lt;br /&gt;//FIRST, TELL THE BROWSERS TO REACT TO THE EVENT&lt;br /&gt;if( document.captureEvents ) {&lt;br /&gt;    //non IE&lt;br /&gt;    if( Event.KEYUP ) {&lt;br /&gt;        //NS 4, NS 6+, Mozilla 0.9+&lt;br /&gt;        document.captureEvents( Event.KEYUP );&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;/* this next line tells the browser to detect a keyup&lt;br /&gt;event over the whole document and when it detects it,&lt;br /&gt;it should run the event handler function 'alertkey' */&lt;br /&gt;document.onkeyup = alertkey;&lt;br /&gt;&lt;br /&gt;//NOW CREATE THE EVENT HANDLER FUNCTION TO PROCESS THE EVENT&lt;br /&gt;function alertkey(e) {&lt;br /&gt;    if( !e ) {&lt;br /&gt;        //if the browser did not pass the event information to the&lt;br /&gt;        //function, we will have to obtain it from the event register&lt;br /&gt;        if( window.event ) {&lt;br /&gt;            //DOM&lt;br /&gt;            e = window.event;&lt;br /&gt;        } else {&lt;br /&gt;            //TOTAL FAILURE, WE HAVE NO WAY OF REFERENCING THE EVENT&lt;br /&gt;            return;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    if( typeof( e.which ) == 'number' ) {&lt;br /&gt;        //NS 4, NS 6+, Mozilla 0.9+, Opera&lt;br /&gt;        e = e.which;&lt;br /&gt;    } else if( typeof( e.keyCode ) == 'number'  ) {&lt;br /&gt;        //IE, NS 6+, Mozilla 0.9+&lt;br /&gt;        e = e.keyCode;&lt;br /&gt;    } else if( typeof( e.charCode ) == 'number'  ) {&lt;br /&gt;        //also NS 6+, Mozilla 0.9+&lt;br /&gt;        e = e.charCode;&lt;br /&gt;    } else {&lt;br /&gt;        //TOTAL FAILURE, WE HAVE NO WAY OF OBTAINING THE KEY CODE&lt;br /&gt;        return;&lt;br /&gt;    }&lt;br /&gt;    window.alert('The key pressed has keycode ' + e +&lt;br /&gt;        ' and is key ' + String.fromCharCode( e ) );&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16671681-113757917530353724?l=kodalis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kodalis.blogspot.com/feeds/113757917530353724/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16671681&amp;postID=113757917530353724' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/113757917530353724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/113757917530353724'/><link rel='alternate' type='text/html' href='http://kodalis.blogspot.com/2006/01/javascript-event-handling.html' title='JavaScript Event Handling'/><author><name>srikanth</name><uri>http://www.blogger.com/profile/04234053570810422671</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16671681.post-113755746514930667</id><published>2006-01-17T20:10:00.000-08:00</published><updated>2006-01-17T20:11:05.160-08:00</updated><title type='text'>Java Tiger Enum Example</title><content type='html'>package LangBasics.Enum;&lt;br /&gt;&lt;br /&gt;import java.util.Scanner;&lt;br /&gt;&lt;br /&gt;class EnumWithMethod&lt;br /&gt;{&lt;br /&gt; //You can declare the method abstract in the enum type and override it &lt;br /&gt; //with a concrete method in each constant. &lt;br /&gt; //Such methods are known as constant-specific methods&lt;br /&gt;&lt;br /&gt; public enum MathEnumWithMethods {&lt;br /&gt;  ADD { &lt;br /&gt;   void doCalc(int i,int j)&lt;br /&gt;   {&lt;br /&gt;    System.out.println("+ --&gt;");&lt;br /&gt;    System.out.println(i + j);&lt;br /&gt;   }&lt;br /&gt;  },&lt;br /&gt;  SUB { &lt;br /&gt;   void doCalc(int i,int j)&lt;br /&gt;   {&lt;br /&gt;    System.out.println("- --&gt;");&lt;br /&gt;    System.out.println(i - j);&lt;br /&gt;   }&lt;br /&gt;  },&lt;br /&gt;  MUL { &lt;br /&gt;   void doCalc(int i,int j)&lt;br /&gt;   {&lt;br /&gt;    System.out.println("* --&gt;");&lt;br /&gt;    System.out.println(i * j);&lt;br /&gt;   }&lt;br /&gt;  },&lt;br /&gt;  DIV { &lt;br /&gt;   void doCalc(int i,int j)&lt;br /&gt;   {&lt;br /&gt;    System.out.println("/ --&gt;");&lt;br /&gt;    if(j!=0)&lt;br /&gt;     System.out.println(i / j);&lt;br /&gt;    else&lt;br /&gt;     System.out.println("Not a valid input");&lt;br /&gt;   }&lt;br /&gt;  };&lt;br /&gt;&lt;br /&gt; abstract void doCalc(int x, int y);&lt;br /&gt;&lt;br /&gt; } // end of : MathEnumWithMethods method&lt;br /&gt;&lt;br /&gt; public static void main(String[] args) &lt;br /&gt; {&lt;br /&gt;  EnumWithMethod objEnumeration = new EnumWithMethod();&lt;br /&gt;  Scanner in = new Scanner(System.in);&lt;br /&gt;  System.out.println("Enter First Number");&lt;br /&gt;  int i = in.nextInt();&lt;br /&gt;  System.out.println("Enter Second Number");&lt;br /&gt;  int j = in.nextInt();&lt;br /&gt;  System.out.println("Enter Operation ADD/SUB/MUL/DIV");&lt;br /&gt;  String strOper = in.next();&lt;br /&gt;  if(strOper.equalsIgnoreCase("ADD")){&lt;br /&gt;&lt;br /&gt;   MathEnumWithMethods.ADD.doCalc(i,j);&lt;br /&gt;&lt;br /&gt;  }else if(strOper.equalsIgnoreCase("SUB")){&lt;br /&gt;&lt;br /&gt;   MathEnumWithMethods.SUB.doCalc(i,j);&lt;br /&gt;&lt;br /&gt;  }else if(strOper.equalsIgnoreCase("MUL")){&lt;br /&gt;&lt;br /&gt;   MathEnumWithMethods.MUL.doCalc(i,j);&lt;br /&gt;&lt;br /&gt;  }else if(strOper.equalsIgnoreCase("DIV")){&lt;br /&gt;&lt;br /&gt;   MathEnumWithMethods.DIV.doCalc(i,j);&lt;br /&gt;&lt;br /&gt;  }else{&lt;br /&gt;    System.out.println(strOper + " is not a right choice");&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt; } // end of : main method&lt;br /&gt;&lt;br /&gt;} // end of : EnumWithMethod Class&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16671681-113755746514930667?l=kodalis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kodalis.blogspot.com/feeds/113755746514930667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16671681&amp;postID=113755746514930667' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/113755746514930667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/113755746514930667'/><link rel='alternate' type='text/html' href='http://kodalis.blogspot.com/2006/01/java-tiger-enum-example.html' title='Java Tiger Enum Example'/><author><name>srikanth</name><uri>http://www.blogger.com/profile/04234053570810422671</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16671681.post-113496509946432832</id><published>2005-12-18T19:56:00.000-08:00</published><updated>2005-12-18T20:05:46.343-08:00</updated><title type='text'>Food As Medicine</title><content type='html'>&lt;b&gt;&lt;font color="black"&gt;HEADACHE ? EAT FISH&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;Eat plenty of fish -- fish oil helps prevent headaches.&lt;br /&gt;So does ginger, which reduces inflammation and pain.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color="black"&gt;HAY FEVER ? EAT YOGURT &lt;/font&gt;&lt;/b&gt;&lt;br /&gt;Eat lots of yogurt before pollen season.&lt;br /&gt;Also-eat honey from your area (local region) daily.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color="black"&gt;TO PREVENT STROKE DRINK TEA &lt;/font&gt;&lt;/b&gt;&lt;br /&gt;Prevent build-up of fatty deposits on artery walls with regular doses of tea. (actually, tea suppresses my appetite and keeps the pounds from invading..Green tea is great for our immune system)!&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color="black"&gt;INSOMNIA (CAN'T SLEEP ?) HONEY &lt;/font&gt;&lt;/b&gt;&lt;br /&gt;Use honey as a tranquilizer and sedative.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color="black"&gt;ASTHMA ? EAT ONIONS &lt;/font&gt;&lt;/b&gt;&lt;br /&gt;Eating onions help! s ease constriction of bronchial tubes. (when I was young, my mother would make onion packs to place on our chest, helped the respiratory ailments and actually made us breathe better).&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color="black"&gt;ARTHRITIS ? EAT FISH, TOO &lt;/font&gt;&lt;/b&gt;&lt;br /&gt;Salmon, tuna, mackerel and sardines actually prevent arthritis. (fish has omega oils, good for our immune system)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color="black"&gt;UPSET STOMACH ?  BANANAS - GINGER &lt;/font&gt;&lt;/b&gt;&lt;br /&gt;Bananas will settle an upset stomach.&lt;br /&gt;Ginger will cure morning sickness and nausea.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color="black"&gt;BLADDER INFECTION ? DRINK CRANBERRY JUICE &lt;br /&gt;High-acid cranberry juice controls harmful bacteria.&lt;br /&gt;&lt;br /&gt;BONE PROBLEMS ? EAT PINEAPPLE &lt;/font&gt;&lt;/b&gt;&lt;br /&gt;Bone fractures and osteoporosis can be prevented by the manganese in pineapple.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color="black"&gt;PREMENSTRUAL SYNDRO! ME ? EAT CORNFLAKES &lt;/font&gt;&lt;/b&gt;&lt;br /&gt;Women can ward off the effects of PMS with (alpha-Q@yahoogroups.com) cornflakes, which help reduce depression, anxiety and fatigue.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color="black"&gt;MEMORY PROBLEMS ? EAT OYSTERS &lt;/font&gt;&lt;/b&gt;&lt;br /&gt;Oysters help improve your mental functioning by supplying much-needed zinc.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color="black"&gt;COLDS ? EAT GARLIC &lt;/font&gt;&lt;/b&gt;&lt;br /&gt;Clear up that stuffy head with garlic. (remember, garlic lowers cholesterol, too.)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color="black"&gt;COUGHING ? USE RED PEPPERS &lt;/font&gt;&lt;/b&gt;&lt;br /&gt;A substance similar to that found in the cough syrups is found in hot red pepper. Use red (cayenne) pepper with caution-it can irritate your tummy.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color="black"&gt;BREAST CANCER ?  EAT Wheat, bran and cabbage &lt;/font&gt;&lt;/b&gt;&lt;br /&gt;Helps to maintain estrogens at healthy levels.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color="black"&gt;LUNG CANCER ? EAT DARK GREEN &amp; ORANGE AND VEGGIES&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;A good antidote is beta carotene, a form of Vitamin A found in dark green and orange vegetables.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color="black"&gt;ULCERS ? EAT CABBAGE ALSO &lt;/font&gt;&lt;/b&gt;&lt;br /&gt;Cabbage contains chemicals that help heal both gastric and duodenal ulcers.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color="black"&gt;DIARRHEA ? EAT APPLES  &lt;/font&gt;&lt;/b&gt;&lt;br /&gt;Grate an apple with its skin, let it turn brown and eat it to cure this condition. (Bananas are good for this ailment)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color="black"&gt;CLOGGED ARTERIES ? EAT AVOCADO &lt;/font&gt;&lt;/b&gt;&lt;br /&gt;Mono unsaturated fat in avocados lowers cholesterol.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color="black"&gt;HIGH BLOOD PRESSURE ? EAT CELERY AND OLIVE OIL &lt;/font&gt;&lt;/b&gt;&lt;br /&gt;Olive oil has been shown to lower blood pressure.&lt;br /&gt;Celery contains a chemical that lowers pressure too.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color="black"&gt;BLOOD SUGAR IMBALANCE ? EAT BROCCOLI AND PEANUTS &lt;/font&gt;&lt;/b&gt;&lt;br /&gt;The chromium in broccoli and peanuts! helps regulate insulin and blood sugar.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color="black"&gt;Kiwifruit: &lt;/font&gt;&lt;/b&gt;But mighty. This is a good source of potassium, magnesium, Vitamin E &amp; fibre. It's Vitamin C content is twice that of an orange.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color="black"&gt;Apple: &lt;/font&gt;&lt;/b&gt;An apple a day keeps the doctor away? Although an apple has a low Vitamin C content, it has antioxidants &amp; flavonoids which enhances the activity of Vitamin C thereby helping to lower the risks of colon cancer, heart attack &amp; stroke.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color="black"&gt;Strawberry: &lt;/font&gt;&lt;/b&gt;Protective fruit. Strawberries have the highest total antioxidant power among major fruits &amp;protects the body from c! ancer causing, blood vessels clogging free radicals. (Actually, any berry is good for you..they're high in anti-oxidants and they actually keep us young.........blueberries are the best and very versatile in the health field........they get rid of all the free-radicals that invade our bodies)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color="black"&gt;Orange : &lt;/font&gt;&lt;/b&gt;Sweetest medicine. Taking 2 - 4 oranges a day may help keep colds away, lower cholesterol, prevent &amp; dissolve kidney stones as well as lessen the risk of colon cancer.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color="black"&gt;Watermelon: &lt;/font&gt;&lt;/b&gt;Coolest Thirst Quencher. Composed of 92% water, it is also packed with a giant dose of glutathione which helps boost our immune system.Other nutrients   &lt;br /&gt;found in watermelon are Vitamin C &amp;Potassium. (watermelon also has natural substances [natural SPF sources] that keep our skin healthy, protecting our skin from those darn suv rays)Guava &amp;Papaya: Top awards for Vitamin C. They are the clear winners for their high Vitamin C content. Guava is also rich in fiber which helps prevent constipation.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color="black"&gt;Papaya: &lt;/font&gt;&lt;/b&gt;is rich in carotene, this is good for your eyes. (also good for gas and indigestion)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color="black"&gt;Tomatoes: &lt;/font&gt;&lt;/b&gt; are very good as a preventative measure for men, keeps those prostrate problems from invading their bodies.&lt;br /&gt;&lt;br /&gt;Note : This is an extract from a forwaded mail&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16671681-113496509946432832?l=kodalis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kodalis.blogspot.com/feeds/113496509946432832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16671681&amp;postID=113496509946432832' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/113496509946432832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/113496509946432832'/><link rel='alternate' type='text/html' href='http://kodalis.blogspot.com/2005/12/food-as-medicine.html' title='Food As Medicine'/><author><name>srikanth</name><uri>http://www.blogger.com/profile/04234053570810422671</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16671681.post-113470884735944250</id><published>2005-12-15T20:53:00.000-08:00</published><updated>2006-03-21T01:05:20.823-08:00</updated><title type='text'>Java Code for Oracle CLOB</title><content type='html'>//this program is for writing to clob and reading from clob column.&lt;br /&gt;//for running this program include ojdbc14.jar available in oracle site.&lt;br /&gt;&lt;br /&gt;class TestOraCLobInsert {&lt;br /&gt; &lt;br /&gt;    public static void main (String args []) throws SQLException {&lt;br /&gt;   &lt;br /&gt;        try {&lt;br /&gt; &lt;br /&gt;            DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());&lt;br /&gt;            Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@server:1521:sid", "uid", "pwd");&lt;br /&gt; &lt;br /&gt;            PreparedStatement ps = conn.prepareStatement("INSERT INTO CLOBTABLE VALUES (?)");&lt;br /&gt;            &lt;br /&gt;            oracle.sql.CLOB newClob = oracle.sql.CLOB.createTemporary(conn, false, oracle.sql.CLOB.DURATION_CALL);&lt;br /&gt;            &lt;br /&gt;            newClob.putString(1,"This string, up to 4 gigabytes will be inserted into the CLOB");&lt;br /&gt;            &lt;br /&gt;            ps.setClob(1, newClob);&lt;br /&gt;            &lt;br /&gt;            int rowcnt = ps.executeUpdate();&lt;br /&gt;            &lt;br /&gt;            System.out.println("Successful update of "+rowcnt+" row");&lt;br /&gt;            &lt;br /&gt;            ps.close();&lt;br /&gt;&lt;br /&gt;            // for reading the data from the clob data type&lt;br /&gt;&lt;br /&gt;             Statement stmt = conn.createStatement();&lt;br /&gt;      ResultSet rs = stmt.executeQuery("select * from t_temp");&lt;br /&gt;      while(rs.next()){&lt;br /&gt;       int i = rs.getInt(1);&lt;br /&gt;        oracle.sql.CLOB objClob =  (oracle.sql.CLOB)rs.getClob(2);&lt;br /&gt;        InputStream objIS = objClob.getAsciiStream();&lt;br /&gt;       ByteArrayOutputStream objByteArrayOutputStream = new          ByteArrayOutputStream(objIS.available());&lt;br /&gt;        byte b[] = new byte[1024];&lt;br /&gt;        int intReadBytes;&lt;br /&gt;        while((intReadBytes=objIS.read(b, 0,objIS.available() )) != -1) {&lt;br /&gt;         objByteArrayOutputStream.write(b, 0, intReadBytes);&lt;br /&gt;        }&lt;br /&gt;        System.out.println(objByteArrayOutputStream.toString());&lt;br /&gt;        &lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;            conn.close();            &lt;br /&gt;        }&lt;br /&gt;        catch (Exception e) {&lt;br /&gt;            System.out.println("Java Exception caught, error message="+e.getMessage());&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16671681-113470884735944250?l=kodalis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kodalis.blogspot.com/feeds/113470884735944250/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16671681&amp;postID=113470884735944250' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/113470884735944250'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/113470884735944250'/><link rel='alternate' type='text/html' href='http://kodalis.blogspot.com/2005/12/java-code-for-oracle-clob.html' title='Java Code for Oracle CLOB'/><author><name>srikanth</name><uri>http://www.blogger.com/profile/04234053570810422671</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16671681.post-113436003603927923</id><published>2005-12-11T19:58:00.000-08:00</published><updated>2005-12-11T22:50:46.553-08:00</updated><title type='text'>Oracle Cursor : Java Resultset</title><content type='html'>This program shows how to return the cursor from the oracle function and how to access it in java as a resultset&lt;br /&gt;&lt;br /&gt;ORACLE CODE&lt;br /&gt;------------&lt;br /&gt;step 1&lt;br /&gt;&lt;br /&gt;package TestORA;&lt;br /&gt; CREATE OR REPLACE PACKAGE TYPES&lt;br /&gt;AS&lt;br /&gt;   TYPE cursorType IS REF CURSOR;&lt;br /&gt;END;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;step 2&lt;br /&gt;&lt;br /&gt;package TestORA;&lt;br /&gt; CREATE OR REPLACE FUNCTION temp_comp RETURN TYPES.cursortype  &lt;br /&gt;AS &lt;br /&gt;    l_cursor  TYPES.cursortype ; &lt;br /&gt;BEGIN &lt;br /&gt;    OPEN l_cursor FOR SELECT USER_GROUP,company_code FROM COMPANY; &lt;br /&gt;    RETURN l_cursor; &lt;br /&gt;END;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;JAVA CODE&lt;br /&gt;----------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;import java.sql.*; &lt;br /&gt;import oracle.jdbc.driver.*; &lt;br /&gt;&lt;br /&gt;class TestResult{&lt;br /&gt; &lt;br /&gt; public static void main(String args[]){&lt;br /&gt; &lt;br /&gt;  TestResult objTestResult = new TestResult();&lt;br /&gt;  &lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; TestResult(){&lt;br /&gt;  &lt;br /&gt;  try{&lt;br /&gt;   &lt;br /&gt;   String driver = "oracle.jdbc.driver.OracleDriver"; &lt;br /&gt;      String constr = "jdbc:oracle:thin:@ipaddress:1521:servicename;&lt;br /&gt;      Connection conn; &lt;br /&gt;      Class.forName(driver);&lt;br /&gt;      conn = DriverManager.getConnection(constr, "username", "password");&lt;br /&gt;      &lt;br /&gt;      String query = "begin :1 := temp_comp; end;"; &lt;br /&gt;&lt;br /&gt;       CallableStatement cstmt = conn.prepareCall(query); &lt;br /&gt;       cstmt.registerOutParameter(1,OracleTypes.CURSOR); &lt;br /&gt;       cstmt.execute(); &lt;br /&gt;       ResultSet rset = (ResultSet)cstmt.getObject(1); &lt;br /&gt;&lt;br /&gt;       while (rset.next ()) &lt;br /&gt;         System.out.println( rset.getString (1) );&lt;br /&gt;       &lt;br /&gt;       cstmt.close(); &lt;br /&gt;  &lt;br /&gt;      System.out.println("Coonected to data base");&lt;br /&gt;      &lt;br /&gt;      conn.close();&lt;br /&gt;       &lt;br /&gt;  }catch(ClassNotFoundException eClassNotFoundException){&lt;br /&gt;   &lt;br /&gt;   eClassNotFoundException.printStackTrace();&lt;br /&gt;   &lt;br /&gt;  }catch(SQLException eSQLException){&lt;br /&gt;   &lt;br /&gt;   eSQLException.printStackTrace();&lt;br /&gt;  }&lt;br /&gt;      &lt;br /&gt; }&lt;br /&gt; &lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16671681-113436003603927923?l=kodalis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kodalis.blogspot.com/feeds/113436003603927923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16671681&amp;postID=113436003603927923' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/113436003603927923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/113436003603927923'/><link rel='alternate' type='text/html' href='http://kodalis.blogspot.com/2005/12/oracle-cursor-java-resultset.html' title='Oracle Cursor : Java Resultset'/><author><name>srikanth</name><uri>http://www.blogger.com/profile/04234053570810422671</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16671681.post-113283430614778074</id><published>2005-11-24T04:10:00.000-08:00</published><updated>2006-02-13T01:19:52.356-08:00</updated><title type='text'>Hitting Same Site With Different Parameters by AJAX</title><content type='html'>==========&lt;br /&gt;AJAX GET&lt;br /&gt;==========&lt;br /&gt;html&lt;br /&gt;head&lt;br /&gt;titleQutoes/title&lt;br /&gt;script&lt;br /&gt;var http;&lt;br /&gt;function getData() {&lt;br /&gt;clearData();&lt;br /&gt;http = new Array(document.frmQuotes.stock.length);&lt;br /&gt;for(i=0;idocument.frmQuotes.stock.length;i++){&lt;br /&gt;if(document.frmQuotes.stock[i].selected){&lt;br /&gt;http[i] = new ActiveXObject("Microsoft.XMLHTTP"); &lt;br /&gt;var myurl = 'http://www.ndtvprofit.com/scripsearch.asp?script=' + frmQuotes.stock[i].value + '&amp;bsense=Both'&lt;br /&gt;http[i].open("GET", myurl, true);&lt;br /&gt;http[i].onreadystatechange = useHttpResponse;&lt;br /&gt;http[i].send(null);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;function useHttpResponse(tt) {&lt;br /&gt;for(j=0;jhttp.length;j++)&lt;br /&gt;{&lt;br /&gt;if(http[j]!=null){&lt;br /&gt;if (http[j].readyState == 4) {&lt;br /&gt;var textout = http[j].responseText;&lt;br /&gt;http[j] = null;&lt;br /&gt;document.all.a.innerHTML += textout&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;function clearData(){&lt;br /&gt;document.all.a.innerHTML ='';&lt;br /&gt;}&lt;br /&gt;/script&lt;br /&gt;/head&lt;br /&gt;&lt;br /&gt;form name="frmQuotes"&lt;br /&gt;select multiple=true name="stock"&lt;br /&gt;option value="SAIL"&gt;SAIL /option&lt;br /&gt;option value="ITC"&gt;ITC /option&lt;br /&gt;option value="INDIA CEM" INDIA CEM /option&lt;br /&gt;option value="TATA TELE" TATA TELE /option&lt;br /&gt;option value="TCS" TCS /option&lt;br /&gt;/select&lt;br /&gt;input type="button" name="get" value="Get" onClick="getData()"&lt;br /&gt;input type="button" name="clear" value="Clear" onClick="clearData()"&lt;br /&gt;div id='a' /div&lt;br /&gt;&lt;br /&gt;==========&lt;br /&gt;AJAX POST&lt;br /&gt;==========&lt;br /&gt;var str = "pet=dog&amp;arg2=1"; &lt;br /&gt;&lt;br /&gt;var url = "http://www.mydomain.com/index.jsp";// No question mark needed &lt;br /&gt;&lt;br /&gt;xmlReq.open("POST",url,true); &lt;br /&gt;&lt;br /&gt;xmlReq.send(str);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16671681-113283430614778074?l=kodalis.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kodalis.blogspot.com/feeds/113283430614778074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=16671681&amp;postID=113283430614778074' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/113283430614778074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16671681/posts/default/113283430614778074'/><link rel='alternate' type='text/html' href='http://kodalis.blogspot.com/2005/11/hitting-same-site-with-different.html' title='Hitting Same Site With Different Parameters by AJAX'/><author><name>srikanth</name><uri>http://www.blogger.com/profile/04234053570810422671</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
