<?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-1421243780350026300</id><updated>2011-12-14T05:33:04.394-08:00</updated><category term='division'/><category term='PHP'/><category term='send'/><category term='operators'/><category term='multiplication'/><category term='files'/><category term='hello world'/><category term='VB.Net'/><category term='JSP'/><category term='shift'/><category term='browser'/><category term='arrays'/><title type='text'>Web Programming</title><subtitle type='html'>A Web Application Blog where you'll find lots of sample code snippets, tips n tricks for many poupular web development languages like PHP,Perl,Python,ASP,ASP.Net,Ruby,JSP,etc.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://programmingtheweb.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1421243780350026300/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://programmingtheweb.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Pradeep S</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-toKTJakb_B4/AAAAAAAAAAI/AAAAAAAAAAA/KJkMwvPmAiA/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1421243780350026300.post-165725133778390769</id><published>2007-05-25T06:39:00.000-07:00</published><updated>2007-05-25T06:40:22.679-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.Net'/><title type='text'>Check For Leap Year in VB.Net</title><content type='html'>When dealing with dates in VB.NET, it's a good idea not to perform manual checks or calculations, which may be inaccurate depending on the quality of the code. Instead, it's advisable to rely on the functionality of classes provided by .NET.&lt;br /&gt;&lt;br /&gt;For instance, if you need to determine if a given year is a leap year, you can use VB.NET's IsLeapYear function. Here's an example of how you can use the function:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Private Sub LeapYearCheck()      &lt;br /&gt; Dim bLeapYear AsBoolean        &lt;br /&gt; bLeapYear = Date.IsLeapYear(Now.Year)      &lt;br /&gt; MessageBox.Show(bLeapYear)        &lt;br /&gt; bLeapYear = Date.IsLeapYear(2004)      &lt;br /&gt; MessageBox.Show(bLeapYear)  &lt;br /&gt;End Sub  &lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;In the example, we define a Boolean variable, bLeapYear, to hold the result of whether a given year is a leap year. we then set the value of bLeapYear to the IsLeapYear property of the Date class and pass to it the current year, which we obtain using the Year property of the Now class. We show the value of bLeapYear in a MessageBox. The result is False because 2007 is not a leap year. After that,we follow the same steps for 2004, which is a leap year. In that case, MessageBox shows True.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PHP,Java, DHTML, C, C++ and many more languages, for help visit&lt;br /&gt;&lt;a style="font-style: italic;" href="http://www.go4expert.com/" target="_blank"&gt;Programming Fourm&lt;/a&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1421243780350026300-165725133778390769?l=programmingtheweb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programmingtheweb.blogspot.com/feeds/165725133778390769/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1421243780350026300&amp;postID=165725133778390769' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1421243780350026300/posts/default/165725133778390769'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1421243780350026300/posts/default/165725133778390769'/><link rel='alternate' type='text/html' href='http://programmingtheweb.blogspot.com/2007/05/check-for-leap-year-in-vbnet.html' title='Check For Leap Year in VB.Net'/><author><name>Pradeep S</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-toKTJakb_B4/AAAAAAAAAAI/AAAAAAAAAAA/KJkMwvPmAiA/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1421243780350026300.post-2901436669925988513</id><published>2007-05-25T06:34:00.000-07:00</published><updated>2007-05-25T06:37:28.675-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='arrays'/><title type='text'>Methods To Recurse Through An Array</title><content type='html'>I was wondering in how many ways can we iterate through an array in PHP. So, I figured out a few, here's it...&lt;br /&gt;&lt;br /&gt;Our Array, which we will be iterating on,&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;$arr = array('PHP','Perl', 'JavaScript','AJAX', 'Python','ASP', 'C#');&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;1. Using a simple for loop&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;// using for loop&lt;br /&gt;for($i=0;$i&amp;lt;count($arr);$i++)&lt;br /&gt;{&lt;br /&gt;    print("$arr[$i]\n");&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;2. Using foreach&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;// using foreach&lt;br /&gt;foreach($arr as $val)&lt;br /&gt;{&lt;br /&gt;    print("$val\n");&lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;3. Using a while loop&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;// using while loop  &lt;br /&gt;$i=0;  &lt;br /&gt;while($val=$arr[$i++])  &lt;br /&gt;{&lt;br /&gt; print("$val\n");  &lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;4. Using the array_walk function&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;// using array_walk function&lt;br /&gt;function print_item($item,$key)&lt;br /&gt;{&lt;br /&gt;    print("$item\n");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;array_walk($arr,'print_item');&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;5. Using an user function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;// using a function, and recursively calling it&lt;br /&gt;function print_recurse(&amp;$a)&lt;br /&gt;{&lt;br /&gt;    printf("%s\n",array_pop($a));&lt;br /&gt;    // check whether array has any elements, or else it'll become an infinite recursion&lt;br /&gt;    if(count($a)&gt;0)&lt;br /&gt;        print_recurse($a);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;print_recurse($arr); &lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1421243780350026300-2901436669925988513?l=programmingtheweb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programmingtheweb.blogspot.com/feeds/2901436669925988513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1421243780350026300&amp;postID=2901436669925988513' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1421243780350026300/posts/default/2901436669925988513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1421243780350026300/posts/default/2901436669925988513'/><link rel='alternate' type='text/html' href='http://programmingtheweb.blogspot.com/2007/05/methods-to-recurse-through-array.html' title='Methods To Recurse Through An Array'/><author><name>Pradeep S</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-toKTJakb_B4/AAAAAAAAAAI/AAAAAAAAAAA/KJkMwvPmAiA/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1421243780350026300.post-2307090454104447523</id><published>2007-02-28T20:53:00.000-08:00</published><updated>2007-02-28T21:00:42.650-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='division'/><category scheme='http://www.blogger.com/atom/ns#' term='shift'/><category scheme='http://www.blogger.com/atom/ns#' term='operators'/><category scheme='http://www.blogger.com/atom/ns#' term='multiplication'/><title type='text'>Using shift operator for faster division and multiplication</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Multiplications&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;12 * 2 = 12 &lt;&lt; 1&lt;br /&gt;12 * 4 = 12 &lt;&lt; 2&lt;br /&gt;12 * 8 = 12 &lt;&lt; 3&lt;br /&gt;12 * 16 = 12 &lt;&lt; 4&lt;br /&gt;12 * 32 = 12 &lt;&lt; 5&lt;br /&gt;12 * 64 = 12 &lt;&lt; 6&lt;br /&gt;12 * 128 = 12 &lt;&lt; 7&lt;br /&gt;12 * 256 = 12 &lt;&lt; 8&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Divisions&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;12 / 2 = 12 &gt;&gt; 1&lt;br /&gt;12 / 4 = 12 &gt;&gt; 2&lt;br /&gt;12 / 8 = 12 &gt;&gt; 3&lt;br /&gt;12 / 16 = 12 &gt;&gt; 4&lt;br /&gt;12 / 32 = 12 &gt;&gt; 5&lt;br /&gt;12 / 64 = 12 &gt;&gt; 6&lt;br /&gt;12 / 128 = 12 &gt;&gt; 7&lt;br /&gt;12 / 256 = 12 &gt;&gt; 8&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Example&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;$a = 12 &lt;&lt; 1;&lt;br /&gt;print $a;&lt;br /&gt;?&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Community discussing C and its derivatives like Win32, C++, MFC, C# tutorials - &lt;a href="http://www.cfanatic.com/"&gt;www.cfanatic.com&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1421243780350026300-2307090454104447523?l=programmingtheweb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programmingtheweb.blogspot.com/feeds/2307090454104447523/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1421243780350026300&amp;postID=2307090454104447523' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1421243780350026300/posts/default/2307090454104447523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1421243780350026300/posts/default/2307090454104447523'/><link rel='alternate' type='text/html' href='http://programmingtheweb.blogspot.com/2007/02/using-shift-operator-for-faster.html' title='Using shift operator for faster division and multiplication'/><author><name>Pradeep S</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-toKTJakb_B4/AAAAAAAAAAI/AAAAAAAAAAA/KJkMwvPmAiA/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1421243780350026300.post-146730161964552347</id><published>2007-02-28T20:50:00.000-08:00</published><updated>2007-02-28T20:52:02.259-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='files'/><category scheme='http://www.blogger.com/atom/ns#' term='JSP'/><category scheme='http://www.blogger.com/atom/ns#' term='send'/><category scheme='http://www.blogger.com/atom/ns#' term='browser'/><title type='text'>Sending files to browser in JSP</title><content type='html'>Sending files to browser in JSP&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;%&lt;br /&gt;// fetch the file&lt;br /&gt;String filename = "companySecret.txt";&lt;br /&gt;String filepath = "C:\\";&lt;br /&gt;&lt;br /&gt;response.setContentType("application/octet-stream");&lt;br /&gt;response.setHeader("Content-Disposition", "attachment; filename=\"" + filename + '"');&lt;br /&gt;&lt;br /&gt;java.io.FileInputStream fileInputStream = new java.io.FileInputStream(filepath + filename);&lt;br /&gt;&lt;br /&gt;int i;&lt;br /&gt;while ((i=fileInputStream.read()) != -1) &lt;br /&gt;{&lt;br /&gt;    out.write(i);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;fileInputStream.close();&lt;br /&gt;out.close();&lt;br /&gt;%&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Community discussing C and its derivatives like Win32, C++, MFC, C# tutorials - &lt;a href="http://www.cfanatic.com/"&gt;www.cfanatic.com&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1421243780350026300-146730161964552347?l=programmingtheweb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programmingtheweb.blogspot.com/feeds/146730161964552347/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1421243780350026300&amp;postID=146730161964552347' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1421243780350026300/posts/default/146730161964552347'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1421243780350026300/posts/default/146730161964552347'/><link rel='alternate' type='text/html' href='http://programmingtheweb.blogspot.com/2007/02/sending-files-to-browser-in-jsp.html' title='Sending files to browser in JSP'/><author><name>Pradeep S</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-toKTJakb_B4/AAAAAAAAAAI/AAAAAAAAAAA/KJkMwvPmAiA/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1421243780350026300.post-394193668305314994</id><published>2007-02-28T20:20:00.000-08:00</published><updated>2007-02-28T20:22:48.893-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hello world'/><title type='text'>Hello World!</title><content type='html'>Like all programming langues where we write a HelloWorld program when we start programming in that language, here's the HelloWorld to this Web Application Blog where you'll find lots of sample code snippets, tips n tricks for many poupular web development languages like PHP,Perl,Python,ASP,ASP.Net,Ruby,JSP,etc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1421243780350026300-394193668305314994?l=programmingtheweb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programmingtheweb.blogspot.com/feeds/394193668305314994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1421243780350026300&amp;postID=394193668305314994' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1421243780350026300/posts/default/394193668305314994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1421243780350026300/posts/default/394193668305314994'/><link rel='alternate' type='text/html' href='http://programmingtheweb.blogspot.com/2007/02/hello-world.html' title='Hello World!'/><author><name>Pradeep S</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-toKTJakb_B4/AAAAAAAAAAI/AAAAAAAAAAA/KJkMwvPmAiA/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry></feed>
