<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Rajesh's Weblog</title>
	<atom:link href="http://arajesh.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://arajesh.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Wed, 13 Aug 2008 16:12:30 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='arajesh.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/3c1ddd7128630afdb82c01c654428b72?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Rajesh's Weblog</title>
		<link>http://arajesh.wordpress.com</link>
	</image>
			<item>
		<title>Buy Dabur Pharma</title>
		<link>http://arajesh.wordpress.com/2008/08/13/buy-dabur-pharma/</link>
		<comments>http://arajesh.wordpress.com/2008/08/13/buy-dabur-pharma/#comments</comments>
		<pubDate>Wed, 13 Aug 2008 16:12:30 +0000</pubDate>
		<dc:creator>arajesh</dc:creator>
				<category><![CDATA[Stocks]]></category>
		<category><![CDATA[dabur pharma stock]]></category>

		<guid isPermaLink="false">http://arajesh.wordpress.com/?p=66</guid>
		<description><![CDATA[Buy Dabur Pharma above 68.00.
Term : Medium Term

Target : 73.00
Stop Loss : 66.65
Current Market Price : 66.40
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arajesh.wordpress.com&blog=1446053&post=66&subd=arajesh&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Buy Dabur Pharma above 68.00.</p>
<p>Term : Medium Term</p>
<p><a href="http://arajesh.files.wordpress.com/2008/08/daburpharma.jpg"><img class="alignnone size-medium wp-image-67" src="http://arajesh.files.wordpress.com/2008/08/daburpharma.jpg?w=300&#038;h=218" alt="" width="300" height="218" /></a></p>
<p>Target : 73.00</p>
<p>Stop Loss : 66.65</p>
<p>Current Market Price : 66.40</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/arajesh.wordpress.com/66/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/arajesh.wordpress.com/66/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arajesh.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arajesh.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arajesh.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arajesh.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arajesh.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arajesh.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arajesh.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arajesh.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arajesh.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arajesh.wordpress.com/66/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arajesh.wordpress.com&blog=1446053&post=66&subd=arajesh&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arajesh.wordpress.com/2008/08/13/buy-dabur-pharma/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/033a2e514c8149a151cbba026d29bea2?s=96&#38;d=identicon" medium="image">
			<media:title type="html">arajesh</media:title>
		</media:content>

		<media:content url="http://arajesh.files.wordpress.com/2008/08/daburpharma.jpg?w=300" medium="image" />
	</item>
		<item>
		<title>Most disgraceful moment in the history of cricket</title>
		<link>http://arajesh.wordpress.com/2008/04/09/most-disgraceful-moment-in-the-history-of-cricket/</link>
		<comments>http://arajesh.wordpress.com/2008/04/09/most-disgraceful-moment-in-the-history-of-cricket/#comments</comments>
		<pubDate>Wed, 09 Apr 2008 16:27:12 +0000</pubDate>
		<dc:creator>arajesh</dc:creator>
				<category><![CDATA[Cricket]]></category>
		<category><![CDATA[Videos]]></category>

		<guid isPermaLink="false">http://arajesh.wordpress.com/?p=62</guid>
		<description><![CDATA[
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arajesh.wordpress.com&blog=1446053&post=62&subd=arajesh&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span style="text-align:center; display: block;"><a href="http://arajesh.wordpress.com/2008/04/09/most-disgraceful-moment-in-the-history-of-cricket/"><img src="http://img.youtube.com/vi/K65_spUU05s/2.jpg" alt="" /></a></span></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/arajesh.wordpress.com/62/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/arajesh.wordpress.com/62/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arajesh.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arajesh.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arajesh.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arajesh.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arajesh.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arajesh.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arajesh.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arajesh.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arajesh.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arajesh.wordpress.com/62/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arajesh.wordpress.com&blog=1446053&post=62&subd=arajesh&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arajesh.wordpress.com/2008/04/09/most-disgraceful-moment-in-the-history-of-cricket/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/033a2e514c8149a151cbba026d29bea2?s=96&#38;d=identicon" medium="image">
			<media:title type="html">arajesh</media:title>
		</media:content>

		<media:content url="http://img.youtube.com/vi/K65_spUU05s/2.jpg" medium="image" />
	</item>
		<item>
		<title>Use FileStream to store and read file : VB.net</title>
		<link>http://arajesh.wordpress.com/2008/04/09/use-filestream-to-store-and-read-file-vbnet/</link>
		<comments>http://arajesh.wordpress.com/2008/04/09/use-filestream-to-store-and-read-file-vbnet/#comments</comments>
		<pubDate>Wed, 09 Apr 2008 08:39:18 +0000</pubDate>
		<dc:creator>arajesh</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://arajesh.wordpress.com/2008/04/09/use-filestream-to-store-and-read-file-vbnet/</guid>
		<description><![CDATA[Imports SystemImports System.IO
Public Class MainClass
  Shared Sub Main()
    Dim i As Integer    Dim theBytes(255) As Byte    For i = 0 To 255      theBytes(i) = CByte(i)    Next    Dim myFileStream As FileStream    Try [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arajesh.wordpress.com&blog=1446053&post=61&subd=arajesh&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Imports System<br />Imports System.IO</p>
<p>Public Class MainClass</p>
<p>  Shared Sub Main()</p>
<p>    Dim i As Integer<br />    Dim theBytes(255) As Byte<br />    For i = 0 To 255<br />      theBytes(i) = CByte(i)<br />    Next<br />    Dim myFileStream As FileStream<br />    Try<br />      myFileStream = New FileStream(&#8220;test.txt&#8221;, FileMode.OpenOrCreate, FileAccess.Write)<br />      myFileStream.Write(theBytes, 0, 256)<br />    Finally<br />      If Not (myFileStream Is Nothing) Then myFileStream.Close()<br />    End Try</p>
<p>    Dim theFile As FileStream<br />    Try<br />      theFile = New FileStream(&#8220;test.txt&#8221;,FileMode.Open, FileAccess.Read)<br />      For i = 0 To (theFile.Length &#8211; 1)<br />        Console.Write(theFile.ReadByte)<br />      Next<br />    Catch e As Exception<br />      Throw e<br />    Finally<br />      If Not (theFile Is Nothing) Then theFile.Close()<br />    End Try<br />  End Sub</p>
<p>End Class</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/arajesh.wordpress.com/61/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/arajesh.wordpress.com/61/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arajesh.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arajesh.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arajesh.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arajesh.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arajesh.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arajesh.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arajesh.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arajesh.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arajesh.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arajesh.wordpress.com/61/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arajesh.wordpress.com&blog=1446053&post=61&subd=arajesh&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arajesh.wordpress.com/2008/04/09/use-filestream-to-store-and-read-file-vbnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/033a2e514c8149a151cbba026d29bea2?s=96&#38;d=identicon" medium="image">
			<media:title type="html">arajesh</media:title>
		</media:content>
	</item>
		<item>
		<title>What is a Smart Client anyway?</title>
		<link>http://arajesh.wordpress.com/2008/04/07/what-is-a-smart-client-anyway/</link>
		<comments>http://arajesh.wordpress.com/2008/04/07/what-is-a-smart-client-anyway/#comments</comments>
		<pubDate>Mon, 07 Apr 2008 08:28:28 +0000</pubDate>
		<dc:creator>arajesh</dc:creator>
				<category><![CDATA[dotNet]]></category>

		<guid isPermaLink="false">http://arajesh.wordpress.com/2008/04/07/what-is-a-smart-client-anyway/</guid>
		<description><![CDATA[And what makes it so smart?
The term Smart Client was coined to highlight the differences
between the typical &#8220;Rich Client&#8221; applications of yesteryear and the
next generation of client applications. To understand these
differences, and to understand how they are likely to change the face
of client-side computing, it is useful to take a trip down memory
lane&#8230;
Client Applications: Then [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arajesh.wordpress.com&blog=1446053&post=60&subd=arajesh&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>And what makes it so smart?</p>
<p>The term Smart Client was coined to highlight the differences<br />
between the typical &#8220;Rich Client&#8221; applications of yesteryear and the<br />
next generation of client applications. To understand these<br />
differences, and to understand how they are likely to change the face<br />
of client-side computing, it is useful to take a trip down memory<br />
lane&#8230;</p>
<p><b>Client Applications: Then and Now<br />
</b>
</p>
<p>In the dim and distant past (that is, the mid 1990&#8217;s) there was a<br />
dramatic increase in the number of client applications being developed<br />
for the Microsoft® Windows® platform. This increase occurred in large<br />
part due to the availability of high-quality developer tools and<br />
frameworks (such as Microsoft® Visual Basic®, Microsoft Visual Studio®,<br />
MFC, and so on) and because of the availability of a feature-rich<br />
client platform. Ah, developer heaven.</p>
<p>The majority of these applications were standalone and operated on<br />
the client machine with no regard to the environment in which they<br />
operated, both with respect to the other machines and services on the<br />
network, and with respect to the other applications on the user&#8217;s<br />
machine. Very often, integration between applications was limited to<br />
using the cut-copy-paste features provided by Windows to transfer small<br />
amounts of data between applications. On the whole, though, users were<br />
pleased with the increasingly useful functionality that these<br />
applications now provided.</p>
<p>After a while, two-tier applications started to appear; these<br />
allowed multiple users to access common data that resided on the<br />
network. Shortly thereafter, DCOM allowed applications to become more<br />
distributed, with logic and state no longer tied to the client machine.<br />
Both of these developments were important and enabled a whole host of<br />
new scenarios and better functionality.</p>
<p>All of this increased flexibility and functionality, however, came<br />
at a price. Perhaps the biggest problem with rich client applications<br />
was that of deployment. As the complexity of the applications and the<br />
client platform had increased, so had the difficulty associated with<br />
deploying the application to the client machine in a reliable and<br />
secure way. One of the biggest problems was that of &#8220;DLL Hell,&#8221; where<br />
one application could break another application by deploying an<br />
incompatible shared component or library.</p>
<p>In addition, the increasingly connected nature of applications<br />
brought with it many other problems. Connected applications were<br />
considerably more complex to develop, despite the availability of<br />
developer tools and frameworks. And as the size and complexity of these<br />
distributed applications grew, the tight coupling between the client<br />
application and the services it consumed became increasingly difficult<br />
to maintain, which in turn exacerbated the deployment and maintenance<br />
problems.</p>
<p>So, while rich clients typically provided a great user experience<br />
and had good developer support, they were still just too difficult to<br />
deploy and maintain.</p>
<p>Around this time, the Internet came along.</p>
<p>The Internet had very little effect on rich client applications.<br />
Some applications provided the ability to notify the user of available<br />
updates, or allowed additional content or features to be downloaded and<br />
installed, but on the whole, the Internet had little influence on how<br />
client applications were developed, deployed, and maintained.</p>
<p>The Internet did provide an alternative to the traditional rich<br />
client model, however, one which promised to solve all of the problems<br />
associated with application deployment and maintenance. Thin client<br />
browser-based applications allowed applications to be deployed and<br />
updated centrally, thereby reducing the problems (and therefore the<br />
cost) associated with deploying and maintaining an application. Also,<br />
thin client applications allowed companies to expose their applications<br />
to a large and diverse external audience.</p>
<p>Unfortunately, this brave new world was not without disadvantages.</p>
<p>Thin client applications at that time often represented the best way<br />
to expose a company&#8217;s information and services to an external user<br />
base. But in many cases, internal applications that would have<br />
traditionally been implemented using a rich client application were<br />
also moved to the thin client model. While this movement had advantages<br />
in reducing deployment complexity, it did so at the cost of the user<br />
experience.</p>
<p>The usability of the applications was often much reduced and common<br />
features that the user had grown accustomed to, such as drag-and-drop,<br />
undo-redo, context sensitive help, and so on, were no longer available.<br />
Furthermore, the responsiveness of the application was diminished,<br />
especially for business applications, such as those in customer call<br />
centers, which demanded heavy data entry and navigation across multiple<br />
screens.</p>
<p>And of course, the browser was entirely dependent on having a<br />
network connection at all times. This meant that mobile workers had no<br />
access to the applications at all, requiring them to re-enter data when<br />
they returned to the office. And even when a connection was available,<br />
low bandwidth or high latency connections caused performance problems<br />
and a reduction in user efficiency.</p>
<p>Developers, too, suffered in the early days of thin clients. Tool<br />
support was lacking, and developers had to move from the cozy world of<br />
component-based development, with type safety and object-oriented<br />
design principles, to the harsh and unforgiving world of script and<br />
HTML. Only now can Web developers claim to have anything approaching<br />
the same level of support as client developers enjoyed 4 or 5 years<br />
ago. Even now, drag-and-drop, undo-redo, context sensitive help, and<br />
other common client-side features are still extremely challenging.</p>
<p>Despite these drawbacks, the deployment and management problems<br />
associated with rich clients were so big that the tradeoff seemed worth<br />
it. As a result, the thin client browser-based application model has<br />
dominated in recent years.</p>
<p><b>Client Applications: The Next Generation<br />
</b>
</p>
<p>Today we live in an information-based economy. In order to thrive in<br />
this hyper-competitive market, users must access and borrow information<br />
from many sources, including customers, partners, and suppliers. And<br />
users are now demanding more from their applications: they want to be<br />
empowered to act, plan, analyze, visualize, and explore the data, not<br />
just to read it.</p>
<p>Such concerns are not limited to a company&#8217;s internal workforce.<br />
Leading companies are increasingly becoming aware that they have to<br />
build a digital relationship with their customers and partners,<br />
allowing them to provide faster and more accurate responses to customer<br />
requests and giving them easy access to purchasing, inventory, and<br />
shipping-status information. These users also need to be able to work<br />
with the data within their own applications.</p>
<p>Without question, the complexity of applications is increasing, and<br />
with it the expectations of the user. The thin client model is no<br />
longer able to provide the required levels of functionality,<br />
performance, flexibility, and integration. Users are now demanding fast<br />
and responsive applications to perform their daily work in a flexible<br />
and efficient manner. Add this to the explosion of devices and the<br />
increasing mobility of the workforce and it is clear that a new<br />
category of client application is required.</p>
<p>So, the pendulum has begun to swing back towards the rich client<br />
model. But what about application deployment and update? The TCO of an<br />
application is still as important as it ever was, probably more so. Do<br />
you sacrifice manageability for usability, or vice versa?</p>
<p><span>Happily, you don&#8217;t need to sacrifice either. Key capabilities<br />
now exist which mean that we can take full advantage of the rich client<br />
model, providing the user with an excellent user experience, while at<br />
the same time reaping the benefits of centralized deployment and<br />
update. In short, this new generation of client applications, the<br />
so-called &#8220;smart&#8221; clients, provides the best of both worlds and adds<br />
the intelligence to manage data and connectivity to produce an<br />
extremely compelling user experience.</span></p>
<p><span></span>W<span>hile smart clients provide the benefits of a<br />
rich client model with thin client manageability, they also provide<br />
much more flexibility than the traditional rich client applications.<br />
For example, smart clients need not be designed as monolithic desktop<br />
applications. Smart client solutions can be developed that are composed<br />
of functionality from more than one client application, with each<br />
application collaborating with the others to provide just the right<br />
functionality to the user. Such &#8220;composite&#8221; applications integrate<br />
client-side software resources into a coherent solution, or extend the<br />
functionality of an existing application to provide smart client<br />
features.</span></p>
<p>In addition, the client platform has moved on in the past few years<br />
and now includes many different types of client devices, not just<br />
desktop PCs. Such devices include PDA&#8217;s, SmartPhones, Tablet PCs,<br />
Laptops, set-top boxes, automotive devices, retail terminals, and so<br />
on. Smart client applications can be built to take maximum advantage of<br />
the features provided by the host device and tuned to provide the best<br />
user experience for the typical users of these devices.</p>
<p><b>Smart Client Check List<br />
</b>
</p>
<p>Because of the high degree of flexibility and somewhat ambiguous<br />
nature of smart client applications, it is often useful to talk about<br />
the key characteristics of a smart client. These characteristics serve<br />
as a guide to the features typically provided by smart clients over and<br />
above those provided by traditional rich client applications. If a<br />
client application displays these characteristics, then it can be said<br />
to be smart:</p>
<ul type="disc">
<li><b>Utilizes Local Resources</b><br />A smart client application<br />
always has code artifacts on the client that enable local resources to<br />
be utilized. What do we mean by local resources? We mean everything<br />
from hardware to software resources. A smart client may take advantage<br />
of the local CPU or GPU, local memory or disk, or any local devices<br />
connected to the client, such as a telephone, bar-code/RFID reader, and<br />
so on. But it may also take advantage of local software, such as<br />
Microsoft Office applications, or any installed line-of-business (LOB)<br />
applications that interact with it.</p>
</li>
<li><b>Connected</b><br />Smart client applications are never<br />
standalone and always form part of a larger distributed solution. This<br />
could mean that the application interacts with a number of Web services<br />
that provide access to data or an LOB application. Very often, the<br />
application has access to specific services that help maintain the<br />
application and provide deployment and update services.</p>
</li>
<li><b>Offline Capable<br /></b>Because they are running on the<br />
local machine, one of the key benefits that smart client applications<br />
offer is that they can be made to work even when the user is not<br />
connected. For applications running in occasional or intermittent<br />
connectivity situations, such as those used by traveling workers or<br />
even those running on laptops, tablets, PDA&#8217;s, and so on, where<br />
connectivity cannot be guaranteed at all times, being able to work<br />
while disconnected is essential. Even when the client is connected, the<br />
smart client application can improve performance and usability by<br />
caching data and managing the connection in an intelligent way.</p>
<p><b><br />
</b>
</li>
<li><b>Intelligent Install and Update<br /></b>Smart client applications manage their deployment and update in a much<b> </b>more<br />
intelligent way than traditional rich client applications. The .NET<br />
framework enables application artifacts to be deployed using a variety<br />
of techniques, including simple file copy or download over HTTP.<br />
Applications can be updated while running and can be deployed on demand<br />
by clicking on a URL. The Microsoft® .NET Framework provides a powerful<br />
security mechanism that guarantees the integrity of the application and<br />
its related assemblies. Assemblies can be given limited permissions in<br />
order to restrict their functionality in semi-trusted scenarios.<b></p>
<p></b>
</li>
<li><b>Client Device Flexibility<br /></b>The .NET Framework<br />
together with the .NET Compact Framework provides a common platform<br />
upon which smart client applications can be built. Often, there will be<br />
multiple versions of the smart client application, each targeting a<br />
specific device type and taking advantage of the devices unique<br />
features and providing functionality appropriate to its usage.</li>
</ul>
<p><b>Smart Clients and the .NET Framework<br />
</b>
</p>
<p>So how does the .NET Framework enable all of these smart client benefits?</p>
<p>The .NET Framework provides a number of fundamental capabilities,<br />
which means that we no longer have to face the difficult usability<br />
versus manageability tradeoff. Let&#8217;s look at some of the more important<br />
features&#8230;</p>
<p>The .NET Framework has very effectively solved the problem of<br />
version conflicts between assemblies shared by more than one<br />
application. A .NET application or assembly has a strong coupling to<br />
the assemblies and components they depend on. Assemblies are annotated<br />
with meta-data, which specifies both their exact version and the<br />
versions of all dependent assemblies. Multiple versions of the same<br />
assembly can be installed side-by-side so that all applications can be<br />
run with the exact same version of the assembly that they were built<br />
and tested against.</p>
<p>This assembly binding mechanism also provides important security<br />
safeguards. Assemblies can be cryptographically signed to prevent<br />
malicious code being run inadvertently, either through tampering or<br />
through luring attacks. In addition, .NET Code Access Security (CAS)<br />
allows assemblies to be granted specific permissions so that they can<br />
be used in semi-trusted scenarios. The .NET runtime ensures that<br />
assemblies can only carry out operations for which they have been<br />
granted permissions. The .NET Framework defines a flexible evidence<br />
based infrastructure for determining which permissions to grant an<br />
application or assembly.</p>
<p>These features effectively address application stability and<br />
predictability, but what about deployment? Assemblies do not need to be<br />
registered on the local machine so they can simply be copied to the<br />
machine before they are run. This greatly simplifies the deployment of<br />
the application. Alternatively, assemblies can be downloaded from a<br />
central server, either at install or at run time.</p>
<p>.NET also provides a deployment feature called No-Touch Deployment,<br />
which allows applications to be run on a URL. When the user clicks on<br />
the URL, the runtime automatically downloads the application, and all<br />
related assemblies, to a special download cache. This mechanism also<br />
checks for version updates so that the user never has to worry about<br />
whether they are running the latest version of the application or not.</p>
<p>Applications deployed in this way are only granted a very limited<br />
amount of permissions by default and are unable to access the local<br />
hard disk or access any network services, apart from the service from<br />
where they were downloaded. Additional permissions can be granted at<br />
the user, machine, or enterprise level if required.</p>
<p>Of course, the .NET Framework provides quite a few other features<br />
that affect how smart client applications can be designed and built. Of<br />
particular important are the Microsoft® .NET Windows Forms classes.<br />
These classes provide very rich user interface controls and give<br />
developers in all languages a common UI framework to work against,<br />
making development and testing much easier. The .NET Framework also<br />
provides many facilities for connecting to network services, such as<br />
SOAP-based Web services, and provides comprehensive XML support.</p>
<p><b>Smart Client Architecture<br />
</b>
</p>
<p>As .NET provides a number of key features that make the development<br />
of smart client applications easier, what are the architectural<br />
implications of all of these new features? It turns out that .NET goes<br />
beyond solving the problems that plagued rich clients and enables a<br />
whole host of new possibilities. The client platform now includes many<br />
different types of client device, and .NET supports them through the<br />
full and compact frameworks, but that&#8217;s just the start.</p>
<p>The flexible binding, deployment, and security models provided by<br />
.NET allow smart client applications to be designed in much more<br />
interesting ways than traditional rich clients. For example, .NET<br />
provides a lot of flexibility in how the application can be &#8220;hosted&#8221;:<br />
applications can be run as a traditional desktop application, or can be<br />
hosted within Microsoft® Office or Microsoft® Internet Explorer. Many<br />
combinations are possible. For instance, a Windows Forms application<br />
can host Internet Explorer or Office components and any host can<br />
subsume any other.</p>
<p>Application logic that is volatile, for example business rules<br />
governing volume order discounts, can be factored into assemblies that<br />
are downloaded on demand over HTTP, obviating the need to frequently<br />
&#8220;update&#8221; the client application in the traditional sense. Additional<br />
(or infrequently used) application features can adopt the same model so<br />
that initial application size is kept to a minimum with additional<br />
features installed on an as-needed basis.</p>
<p>Another popular model is the Composite Application model, where many<br />
applications combine to form a coherent solution. Such solutions can be<br />
formed by coupling together desktop applications, or by providing a<br />
generic &#8220;shell&#8221; application that houses multiple lightweight<br />
applications combining to form the solution.</p>
<p>The latter model has proven to be extremely useful in situations<br />
where the user has to deal with many applications to do their work. For<br />
example, customer service agents in call centers typically have to deal<br />
with many LOB applications, including desktop, browser-based, and<br />
terminal-based applications. All such LOB applications can be hosted<br />
within a generic Windows Forms application that provides integration<br />
between them, greatly simplifying the user&#8217;s job and, most importantly,<br />
reducing the time spent on a particular call.</p>
<p>By providing a generic shell to host these LOB applications, common<br />
infrastructure features, such as security, deployment, window<br />
management, application integration, auditing, and so on, can be<br />
developed, tested, and re-used across different solutions, leaving the<br />
developers of the LOB applications to focus on business functionality.</p>
<p>Perhaps the most compelling example of a composite smart client<br />
application is Microsoft Office. Microsoft Office applications can be<br />
extended using SmartTags, SmartDocuments, or with Microsoft® Visual<br />
Studio® Tools for Office enabling powerful smart client solutions to be<br />
built.</p>
<p>Office smart client solutions can become an integral part of an<br />
organization&#8217;s information infrastructure, accessing corporate data and<br />
services and providing a powerful and familiar working environment. Of<br />
course, Web services provide a natural way for companies to expose data<br />
and services, and smart client applications are the ultimate consumers<br />
of these Web services. And since Microsoft Office also provides XML<br />
support, data can easily be shared between both client and server and<br />
between the user&#8217;s desktop applications.</p>
<p>Office smart client applications are capable of integrating data and<br />
services provided by multiple line-of-business (LOB) applications, each<br />
accessed through separate Web services. Such smart client applications<br />
can provide valuable Business Intelligence functionality, providing the<br />
user with access to critical business data in powerful desktop<br />
applications, such as Microsoft® Excel, where they can visualize,<br />
pivot, and analyze the data as much as required.</p>
<p>And finally, the advent of service-oriented architectures (SOA)<br />
means that there are huge opportunities for client applications to take<br />
advantage of the many and varied services available to them. All such<br />
services are provided in an industry standard way, which provides huge<br />
benefits in terms of interoperability, developer tool support, and the<br />
ease with which new features can be built into the smart client<br />
application.</p>
<p><b>Next Up: Whidbey and Longhorn<br />
</b>
</p>
<p>The above discussion focuses on the benefits that .NET currently<br />
brings to the area of smart clients. What about the future? The next<br />
release of the Microsoft .NET Framework, code-named &#8220;Whidbey,&#8221; will<br />
bring a whole set of new features that build on the .NET Framework and<br />
make smart clients even more compelling: richer and more flexible user<br />
interface components, easier thread management, better tools, and a new<br />
deployment feature called click-once, which builds on the no-touch<br />
deployment mechanism described above.</p>
<p>Microsoft Windows, code-named &#8220;Longhorn,&#8221; will take smart clients to<br />
a whole new level, with features like the presentation subsystem in<br />
Longhorn (code-named &#8220;Avalon&#8221;) providing next generation meta-data<br />
driven user interfaces, and the storage subsystem in Longhorn<br />
(code-named &#8220;WinFS&#8221;) providing huge integration opportunities between<br />
applications. Check out the Longhorn smart client demo for commercial<br />
real estate at <a title="http://msdn.microsoft.com/Longhorn/productinfo/default.aspx" href="http://msdn.microsoft.com/Longhorn/productinfo/default.aspx">http://msdn.microsoft.com/Longhorn/productinfo/default.aspx</a> for a glimpse of the Longhorn smart client vision.</p>
<p>Many analysts have been predicting for a while now that the pendulum<br />
has swung back towards rich clients and away from browser-based<br />
applications. With .NET, and especially with Whidbey and Longhorn, it<br />
looks like the time of the smart client is well and truly upon us.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/arajesh.wordpress.com/60/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/arajesh.wordpress.com/60/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arajesh.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arajesh.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arajesh.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arajesh.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arajesh.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arajesh.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arajesh.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arajesh.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arajesh.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arajesh.wordpress.com/60/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arajesh.wordpress.com&blog=1446053&post=60&subd=arajesh&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arajesh.wordpress.com/2008/04/07/what-is-a-smart-client-anyway/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/033a2e514c8149a151cbba026d29bea2?s=96&#38;d=identicon" medium="image">
			<media:title type="html">arajesh</media:title>
		</media:content>
	</item>
		<item>
		<title>VB.NET Coding Guidelines</title>
		<link>http://arajesh.wordpress.com/2008/04/04/vbnet-coding-guidelines/</link>
		<comments>http://arajesh.wordpress.com/2008/04/04/vbnet-coding-guidelines/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 11:26:44 +0000</pubDate>
		<dc:creator>arajesh</dc:creator>
				<category><![CDATA[dotNet]]></category>

		<guid isPermaLink="false">http://arajesh.wordpress.com/2008/04/04/vbnet-coding-guidelines/</guid>
		<description><![CDATA[by Cory Smith
Table of Contents
1. Introduction2. Style Guidelines  2.1 Tabs and Indenting  2.2 Option Explicit / Option Strict  2.3 Block Formatting  2.4 Single line statements  2.5 Commenting    2.5.1 Copyright notice    2.5.2 Documentation Comments    2.5.3 Comment Style  2.6 Spacing  2.7 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arajesh.wordpress.com&blog=1446053&post=59&subd=arajesh&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>by Cory Smith
<p><b>Table of Contents</b></p>
<p><b>1. Introduction</b><br /><b>2. Style Guidelines</b><br />  2.1 Tabs and Indenting<br />  2.2 Option Explicit / Option Strict<br />  2.3 Block Formatting<br />  2.4 Single line statements<br />  2.5 Commenting<br />    2.5.1 Copyright notice<br />    2.5.2 Documentation Comments<br />    2.5.3 Comment Style<br />  2.6 Spacing<br />  2.7 Attributes<br />  2.8 Naming<br />  2.9 Naming Conventions<br />    2.9.1 Interop Classes<br />  2.10 File Organization<br />  2.11 Doing things the Visual Basic .NET Way<br />  2.12 Microsoft.VisualBasic.Compatibility<br />  2.13 Other Considerations<br />  2.14 Special Thanks</p>
<p><b>1. Introduction</b></p>
<p>First, read the <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconNETFrameworkDesignGuidelines.asp">.NET Framework Design Guidelines</a>. These guidelines exist to extend upon those guidelines for the VB.NET developer. Almost all naming conventions, casing rules, etc., are spelled out in this document. Unlike the Design Guidelines document, you should treat this document as a set of suggested guidelines. These guidelines are not to be taken a law and exist to offer guidance for people who do not have guidelines or are seeking improving upon their existing coding habits.</p>
<p>Note: Portions of this document are based on the <a href="http://blogs.msdn.com/brada/articles/361363.aspx">C# Coding Guidelines</a> written by Brad Abrams.</p>
<p><b>2. Style Guidelines</b></p>
<p><b>2.1 Tabs &amp;amp; Indenting</b></p>
<p>Tab characters (ASCII 9) should not be used in code. All indentation should be done with 2 space characters.</p>
</p>
<table cellpadding="1" cellspacing="0">
<tbody>
<tr>
<td><font face="Arial Narrow" size="2">The reason I use 2 spaces is that, to me, it&#8217;s just a readable as 3 or 4. I believe the VB runtime team uses 3 spaces and the default in the IDE is 4. However, if your code as a lot of indentation (which VB.NET does), you quickly end up with some pretty long lines and a lot of extraneous white space. The reason I settled on 2 spaces is because of these issues and it looks great when publishing code one the web and in print. In the end this is a really minor guideline. Use whatever your comfortable with since, with the &#8220;<strong>Pretty Print</strong>&#8221; feature in the IDE, you can quickly set the spacing to your preference.</font></td>
</tr>
</tbody>
</table>
<p><b>2.2 Option Explicit / Option Strict</b></p>
<p>Although it’s possible to enable these options within the project properties, you should place the following at the top of every source file:</p>
<p><font color="blue">Option Explicit On <br />Option Strict On</font></p>
<p>If you are unable to have both of these set to “On”, a comment should be given as to the reason for doing so.</p>
</p>
<table cellpadding="1" cellspacing="0">
<tbody>
<tr>
<td><font face="Arial Narrow" size="2">Although there is an option in the IDE to enable this, the problem is that when you share code with others. The default in the IDE is these turned off. So when you provide code and they incorporate it within their project, the compiler features enabled when these are turn on are not gained. Also, if they are in every file, you know, without a doubt, what the options are set to. Finally, if you turn the options on in the IDE and you get code from another source, your going to see a potentially see a ton of errors. Have to fix them before (or adding Options Off) even being able to if the code does what you are looking for it to do. One final point. During code reviews, you can see this in the source&#8230; again, absolutely no questions being raised.</font></td>
</tr>
</tbody>
</table>
<p><b>2.3 Block Formatting</b></p>
<p>All logical blocks should be formatted in such a way as to be clean and clear as to what’s occurring. Every If/Then should have an End If. </p>
<p><font color="blue">If</font> someExpression <font color="blue">Then</font><br />  DoSomething()<br /><font color="blue">Else</font><br />  DoSomethingElse()<br /><font color="blue">End If</font></p>
<p>“Select Case” statements should be formatted as follows:</p>
<p><font color="blue">Select Case</font> someExpression <br />  <font color="blue">Case</font> 0<br />    DoSomething()<br />  <font color="blue">Case</font> 1<br />    DoSomethingElse()<br />  <font color="blue">Case</font> 2 <br />    <font color="blue">Dim</font> n <font color="blue">As Integer</font> = 1<br />    DoAnotherThing(n) <br />  <font color="blue">Case Else<br />    <font color="green">&#8216; Normally this would be the default.</font><br /></font><font color="blue">End Select</font></p>
</p>
<table id="Table3" cellpadding="1" cellspacing="0">
<tbody>
<tr>
<td><font face="Arial Narrow" size="2">Not wanting to get into a situation where these guidelines become too restrictive. Personally, in my code, I avoid ever having an empty Case Else. I think there should always be a default setting and I make this one inside of the Case Else. If there is a case when there is no default, then I raise an error. As for If/Then Else sections being empty, I just don&#8217;t have them.</font>  </td>
</tr>
</tbody>
</table>
<p><b>2.4 Single line statements</b></p>
<p>Single line statements should be avoided in every instance except possibly the Select Case blocks. Even then, strong consideration needs to be given to doing so and only done if the statement in question is a single line and very short. If any of the Case elements are not a single line, make all of the Case elements multiple lines for consistency.</p>
<p>Right: </p>
<p><font color="blue">Select Case</font> value<br />  <font color="blue">Case</font> 0: x += 1<br />  <font color="blue">Case</font> 1: x += 5<br />  <font color="blue">Case Else</font>: x += 10<br /><font color="blue">End Select</font></p>
<p>Or</p>
<p><font color="blue">Select Case</font> value<br />  <font color="blue">Case</font> 0<br />    DoSomeProcessStep1()<br />    DoSomeProcessStep2()<br />    x += 1<br />  <font color="blue">Case</font> 1<br />    x += 5<br />  <font color="blue">Case Else</font><br />    x += 10<br /><font color="blue">End Select</font></p>
<p>Wrong: </p>
<p><font color="blue">Select Case</font> value<br />  <font color="blue">Case</font> 0: DoSomeProcessStep1() : DoSomeProcessStep2() : x += 1<br />  <font color="blue">Case</font> 1<br />    x += 5<br />  <font color="blue">Case Else</font>: x += 10<br /><font color="blue">End Select</font></p>
<p><b>2.5 Commenting</b></p>
<p>Comments should be used to describe intention, algorithmic overview, and/or logical flow. It would be ideal, if from reading the comments alone, someone other than the author could understand a function’s intended behavior and general operation. While there are no minimum comment requirements and certainly some very small routines need no commenting at all, it is hoped that most routines will have comments reflecting the programmer’s intent and approach.</p>
<p><b>2.5.1 Copyright notice</b></p>
<p>Each file should start with a copyright notice. To avoid errors in doc comment builds, you don’t want to use triple-apostrophe doc comments, but using XML makes the comments easy to replace in the future. Final text will vary by product (you should contact legal for the exact text), but should be similar to:</p>
<p><font color="green">&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />&#8216; &amp;amp;lt;copyright file=&#8221;ContainerControl.vb&#8221; company=&#8221;Microsoft&#8221;&amp;amp;gt;<br />&#8216; Copyright (c) Microsoft Corporation. All rights reserved.<br />&#8216; &amp;amp;lt;/copyright&amp;amp;gt;<br />&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</font></p>
<p><b><br />
<table id="Table6" cellpadding="1" cellspacing="0">
<tbody>
<tr>
<td><font face="Arial Narrow" size="2">Contact legal?  As you can see with the mention of Microsoft Corporation within the example, this section is included mainly to be consistent with the Microsoft internal C# guidelines.  Whatever the reason may be, it&#8217;s pretty good advice.</font></td>
</tr>
</tbody>
</table>
<p></b></p>
<p><b>2.5.2 Documentation Comments</b></p>
<p>All methods should use XML doc comments. For internal dev comments, the &amp;amp;lt;devdoc&amp;amp;gt; tag should be used.</p>
<p><font color="blue">Public Class</font> World  </p>
<p>  <font color="green">&#8221;&#8217; &amp;amp;lt;summary&amp;amp;gt;Public stuff about the method&amp;amp;lt;/summary&amp;amp;gt;<br />  &#8221;&#8217; &amp;amp;lt;param name=”value”&amp;amp;gt;What a neat parameter!&amp;amp;lt;/param&amp;amp;gt;<br />  &#8221;&#8217; &amp;amp;lt;devdoc&amp;amp;gt;Cool internal stuff!&amp;amp;lt;/devdoc&amp;amp;gt;<br />  &#8221;&#8217;</font><br />  <font color="blue">Public Sub</font> MyMethod(<font color="blue">Byval</font> value <font color="blue">As Integer</font>)<br />    <font color="green">&#8216; &#8230;</font><br />  <font color="blue">End Sub</font></p>
<p><font color="blue">End Class</font></p>
<p><b>2.5.3 Comment Style</b></p>
<p>The &#8216; (apostrophe) style of comment tag should be used in most situations. Where ever possible, place comments above the code instead of beside it. Separate the actually comment (text) from the comment tag with a minimum of a single space, begin the comment with an uppercase letter (proper sentence structure) and end each comment with a period. Here are some examples:</p>
<p><font color="green">&#8216; This is required for WebClient to work through the proxy.</font><br />GlobalProxySelection.Select = New WebProxy(&#8220;http://itgproxy&#8221;)</p>
<p><font color="green">&#8216; Create object to access Internet resources.</font><br /><font color="blue">Dim</font> myClient <font color="blue">As New</font> WebClient()</p>
<p>Comments can be placed at the end of a line when space allows:</p>
<p><font color="blue">Public Class</font> SomethingUseful <br />  <font color="blue">Private</font> itemHash <font color="blue">As Integer</font> <font color="green">&#8216; Some instance member.</font><br />  <font color="blue">Private Static</font> hasDoneSomething <font color="blue">A Boolean</font> <font color="green">&#8216; Some static member.</font><br /><font color="blue">End Class</font></p>
<p><b>2.6 Spacing</b></p>
<p>In addition to using the “Pretty Listing” feature from within Visual Studio, follow these guidelines. Spaces improve readability by decreasing code density. Here are some guidelines for the use of space characters within code:</p>
<ul>
<li>Do use a single space after a comma between function arguments.</p>
<p>Right: </p>
<p>Console.In.Read(myChar, 0, 1)</p>
<p>Wrong: </p>
<p>Console.In.Read(myChar,0,1)</p>
</li>
<li>Do not use a space after the parenthesis and function arguments
<p>Right: </p>
<p>CreateWorld(myChar, 0, 1)</p>
<p>Wrong: </p>
<p>CreateWorld( myChar, 0, 1 )</p>
</li>
<li>Do not use spaces between a function name and parenthesis.
<p>Right: </p>
<p>CreateWorld()</p>
<p>Wrong: </p>
<p>CreateWorld ()</p>
</li>
<li>Do use a single space before and after comparison operators
<p>Right: </p>
<p><font color="blue">If</font> (x = y) <font color="blue">Then</font></p>
<p>Wrong: </p>
<p><font color="blue">If</font> (x=y) <font color="blue">Then</font></p>
</li>
<li>Do use single line spacing between Class, Module, Method and Property definitions
<p>Right: </p>
<p><font color="blue">Sub</font> Spin()<br /><font color="blue">End Sub</font></p>
<p><font color="blue">Sub</font> Bounce()<br /><font color="blue">End Sub</font></p>
<p>Wrong: </p>
<p><font color="blue">Sub</font> Spin()<br /><font color="blue">End Sub</font><br /><font color="blue">Sub</font> Bounce()<br /><font color="blue">End Sub</font> </li>
</ul>
<p><b><br />
<table id="Table4" cellpadding="1" cellspacing="0">
<tbody>
<tr>
<td><font face="Arial Narrow" size="2">Someone asked about defining spacing within the methods.  To me, this is something that is pretty dependent on the type and amount of code within the method.  My general rule of thumb is methods that contain a section of variable declarations or contain a lot of If/End If testing, I add a single space on either side of the code.  For code that is very small and/or doesn&#8217;t contain any variable declarations separated on their own, I usually have no spacing within the method.</font></td>
</tr>
</tbody>
</table>
<p></b></p>
<p><b>2.7 Attributes</b></p>
<p>Attributes should be on the line before the statement the attribute is pertaining to (followed by the space underscore)</p>
<p>&amp;amp;lt;Flags()&amp;amp;gt; _<br /><font color="blue">Public Enum</font> ExitWindowFlags<br />  LogOff = &amp;amp;H0<br />  Shutdown = &amp;amp;H1<br />  Reboot = &amp;amp;H2<br />  Force = &amp;amp;H4<br />  PowerOff = &amp;amp;H8<br />  ForceIfHung = &amp;amp;H10<br /><font color="blue">End Enum</font></p>
<p><b>2.8 Naming</b></p>
<p>Follow all .NET Framework Design Guidelines for both internal and external members. Highlights of these include:</p>
<ul>
<li><b>Do not</b> use Hungarian notation (except for private member variables).  </li>
<li><b>Do</b> use the m_ prefix for private Class level member variables.
<p><em>This is the only guideline in this document that goes against the .NET Framework Design Guidelines, but the guidelines in that document assume languages that are case-sensitive. It is necessary to distinguish the private member variables in some manner as to not collide with the public properties of the same name. To offer complete consistency, this guideline is extended to all private member variables.<br /></em></li>
<li><b>Do</b> use camelCasing for member variables.  </li>
<li><b>Do</b> use camelCasing for parameters.  </li>
<li><b>Do</b> use camelCasing for local variables.  </li>
<li><b>Do</b> use PascalCasing for function, property, event, and class names.  </li>
<li><b>Do</b> prefix interfaces names with “I”  </li>
<li><b>Do not</b> prefix enums, classes, or delegates with any letter  </li>
<li><b>Do not</b> use single-letter naming for variables.  </li>
<li><b>Avoid</b> using constants, use Enum instead. However, when you can’t avoid using constants, use PascalCasing.  </li>
<li><b>Do</b> use ex as the local exception variable in a Try…Catch statement. </li>
</ul>
<p><em>The reason to extend the public rules (no Hungarian, etc.) is to produce a consistent source code appearance. In addition a goal is to have clean readable source. Code legibility should be a primary goal.</em></p>
<p><b> </b>
</p>
<table id="Table2" cellpadding="1" cellspacing="0">
<tbody>
<tr>
<td>
<p><font face="Arial Narrow" size="2">According to the guidelines, private variables are camelCased.  I suggest following this guideline even for the backing variables using the m_, meaning that you would use m_hairColor and not m_HairColor.  The variable name is actually (in concept) the hairColor portion and just adding the m_ to prevent a collision from occurring (to represent it as a backing variable).</font></p>
<p><font face="Arial Narrow" size="2">If you choose not to use m_, your alternative should be to follow the guidelines which means you would use camelCasing and use a variable naming scheme that would allow you to differentiate the backing variable from the property name.  This can be done by appending a word after the variable name such as Value, Member or Private giving you hairColorValue.  I don&#8217;t prefer to go this route myself, but the choice is ultimately yours.</font></p>
</td>
</tr>
</tbody>
</table>
<table id="Table1" cellpadding="1" cellspacing="0">
<tbody>
<tr>
<td>
<p><font face="Arial Narrow" size="2">Single-letter variable names should be avoided; however, if the single-letter naming is clear to anyone that will be viewing the code and doesn&#8217;t need any explanation (x, y for coordinates for example), feel free to use them.  The main thing is to avoid them unless it makes perfect sense to use them.  Rule of Thumb: Think about an alternative to using the single-letter variable name and after additional thought the single-letter naming seems more appropriate, then it&#8217;s probably OK.  For example, instead of using i in an For/Next, use index, count, offset, etc.</font></p>
</td>
</tr>
</tbody>
</table>
<p><b>2.9 Naming Conventions</b></p>
<p><b>2.9.1 Interop Classes</b></p>
<p>Classes that are there for interop wrappers (Declare statements) should follow the naming convention below:</p>
<ul>
<li><b>NativeMethods</b> – No suppress unmanaged code attribute, these are methods that can be used anywhere because a stack walk will be performed.  </li>
<li><b>UnsafeNativeMethods</b> – Has suppress unmanaged code attribute. These methods are potentially dangerous and any caller of these methods must do a full security review to ensure that the usage is safe and protected as no stack walk will be performed. </li>
<li><b>SafeNativeMethods</b> – Has suppress unmanaged code attribute. These methods are safe and can be used fairly safely and the caller isn’t needed to do full security reviews even though no stack walk will be performed.
<p><font color="blue">Class</font> NativeMethods </p>
<p>  <font color="blue">Private Sub New</font>()<br />  <font color="blue">End Sub</font></p>
<p>  <font color="blue">Friend Declare Sub</font> FormatHardDrive <font color="blue">Lib</font> &#8220;user32&#8243; (<font color="blue">ByVal</font> driveName <font color="blue">As String</font>)</p>
<p><font color="blue">End Class</font></p>
<p>&amp;amp;lt;SuppressUnmanagedCodeSecurityAttribute()&amp;amp;gt; _<br /><font color="blue">Class</font> UnsafeNativeMethods</p>
<p>  <font color="blue">Private Sub New</font>()<br />  <font color="blue">End Sub</font></p>
<p>  <font color="blue">Friend Declare Sub</font> CreateFile <font color="blue">Lib</font> &#8220;user32&#8243; (<font color="blue">ByVal</font> fileName <font color="blue">As String</font>)</p>
<p><font color="blue">End Class</font></p>
<p>&amp;amp;lt;SuppressUnmanagedCodeSecurityAttribute()&amp;amp;gt; _<br /><font color="blue">Class</font> SafeNativeMethods</p>
<p>  <font color="blue">Private Sub New</font>()<br />  <font color="blue">End Sub</font></p>
<p>  <font color="blue">Friend Declare Sub</font> MessageBox <font color="blue">Lib</font> &#8220;user32&#8243; (<font color="blue">ByVal</font> [text] <font color="blue">As String</font>)</p>
<p><font color="blue">End Class</font></li>
</ul>
<p>All interop classes <b>must</b> be Private, and all methods must be <b>Friend</b>. In addition a private constructor should be provided to prevent instantiation.</p>
<p>Use the Declare statement instead of the Attribute/Method blocks for declaring Win32 interop unless there is a need to do so because the Declare statement doesn’t expose some needed functionality.</p>
<p>When handling errors involved with interop, use the follow when the API documentation states to use GetLastError (if you aren’t going to handle the error within the code):</p>
<p><font color="blue">Throw New</font> Win32Exception(Marshal.GetLastWin32Error)</p>
<p><b>2.10 File Organization</b></p>
<ul>
<li>Source files should contain only one public type, although multiple internal classes are allowed.  </li>
<li>Source files should be given the name of the Public Class in the file.  </li>
<li>Directory names should follow the Namespace for the class.</li>
</ul>
<p>For example, I would expect to find the public class “System.Windows.Forms.Control” in “System\Windows\Forms\Control.vb”…</p>
<p>Class elements should be grouped into sections. Within these sections, elements should be <b><em>alphabetized</em></b>. </p>
<ul>
<li>Private member variables  </li>
<li>New / Finalize / Dispose  </li>
<li>Public
<ul>
<li>Events  </li>
<li>Properties  </li>
<li>Methods  </li>
<li>Enumerators </li>
</ul>
</li>
<li>Protected
<ul>
<li>Events  </li>
<li>Properties  </li>
<li>Methods  </li>
<li>Enumerators </li>
</ul>
</li>
<li>Friend
<ul>
<li>Events  </li>
<li>Properties  </li>
<li>Methods  </li>
<li>Enumerators </li>
</ul>
</li>
<li>Private
<ul>
<li>Events  </li>
<li>Properties  </li>
<li>Methods  </li>
<li>Enumerators </li>
</ul>
</li>
</ul>
<p><b>2.11 Doing things the Visual Basic .NET Way</b></p>
<ul>
<li><b>Do</b> use the Visual Basic runtime methods rather than .NET Framework where appropriate.  </li>
<li><b>Do</b> use the short method for instantiating classes on the same line.
<p>Right: </p>
<p><font color="blue">Dim</font> someStuff <font color="blue">As New</font> Collection()</p>
<p>Wrong: </p>
<p><font color="blue">Dim</font> someStuff <font color="blue">As</font> Collection = <font color="blue">New</font> Collection()</p>
</li>
<li><b>Do</b> use Try…Catch instead of On Error.  </li>
<li><b>Do</b> use Cnnn() methods instead of System.Convert.Tonnn() methods.  </li>
<li><b>Do not</b> use type characters ($, !, #, %, etc.)  </li>
<li><b>Do not</b> create a Class containing only Shared methods. Use Modules instead. </li>
</ul>
<p><b><br />
<table id="Table5" cellpadding="1" cellspacing="0">
<tbody>
<tr>
<td>
<p><font face="Arial Narrow" size="2">Using the Visual Basic runtime seems to cause people to enter into a holy war, so to explain this:</font></p>
<p><font face="Arial Narrow" size="2">First, taking the example of Right(); yes, in the end, it will call upon String.Substring(). It&#8217;s doing a bit more than that, which in many cases helps to make sure you code is more stable. Here is basically what the code looks like. </font></p>
<p><font face="Arial Narrow" size="2">Public Shared Function Right(ByVal value As String, ByVal length As Integer) As String <br />  If (length &amp;amp;lt; 0) Then <br />    Throw New ArgumentException(&#8220;Length is too short.&#8221;) <br />  End If <br />  If (length = 0 OrElse value Is Nothing) Then <br />    Return &#8220;&#8221; <br />  End If <br />  Dim size As Integer = value.Length <br />  If (length &amp;amp;gt;= size) Then <br />    Return value <br />  End If <br />  Return value.Substring(size &#8211; length, length) <br />End Function </font></p>
<p><font face="Arial Narrow" size="2">By using Right, you don&#8217;t have to worry about whether or not the value is nothing or even if the size you want is within the range. However, if this is important to you, then by all means, use Substring directly. I added the &#8220;where appropriate&#8221; because I think there are some areas where it makes more sense to use the objects (String for example) method over the runtime method. The main point here is to not be afraid to utilize these methods and if you don&#8217;t use them, be sure you are aware of the reason as to why you aren&#8217;t. </font></p>
<p><font face="Arial Narrow" size="2">The second reason is that this suggestion is shared by members of the VB team; obviously they worked hard to make these available in order to make our development life more productive and I don&#8217;t blame them for wanting to see the fruits of their labor leveraged by us. In addition, I&#8217;m constantly seeing false information being spread regarding the &#8220;non-use&#8221; of the runtime and how it&#8217;s not the &#8220;.NET&#8221; way. These are every bit a part of the .NET Framework as say Windows Forms, ADO.NET, ASP.NET, etc. and should be given as much, if not more, consideration in being leveraged, especially by VB.NET developers. </font></p>
<p><font face="Arial Narrow" size="2">Third, the compiler is able to optimize the code when you leverage several of these and my guess is this will improve over time. Not using these puts that responsibility on you, the developer and you don&#8217;t gain any of these benefits in the current and future compiler. This is a minor point, but one I feel I should mention for completeness. </font></p>
<p><font face="Arial Narrow" size="2">In the end, use whatever you are most comfortable with. Just be aware that it&#8217;s not &#8220;wrong&#8221; to leverage the runtime, in fact, in many cases its significantly better than trying to do the same task on your own. To be fair, there are some areas in the VB runtime that don&#8217;t perform that well; in those instances, you have to decide whether performance is your key concern and if it is, for those instances (and, this part is key, if it truly is a bottleneck), find an alternate solution. Performance is a completely different subject and there is no one right answer. </font></p>
</td>
</tr>
</tbody>
</table>
<p></b></p>
<p><b>2.12 Microsoft.VisualBasic.Compatibility</b></p>
<p><b><u>Do not</u></b> use any methods within the Microsoft.VisualBasic.Compatibility namespace. This namespace is not to be confused with Microsoft.VisualBasic; I encourage you to use these timesaving tidbits. If your project contains a reference to the Microsoft.VisualBasic. Compatibility.dll, <b><u>remove it</u></b> and replace any methods that have become invalid with methods either from the Microsoft.VisualBasic or System namespaces.</p>
<p><b>2.13 Other Considerations</b></p>
<p>The following are general considerations that you should keep in mind.</p>
<ul>
<li>Use collections instead of arrays when returning a group of data from a method.  </li>
<li>Use events instead of overriding methods. For example, use the Paint event instead of overriding OnPaint.  </li>
<li>Avoid requiring the orchestration of multiple objects to do a single job.  </li>
<li>Avoid performing operations within properties, use properties to set state. Configure an object through its properties and then use its methods to do the work. </li>
<li>Try to gather items in a namespace that directly relate to each other. Try to avoid putting too many classes under a general category as it creates intellisense noise for developers trying to find something. </li>
</ul>
<p><b>2.14 Special Thanks</b></p>
<p>I&#8217;d like to thank the following people for their invaluable input while working on this document:</p>
<p><a href="http://blogs.msdn.com/brada">Brad Abrams</a> (Microsoft)<br /><a href="http://www.panopticoncentral.net/">Paul Vick</a> (Microsoft)<br />Tyler Whitney (Microsoft)<br /><a href="http://weblogs.asp.net/eporter">Erik Porter</a> (MVP)  </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/arajesh.wordpress.com/59/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/arajesh.wordpress.com/59/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arajesh.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arajesh.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arajesh.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arajesh.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arajesh.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arajesh.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arajesh.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arajesh.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arajesh.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arajesh.wordpress.com/59/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arajesh.wordpress.com&blog=1446053&post=59&subd=arajesh&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arajesh.wordpress.com/2008/04/04/vbnet-coding-guidelines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/033a2e514c8149a151cbba026d29bea2?s=96&#38;d=identicon" medium="image">
			<media:title type="html">arajesh</media:title>
		</media:content>
	</item>
		<item>
		<title>Santa Banta SMS Jokes &#8211; Set 1</title>
		<link>http://arajesh.wordpress.com/2008/04/04/santa-banta-sms-jokes-set-1/</link>
		<comments>http://arajesh.wordpress.com/2008/04/04/santa-banta-sms-jokes-set-1/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 08:33:44 +0000</pubDate>
		<dc:creator>arajesh</dc:creator>
				<category><![CDATA[Jokes_Fun]]></category>

		<guid isPermaLink="false">http://arajesh.wordpress.com/2008/04/04/santa-banta-sms-jokes-set-1/</guid>
		<description><![CDATA[Titanic was sinking.
An englishman asked Santa, &#8220;How far is land&#8221;?
Santa: 2 KMs.
Englishman jumped into sea.
Englishman: Now, which direction?
Santa: Downwards!

Two days of powercut in Delhi had made life miserable. Worst affected was Delhi Metro station where families of Santa &#38;amp;amp; Banta were struck for 48 hrs on escalators

    How did santa tried to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arajesh.wordpress.com&blog=1446053&post=58&subd=arajesh&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Titanic was sinking.<br />
An englishman asked Santa, &#8220;How far is land&#8221;?<br />
Santa: 2 KMs.<br />
Englishman jumped into sea.<br />
Englishman: Now, which direction?<br />
Santa: Downwards!</p>
<hr />
<p>Two days of powercut in Delhi had made life miserable. Worst affected was Delhi Metro station where families of Santa &amp;amp;amp; Banta were struck for 48 hrs on escalators</p>
<hr />
    How did santa tried to kill a bird??<br />
He took it to the top of a building and dropped it from there to die.</p>
<hr />
Santa: I have swallowed a key.<br />
Doctor: When?<br />
Santa: 3 months back!<br />
Doctor: What were you doing till now?<br />
Santa: I was using duplicate key, now I have lost it too.</p>
<hr />
Santa was drawing money from ATM. Banta, who was just behind him in the line said: I&#8217;ve seen ur password. It’s ****. Santa: U r wrong. It’s 1394.</p>
<hr />
Santa falls in love with a nurse&#8230; After much thinking, he finally writes a love letter to her: &#8220;I luv u sister.&#8221;</p>
<hr />
Santa asked Banta: Why Manmohan Singh goes for a walk in evening?<br />
Banta: Very simple, because he is PM not AM. </p>
<hr />
Pappu while filling up a form: What should I write against mother tongue.?<br />
Santa: Very long&#8230;!</p>
<hr />
Teacher: What should be in a book to make it a bestseller?<br />
Pappu: A girl on the cover and no cover on the girl.</p>
<hr />
A lady calls Santa for repairing door bell.<br />
Santa doesn’t turns up for 4 days.<br />
Lady calls again, Santa replies: I&#8217;m coming daily since 4 days, I press the bell but no one comes out.</p>
<hr />
Lady to inspector Santa: My husband went to buy potatos 5 days ago, he hasn&#8217;t came back yet!<br />
Santa: Why don&#8217;t u cook something else?</p>
<hr />
An englishman and santa inside the toilet. Englishman: Good evening, how do u do? Santa: Good evening, we open the zip and do!</p>
<hr />
Jeeto yelled at santa: U&#8217;re gonna b really sorry! I&#8217;m going to LEAVE you!<br />
Santa: Make up ur mind, which one is it gonna be!</p>
<hr />
Santa opened a petrol pump, but not even one customer went there. You know why?<br />
Because he opened petrol pump on second floor..</p>
<hr />
Ultimate answer while changing the job.<br />
Interviewer: Why did you changed your last job?<br />
Santa: Because the company shifted and didn&#8217;t tell me where..</p>
<hr />
Santa and Banta went for a drive.<br />
Santa: Hey, look out from the window, are the indicators working or not?<br />
Banta puts his head out &amp;amp;amp; says &#8220;Yes-No, Yes-No, Yes-No, Yes-No!!!&#8221;</p>
<hr />
Santa&#8217;s wife dies. He is calm, but his wife&#8217;s lover is crying furiously&#8230;<br />
Finally, santa consoles him: Don&#8217;t worry buddy, I will marry again.</p>
<hr />
Why did santa keep the door open while bathing?<br />
Because he was afraid that someone might watch him from the key hole.</p>
<hr />
Santa phoned his wife: I am not coming home. The stearing, dash board, gears of car have been stolen.<br />
After sometime he calls again: I am coming, earlier I sat on the back seat.</p>
<hr />
History teacher asked Santa: Name kalidas&#8217;s brother who was a shoemaker.<br />
Santa: Adidas</p>
<hr />
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/arajesh.wordpress.com/58/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/arajesh.wordpress.com/58/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arajesh.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arajesh.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arajesh.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arajesh.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arajesh.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arajesh.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arajesh.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arajesh.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arajesh.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arajesh.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arajesh.wordpress.com&blog=1446053&post=58&subd=arajesh&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arajesh.wordpress.com/2008/04/04/santa-banta-sms-jokes-set-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/033a2e514c8149a151cbba026d29bea2?s=96&#38;d=identicon" medium="image">
			<media:title type="html">arajesh</media:title>
		</media:content>
	</item>
		<item>
		<title>Design Patterns : Singleton Example</title>
		<link>http://arajesh.wordpress.com/2008/04/04/design-patterns-singleton-example/</link>
		<comments>http://arajesh.wordpress.com/2008/04/04/design-patterns-singleton-example/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 07:32:03 +0000</pubDate>
		<dc:creator>arajesh</dc:creator>
				<category><![CDATA[dotNet]]></category>

		<guid isPermaLink="false">http://arajesh.wordpress.com/2008/04/04/design-patterns-singleton-example/</guid>
		<description><![CDATA[Public Class Singleton  Private Shared SP As Singleton  Private InnerList as New Collections.ArrayList()
  Private Sub New()  End Sub 
  Public Shared Function Create() As Singleton    If SP is Nothing Then SP = New Singleton()     Return SP  End Function
  Public ReadOnly Property [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arajesh.wordpress.com&blog=1446053&post=57&subd=arajesh&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Public Class Singleton<br />  Private Shared SP As Singleton<br />  Private InnerList as New Collections.ArrayList()</p>
<p>  Private Sub New()<br />  End Sub </p>
<p>  Public Shared Function Create() As Singleton<br />    If SP is Nothing Then SP = New Singleton() <br />    Return SP<br />  End Function</p>
<p>  Public ReadOnly Property List As Collections.ArrayList<br />    Get<br />      Return InnerList<br />    End Get<br />  End Property<br />End Class</p>
<p>Module SingletonExample<br />  Sub Main<br />    Dim CountValue as Integer<br />    Dim SP As Singleton = Singleton.Create()<br />    Dim SP2 As Singleton = Singleton.Create()</p>
<p>    SP.List.Add(&#8220;First&#8221;)<br />    SP.List.Add(&#8220;Second&#8221;)<br />    SP.List.Add(&#8220;Third&#8221;)</p>
<p>    For CountValue = 0 To SP2.List.Count &#8211; 1<br />      Console.WriteLine(SP2.List.Item(CountValue).ToString())<br />    Next<br />  End Sub<br />End Module</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/arajesh.wordpress.com/57/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/arajesh.wordpress.com/57/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arajesh.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arajesh.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arajesh.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arajesh.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arajesh.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arajesh.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arajesh.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arajesh.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arajesh.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arajesh.wordpress.com/57/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arajesh.wordpress.com&blog=1446053&post=57&subd=arajesh&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arajesh.wordpress.com/2008/04/04/design-patterns-singleton-example/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/033a2e514c8149a151cbba026d29bea2?s=96&#38;d=identicon" medium="image">
			<media:title type="html">arajesh</media:title>
		</media:content>
	</item>
		<item>
		<title>Xor</title>
		<link>http://arajesh.wordpress.com/2008/04/04/xor/</link>
		<comments>http://arajesh.wordpress.com/2008/04/04/xor/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 07:30:43 +0000</pubDate>
		<dc:creator>arajesh</dc:creator>
				<category><![CDATA[dotNet]]></category>

		<guid isPermaLink="false">http://arajesh.wordpress.com/2008/04/04/xor/</guid>
		<description><![CDATA[Truth table for Xor
Imports System
Public Class MainClass
    Shared Sub Main(ByVal args As String())      &#8216; create truth table for Xor      Console.Write(&#8220;Xor&#8221; &#38;amp; vbCrLf &#38;amp; &#8220;False Xor False: &#8221; &#38;amp; _         (False Xor False) &#38;amp; vbCrLf [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arajesh.wordpress.com&blog=1446053&post=56&subd=arajesh&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span style="font-weight:bold;">Truth table for Xor</span></p>
<p>Imports System</p>
<p>Public Class MainClass</p>
<p>    Shared Sub Main(ByVal args As String())<br />      &#8216; create truth table for Xor<br />      Console.Write(&#8220;Xor&#8221; &amp;amp; vbCrLf &amp;amp; &#8220;False Xor False: &#8221; &amp;amp; _<br />         (False Xor False) &amp;amp; vbCrLf &amp;amp; &#8220;False Xor True: &#8221; &amp;amp; _<br />         (False Xor True) &amp;amp; vbCrLf &amp;amp; &#8220;True Xor False: &#8221; &amp;amp; _<br />         (True Xor False) &amp;amp; vbCrLf &amp;amp; &#8220;True Xor True: &#8221; &amp;amp; _<br />         (True Xor True) &amp;amp; vbCrLf &amp;amp; vbCrLf)<br />    End Sub<br />End Class</p>
<p><span style="font-weight:bold;">Xor Demo</span></p>
<p>Imports System</p>
<p>public class MainClass<br />   Shared Sub Main()<br />    Dim Var1 As Short</p>
<p>    Console.WriteLine( Var1 Xor 5 )</p>
<p>   End Sub</p>
<p>End Class</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/arajesh.wordpress.com/56/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/arajesh.wordpress.com/56/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arajesh.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arajesh.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arajesh.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arajesh.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arajesh.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arajesh.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arajesh.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arajesh.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arajesh.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arajesh.wordpress.com/56/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arajesh.wordpress.com&blog=1446053&post=56&subd=arajesh&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arajesh.wordpress.com/2008/04/04/xor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/033a2e514c8149a151cbba026d29bea2?s=96&#38;d=identicon" medium="image">
			<media:title type="html">arajesh</media:title>
		</media:content>
	</item>
		<item>
		<title>While Loop</title>
		<link>http://arajesh.wordpress.com/2008/04/04/while-loop/</link>
		<comments>http://arajesh.wordpress.com/2008/04/04/while-loop/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 07:22:28 +0000</pubDate>
		<dc:creator>arajesh</dc:creator>
				<category><![CDATA[dotNet]]></category>

		<guid isPermaLink="false">http://arajesh.wordpress.com/2008/04/04/while-loop/</guid>
		<description><![CDATA[Exit from While Loop
Imports System
Public Class MainClass
    Shared Sub Main(ByVal args As String())      Dim counter As Integer
      While counter &#38;amp;amp;amp;lt;= 10         &#8216; skip remaining code in loop only if counter = 7   [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arajesh.wordpress.com&blog=1446053&post=55&subd=arajesh&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span style="font-weight:bold;">Exit from While Loop</p>
<p></span>Imports System</p>
<p>Public Class MainClass</p>
<p>    Shared Sub Main(ByVal args As String())<br />      Dim counter As Integer</p>
<p>      While counter &amp;amp;amp;amp;lt;= 10<br />         &#8216; skip remaining code in loop only if counter = 7<br />         If counter = 7 Then<br />            Exit While<br />         End If</p>
<p>         counter += 1<br />      End While</p>
<p>      Console.WriteLine( &#8220;counter = &#8221; &amp;amp;amp;amp; counter &amp;amp;amp;amp; _<br />         &#8221; after exiting While structure&#8221;)</p>
<p>    End Sub<br />End Class</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/arajesh.wordpress.com/55/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/arajesh.wordpress.com/55/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arajesh.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arajesh.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arajesh.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arajesh.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arajesh.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arajesh.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arajesh.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arajesh.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arajesh.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arajesh.wordpress.com/55/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arajesh.wordpress.com&blog=1446053&post=55&subd=arajesh&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arajesh.wordpress.com/2008/04/04/while-loop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/033a2e514c8149a151cbba026d29bea2?s=96&#38;d=identicon" medium="image">
			<media:title type="html">arajesh</media:title>
		</media:content>
	</item>
		<item>
		<title>For Each loop</title>
		<link>http://arajesh.wordpress.com/2008/04/04/for-each-loop/</link>
		<comments>http://arajesh.wordpress.com/2008/04/04/for-each-loop/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 07:21:15 +0000</pubDate>
		<dc:creator>arajesh</dc:creator>
				<category><![CDATA[dotNet]]></category>

		<guid isPermaLink="false">http://arajesh.wordpress.com/2008/04/04/for-each-loop/</guid>
		<description><![CDATA[Exit a For Each loop
Imports SystemImports System.Collections
Public Class MainClass
Shared Sub Main(ByVal args As String())Dim employees As New Collectionemployees.Add(New Employee(&#8220;A&#8221;))employees.Add(New Manager(&#8220;B&#8221;))employees.Add(New Employee(&#8220;C&#8221;))
Dim a_manager As Manager = Nothing
For Each emp2 As Employee In employeesIf TypeOf emp2 Is Manager Thena_manager = CType(emp2, Manager)Exit ForEnd IfNext emp2Console.WriteLine(&#8220;Manager: &#8221; &#38;amp;amp; a_manager.Name)
End Sub
End Class
Public Class EmployeePublic Name As String
Public Sub New(ByVal [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arajesh.wordpress.com&blog=1446053&post=54&subd=arajesh&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span style="font-weight:bold;">Exit a For Each loop</span></p>
<p>Imports System<br />Imports System.Collections</p>
<p>Public Class MainClass</p>
<p>Shared Sub Main(ByVal args As String())<br />Dim employees As New Collection<br />employees.Add(New Employee(&#8220;A&#8221;))<br />employees.Add(New Manager(&#8220;B&#8221;))<br />employees.Add(New Employee(&#8220;C&#8221;))</p>
<p>Dim a_manager As Manager = Nothing</p>
<p>For Each emp2 As Employee In employees<br />If TypeOf emp2 Is Manager Then<br />a_manager = CType(emp2, Manager)<br />Exit For<br />End If<br />Next emp2<br />Console.WriteLine(&#8220;Manager: &#8221; &amp;amp;amp; a_manager.Name)</p>
<p>End Sub</p>
<p>End Class</p>
<p>Public Class Employee<br />Public Name As String</p>
<p>Public Sub New(ByVal new_name As String)<br />Name = new_name<br />End Sub</p>
<p>Public Overridable Function IsManager() As Boolean<br />Return False<br />End Function<br />End Class<br />Public Class Customer<br />Public Name As String</p>
<p>Public Sub New(ByVal new_name As String)<br />Name = new_name<br />End Sub<br />End Class<br />Public Class Manager<br />Inherits Employee</p>
<p>Public Sub New(ByVal new_name As String)<br />MyBase.new(new_name)<br />End Sub<br />Public Overrides Function IsManager() As Boolean<br />Return True<br />End Function<br />End Class<br />
<h1></h1>
<p><span style="font-weight:bold;">Use For Each to Loop an Array</span></p>
<p>Imports System</p>
<p>Public Class MainClass</p>
<p>Shared Sub Main(ByVal args As String())</p>
<p>Dim friends() As String = {&#8220;A&#8221;, &#8220;B&#8221;, &#8220;C&#8221;,&#8221;D&#8221;, &#8220;E&#8221;}</p>
<p>Dim friendName As String<br />For Each friendName In friends</p>
<p>Console.WriteLine(friendName)</p>
<p>Next<br />End Sub</p>
<p>End Class<br />
<h1></h1>
<p><span style="font-weight:bold;">Loop through an Array</span></p>
<p>Imports System</p>
<p>Public Class MainClass<br />Shared Sub Main()<br />&#8216;Declare an array<br />Dim strFriends(4) As String</p>
<p>&#8216;Populate the array<br />strFriends(0) = &#8220;R&#8221;<br />strFriends(1) = &#8220;B&#8221;<br />strFriends(2) = &#8220;S&#8221;<br />strFriends(3) = &#8220;S&#8221;<br />strFriends(4) = &#8220;K&#8221;</p>
<p>&#8216;Enumerate the array<br />For Each strName As String In strFriends<br />&#8216;Add the array item to the list<br />System.Console.WriteLine(strName)<br />Next</p>
<p>End Sub<br />End Class</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/arajesh.wordpress.com/54/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/arajesh.wordpress.com/54/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arajesh.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arajesh.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arajesh.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arajesh.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arajesh.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arajesh.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arajesh.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arajesh.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arajesh.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arajesh.wordpress.com/54/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arajesh.wordpress.com&blog=1446053&post=54&subd=arajesh&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://arajesh.wordpress.com/2008/04/04/for-each-loop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/033a2e514c8149a151cbba026d29bea2?s=96&#38;d=identicon" medium="image">
			<media:title type="html">arajesh</media:title>
		</media:content>
	</item>
	</channel>
</rss>