<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>Java Blog - Java, J2EE, SOA, Spring and Hibernate &#187; Uncategorized</title>
	<link>http://javablog.info</link>
	<description></description>
	<pubDate>Thu, 17 Apr 2008 00:24:36 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
	<language>en</language>
			<item>
		<title>URL Request Parameters using Javascript</title>
		<link>http://javablog.info/2008/04/17/url-request-parameters-using-javascript/</link>
		<comments>http://javablog.info/2008/04/17/url-request-parameters-using-javascript/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 00:24:36 +0000</pubDate>
		<dc:creator>Ravi Nallakukkala</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://javablog.info/2008/04/17/url-request-parameters-using-javascript/</guid>
		<description><![CDATA[function getRequestParameter( name ) {
name = name.replace(/[\[]/,&#8221;\\\[&#8221;).replace(/[\]]/,&#8221;\\\]&#8221;);
var regexS = &#8220;[\\?&#38;]&#8221;+name+&#8221;=([^&#38;#]*)&#8221;;
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null )
return &#8220;&#8221;;
else
return results[1];
}
Let&#8217;s say you have the following URL:
http://www.foo.com/index.html?customerCode=123&#38;consignment=321&#38;debug=true
You want to get the value of consignment parameter so you call the javascript function as follows:
var value = getRequestParameter( &#8216;consignment&#8217; );
]]></description>
			<content:encoded><![CDATA[<p>function getRequestParameter( name ) {<br />
name = name.replace(/[\[]/,&#8221;\\\[&#8221;).replace(/[\]]/,&#8221;\\\]&#8221;);<br />
var regexS = &#8220;[\\?&amp;]&#8221;+name+&#8221;=([^&amp;#]*)&#8221;;<br />
var regex = new RegExp( regexS );<br />
var results = regex.exec( window.location.href );<br />
if( results == null )<br />
return &#8220;&#8221;;<br />
else<br />
return results[1];<br />
}</p>
<p>Let&#8217;s say you have the following URL:<br />
http://www.foo.com/index.html?customerCode=123&amp;consignment=321&amp;debug=true</p>
<p>You want to get the value of consignment parameter so you call the javascript function as follows:<br />
var value = getRequestParameter( &#8216;consignment&#8217; );</p>
]]></content:encoded>
			<wfw:commentRss>http://javablog.info/2008/04/17/url-request-parameters-using-javascript/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Understanding JavaScript Prototypes</title>
		<link>http://javablog.info/2008/01/14/understanding-javascript-prototypes/</link>
		<comments>http://javablog.info/2008/01/14/understanding-javascript-prototypes/#comments</comments>
		<pubDate>Mon, 14 Jan 2008 17:43:17 +0000</pubDate>
		<dc:creator>Ravi Nallakukkala</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://javablog.info/2008/01/14/understanding-javascript-prototypes/</guid>
		<description><![CDATA[I  never got the basics of Javascript Prototypes correct until i found this excellent article by Morris Johns
]]></description>
			<content:encoded><![CDATA[<p>I  never got the basics of Javascript Prototypes correct until i found this excellent <a href="http://blog.morrisjohns.com/illumination_on_javascript_prototypes">article</a> by <a href="http://blog.morrisjohns.com/">Morris Johns</a></p>
]]></content:encoded>
			<wfw:commentRss>http://javablog.info/2008/01/14/understanding-javascript-prototypes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>String IndexOf Case in-sensitive search - PHP</title>
		<link>http://javablog.info/2007/06/04/string-indexof-case-in-sensitive-search-php/</link>
		<comments>http://javablog.info/2007/06/04/string-indexof-case-in-sensitive-search-php/#comments</comments>
		<pubDate>Mon, 04 Jun 2007 22:02:29 +0000</pubDate>
		<dc:creator>Ravi Nallakukkala</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://javablog.info/2007/06/04/string-indexof-case-in-sensitive-search-php/</guid>
		<description><![CDATA[PHP supports a function &#8220;strpos&#8221; which return the position index of the element found or a false if the element is not found.
Usage
$content = &#8216; Search for a string here&#8230;&#8217;;
$find = &#8217;search&#8217;;//lower case s
$pos =strpos($content, $pos);
now $pos will hold a value false;
For case in-sensitive searches, PHP version &#62;5 supports a function &#8220;stripos&#8221; which return the [...]]]></description>
			<content:encoded><![CDATA[<p>PHP supports a function &#8220;strpos&#8221; which return the position index of the element found or a false if the element is not found.</p>
<p><strong>Usage</strong></p>
<p>$content = &#8216; Search for a string here&#8230;&#8217;;<br />
$find = &#8217;search&#8217;;//lower case s<br />
$pos =strpos($content, $pos);<br />
now $pos will hold a value false;</p>
<p>For case in-sensitive searches, PHP version &gt;5 supports a function &#8220;stripos&#8221; which return the position index of the element found or a false if the element is not found; Lower versions of the PHP can use the following code to achieve the same functionality</p>
<p>if (!function_exists(&#8221;stripos&#8221;)) {<br />
function stripos($str,$needle) {<br />
return strpos(strtolower($str),strtolower($needle));<br />
}<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://javablog.info/2007/06/04/string-indexof-case-in-sensitive-search-php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Javascript Child Window invoking a parent window</title>
		<link>http://javablog.info/2007/05/18/javascript-child-window-invoking-parent-window/</link>
		<comments>http://javablog.info/2007/05/18/javascript-child-window-invoking-parent-window/#comments</comments>
		<pubDate>Fri, 18 May 2007 22:15:00 +0000</pubDate>
		<dc:creator>Ravi Nallakukkala</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://javablog.info/2007/05/18/javascript-child-window-invoking-parent-window/</guid>
		<description><![CDATA[Here&#8217;s on the most simplest example of demonstrating Child window to parent window communication using javascript.
The trick is  in using the javascript function &#8220;parent.opener.&#60;js method name to invoke in parent&#62;&#8221;
Parent window HTML code 
&#60;html&#62;
&#60;body&#62;
&#60;script&#62;
function clickme() {
winopen(&#8217;DeleteUserConfirmation.html&#8217;,'popup575&#215;505&#8242;,
&#8216;WIDTH=575,HEIGHT=500,RESIZABLE=No,SCROLLBARS=YES,
TOOLBAR=NO,LEFT=200,TOP=100&#8242;);
}
function winopen(url,stuff,morestuff)
{
var popwin = window.open(url,stuff,morestuff);
if( typeof(popwin) != &#8220;undefined&#8221; &#38;&#38; popwin ) {
popwin.focus();
}
}
function forward(){
alert(&#8217;function in parent window&#8217;);
}
&#60;/script&#62;
&#60;a href=&#8221;javascript:clickme()&#8221;&#62; Click for [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s on the most simplest example of demonstrating Child window to parent window communication using javascript.</p>
<p>The trick is  in using the javascript function &#8220;parent.opener.&lt;js method name to invoke in parent&gt;&#8221;</p>
<p><strong>Parent window </strong><strong>HTML </strong><strong>code </strong></p>
<p>&lt;html&gt;<br />
&lt;body&gt;<br />
&lt;script&gt;<br />
function clickme() {<br />
winopen(&#8217;DeleteUserConfirmation.html&#8217;,'popup575&#215;505&#8242;,<br />
&#8216;WIDTH=575,HEIGHT=500,RESIZABLE=No,SCROLLBARS=YES,<br />
TOOLBAR=NO,LEFT=200,TOP=100&#8242;);<br />
}<br />
function winopen(url,stuff,morestuff)<br />
{<br />
var popwin = window.open(url,stuff,morestuff);<br />
if( typeof(popwin) != &#8220;undefined&#8221; &amp;&amp; popwin ) {<br />
popwin.focus();<br />
}<br />
}<br />
function forward(){<br />
alert(&#8217;function in parent window&#8217;);<br />
}<br />
&lt;/script&gt;<br />
&lt;a href=&#8221;javascript:clickme()&#8221;&gt; Click for Popup Window&lt;/a&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p><strong>Child window HTML code</strong></p>
<p>&lt;!DOCTYPE HTML PUBLIC &#8220;-//W3C//DTD HTML 4.0 Transitional//EN&#8221;&gt;</p>
<p>&lt;html &gt;<br />
&lt;head&gt;<br />
&lt;title&gt;Second Window&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;table cellpadding=&#8221;0&#8243; cellspacing=&#8221;0&#8243; border=&#8221;0&#8243; width=&#8221;100%&#8221; &gt;<br />
&lt;tr&gt;<br />
&lt;td align=&#8221;center&#8221;&gt;<br />
&lt;p&gt; &lt;/p&gt;<br />
&lt;p&gt;&lt;B&gt;What&#8217;s your choice?&lt;/B&gt;&lt;/p&gt;<br />
&lt;p&gt;&lt;a href=&#8221;javascript:parent.opener.forward();window.close();&#8221;&gt;&lt;b&gt;Call Parent Window&lt;/b&gt;&lt;/a&gt; &lt;a href=&#8221;javascript:window.close()&#8221;&gt;Close me&lt;/a&gt;&lt;/p&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
&lt;/body&gt;<br />
&lt;/HTML&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://javablog.info/2007/05/18/javascript-child-window-invoking-parent-window/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Hiding dropdown using Javascript</title>
		<link>http://javablog.info/2007/05/14/hiding-dropdown-using-javascript/</link>
		<comments>http://javablog.info/2007/05/14/hiding-dropdown-using-javascript/#comments</comments>
		<pubDate>Mon, 14 May 2007 18:30:03 +0000</pubDate>
		<dc:creator>Ravi Nallakukkala</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://javablog.info/2007/05/14/hiding-dropdown-using-javascript/</guid>
		<description><![CDATA[I started working on a task  where we need to display drop down based on the text selected in another drop down. The contents of the second drop down are retrieved though an AJAX call.
Here&#8217;s and example which does displays a drop down with three values Admin, Student and Teacher. on selection of a [...]]]></description>
			<content:encoded><![CDATA[<p>I started working on a task  where we need to display drop down based on the text selected in another drop down. The contents of the second drop down are retrieved though an AJAX call.</p>
<p>Here&#8217;s and example which does displays a drop down with three values Admin, Student and Teacher. on selection of a teacher, a grades drop down will be displayed.<br />
&lt;html&gt;<br />
&lt;body&gt;</p>
<p>&lt;script TYPE=&#8221;text/javascript&#8221;&gt;<br />
function handleGrades(obj) {<br />
if(obj.value== 2){<br />
buildGradesDropDown();<br />
document.getElementById(&#8221;GradesDropDown&#8221;).style.visibility = &#8220;visible&#8221;;<br />
} else{<br />
document.getElementById(&#8221;GradesDropDown&#8221;).style.visibility = &#8220;hidden&#8221;;<br />
}<br />
}</p>
<p>function buildGradesDropDown() {<br />
var dropdown = &#8216;Grade : &lt;select name=&#8221;selGradeId&#8221; id=&#8221;selGradeId&#8221; &gt;&#8217;;<br />
//Ajax call should be here, to retrieve the data for the dropdown<br />
dropdown += getOption(&#8217;first&#8217;,1);<br />
dropdown += getOption(&#8217;second&#8217;,2);<br />
dropdown += getOption(&#8217;third&#8217;,3);<br />
dropdown += &#8216;&lt;/select&gt;&#8217;;<br />
document.getElementById(&#8221;GradesDropDown&#8221;).innerHTML = dropdown;<br />
//alert(document.getElementById(&#8221;GradesDropDown&#8221;).innerHTML);<br />
}</p>
<p>function getOption(value,display) {<br />
return &#8216;&lt;Option value=&#8217;+value+&#8217;&gt;&#8217;+display +&#8217;&lt;/option&gt;&#8217;;<br />
}<br />
&lt;/script&gt;</p>
<p>&lt;form &gt;<br />
Select Role<br />
&lt;select name=&#8221;selSchoolId&#8221; id=&#8221;day&#8221; onchange=&#8221;handleGrades(this);&#8221;&gt;<br />
&lt;option value=&#8221;1&#8243;&gt;Admin&lt;/option&gt;<br />
&lt;option value=&#8221;2&#8243;&gt;Student&lt;/option&gt;<br />
&lt;option value=&#8221;3&#8243;&gt;Teacher&lt;/option&gt;<br />
&lt;/select&gt;</p>
<p>&lt;div id=&#8221;GradesDropDown&#8221; style=&#8221;visibility:hidden&#8221;&gt;</p>
<p>&lt;/div&gt;<br />
&lt;/form&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://javablog.info/2007/05/14/hiding-dropdown-using-javascript/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Code generation of JUnit test cases</title>
		<link>http://javablog.info/2007/04/16/code-generation-of-junit-test-cases/</link>
		<comments>http://javablog.info/2007/04/16/code-generation-of-junit-test-cases/#comments</comments>
		<pubDate>Mon, 16 Apr 2007 18:34:11 +0000</pubDate>
		<dc:creator>Ravi Nallakukkala</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://javablog.info/2007/04/16/code-generation-of-junit-test-cases/</guid>
		<description><![CDATA[Found a good discussion on IBM site; but remember this is a discussion in 2003 things could have changed by now
]]></description>
			<content:encoded><![CDATA[<p>Found a good discussion on <a href="http://www-128.ibm.com/developerworks/forums/dw_thread.jsp?message=25075&amp;cat=10&amp;thread=7324&amp;treeDisplayType=threadmode1&amp;forum=179#25075">IBM site</a>; but remember this is a discussion in 2003 things could have changed by now</p>
]]></content:encoded>
			<wfw:commentRss>http://javablog.info/2007/04/16/code-generation-of-junit-test-cases/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Drive from Atlanta to Birmingham</title>
		<link>http://javablog.info/2007/04/13/drive-from-atlanta-to-birmingham/</link>
		<comments>http://javablog.info/2007/04/13/drive-from-atlanta-to-birmingham/#comments</comments>
		<pubDate>Fri, 13 Apr 2007 09:29:58 +0000</pubDate>
		<dc:creator>Ravi Nallakukkala</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://javablog.info/2007/04/13/drive-from-atlanta-to-birmingham/</guid>
		<description><![CDATA[It been long time that i had got an opportunity to demonstrate my driving skills on road, and was memorizing when did I had a good test for my good driving skills, the first thing that comes to my mind is a drive from Atlanta to Birmingham.
Let me give my driving background first, I&#8217;m always [...]]]></description>
			<content:encoded><![CDATA[<p>It been long time that i had got an opportunity to demonstrate my driving skills on road, and was memorizing when did I had a good test for my good driving skills, the first thing that comes to my mind is a drive from Atlanta to Birmingham.</p>
<p>Let me give my driving background first, I&#8217;m always fascinated by Cars and a great fan of  Formula 1 and in particular to Michael Schumacher and Ferrari. I&#8217;m used for driving manual gear cars with a drive on right side, mostly driven in Asia and United kingdom where traffic is considerable good, when moved to states, needed to drive a automated gear cars, not much of traffic on streets, cars hasa left drive (rigth traffic), to make life even difficult very polite drivers , low seep limits on a good roads and photo enforcement in most of the places <img src='http://www.javablog.info/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Sometime back I was working in Atlanta, GA, the one place where I love to drive. Here most of the traffic drives is very very aggressively. I&#8217;m a frequent visitor to Phoenix, AZ; so any guess how does Birmingham come into picture? Yes its because of Southwest airlines.   Couple of times I had to pickup my flight from Birmingham, according to maps, the drive time between the two places should be approximately  to 2 hours 20Min&#8217;s (around 150 miles). After driving for a while a in Atlanta, thought its an 1 hr and 40Min&#8217;s drive and having obtained a boarding card, ideally a door to door of 2 hours and 30 - 40 min&#8217;s is an ideal time for drive (need to be a bit careful in time calculations, Alabama is in CST and Georgia in EST).</p>
<p>Already, I missed couple of factors,</p>
<ul>
<li>I&#8217;m starting my drive on a Friday afternoon  2pm (weekend traffic).</li>
<li>Any road works?</li>
</ul>
<p>The drive from Atlanta to Birmingham is on I20 from east to west; for most part of the freeway official speed-limit is 75miles/ hour. Every time I had driven from Atlanta to Birmingham, it was definitely never without action, excitement!</p>
<p>My Trip to  Birmingham started on a bad note,  Got stuck in traffic in Atlanta Just before I could enter I 20 freeway, It was a delay of 6Min&#8217;s, was getting nervous as I knew I&#8217;m on road which I have no knowledge about, and that&#8217;s the last southwest flight from Birmingham to Phoenix; so pretty much knew what should I do if I miss my flight <img src='http://www.javablog.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . Once Entered into I 20, well its all mine, Friday traffic was there, but as long as I was in Georgia, the whole traffic moves at a higher speed so no real  problems till 50miles, all of sudden a &#8220;Work Zone&#8221; sign for next 6miles; hmm getting interesting <img src='http://www.javablog.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  drove about a mile at reduced speed, then another surprise, slow traffic  and eventually no movement in the car (may be 10feet) for 25 minutes, totally frustrated, saw a small gap in front of me, so moved around 3feet, here you goo&#8230;.bang!!! its from the back, someone hit me from back!  hmm stopped the car to check the damage, a small dent and its was a old lady driver who expressed her apology, considering time constraints immediately back to car; after 40 Min&#8217;s of near stand still situation, suddenly found my car running at 40miles/hour then slowly to hitting the speed limit  on the road, car speed limit slow traffic,  a quick mathematics says I need an &#8220;average speed&#8221; of 80miles + 10-15minutes for car parking and security + boarding (Assumption was Birmingham is a small airport). May times, was revisiting my decision, would it be good to return back ? but same time wanna to give a try.</p>
<p>The opportunity to test driving skill was presented to me in a most beautiful way, drove to the potential of my car for next 50miles, the expected average speed was so high that my speed is not making any significant impact on the overall time, so complete 100miles; here comes another surprise, &#8220;work zone next 6miles&#8221;, hmm I don&#8217;t remember if I had followed the speed limits, but mostly it was a empty work zone roads! after that its all driving on I20 in a deep forests no sharp turns and not many narrow roads, but once reached the outskirts of Birmingham, traffic was there, not so crowded, comparatively,  the average speed seems to be low in Birmingham, reached airport 13Min&#8217;s before my flight schedule, car parking in Birmingham was the best (just 1min walk), I parked in C12 slot (which later realized is the nearest place to reach airport security), a 30sec run, I&#8217;m  in airport, a minute to find the security location and if my flight was still there, around 10 Min&#8217;s left at in front of security, Luckily, I&#8217;m the lone one at security counter (small airports are handy ah <img src='http://www.javablog.info/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> )  6minutes left,1 minute run to boarding area, &#8220;well, you are too close sir&#8221; was the greeting I got!  Sounded like honey to ears, &#8221; I made it&#8221;.</p>
<p>Now thinking back, the only thing, I was missing the other day was &#8220;Rain&#8221;, I love driving in rainy conditions, it would have been awesome had it rained, although I wasn&#8217;t sure If I could have make it to my flight <img src='http://www.javablog.info/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://javablog.info/2007/04/13/drive-from-atlanta-to-birmingham/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
