<?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/"
	>

<channel>
	<title>Discrete Vector</title>
	<atom:link href="http://www.discretevector.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.discretevector.com</link>
	<description>C#, Gaming &#38; Heartburn</description>
	<lastBuildDate>Fri, 24 Oct 2014 13:45:33 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.2</generator>
	<item>
		<title>DIY: Unlocking iPhone 3G/3Gs with iOS 4.1 using redsn0w</title>
		<link>http://www.discretevector.com/2011/01/diy-unlocking-iphone-3gs-with-ios-4-1.html</link>
		<comments>http://www.discretevector.com/2011/01/diy-unlocking-iphone-3gs-with-ios-4-1.html#comments</comments>
		<pubDate>Sun, 16 Jan 2011 18:33:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[DIY]]></category>
		<category><![CDATA[iphone 3gs]]></category>
		<category><![CDATA[unlock]]></category>

		<guid isPermaLink="false">http://www.discretevector.com/2011/01/diy-unlocking-iphone-3gs-with-ios-4-1.html</guid>
		<description><![CDATA[  [Update 01-Feb-2011: This procedure also works on an iPhone 3G on iOS 4.1. I have personally tried it. The only difference is that you have to download the iOS 4.1 firmware for the 3G instead of the 3Gs. And yes, they are different.]  [If you are interested in unlocking a first generation iPhone, then [&#8230;]]]></description>
				<content:encoded><![CDATA[<p> </p>
<p><span style="color: #ff0000;">[Update 01-Feb-2011: This procedure also works on an <strong>iPhone 3G</strong> on iOS 4.1. I have personally tried it. The only difference is that you have to download the iOS 4.1 firmware for the 3G instead of the 3Gs. And yes, they are different.]</span> </p>
<p><span style="color: #ff0000;">[If you are interested in unlocking a first generation iPhone, then refer <a href="http://www.discretevector.com/2009/06/diy-updating-iphone-2g-to-os-30-using.html" target="_blank">this post</a>.]</span></p>
<p>A sleepless night trying to unlock my new iPhone 3Gs got me into writing this tutorial. Although the unlocking procedure was rather simple, it took me a very long time to sift the grain from the chaff. There is a lot of conflicting, half cooked information out there. Plus I had a gazillion questions that I didn’t know whom to ask.</p>
<p>I have put together this DIY so that people in the same situation wont have to go through the same hell as me.</p>
<p>Without further ado lets get started.</p>
<h3>But first…</h3>
<p>let my answer some basic questions that you might have</p>
<h3>What does this procedure apply to?</h3>
<p>The procedure described here helps you jailbreak and unlock your iPhone 3Gs that is on iOS 4.1 with 5.14.XX baseband.</p>
<h3>What if I am on a different firmware/baseband?</h3>
<p>This tutorial may not apply to you. Sorry, buy you will have to Google it.</p>
<h3>Why do I have to jailbreak? Cant I just unlock?</h3>
<p>No. Jail breaking helps you run apps that are not approved by Apple (didn’t come from the Apple app store). The app that performs the unlock is one such app.</p>
<h3>Will this work??!!!</h3>
<p>Yes. I have personally tried it on my 3Gs <span style="color: #ff0000;">(and also on a 3G)</span>.</p>
<h3>Great. What do I need?</h3>
<p> </p>
<ul>
<li>iTunes 10.1 (Download from the Apple.com site)</li>
<li>iPhone firmware 4.1 (Download from <a href="http://appldnld.apple.com/iPhone4/061-7938.20100908.F3rCk/iPhone2,1_4.1_8B117_Restore.ipsw" target="_blank">here</a>)</li>
<li>iPad firmware 3.2 (Download from <a href="http://appldnld.apple.com/iPad/061-8801.20100811.CvfR5/iPad1,1_3.2.2_7B500_Restore.ipsw" target="_blank">here</a>)<strong><sup><span style="color: #ff0000;">#</span></sup></strong></li>
<li>redsn0w 0.9.6 (Download the mac version from <a href="https://sites.google.com/a/iphone-dev.com/files/home/redsn0w_mac_0.9.6rc8.zip?attredirects=0&amp;d=1" target="_blank">here</a> and the Windows version <a href="https://sites.google.com/a/iphone-dev.com/files/home/redsn0w_win_0.9.6rc8.zip?attredirects=0&amp;d=1" target="_blank">here</a>)</li>
<li>Wireless Internet connection.</li>
</ul>
<p>Ok before we begin, I need to tell you this. This unlock works by upgrading your firmware to the iPad’s 6.15 baseband. That’s right, the iPad’s baseband. There was a hole in the basebands that came with iPhone firmware 5.13.04 and earlier, that could have been exploited to perform a carrier unlock. But this flaw has been fixed by Apple in the later releases (damn!) but luckily for us the iPad 6.15.00 baseband that comes with the 3.2 firmware has the same flaw (yay!) This is the reason you need to upgrade the baseband if you need to perform the unlock.</p>
<h3> </h3>
<h3>What’s the catch?</h3>
<p><span style="color: #ff0000;">Ok first of all, the baseband is an iPad baseband although it seems to work fine with the iPhone 3Gs . This is not a problem in itself but what you need to know is that once you update the baseband, there’s no going back! You cannot downgrade the baseband. Due to this you will be instantly voiding you warranty because if you take it to an Apple store for service they will know what you did. Plus, if Apple releases a 5.XX.XX baseband with any fixes, you wont be able to upgrade the baseband as you are already on a higher version! Downgrading of the baseband is not allowed.</span></p>
<p><span style="color: #ff0000;">Another drawback is that if you decide that you don’t need the jailbreak (or the unlock for that matter) you wont be able to restore the firmware back to 4.1 using iTunes. You are stuck with the jailbreak! (unless the dev team finds some way around it)</span></p>
<p><span style="color: #ff0000;">Ok this is very important: some people who performed the unlock have reported that the GPS feature has stopped working for them. So for the sake of argument lets assume that you will lose GPS with this unlock.</span></p>
<p><span style="color: #ff0000;">Before you proceed make sure you understand the above risks well. In fact, go ahead and read it again. I&#8217;ll wait.</span></p>
<h3> </h3>
<h3>Is there no other way to unlock?</h3>
<p>Unfortunately no. This is the only way available at the time this article was written.</p>
<p>Now that you understand what you are getting into, <strong><span style="font-size: x-small;">lets get started</span></strong>.</p>
<p>Download the 4.1 firmware, 3.2 firmware and redsn0w and put them all in the same folder.</p>
<p>Launch redsn0w. <span style="color: #ff0000;">Important: On Windows 7/Vista/Windows 2008 make sure you run redsn0w under the administrative account. (Right click redsn0w and select Run as administrator)</span></p>
<p>Click on browse and select the 4.1 firmware.</p>
<p>redSn0w will ask you to check if you have a newer model of the iPhone 3Gs. The steps to do this is explained in the popup. If it’s a newer model click yes, else click no.</p>
<p><a href="http://www.discretevector.com/wp-content/uploads/images/DIY-Unlocking-iPhone-3Gs_14273/Screen-shot-2011-01-18-at-4.17.56-PM.png"><img style="display: inline" title="redsn0w newer iPhone 3gs prompt" src="http://www.discretevector.com/wp-content/uploads/images/DIY-Unlocking-iPhone-3Gs_14273/Screen-shot-2011-01-18-at-4.17.56-PM_thumb.png" alt="redsn0w newer iPhone 3gs prompt" width="240" height="192" /></a></p>
<p>The program will now prepare the jailbreak data</p>
<p>In the next prompt, select <strong>Install Cydia</strong> and <strong>Install iPad</strong> baseband. When you select the iPad baseband option, it will warn you. Basically it’s the same thing I said before we started the tutorial. Click Yes to continue.</p>
<p><a href="http://www.discretevector.com/wp-content/uploads/images/DIY-Unlocking-iPhone-3Gs_14273/Screen-shot-2011-01-18-at-4.18.55-PM.png"><img style="display: inline" title="redsn0w iPad baseband warning" src="http://www.discretevector.com/wp-content/uploads/images/DIY-Unlocking-iPhone-3Gs_14273/Screen-shot-2011-01-18-at-4.18.55-PM_thumb.png" alt="redsn0w iPad baseband warning" width="240" height="175" /></a></p>
<p>Now redsn0w is ready to start the actual jailbreak process. Plug in the iPhone and then turn it off. If you turn it off and then plug it in, it will turn right back on. So don’t do that.</p>
<p><a href="http://www.discretevector.com/wp-content/uploads/images/DIY-Unlocking-iPhone-3Gs_14273/Screen-shot-2011-01-18-at-4.19.42-PM.png"><img style="display: inline" title="redsn0w iPad baseband warning" src="http://www.discretevector.com/wp-content/uploads/images/DIY-Unlocking-iPhone-3Gs_14273/Screen-shot-2011-01-18-at-4.19.42-PM_thumb.png" alt="redsn0w iPad baseband warning" width="196" height="240" /></a></p>
<p>The next step will require you to put the phone in DFU mode. That’s the mode the iPhone enters to enable a firmware restore. The next screen will explain the steps to do this. It is very critical to get it right to continue with the jailbreak process. So before you click next, familiarize yourself with the steps.</p>
<p>First you will need to press and hold the power button (the button on top of your phone) for around 3 seconds. Next, WITHOUT releasing the power button, press and hold the home button (the round button at the bottom of the screen) around 10 seconds. Finally, release the power button but DO NOT release the home button.</p>
<p>If you did the steps properly, redsn0w will automatically move to the next screen.</p>
<p><span style="color: #ff0000;"><strong>IMPORTANT: Ensure that your computer is connected to the Internet at this point. The version of redsn0w I used pulls data from the net, so a connection is important to complete the jailbreak.</strong></span></p>
<p>Ready? Click next.</p>
<p><a href="http://www.discretevector.com/wp-content/uploads/images/DIY-Unlocking-iPhone-3Gs_14273/Screen-shot-2011-01-18-at-4.19.51-PM.png"><img style="display: inline" title="redsn0w DFU screen" src="http://www.discretevector.com/wp-content/uploads/images/DIY-Unlocking-iPhone-3Gs_14273/Screen-shot-2011-01-18-at-4.19.51-PM_thumb.png" alt="redsn0w DFU screen" width="196" height="240" /></a></p>
<p>Perform each of the steps as mentioned in the screen. The program will automatically move to the next screen and start downloading the jailbreak data to the phone. Once you reach that screen, release the home button.</p>
<p><span style="color: #ff0000;"><strong><sup>#</sup></strong>IMPORTANT: In the requirements section, I had asked you to download the iPad firmware too. This may nor may not be required because at the time of writing, redsn0w was designed to download the required data directly from Apple’s servers. If you wish, you can try to perform the jailbreak without downloading the firmware. I just played safe and downloaded it, all the same.</span></p>
<p>After the download is complete, you will move to the next screen which says that the rest of the jailbreak will happen on your phone. Click on the close button to close redsn0w.</p>
<p>Wait for the jailbreak to complete and for the phone to restart. Once you see the slide to unlock screen, you are done.</p>
<h3> </h3>
<h3>Here comes the unlock.</h3>
<p> </p>
<p>Connect the phone to a wireless access point.</p>
<p>Launch Cydia. Wait for Cydia to complete whatever is doing (this will take some time, so be patient).</p>
<p>Tap on Manage &gt; Sources</p>
<p>Tap Edit and then Add</p>
<p>In the dialog that appears enter: <a href="http://repo666.ultrasn0w.com">http://repo666.ultrasn0w.com</a> (that’s a zero in there not the letter o) and tap Add Source.</p>
<p>Once it has been added, tap on the entry, select ultrasn0w and tap on install.</p>
<p>Cydia will install ultrasn0w and unlock the phone.</p>
<p>Restart the phone, put in your SIM and start it up again.</p>
<p>The phone might say No Service for some time but it should ultimately change to the name of your network provider.</p>
<p>Congratulations! You now have an unlocked iPhone.</p>
<h3><span style="color: #ff0000;"> </span></h3>
<h3><span style="color: #ff0000;">Wait! You are not done yet</span></h3>
<p> </p>
<p>Some people have reported battery issues after unlocking their iPhones. This has something to do with the phone trying to retrieve valid activation keys from the net at regular intervals. A chap going by the handle of sbingner has devised a method to give each phone a legitimate activation ticket. His hack is called SAM (Subscriber Artificial Module).</p>
<p>The information on how to use this hack is bit hazy so I will tell you the method that worked for me.</p>
<p>Open up Cydia.</p>
<p>Tap on Manage &gt; Sources</p>
<p>Tap Edit and then Add</p>
<p>In the dialog that opens enter, <a href="http://repo.bingner.com">http://repo.bingner.com</a> and tap on Add Source</p>
<p>Tap the entry you just added and install SAM</p>
<p>Once installation is complete, quit Cydia.</p>
<p>Go to Settings &gt; SAM, tap on <em>Revert lockdown to Stock</em></p>
<p>Next tap on <em>De-Activate iPhone</em></p>
<p>Restart your phone, plug it in to your computer and launch iTunes.</p>
<p>You will briefly see a message on your phone which says Activating iPhone.</p>
<p>Go back to Settings &gt; SAM.</p>
<p>Next to Activation State it should now say WildcardActivated.</p>
<p><a href="http://www.discretevector.com/wp-content/uploads/images/DIY-Unlocking-iPhone-3Gs_14273/IMG_0001.jpg"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="IMG_0001" src="http://www.discretevector.com/wp-content/uploads/images/DIY-Unlocking-iPhone-3Gs_14273/IMG_0001_thumb.jpg" border="0" alt="IMG_0001" width="164" height="244" /></a></p>
<h3><span style="color: #4f81bd;"> </span></h3>
<h3><span style="color: #4f81bd;"> </span></h3>
<h3><span style="color: #4f81bd;">That’s it. You are done. Enjoy your new unlocked iPhone.</span></h3>
<p> </p>
<p>If something didn’t work out, leave a comment and I will do my best to help you out. Also, if the unlock worked, do let me know if you are one of the lucky ones for whom GPS works.</p>
<p>Have fun</p>
<p><em><strong><span style="color: #008000;">Alex</span></strong></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2011/01/diy-unlocking-iphone-3gs-with-ios-4-1.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>SyncBlocks and Critical Sections</title>
		<link>http://www.discretevector.com/2010/03/syncblocks-and-critical-sections.html</link>
		<comments>http://www.discretevector.com/2010/03/syncblocks-and-critical-sections.html#comments</comments>
		<pubDate>Sun, 28 Mar 2010 19:51:33 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[locks]]></category>
		<category><![CDATA[syncblocks]]></category>

		<guid isPermaLink="false">http://www.discretevector.com/2010/03/syncblocks-and-critical-sections.html</guid>
		<description><![CDATA[This article is an extension to an earlier one I wrote on locks. A reader requested that I explain SyncBlocks too, so here it is. Simply put, SyncBlocks are how mutual exclusion of critical sections are achieved in .net (using Monitors and locks).&#160; SyncBlocks are basically data structures that the runtime maintains to store information [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>This article is an extension to an <a href="http://www.discretevector.com/2008/02/locks-threads-and-this-huh-most-people.html" target="_blank">earlier one I wrote on locks</a>. A reader requested that I explain SyncBlocks too, so here it is.</p>
<p>Simply put, SyncBlocks are how mutual exclusion of critical sections are achieved in .net (using Monitors and locks).&#160; SyncBlocks are basically data structures that the runtime maintains to store information about objects and among other things it maintains the lock state of an object.</p>
<p>When an object is created on the managed heap, the runtime automatically adds couple of fields to an object. One of them is the SyncBlockIndex. (The other is the method table pointer, but we will leave that out of this discussion). When an object is initialized, it is assigned some negative value which denotes that the object has not been assigned a SyncBlock (and hence not locked yet). When a thread acquires a lock on an object (by calling Monitor.Enter), the CLR allocates a SyncBlock (from its cache of SyncBlocks) to the object. The index of that allocated block is assigned to the SyncBlockIndex. Once the thread releases the lock (by calling Monitor.Exit), the SyncBlock is freed and the index of the object is reset to a negative value. The released SyncBlock is returned to the pool of SyncBlocks and is free to be allocated to another object.</p>
<p>With this approach, there is very little overhead; a Syncblock is only allocated when a lock is acquired on an object and can be reused on release.</p>
<p><a href="http://www.discretevector.com/wp-content/uploads/image2.png"><img title="Allocation of SyncBlocks" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="212" alt="Allocation of SyncBlocks" src="http://www.discretevector.com/wp-content/uploads/image_thumb2.png" width="240" border="0" /></a></p>
<p>Remember that a thread that has acquired the lock on object can make additional calls to Monitor.Enter without blocking itself. But it has to call Monitor.Exit the same number of times it called Enter to completely release the object. It is entirely possible that a developer forgets to call Monitor.Exit after he is done with a critical section. For this the framework provides the lock statement. Since the lock statement automatically relinquishes the lock after the block there is nothing to forget!</p>
<p>&#160;</p>
<pre class="csharpcode"><span class="kwrd">lock</span>
{
<span class="rem">//Critical section</span>
}</pre>
<p>
  </p>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>So the above lock statement is functionally equivalent to</p>
<pre class="csharpcode">Monitor.Enter(lockObject)
<span class="kwrd">try</span>
{
    <span class="rem">//Critical Section</span>
}
<span class="kwrd">finally</span>
{
    Monitor.Exit(lockObject)
}</pre>
<p>
  </p>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>&#160;</p>
<blockquote>
<p>You might be wondering why the lock information cannot be stored as part of the object itself. After all the CLR does allocate a member to hold the index, so why not use it to hold the state of the lock itself. Well it turns out that the lock is one of the many things that a SyncBlock data structure holds. Other stuff includes the objects hashcode, COM interop information etc.</p>
<p>Moreover, using a separate data structure allows the CLR to move it around in memory to support garbage collection without affecting the object on which the lock is acquired.</p>
</blockquote>
<p>You will notice that with this infrastructure it is possible to acquire a lock on ANY reference type including the object you are trying to protect inside the critical section. Compare this with the Win32 CRITICAL_SECTION data structure. To protect a critical section in C++ one would have to explicitly declare a CRITICAL_SECTION object and then call InitializeCriticalSection and EnterCriticalSection on it. (and later, LeaveCriticalSection and DeleteCriticalSection). With this approach, every critical section was associated with an arbitrary critical section.</p>
<p>In .net, since the runtime allocates and maintains the SyncBlocks, the developer does not have to deal with the overhead involved in creating and deleting critical sections which is a good thing. Also, SyncObjects are by their nature lightweight objects as opposed to acquiring locks on a CRITICAL_SECTION object in C++.&#160; But the ability to acquire locks on any reference object (as opposed to a dedicated lock object, like the CRITICAL_SECTION object in C++) brings in this rather interesting problem of locking on <em>this</em>. (<a href="http://www.discretevector.com/2008/02/locks-threads-and-this-huh-most-people.html" target="_blank">Explained in this article</a>)</p>
<p>Code safely </p>
<p><em><strong><font color="#008080">Alex</font></strong></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2010/03/syncblocks-and-critical-sections.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tap</title>
		<link>http://www.discretevector.com/2010/03/tap.html</link>
		<comments>http://www.discretevector.com/2010/03/tap.html#comments</comments>
		<pubDate>Fri, 19 Mar 2010 17:24:30 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[insight]]></category>
		<category><![CDATA[tap]]></category>

		<guid isPermaLink="false">http://www.discretevector.com/2010/03/tap.html</guid>
		<description><![CDATA[&#160; My faithful refrigerator started making this most irritating noise recently. It was this constant ‘whirr’ that was driving me and my wife up the wall. I prided myself as Mr Fixit and so tried to fix the problem myself. I touched and prodded, kicked and spanked but to no avail. The damned thing would [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>&#160;</p>
<p><a href="http://www.discretevector.com/wp-content/uploads/image1.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="image" border="0" alt="image" align="left" src="http://www.discretevector.com/wp-content/uploads/image_thumb1.png" width="181" height="180" /></a> My faithful refrigerator started making this most irritating noise recently. It was this constant ‘whirr’ that was driving me and my wife up the wall. I prided myself as Mr Fixit and so tried to fix the problem myself. I touched and prodded, kicked and spanked but to no avail. The damned thing would for stop for a while and start back up just when I was in the middle of a movie.</p>
<p>I finally called it quits and called up the customer care center. They sent someone down promptly (a rarity around this part of the globe). The chap came in around evening, tool box and all and asked: wherisit? I pointed him to the kitchen. He opened the freezer to make the compressor kick in and the noise started. He pulled the refrigerator away from the wall, touched something behind it and viola! the pandemonium stopped.</p>
<p>He opened his bag, took out his receipt book and promptly made out a receipt for 100 bucks and handed it over to me.</p>
<p>I was about to ask: “What? 100 bucks for touching my fridge? You got to be kidding! “when I realized something and bit my tongue.</p>
<p>&#160;</p>
<p><em>A giant ship engine failed. The ship&#8217;s owners tried one expert after another, but none of them could figure but how to fix the engine. Then they brought in an old man who had been fixing ships since he was young. He carried a large bag of tools with him, and when he arrived, he immediately went to work. He inspected the engine very carefully, top to bottom. Two of the ship&#8217;s owners were there, watching this man, hoping he would know what to do. After looking things over, the old man reached into his bag and pulled out a small hammer. He gently tapped something. Instantly, the engine lurched to life. He carefully put his hammer away. The engine was fixed. </em></p>
<p><em>A week later, the owners received a bill from the old man for ten thousand dollars. </em></p>
<p><em>&quot;What?!&quot; the owners exclaimed. &quot;He hardly did anything!&quot; So they wrote the old man a note saying, &quot;Please send us an itemized bill.&quot; </em></p>
<p><em>The man sent a bill that read:      <br />Tapping with a hammer&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. $ 2.00       <br />Knowing where to tap&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; $ 9,998.00</em> </p>
<p>&#160;</p>
<p>There are two types of people in the software industry today: The ones that know where to tap and the ones that don&#8217;t. Which type are you?</p>
<p><em><strong>Alex</strong></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2010/03/tap.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DIY: Updating iPhone 2G to OS 3.0 and unlocking using redsn0w</title>
		<link>http://www.discretevector.com/2009/06/diy-updating-iphone-2g-to-os-30-using.html</link>
		<comments>http://www.discretevector.com/2009/06/diy-updating-iphone-2g-to-os-30-using.html#comments</comments>
		<pubDate>Sat, 20 Jun 2009 06:29:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[DIY]]></category>
		<category><![CDATA[iphone 2g]]></category>
		<category><![CDATA[iphone OS 3.0]]></category>
		<category><![CDATA[redsn0w]]></category>
		<category><![CDATA[unlock]]></category>

		<guid isPermaLink="false">http://discretevector.com/2009/06/diy-updating-iphone-2g-to-os-3-0-and-unlocking-using-redsn0w.html</guid>
		<description><![CDATA[&#160; [Update 01-Feb-2011: If you are using an iPhone 3G/3Gs with iOS 4.1 and you want to unlock your phone, then the procedure is described here] Well the waits over if you have an iPhone 2G. The iPhone Dev team has released the redsn0w application that will help you unlock/jailbreak your iPhone after updating the [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>&#160;</p>
<p><strong><font color="#ff0000">[Update 01-Feb-2011: If you are using an iPhone 3G/3Gs with iOS 4.1 and you want to unlock your phone, then the procedure is described </font></strong><strong><font color="#ff0000"><a href="http://www.discretevector.com/2011/01/diy-unlocking-iphone-3gs-with-ios-4-1.html" target="_blank">here</a></font></strong><strong><font color="#ff0000">]</font></strong></p>
<p><img style="border-right-width: 0px; width: 90px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_izTBHqIkTp4/Sj04y-QfH3I/AAAAAAAACvI/QnRdDig0FnY/image%5B8%5D.png?imgmax=800" width="90" height="77" /> Well the waits over if you have an iPhone 2G. The iPhone Dev team has released the redsn0w application that will help you unlock/jailbreak your iPhone after updating the OS to 3.0.</p>
<p><strong>Update</strong>: Ultrasn0w has been released by the dev team which allows you to jailbreak/unlock your 3g/3gs. Check out <a title="http://blog.iphone-dev.org/" href="http://blog.iphone-dev.org/">http://blog.iphone-dev.org/</a></p>
<p>I know how it feels to be in the dark with the itch to badly update to the new OS. Will you brick your phone? What happens if I screw up? Are there any pre-requisites for this? So I have put together this short post to help you guys out. If you are stuck, don&#8217;t hesitate to ask.</p>
<p><strong><span style="color: #ff0000">Warning</span></strong>: I&#8217;m just trying to help. I provide no guarantees. Secondly, this post is only for people who have a first generation iPhone (AKA iPhone 2G). I have performed these steps myself, hence the post. I don&#8217;t have an iPhone 3g. So I cant help you out there. Refer the iPhone dev teams blog for more info. Theoretically it is very unlikely that you will brick your 2g or lock yourself out permanently. (Not true for 3g though) So if you mess up, just restore to OS 2.2.1 and use QuickPwn to unlock it.</p>
<p>Oh, I nearly forgot. I am a PC. But the MAC instructions will remain almost the same.</p>
<h3>Lets get started.</h3>
<h4>Question: What firmware do I have to be on for this?</h4>
<p>Answer: Doesn&#8217;t matter. You will restore your phone to 3.0 before using redsn0w.</p>
<h4>Question: What version of iTunes do I need?</h4>
<p>Answer: You will need iTunes 8.2. This is important.</p>
<h4>Question: What else do I need?</h4>
<p>Answer: If you want to unlock your phone (which in most cases the answer is yes) then you will need the boot loader files bl-39.bin and bl-46.bin. (Google for the links. Its easy to find). And of course you will need the 3.0 firmware that was downloaded from Apple. Refer <a href="http://codewidgets.blogspot.com/2009/06/iphone-os-30-now-available-for-download.html" target="_blank">this post</a> for the links. You will also need the redsn0w program. Download it from <a href="http://www.discretevector.com/2009/06/iphone-os-30-now-available-for-download.html" target="_blank">here</a>.</p>
<h4><span style="color: #ff0000">Question: What happens to my data?</span></h4>
<p>Well, if you had Cydia before you will lose all the Cydia apps with this process. I think there is an app available on Cydia that will backup your jailbroken apps. Ensure that your iPhone is completely synced to your machine before doing this. . When you restore the firmware you will lose EVERYTHING. Ensure that iTunes is configured to <span style="color: #ff0000">sync all your apps</span>, contacts and calendar. (PS: This will backup only the apps you bought through iTunes Store NOT Cydia) Every time you sync, iTunes automatically creates a backup of your iPhone which includes contacts, calendar, settings, photos and some other miscellaneous stuff which you can restore later. <span style="color: #ff0000"><strong>Don&#8217;t forget to do this. There is no way to get your data back once you restore the firmware.</strong></span></p>
<h4>Question: Do I need to stock on the beer?</h4>
<p>Answer: Not exactly. The procedure takes about half an hour. One beer wouldn&#8217;t hurt I guess.</p>
<h3>Ok, Here we go.</h3>
<p>First, put everything into one folder. The boot loader files, the 3.0 firmware and the redsn0w app.</p>
<p>Launch iTunes and select your iPhone on the left side. On the Summary page, hold down the shift key and click on the Restore button. This will bring up a file selection window. Go to the folder where you put the firmware and select it.</p>
<p>iTunes will now restore your firmware to 3.0. Wait for the phone to restart.</p>
<h4><span style="color: #ff0000">DO NOT launch redsn0w while the restore is in progress!</span></h4>
<h3>Now for the unlock/jailbreak</h3>
<p>It doesn&#8217;t matter what state your iPhone is in now (home screen or stuck on the emergency call screen), you can proceed.</p>
<p>Ensure that iTunes is closed.</p>
<p>Run redsn0w by double clicking on it.</p>
<p>Browse and select the 3.0 firmware (the same one you used to restore). Redsn0w will process the file and check if it is indeed the right firmware. If the file is ok then you will get the screen shown below which says <strong>IPSW successfully identified</strong>.</p>
<p><a href="http://lh3.ggpht.com/_izTBHqIkTp4/Sj0qhL9B39I/AAAAAAAACvY/oL7D4HWeu-4/s1600-h/image%5B1%5D.png"><img style="border-right-width: 0px; width: 194px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="redsn0w" border="0" alt="redsn0w" src="http://lh5.ggpht.com/_izTBHqIkTp4/Sj0qhwpUSEI/AAAAAAAACvg/sQl9SisidcM/image_thumb.png?imgmax=800" width="190" height="192" /></a></p>
<h4><span style="color: #ff0000">Help! It says &#8220;Unable to recognize specified IPSW&#8221; </span></h4>
<p><a href="http://lh6.ggpht.com/_izTBHqIkTp4/Sj-rJkoMo7I/AAAAAAAACvM/0yFYmkOo2RY/s1600-h/image8%5B1%5D.png"><img style="width: 207px; display: inline" title="redsn0w Unable to recognize specified IPSW" border="0" alt="redsn0w Unable to recognize specified IPSW" src="http://lh6.ggpht.com/_izTBHqIkTp4/Sj0qkf5bClI/AAAAAAAACvQ/tLJmPqmRWps/image8_thumb.png?imgmax=800" width="203" height="210" /></a></p>
<p>If you get this error (shown on the screen shot to the right) then it means that your firmware download was not as smooth as expected. Maybe its corrupt. Anyways, I lost some hair trying to fix this issue. If you get this error then the best thing to do is to download it manually from Apple&#8217;s website. (Find the <a href="http://codewidgets.blogspot.com/2009/06/iphone-os-30-now-available-for-download.html" target="_blank">links here</a>). I guess this usually happens if you use the file that iTunes downloaded when you hit the update button.</p>
<p>Also ensure that the name of the firmware file is<span style="font-weight: bold"> iPhone1,1_3.0_7A341_Restore.ipsw</span>. If you downloaded the file from some other location (not recommended) and if it has a zip extension then unzip the file and use it. By default, known extensions are hidden by windows. So if you have a file named iPhone1,1_3.0_7A341_Restore.ipsw.zip then it will appear as iPhone1,1_3.0_7A341_Restore.ipsw in windows explorer (without the zip extension). Because of this most people will use this file directly in redsn0w without unzipping it.</p>
<p>To show file extensions in Windows explorer, go to Tools &gt; Folder options &gt; View and uncheck Hide extensions for known file types.</p>
<p>Click Next and follow the instructions on screen. Trust me its easy!</p>
<p>You will get to a screen which says turn off your phone. DO IT! Just turn it off normally but ensure that it is still connected to your machine.</p>
<p>The screen after that will ask you to press the home and power keys in a certain sequence. Perform the steps as mentioned. If you don&#8217;t get it right the first time, try again.</p>
<p>After that set your iPhone down and let redsn0w do its magic. Don&#8217;t touch anything!</p>
<p>The app will finally say <em>done</em> and the <em>Finish</em> button will be enabled. I suggest you don&#8217;t click it till the phone completes what its doing, restarts and finally leaves you at the home screen. Maybe it wont hurt but rather not take chances.</p>
<p>That&#8217;s it. You now have an unlocked iPhone running OS 3.0. Enjoy cut and paste!</p>
<p>Credit must go where its due. Big thanks to the iPhone dev team without whom, many people would never had known what owning an iPhone feels like. Thanks guys. Much appreciated.</p>
<p><strong><span style="color: #ff0000">Battery Life Update 1 [August 02 2009]:</span></strong> A lot of users are complaining about low battery life after updating to 3.0. I have personally faced this. So after you update to 3.0, <span style="color: #ff0000">DO NOT</span> restore your phone from a saved backup. Set it up as a new phone when prompted after iTunes detects it for the first time after the jailbreak and then proceed to perform a sync to load all your applications and data. You will have to setup your mail accounts and wifi settings again. But then that&#8217;s a small price to pay for precious battery life. I found this information too late and so I was forced to jailbreak my phone all over again today! I&#8217;ll update this post if I see any improvements in battery life.</p>
<p><span style="color: #ff0000"><strong><a href="http://lh6.ggpht.com/_izTBHqIkTp4/Snk7tNEodwI/AAAAAAAACxE/WOO5AUMQ3Fc/s1600-h/image%5B10%5D.png"><img style="border-right-width: 0px; margin: 0px 15px 10px 0px; width: 134px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" align="left" src="http://lh6.ggpht.com/_izTBHqIkTp4/Snk7wZLfOeI/AAAAAAAACxM/rm_EaZCfqU4/image_thumb%5B8%5D.png?imgmax=800" width="134" height="189" /></a>Battery Life Update 2 [August 05 2009]: </strong></span>Well, what do you know? It worked. I am getting noticeably improved battery life now. My current standby time after last recharge is 2 days 13 hours and usage is 4 hours 40 minutes. Mostly calls and SMS. Occasional WiFi/Edge and games. And the best part is that I still have 40% battery left!</p>
<p><em><strong><span style="color: #008080">&#160;</span></strong></em></p>
<p><em><strong><span style="color: #008080">Alex</span></strong></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2009/06/diy-updating-iphone-2g-to-os-30-using.html/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Impressions: Bing goes live</title>
		<link>http://www.discretevector.com/2009/06/impressions-bing-goes-live.html</link>
		<comments>http://www.discretevector.com/2009/06/impressions-bing-goes-live.html#comments</comments>
		<pubDate>Mon, 01 Jun 2009 04:52:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[Impressions]]></category>
		<category><![CDATA[Bing]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[search engine]]></category>

		<guid isPermaLink="false">http://discretevector.com/2009/06/impressions-bing-goes-live.html</guid>
		<description><![CDATA[Microsoft latest foray into search has gone public. This time its called Bing. You got to hand it to the guys at Microsoft though, they just don&#8217;t give up. First they put search on MSN and called it MSN Search. Then they decided to take on the might of Google through Live search. It was [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Microsoft latest foray into search has gone public. This time its called Bing. You got to hand it to the guys at Microsoft though, they just don&#8217;t give up. First they put search on MSN and called it MSN Search. Then they decided to take on the might of Google through Live search. It was live this and live that for quite some time. Now its <a href="http://www.bing.com" target="_blank">Bing</a>. </p>
<p><a href="http://lh5.ggpht.com/_izTBHqIkTp4/SiQHPxN9OtI/AAAAAAAACrA/wmCaFWhs548/s1600-h/image%5B4%5D.png"><img title="bing homepage" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; width: 242px; border-right-width: 0px" height="140" alt="bing homepage" src="http://lh4.ggpht.com/_izTBHqIkTp4/SiQHRCanLEI/AAAAAAAACrE/JK_w766jT6I/image_thumb%5B2%5D.png?imgmax=800" width="242" border="0" /></a> </p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>Incidentally, they are rebranding all the search spread across various Microsoft sites and are bringing it under the Bing umbrella. Its about time too. The problem with Microsoft&#8217;s search agenda was branding. Like I said they kept rebranding themselves every other year and users had difficulty keeping track of what or where Microsoft search was exactly.</p>
<p>I mean, think of Google search and there is only one place to go; <a href="http://www.google.com" target="_blank">google.com</a> (not considering the country specific sites). <a href="http://www.yahoo.com" target="_blank">Yahoo search</a>? One place. Microsoft search? eh&#8230; umm&#8230;</p>
<p>Bing, to me, is in the right direction. Whether it can take on the might of Google is a completely different ball game altogether. You can throw a hundred gimmicks at the user but the end of the day everyone wants just one thing: relevant search results.</p>
<p><a href="http://lh6.ggpht.com/_izTBHqIkTp4/SiQHTR9cYDI/AAAAAAAACrI/dt27T77xEjo/s1600-h/image%5B8%5D.png"><img title="result preview" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; width: 208px; border-right-width: 0px" height="111" alt="result preview" src="http://lh5.ggpht.com/_izTBHqIkTp4/SiQHUYtPuHI/AAAAAAAACrM/VaQp1mBt55w/image_thumb%5B4%5D.png?imgmax=800" width="208" border="0" /></a> </p>
<p>The Bing preview feature is quite nice. It allows you to see a bit of the site content without actually going to it. Search for products and reviews and comparisons are available to you right on the results page.</p>
<p><a href="http://lh5.ggpht.com/_izTBHqIkTp4/SiQHV9U9p1I/AAAAAAAACrQ/irHjLBid6k8/s1600-h/image%5B13%5D.png"><img title="image serach" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; width: 220px; border-right-width: 0px" height="130" alt="image serach" src="http://lh4.ggpht.com/_izTBHqIkTp4/SiQHYWk6i-I/AAAAAAAACrU/LR7Rlc__GMc/image_thumb%5B7%5D.png?imgmax=800" width="220" border="0" /></a>I liked Bing&#8217;s <a href="http://www.bing.com/images/search?q=fuji+S9600&amp;FORM=BIFD#" target="_blank">image search</a> better than Google&#8217;s. It allows you to filter images on image characteristics such as size, layout and even people (faces, head and shoulders). Neat.</p>
<p>&#160;</p>
<p>The homepage and the results page layout looks suspiciously Googlish. Oh well, whatever works.</p>
<p>Will Bing be your new search engine? Let us know what you think.</p>
<p>Happy Searching,    <br /><strong><em><font color="#008040">Alex</font></em></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2009/06/impressions-bing-goes-live.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Preview: PSP Go</title>
		<link>http://www.discretevector.com/2009/05/preview-psp-go.html</link>
		<comments>http://www.discretevector.com/2009/05/preview-psp-go.html#comments</comments>
		<pubDate>Sun, 31 May 2009 12:41:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[Console Gaming]]></category>
		<category><![CDATA[PSP]]></category>
		<category><![CDATA[PSP Go]]></category>
		<category><![CDATA[Sony]]></category>

		<guid isPermaLink="false">http://discretevector.com/2009/05/preview-psp-go.html</guid>
		<description><![CDATA[After months of secrecy, it is finally here. The next gen Playstation portable: the PSP Go. The PSP Go is expected to be announced at this years E3 (June 2-4). &#160; &#160; &#160; &#160; &#160; &#160; &#160; Picture source: www.engadget.com (Leaked) Specs: 3.8 inch Display 16 GB flash memory Memory Stick duo support for expandable [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>After months of secrecy, it is finally here. The next gen Playstation portable: the PSP Go. The PSP Go is expected to be announced at this years E3 (June 2-4).</p>
<p>&#160;<a href="http://lh5.ggpht.com/_izTBHqIkTp4/SiJzOgYw6JI/AAAAAAAACq4/J0DCublQlig/s1600-h/image%5B4%5D.png"><img style="border-right-width: 0px; width: 262px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_izTBHqIkTp4/SiJz4yHkvuI/AAAAAAAACq8/IqkYl31-5Yc/image_thumb%5B2%5D.png?imgmax=800" width="262" height="198" /></a></p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>Picture source: <a href="http://www.engadget.com">www.engadget.com</a></p>
<p><strong>(Leaked) Specs:</strong></p>
<ul>
<li>3.8 inch Display </li>
<li>16 GB flash memory </li>
<li>Memory Stick duo support for expandable memory </li>
<li>Bluetooth support (Keller only mentions Bluetooth headset support. It is not yet sure whether you can transfer files between systems) </li>
<li>Slide form factor </li>
<li>No UMD drive </li>
</ul>
<ul>Check out the YouTube video where John Keller, director of hardware marketing spells out the specifics.</ul>
<p> <object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/ObElhJIcOKE&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;feature=player_embedded&amp;fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/ObElhJIcOKE&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;feature=player_embedded&amp;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object>
</p>
<ul>Keller also mentions that the PSP Go will not replace the PSP-3000 and that both will be available in the market. He says that the PSP Go is for the more “Digital” audience who like to have their media content while on the move. (Whatever that means). The new PSP has a bigger screen and is lighter than the PSP 3000 and from the looks of it, thinner too.</ul>
<ul>I am really not sure what Sony’s strategy is here. How do you deploy games that were previously shipped in a UMD? Are they really expecting users to download all the games?</ul>
<ul>Also, the PSP Go still has only one analog stick in spite of users everywhere crying out in forums to include a right analog controller. The existing analog stick got moved to the right of the directional keys. Not a very comfortable position.</ul>
</p>
<p>For more details, stay tuned to Sony’s conference at E3. <a title="http://e3insider.com/" href="http://e3insider.com/">(http://e3insider.com/</a>)</p>
<p><strong>UPDATE: 02/06/2009 11:46 AM PST</strong></p>
<p><a href="http://lh5.ggpht.com/_izTBHqIkTp4/SiVxtkVJ-dI/AAAAAAAACrw/xTRzRivdWpY/s1600-h/image%5B7%5D.png"><img style="border-right-width: 0px; width: 167px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_izTBHqIkTp4/SiVxu7Dr4fI/AAAAAAAACr0/qcPz8sOh0vk/image_thumb%5B4%5D.png?imgmax=800" width="167" height="93" /></a> PSP GO announced at E3 2 minutes ago</p>
<p>&#160;</p>
<p>&#160;</p>
<p>Official link: <a title="http://uk.playstation.com/games-media/news/articles/detail/item160412/PSP-has-evolved/" href="http://uk.playstation.com/games-media/news/articles/detail/item160412/PSP-has-evolved/">http://uk.playstation.com/games-media/news/articles/detail/item160412/PSP-has-evolved/</a></p>
<p>Happy Gaming,    <br /><strong><em>Alex</em></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2009/05/preview-psp-go.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixit: iPhone displays wrong world time</title>
		<link>http://www.discretevector.com/2009/04/fixit-iphone-displays-wrong-world-time.html</link>
		<comments>http://www.discretevector.com/2009/04/fixit-iphone-displays-wrong-world-time.html#comments</comments>
		<pubDate>Mon, 27 Apr 2009 18:39:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Fixit]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://discretevector.com/2009/04/fixit-iphone-displays-wrong-world-time.html</guid>
		<description><![CDATA[Well, of all the things, I though you could at least count on a phone to give the right time. I had never bothered to actually check the world times on my iPhone. I just assumed they were correct. I mean, what’s the point of technology if you had to double check everything, right? I [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><img style="border-bottom: 0px; border-left: 0px; width: 70px; display: inline; border-top: 0px; border-right: 0px" title="iphone thumbnail" border="0" alt="iphone thumbnail" src="http://lh4.ggpht.com/_izTBHqIkTp4/SfX028vvPYI/AAAAAAAACTs/Cfso0xqj5n8/iphone%20thumb%5B14%5D.png?imgmax=800" width="70" height="103" /> Well, of all the things, I though you could at least count on a phone to give the right time. </p>
<p>I had never bothered to actually check the world times on my iPhone. I just assumed they were correct. I mean, what’s the point of technology if you had to double check everything, right?</p>
<p>I was fiddling on my phone during a boring meeting in office and to while away the time I started adding places to my world times list. I thought I would add Abu Dhabi (that’s in UAE for the geographically challenged) to the list even though I knew very well it was 1.5 hours behind Indian time. Heck, I grew up there, I should know.&#160; </p>
<p>&#160;<a href="http://lh3.ggpht.com/_izTBHqIkTp4/SfX03zTGe5I/AAAAAAAACTw/OTHcgVfLUjo/s1600-h/iphone%20wc%20wrong%5B17%5D.jpg"><img style="border-right-width: 0px; width: 118px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="iPhone showing wrong world times" border="0" alt="iPhone showing wrong world times" src="http://lh5.ggpht.com/_izTBHqIkTp4/SfX05ARXHeI/AAAAAAAACT0/Sp7SAwVD_nE/iphone%20wc%20wrong_thumb%5B13%5D.jpg?imgmax=800" width="118" height="178" /></a></p>
<p align="center"><strong><font size="1">Stuck in a time warp</font></strong></p>
<p>To my surprise it showed the time several hours ahead of Indian time. So much for technology. I checked the time and date on my phone; right on the dot. What could be wrong, I wondered.</p>
<p>I navigated to <strong>Settings &gt; General &gt; Date &amp; Time</strong> and I saw that the <strong>Set Automatically</strong> option was turned <strong>ON</strong>. I turned it <strong>OFF</strong>, set the time zone, time and date manually (don’t forget to do this) and well, that was the end of that little glitch. </p>
<p><a href="http://lh4.ggpht.com/_izTBHqIkTp4/SfX06rHoikI/AAAAAAAACT4/hMfmofXpjA0/s1600-h/iphone%20wc%20right%5B12%5D.jpg"><img style="border-right-width: 0px; width: 117px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="iPhone world time problem fixed" border="0" alt="iPhone world time problem fixed" src="http://lh4.ggpht.com/_izTBHqIkTp4/SfX07QplmWI/AAAAAAAACT8/N1OYF8SpgK4/iphone%20wc%20right_thumb%5B8%5D.jpg?imgmax=800" width="117" height="177" /></a></p>
<p align="center"><font size="1"><strong>Sign of the times</strong></font></p>
<p>I wonder how I know these things. Hmmm.</p>
<p><strong><em><font color="#008080">Alex</font></em></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2009/04/fixit-iphone-displays-wrong-world-time.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Impressions: Piracy gets its due</title>
		<link>http://www.discretevector.com/2009/04/impressions-piracy-gets-its-due.html</link>
		<comments>http://www.discretevector.com/2009/04/impressions-piracy-gets-its-due.html#comments</comments>
		<pubDate>Fri, 17 Apr 2009 18:56:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[Impressions]]></category>
		<category><![CDATA[Piracy]]></category>
		<category><![CDATA[thepiratebay]]></category>

		<guid isPermaLink="false">http://discretevector.com/2009/04/impressions-piracy-gets-its-due.html</guid>
		<description><![CDATA[In August 2004 Dreamworks SKG shot off an email to PirateBay telling them that what they were doing was a violation of the copyright act and threatened legal action. The reply from PirateBay was short: they reminded them that what they were doing were not a violation of Swedish laws, and that they would sue [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><a href="http://images.google.co.in/imgres?imgurl=http://jeremyfain.files.wordpress.com/2007/11/pirateflag.jpg&amp;imgrefurl=http://techiteasy.org/2007/11/15/yo-ho-lessons-from-piracy-for-industry-dynamics/&amp;usg=__xXhqn2qNWZgRM5YpYIPwGp8f4wY=&amp;h=314&amp;w=401&amp;sz=19&amp;hl=en&amp;start=29&amp;sig2=Nqmex4o7xOz3GDjz2RYB1A&amp;tbnid=AIar9B_NIVOU7M:&amp;tbnh=97&amp;tbnw=124&amp;prev=/images%3Fq%3Dpiracy%26gbv%3D2%26ndsp%3D18%26hl%3Den%26sa%3DN%26start%3D18&amp;ei=xcfoSd63D6fg6gOkr83xAw"><img style="width: 124px;" src="http://tbn3.google.com/images?q=tbn:AIar9B_NIVOU7M:http://jeremyfain.files.wordpress.com/2007/11/pirateflag.jpg" height="97" width="124" /></a> In August 2004 Dreamworks SKG shot off <a href="http://static.thepiratebay.org/dreamworks_response.txt" target="_blank">an email</a> to PirateBay telling them that what they were doing was a violation of the copyright act and threatened legal action.</p>
<p>The reply from PirateBay was short: they reminded them that what they were doing were not a violation of Swedish laws, and that they would sue Dreamworks for harassment if the further emails were sent. Then they politely asked them to **** themselves.</p>
<p><strong>Earlier today, the 17th of April 2009, a Swedish court sentenced the founders of ThePirateBay.org to one year in prison and $3.6 million in damages to copyright holders like Dreamworks.</strong></p>
<p>Guess who had the last laugh.</p>
<p>PirateBay constantly justified themselves saying that they did not directly provide downloads to any files whatsoever, they were just, uh, maintaining a list of computers where you can find possibly copyrighted stuff.</p>
<p>That’s like saying that you were selling Marijuana to kids on the block but all the while you thought that were using it for medicinal purposes.</p>
<p>Really mature guys.</p>
<p>Someone spends millions creating a movie, designing a game, months writing a book, tries to make money out of the talent that they have and these losers come along and start to patronize everyone and tell people the evils of copyrighting.</p>
<p>You can make your millions by forming a company in a garage but you have no right to make money out of your talent. <em>Singing for money? Good heavens! What will they think of next?</em></p>
<p>Self righteous asses.</p>
<p>How would you like to make a Jurassic Park and sell it for free? I feel that people who pirate are people who have no talent and worse, no self respect.</p>
<p>The irony is that education and awareness have no effect on piracy. I have had a colleague preach to me about the evils of copyrights and how every man should have access to all the media he wants… for free.</p>
<p>Stephen King spends a year or more writing a single book only to find it being sold for 50 rupees on the sidewalks in Bangalore. Low cost reprinting of course. To top it all off, you will find a cop standing a few feet away seemingly oblivious to the fact that a crime was being perpetrated right next to him. For his oversight, he would probably be rewarded with a hundred bucks at the end of the week. </p>
</p>
<p>The world is moving right along.</p>
<p>Do the right thing. Don’t encourage piracy. It kills the talent.</p>
<p><strong><em><span style="color: rgb(0, 128, 128);">Alex</span></em></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2009/04/impressions-piracy-gets-its-due.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fixit: Internet Explorer 8 installation fails on Windows XP with SP3</title>
		<link>http://www.discretevector.com/2009/03/fixit-internet-explorer-installation.html</link>
		<comments>http://www.discretevector.com/2009/03/fixit-internet-explorer-installation.html#comments</comments>
		<pubDate>Sun, 29 Mar 2009 13:58:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[Fixit]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[Internet Explorer 8]]></category>

		<guid isPermaLink="false">http://discretevector.com/2009/03/fixit-internet-explorer-8-installation-fails-on-windows-xp-with-sp3.html</guid>
		<description><![CDATA[My initial attempt to install IE 8 was met with failure. The installation complained that it could not install a required update and that I had to do it manually. Sure, always glad to help. The error was something on the lines of “Could not install because your computer failed to install a required update”. [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><img style="width: 191px;" src="http://www.microsoft.com/library/media/1033/windows/images/internet-explorer/default/ie8_logo.gif" border="0" alt="Internet Explorer 8" />My initial attempt to install IE 8 was met with failure. The installation complained that it could not install a required update and that I had to do it manually. Sure, always glad to help.</p>
<p>The error was something on the lines of “<strong>Could not install because your computer failed to install a required update</strong>”. Sorry, forgot to capture the screen shot.</p>
<p>The installation redirected me to the download page for an update that I downloaded <strong>(KB932823-v3)</strong>. But when I tried to install it, the installation told me that I was not required to install this update as I had a later service pack. Great! Now I was stuck.</p>
<p>Ok, so here is how I fixed the problem. Incidentally I had XP SP 3 installed. I went ahead an uninstalled it. Restarted the machine. Installed the update that had failed earlier. Restarted again. Then ran IE8 installation.</p>
<p>The installation completed like a charm.</p>
<p>PS: The installation can fail due to various reasons and this is just one of them. Follow the above instructions only if your symptoms match the ones I have mentioned above.</p>
<p><a href="http://lh6.ggpht.com/_izTBHqIkTp4/Sc93gduBDwI/AAAAAAAACSU/D2Q-QOPme8c/s1600-h/untitled%5B5%5D.png"><img style="border: 0px none; width: 288px; display: inline;" title="IE8 failed Installation screen" src="http://lh6.ggpht.com/_izTBHqIkTp4/Sc93jCQKRHI/AAAAAAAACSY/4NNMfLsLe1c/untitled_thumb%5B5%5D.png?imgmax=800" border="0" alt="IE8 failed Installation screen" width="288" height="181" /></a></p>
<p>Click to enlarge the above screenshot. This is the screen where the installation fails. If your problem is the same as mine, there will be a checkmark next to the first item but everything else in the list will fail (there will be a cross mark next to it). Subsequently it will show the error screen I mentioned earlier.</p>
<p>Happy fixing,<br />
<strong><em><span style="color: #008040;">Alex</span></em></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2009/03/fixit-internet-explorer-installation.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Fixit: Fan noise while playing movies on the PS3</title>
		<link>http://www.discretevector.com/2009/03/fixit-fan-noise-while-playing-movies-on.html</link>
		<comments>http://www.discretevector.com/2009/03/fixit-fan-noise-while-playing-movies-on.html#comments</comments>
		<pubDate>Sun, 22 Mar 2009 10:11:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[Fan noise]]></category>
		<category><![CDATA[Fixit]]></category>
		<category><![CDATA[Playstation 3]]></category>

		<guid isPermaLink="false">http://discretevector.com/2009/03/fixit-fan-noise-while-playing-movies-on-the-ps3.html</guid>
		<description><![CDATA[When my eternally silent Playstaion(3) started to sound like a hairdryer from hell, I was concerned. The PS3 is well known for the fact that it is extremely silent. In fact most people would have difficulty figuring out whether it is on had it not been for the power LED glowing green. The problem, simply [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><img style="border-width: 0px; width: 128px; display: inline;" title="image" src="http://lh5.ggpht.com/_izTBHqIkTp4/ScYHws5khGI/AAAAAAAACO0/LIDNcbvrZeM/image%5B4%5D.png?imgmax=800" border="0" alt="image" width="128" height="102" /> When my eternally silent Playstaion(3) started to sound like a hairdryer from hell, I was concerned. The PS3 is well known for the fact that it is extremely silent. In fact most people would have difficulty figuring out whether it is on had it not been for the power LED glowing green.</p>
<p>The problem, simply stated was this: After playing a movie for around 15 minutes, the PS3’s fan kicks into overdrive. The first time it happened it scared the crap out of me. I though it was going to blow a fuse or something.The only way to bring down the noise was to turn off the console.</p>
<p>It was ridiculous. The sound was loud enough to spoil your movies. Conversations were easily drowned out. I was pissed.</p>
<p><strong>It is to be noted that I have played dozens of movies before without incident.</strong> What had changed? I searched the net for answers and to my surprise I learned that there were lots of people who had this problem with their PS3.</p>
<p>But what was unique about my case was this: the noise started only after playing a movie for sometime, NOT games or any other media! Most people who reported this problem encountered it while playing games too. I checked the vents for dust. Nothing. I feared that the unit might be broken. I dreaded the thought of turning it over for service.</p>
<p>Having assembled dozens of computers, I knew that fans usually rotate faster in case the unit started producing more heat, especially processing units like the CPU or the GPU. I also knew that DVD decoding was a processor intensive operation. But why now? What about all the movies I had played earlier without incident?</p>
<p>That’s when it hit me. <a href="http://hometheater.about.com/od/dvdbasicsfaqs/f/dvdbasics12.htm" target="_blank">Upscaling</a>. Upscaling increases the resolution of your output video which, theoretically at least, results in better video quality. I knew the PS3 supported this.</p>
<p>On your XMB menu the setting is under:</p>
<p><strong>Settings &gt; Video Settings &gt; BD/DVD Upscaler</strong></p>
<p>It was no surprise that the option was turned on. I simply turned it off and viola, no more noise.</p>
<p>Upscaling requires additional processing by the CPU, which I guess, was generating more heat, which in turned caused the fan to kick in. <a href="http://techon.nikkeibp.co.jp/english/NEWS_EN/20061113/123465/?SS=imgview_e&amp;FD=763397362&amp;ad_q" target="_blank">(And freakin’ big fan at that)</a></p>
<p>I tested the difference in visual quality buy enabling and then disabling this setting and frankly on my 32” LCD, didn&#8217;t notice any difference.</p>
<p>Another point to note is that as far as I can remember this setting was enabled the day I bought the PS3 (almost an year ago) but the problem surfaced recently. My only guess is that one of the system updates broke this. Since the PS3 doesn’t allow you to downgrade the firmware (legally) I guess we will never know.</p>
<p>If you have this problem and if this little setting change fixed it, do post a comment. It will help me validate the fix on other machines.</p>
<p><strong><em><span style="color: #008080;">Alex</span></em></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2009/03/fixit-fan-noise-while-playing-movies-on.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Impressions: Try mobileme? I don’t think so.</title>
		<link>http://www.discretevector.com/2009/03/impressions-try-mobileme-i-dont-think.html</link>
		<comments>http://www.discretevector.com/2009/03/impressions-try-mobileme-i-dont-think.html#comments</comments>
		<pubDate>Sun, 15 Mar 2009 12:08:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[mobileme]]></category>

		<guid isPermaLink="false">http://discretevector.com/2009/03/impressions-try-mobileme-i-don%e2%80%99t-think-so.html</guid>
		<description><![CDATA[iTunes is the worst excuse for a sync tool for the iPhone. Period. (Then again, its the worst excuse for a media manager too but that’s another story.). Apple tried to fill the PIM/Outlook gap by the mobileme service. Don’t get the title wrong. I have nothing against the service per se. In fact I [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>iTunes is the worst excuse for a sync tool for the iPhone. Period. (Then again, its the worst excuse for a media manager too but that’s another story.). Apple tried to fill the PIM/Outlook gap by the mobile<em>me</em> service.</p>
<p>Don’t get the title wrong. I have nothing against the service per se. In fact I haven’t even tried it so it wouldn’t be fair on me to pass judgment. (Do not judge or…)</p>
<p><a href="http://lh4.ggpht.com/_izTBHqIkTp4/SbzovYga4pI/AAAAAAAACOU/dKj9iwZV9t0/s1600-h/image5.png"><img style="border-width: 0px; display: inline; width: 212px;" title="mobile me signup" src="http://lh6.ggpht.com/_izTBHqIkTp4/Sbzow-lqkQI/AAAAAAAACOY/j9-IsGVk4mY/image_thumb3.png?imgmax=800" border="0" alt="mobile me signup" width="212" height="198" /></a></p>
<p>No. The problem is for people who want to try the service before deciding whether to pay for it or not. But Apple, in its infinite wisdom, (or should I say greed) decided that it could rake in some extra money by counting on people’s forgetfulness. That’s because if you opt in for the trial, you are required to enter your credit card information and in case you don’t bail out before the trial period gets over, your card is automatically charged!</p>
<p>That’s when I clicked the close button on my browser.</p>
<p><em><strong><span style="color: #008080;">Alex</span></strong></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2009/03/impressions-try-mobileme-i-dont-think.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The other side: Airtel Customer Care</title>
		<link>http://www.discretevector.com/2009/01/other-side-airtel-customer-care.html</link>
		<comments>http://www.discretevector.com/2009/01/other-side-airtel-customer-care.html#comments</comments>
		<pubDate>Sun, 25 Jan 2009 16:48:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[Airtel]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[The other side]]></category>

		<guid isPermaLink="false">http://discretevector.com/2009/01/the-other-side-airtel-customer-care.html</guid>
		<description><![CDATA[This little incident happened few days back and I though I would share it. Airtel customer care has always impressed me with their timely response and ability to resolve technical issues. Couple of days back I had put in a request to activate edge on my iPhone. The data plan was supposed to be activated [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><img style="border-width: 0px; width: 86px; display: inline;" title="Airtel logo" src="http://lh4.ggpht.com/_izTBHqIkTp4/Sfweomc5tjI/AAAAAAAACVw/DstLVIL_2Vw/image%5B2%5D.png?imgmax=800" border="0" alt="Airtel logo" width="86" height="39" /> This little incident happened few days back and I though I would share it. Airtel customer care has always impressed me with their timely response and ability to resolve technical issues.</p>
<p>Couple of days back I had put in a request to activate edge on my iPhone. The data plan was supposed to be activated in 24 hours. Not being able to connect even after 2 days I decides to give customer care a call.</p>
<p>Customer Rep: Good Mor… er… Afternoon. Airtel customer care. How many I help you?</p>
<p>Me: I had put in a request to activate Mobile Office on my phone but it has been 48 hours and its still not active.</p>
<p>CR: I’m sorry to hear that Sir. Let me check.</p>
<p>(On hold for 20 seconds)</p>
<p>CR: You are using an iPhone right?</p>
<p>Me: That’s right. (I wonder how they get to know that)</p>
<p>CR: 2g or 3g?</p>
<p>Me: 2g.</p>
<p>CR: Is it on the latest firmware?</p>
<p>Me: Yes. (Glad to know that she knew about firmwares….)</p>
<p>CR: Right. What you need to do is  … you need to switch off the phone… pull out the battery…</p>
<p><strong>Me: Uh, pull out the battery?!!! But…</strong></p>
<p>CR: Right .. pull out the battery and put it back… then…</p>
<p>Me: &lt;Click&gt;</p>
<p>Well, so much for technical expertise.</p>
<p>PS: I was informed by a good friend of mine after reading this post that removing and then replacing the battery was indeed a good solution for many problems. That’s when I realized that if you don’t own an iPhone or haven&#8217;t read about it then you wont get what this fuss was all about. Ok here it is: <strong>You cannot remove the battery from an iPhone. It is not a user replaceable component like all other phones. (and hence you cannot ‘<em>pull out the battery</em>’)</strong> That’s Apple for you. Go figure.</p>
<p>Thanks Jef, for the heads up.</p>
<p><strong><em><span style="color: #008080;">Alex</span></em></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2009/01/other-side-airtel-customer-care.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Impressions: My All time worst Movies list</title>
		<link>http://www.discretevector.com/2009/01/impressions-my-all-time-worst-movies.html</link>
		<comments>http://www.discretevector.com/2009/01/impressions-my-all-time-worst-movies.html#comments</comments>
		<pubDate>Sun, 11 Jan 2009 16:50:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[Impressions]]></category>
		<category><![CDATA[Movies]]></category>

		<guid isPermaLink="false">http://discretevector.com/2009/01/impressions-my-all-time-worst-movies-list.html</guid>
		<description><![CDATA[Hellboy – I don’t care about the Rotten Tomato’s rating (79%), I found this movie severely disconnected. Not to mention bad acting, poor script, overused prosthetics. And what was that ending creature anyways? Rubberized clockwork? Several of the movies aspects were not clear. I guess only the fans of the comic was expected to watch [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><a href="http://lh5.ggpht.com/_izTBHqIkTp4/SWobFfeN4_I/AAAAAAAACLE/vJLNogzOA38/image%5B7%5D.png?imgmax=800"><img style="border-width: 0px; display: inline; width: 140px;" title="image" src="http://lh3.ggpht.com/_izTBHqIkTp4/SWocSTpnnbI/AAAAAAAACLI/ON5L3HWtzI8/image_thumb%5B5%5D.png?imgmax=800" border="0" alt="image" width="140" height="88" /></a> <strong>Hellboy</strong> – I don’t care about the Rotten Tomato’s rating (79%), I found this movie severely disconnected. Not to mention bad acting, poor script, overused prosthetics. And what was that ending creature anyways? Rubberized clockwork? Several of the movies aspects were not clear. I guess only the fans of the comic was expected to watch the movie.</p>
<p><strong>Blade Trinity</strong> – Let me not start on this one. No acting. Vampires. Explosions. Vampires. Bad acting…. oh well, you get the point. There goes Snipes’s career.</p>
<p><strong>Ghost Rider</strong> – What in the world was Nicholas cage thinking? Must have been really desperate to act as a guy who sold his soul to Satan, rides a bike and whose head bursts into flames. To top it all off is a script that looks like it was written on the sets.</p>
<p><strong>Dare Devil</strong> – Ben Affleck is clearly no superhero. There is no plot to speak of and the bad guys are… well… human. I heard they made an Elektra movie too. Thankfully I didn&#8217;t have to put myself through that ordeal.</p>
<p><strong>Solaris</strong> – George Clooney’s ‘watch-the-paint-dry movie’. Some call it the next level of movie making. I choose to stay normal.</p>
<p><strong>Mr &amp; Mrs Smith</strong> – The Brangelina couple fails to light up the screen thanks to a pathetic script and bad direction.</p>
<p><strong>I am Legend</strong> &#8211; Man develops a virus that, well, wipes out humanity from the face of the Earth (what else). The only surviving creatures are, by the law of movie making, blood thirsty zombies that roam about after sunset. Really ORIGINAL script! 28 weeks later, Dawn of the dead. Hello? George Romero has literally beaten this genre to death. Oh, Will Smith has a dog in the movie. I guess that counts for some originality. The movie isn’t bad actually but like I said how many times will you put up with the same Zombie plot.</p>
<p>[March 28 2009]</p>
<p>Moving right along…</p>
<p><strong>AI (Artificial Intelligence)</strong>: You wont believe that this movie was directed by the same guy who did Saving Private Ryan. Maybe Spielberg wrote the script when he was drunk. And what’s with Spielberg and aliens anyways? Does he have to have aliens in all his movies? May be its a disorder or something. Maybe he was kidnapped by aliens when he was a kid. He convinced them to let him go. In return he promised to give the aliens cameo roles in all his movies. (I think I spotted couple of them dressed as soldiers in the opening scene of Saving private Ryan). Indiana Jones and the Kingdom of the crystal skull: more aliens!!</p>
<p><strong>Jacob’s Ladder:</strong> Another Rotten Tomatoes favorite. I found the movie dark and pointless. Sure the concept was good but you can only stretch it so much you know.</p>
<p>This list will be updated. Stay tuned.</p>
<p><strong><em>Alex</em></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2009/01/impressions-my-all-time-worst-movies.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DIY: Taking iPhone Screenshots</title>
		<link>http://www.discretevector.com/2009/01/diy-taking-iphone-screenshots.html</link>
		<comments>http://www.discretevector.com/2009/01/diy-taking-iphone-screenshots.html#comments</comments>
		<pubDate>Fri, 09 Jan 2009 10:35:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[DIY]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://discretevector.com/2009/01/diy-taking-iphone-screenshots.html</guid>
		<description><![CDATA[This one is real easy. Most phones would require an application to get this done. Not the iPhone. That’s right, taking a screen shot of an iPhone screen is as easy as: Step 1: Open the screen you want to take a screen shot of. Step 2: Hold down the home button for about a [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><a href="http://lh3.ggpht.com/_izTBHqIkTp4/SWchaOFPeNI/AAAAAAAACKc/eCQU2b7u9do/s1600-h/image%5B6%5D.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; width: 77px; border-right-width: 0px" height="116" alt="image" src="http://lh5.ggpht.com/_izTBHqIkTp4/SWchbCbhStI/AAAAAAAACKg/LS7doldyXmg/image_thumb%5B4%5D.png?imgmax=800" width="77" border="0" /></a> This one is real easy. Most phones would require an application to get this done. Not the iPhone. That’s right, taking a screen shot of an iPhone screen is as easy as:</p>
<p><strong>Step 1</strong>: Open the screen you want to take a screen shot of.</p>
<p><strong>Step 2</strong>: Hold down the home button for about a second.</p>
<p><strong>Step 3</strong>: Without releasing the home button, press and release the sleep/power key the way you would press the shutter button on a camera to take a picture.</p>
<p><a href="http://lh5.ggpht.com/_izTBHqIkTp4/SWchbxPCJ_I/AAAAAAAACKk/EMgwC4yT6z4/s1600-h/image%5B14%5D.png"><img title="image" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; width: 170px; margin-right: auto; border-right-width: 0px" height="240" alt="image" src="http://lh5.ggpht.com/_izTBHqIkTp4/SWchczlWeYI/AAAAAAAACKo/p909Cj1Mywc/image_thumb%5B10%5D.png?imgmax=800" width="170" border="0" /></a><strong>[ Picture courtesy: PwnageTool ]</strong></p>
<p>That’s it! There will be a flash of white on the screen to acknowledge the operation. The picture will be saved under ‘<em>Camera Rolls</em>’.</p>
<p>Easy, wasn’t it?</p>
<p><em><strong>Alex</strong></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2009/01/diy-taking-iphone-screenshots.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Impressions &amp; DIY: Intel and the heatsink business</title>
		<link>http://www.discretevector.com/2008/12/impressions-diy-intel-and-heatsink.html</link>
		<comments>http://www.discretevector.com/2008/12/impressions-diy-intel-and-heatsink.html#comments</comments>
		<pubDate>Thu, 25 Dec 2008 19:37:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[DIY]]></category>
		<category><![CDATA[Impressions]]></category>
		<category><![CDATA[PC Hardware]]></category>

		<guid isPermaLink="false">http://discretevector.com/2008/12/impressions-diy-intel-and-the-heatsink-business.html</guid>
		<description><![CDATA[What’s with Intel and their stock heat sinks anyway? Every time they change the socket type they end up changing the heat sink installation design? Mind you, change doesn’t always mean improved. I have been assembling computers for a long time now. I should know. The computer I had few years back was a Pentium [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><a href="http://lh5.ggpht.com/_izTBHqIkTp4/SVPZ3u1v7zI/AAAAAAAACJ8/4vfuIPbrGvg/s1600-h/image%5B11%5D.png"><img style="border: 0px none; display: inline; width: 108px;" title="image" src="http://lh5.ggpht.com/_izTBHqIkTp4/SVPZ42bORYI/AAAAAAAACKA/oPM_mQubzYE/image_thumb%5B6%5D.png?imgmax=800" border="0" alt="image" width="108" height="59" /></a> What’s with Intel and their stock heat sinks anyway? Every time they change the socket type they end up changing the heat sink installation design? Mind you, change doesn’t always mean improved.</p>
<p>I have been assembling computers for a long time now. I should know. The computer I had few years back was a Pentium 4. The 423 PIN one. Boy, was that heatsink a nightmare or what.  There were these damn clips that had to clamped on. It was pure physical work. If installing them were bad you should try removing them.. The wretched things never seem to come off.</p>
<p><img style="border-width: 0px; display: inline; width: 300px;" title="image" src="http://lh6.ggpht.com/_izTBHqIkTp4/SVPZ5z0PkgI/AAAAAAAACKE/0NPF6UtpMOs/image16%5B1%5D.png?imgmax=800" border="0" alt="image" width="240" height="126" /></p>
<p><strong>(The clamps. Remember these characters?)</strong></p>
<p>Intel finally go some hold on things and released the best heat sink I have installed. Drop ‘em in, turn the levers and you are done. (See below) To remove just release the levers. Easy.</p>
<p><img style="border-width: 0px; display: inline; width: 281px;" title="image" src="http://lh6.ggpht.com/_izTBHqIkTp4/SVPZ6kQ4BaI/AAAAAAAACKI/DZ2a_LTrifc/image17.png?imgmax=800" border="0" alt="image" width="281" height="200" /></p>
<p><strong>(The 478 PIN Pentium 4’s Heat sink)</strong></p>
<p>The latest introduction for the core 2’s is this contraption below. This one has no levers or clamps. Your place it on the motherboard, align the legs to the four holes on the motherboard and press them all in place. That’s it. Unfortunately its not so straight forward. For one, pressing the legs down doesn’t always seem to lock them in place. When you lock one leg in place, the rest of the three corners tip away from the motherboard and you have to put extra pressure to lock the others, all the while worrying whether you will break the damn thing or with some luck damage the processor itself.</p>
<p><img style="border-width: 0px; display: inline; width: 263px;" title="image" src="http://lh4.ggpht.com/_izTBHqIkTp4/SVPZ78RxVII/AAAAAAAACKQ/WllpQSQAi1w/image18.png?imgmax=800" border="0" alt="image" width="263" height="177" /></p>
<p align="left">
<p align="left">
<p align="left"><strong>(Core 2 Duo Stock Heat Sink. Picture courtesy PCStats.com)</strong></p>
<h4>Installing the 775 Socket processor stock heatsink</h4>
<p align="left">Here are some tips for installing the 775 socket stock processor.</p>
<p align="left">Always install the processor, heatsink and RAM before screwing the motherboard onto the casing. There is less hassle this way. Once you put in the motherboard inside the case you will have to work inside the constraints of the case which can be a pain at time.</p>
<p align="left">Before inserting the processor check for bent pins on the motherboard. The LGA design moved all the legs from the processor to the motherboard making it easier for Intel. Bad news for the mobo vendor though. More replacement orders due to bent pins!</p>
<p align="left">To install the processor, hold it parallel to the motherboard socket. Ensure that the golden triangle one of the processors corners is aligned with the corner of the socket which has a pin missing. Its foolproof design actually. Two notches on the socket ensure that the processer can only be inserted the right way. Once its aligned hold it at a height of around 1 cm above the socket and just drop it in place. Run your finger around the sides to ensure that its seated properly.</p>
<p align="left">The stock heat sink comes pre applied with thermal compound. Look at the bottom of the heat sink, you’ll see three strips of grey. The thermal compound ensures that the heat is efficiently transferred off the surface of the processor onto the heatsink. Do not wipe it off do something stupid like that. I have had a friend call me up once for help because he wiped the thermal compound clean off the heatsink because he though it was a sticker or something that had to be removed before installation.</p>
<p align="left">“Ok Bob, the heatsink’s protective sticker is off. Now what? ”.</p>
<p align="left">“Uh… what protective sticker?”</p>
<p align="left">For the same reason, do not rest the heatsink somewhere with the compound side touching it. Only remove the heatsink from the plastic housing when you are ready to install it.</p>
<p align="left">Ok, now we come to the tricky part. Ensure that the legs are aligned properly before inserting them onto the motherboard. The cut on the top of each of the legs should be pointed towards to the side of the heatsink, NOT away from it. Oh one more thing, even though you can insert any of the legs in any of the holes its easier if you align the heatsink so that the fans connector is closest to the corresponding socket on the motherboard.</p>
<p align="left">Place the heatsink gently down on the processor ensuring that all four legs have gone through all the four holes. Now comes the benefit holding off installing the motherboard inside the case. Hold the heatsink in place and turn the motherboard around. Make sure the ends of the legs are protruding through the holes.</p>
<p align="left">Now comes the tricky part. Hold the heatsink down with one hand and press one of the legs down till you hear a solid click. Now do the same to the leg diagonally opposite to the one you just locked in. Do the same for the other two. Sometimes you will have difficulty pushing in one of the legs or you may not hear the satisfactory click. In such cases give all of the legs a good push and then turn the motherboard around. All the legs should now have a black ‘stick’ in between. More importantly the end of the black stick should be aligned with the end of the white tip. Then and only then are the legs properly locked in place.</p>
<p align="left">
<p align="left"><a href="http://lh4.ggpht.com/_izTBHqIkTp4/SVPZ8ruadeI/AAAAAAAACKU/nXKnf3KL92I/s1600-h/image16.png"><img style="border-width: 0px; display: inline; width: 294px;" title="image" src="http://lh5.ggpht.com/_izTBHqIkTp4/SVPZ-c1US1I/AAAAAAAACKY/hAANmeDcSPk/image_thumb7.png?imgmax=800" border="0" alt="image" width="294" height="197" /></a></p>
<p align="left">
<p align="left">
<p align="left">
<p align="left">
<p align="left">
<p align="left">
<p align="left"><strong>(The heatsink after insertion. Note the base of the pin and the direction of the cut on top of the pin head)</strong></p>
<p align="left">As an ending note I really hope Intel ships heatsinks that are more easier to install. One that doesn’t involve installing a heatsink more painful than pulling teeth.</p>
<p align="left">PS: If you have issues while assembling your PC, drop me a line and I’ll help you out.</p>
<p><strong>Additional Links</strong></p>
<p>PCStats  has an excellent processor and heat sink installation guide on their site. Say it with pictures. Great for the newbie.</p>
<p><a title="http://www.pcstats.com/articleview.cfm?articleid=2231&amp;page=6" href="http://www.pcstats.com/articleview.cfm?articleid=2231&amp;page=6">http://www.pcstats.com/articleview.cfm?articleid=2231&amp;page=6</a></p>
<p>Happy assembling,<br />
<strong><em><span style="color: #008080;">Alex</span></em></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2008/12/impressions-diy-intel-and-heatsink.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixit: ODBC DSN ‘The configuration process failed’ error</title>
		<link>http://www.discretevector.com/2008/12/odbc-dsn-configuration-process-failed.html</link>
		<comments>http://www.discretevector.com/2008/12/odbc-dsn-configuration-process-failed.html#comments</comments>
		<pubDate>Sun, 07 Dec 2008 18:23:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[Fixit]]></category>

		<guid isPermaLink="false">http://discretevector.com/2008/12/fixit-odbc-dsn-%e2%80%98the-configuration-process-failed%e2%80%99-error.html</guid>
		<description><![CDATA[An old client of mine asked me to provide a minor fix for a software I had developed for him few years ago. The application was developed in Visual Basic and the required database connection was configured using DSN. Since my machine was formatted several times since then, I had to create the ODBC entry [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>An old client of mine asked me to provide a minor fix for a software I had developed for him few years ago. The application was developed in Visual Basic and the required database connection was configured using DSN. Since my machine was formatted several times since then, I had to create the ODBC entry again. But alas, the moment I configured the entry under System DSN I got an error saying:</p>
<p><em><span style="color:#ff0000;">The configuration process failed.</span></em></p>
<p>and then</p>
<p><span style="color:#ff0000;">Could not write to registry</span></p>
<p>Google search yielded nothing much  so I tried to find the fix myself. I knew it was related to missing registry permissions.</p>
<p>The first thing you can try if you face this error is to explicitly give yourself registry permissions (even if you are an administrator).</p>
<p>Fire up the registry editor (<em>Start&gt;Run&gt;Regedit</em>)</p>
<p>Navigate to <em>HKLM\Software\ODBC\ODBC.INI</em></p>
<p>Right click on the ODBC.INI key and select permissions. Add yourself to the list of users (if not already present) and give yourself <em>Full Control</em> permissions.</p>
<p>Click on Advanced and check the following checkbox</p>
<p><em>Replace permission entries on all child objects…</em></p>
<p>Click OK and then OK again.</p>
<p>Restart your machine.</p>
<p>Another possible issue is if Auto-Logon is enabled on your machine. Some permissions in Windows require an explicit logon for permissions to be granted (even if you are logging in automatically as an administrator). Disable Auto-logon using the utility you used to enable it and then restart the machine. Logon by entering admin credentials. I suggest you try this method first before attempting the former.</p>
<p><strong><em><span style="color:#008000;">Alex</span></em></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2008/12/odbc-dsn-configuration-process-failed.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>DIY: Streaming Media from a PC to your PS3</title>
		<link>http://www.discretevector.com/2008/10/diy-streaming-media-from-pc-to-your-ps3.html</link>
		<comments>http://www.discretevector.com/2008/10/diy-streaming-media-from-pc-to-your-ps3.html#comments</comments>
		<pubDate>Sun, 12 Oct 2008 17:46:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[DIY]]></category>
		<category><![CDATA[Playstation 3]]></category>

		<guid isPermaLink="false">http://discretevector.com/2008/10/diy-streaming-media-from-a-pc-to-your-ps3.html</guid>
		<description><![CDATA[You have a PC with all your media content that you have collected over the years. You want to play the same on your TV without physically connecting the two. Oh and you have a PS3. What do you do? Simple; setup a media server. There are lots of ways to do this. Just run [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><img style="border-width: 0px; display: inline; width: 142px;" title="gears" src="http://lh3.ggpht.com/bobbyalex/SPIw72gZUoI/AAAAAAAACE8/J82k6ZjNa2s/gears%5B10%5D.jpg?imgmax=800" border="0" alt="gears" width="142" height="120" /> You have a PC with all your media content that you have collected over the years. You want to play the same on your TV without physically connecting the two. Oh and you have a PS3. What do you do?<br />
Simple; setup a media server.</p>
<p>There are lots of ways to do this. Just run a search on Google and it will give you a good number of sites. Most of them demonstrate the same using Windows media player 11 because most people have it on their computer. I tried it. Didn&#8217;t work for me. So if you are like me read on.</p>
<blockquote><p><strong><br />
What you need.</strong></p>
<p>A PC running Windows XP/VIsta</p>
<p>A Playstation 3</p>
<p>A wireless router</p>
<p>SimpleCenter</p></blockquote>
<p>First I assume that you have a functional wireless router connected to your PC. I also assume that your PS3 can connect to your wireless router. If you cant, Google it, you&#8217;ll find a gazillion sites which will walk you through the procedure. If you STILL don&#8217;t get it, drop me a message, I’ll try to help you out.</p>
<p>Let’s start shall we?</p>
<p>First download SimpleCenter from <a href="http://www.simplecenter.com/download.html">http://www.simplecenter.com/download.html</a> and install it.</p>
<p>Launch SimpleCenter, click on <em>Settings</em>. Under <em>Media</em>, add your media folders (the ones you want to make available to your PS3) and remove the ones you don&#8217;t want to share.</p>
<p>Go to the <em>Server</em> tab and ensure that <em>Enable Media Server</em> is checked. It would also be convenient to check <em>Start automatically at login</em>. Under name, type the name of your media server. This is how PS3 will display your media server.</p>
<p>That’s it! Fire up your PS3 and under one of the media sub menus (Music, Photos, Video) select <em>Search for Media Server</em>. Your newly configured media server should now be displayed. Select the media server and your shared folders will be displayed.</p>
<p>Ensure that Media server connection is enabled in your PS3. (Settings &gt; Network Settings &gt; Media Server connection)</p>
<p>Now that was simple (forgive the pun) wasn&#8217;t it?</p>
<p>TIP: If your DSL modem is connected to your router, switch it off to improve streaming.</p>
<p>TIP: If you have difficulty finding your media server, try enabling uPnP on your wireless connection settings. (Settings &gt; Network Settings &gt; Internet connection settings (wireless connection). Select Custom and when you reach the uPnP screen make sure that it is enabled)</p>
<p>Note: Each media can be played only under the corresponding menu item, i.e, videos can be played only though the Video menu etc etc</p>
<p>Note: If you don’t mind shedding some moolah then you can upgrade SimpleCenter and enable advanced features such as making your media available to you from anywhere in the world.</p>
<p>All the best,<br />
<strong><em><span style="color: #008040;">Alex</span></em></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2008/10/diy-streaming-media-from-pc-to-your-ps3.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Impressions: Why the iPhone 3G won’t sell for $199 in India</title>
		<link>http://www.discretevector.com/2008/07/impressions-why-iphone-3g-wont-sell-for.html</link>
		<comments>http://www.discretevector.com/2008/07/impressions-why-iphone-3g-wont-sell-for.html#comments</comments>
		<pubDate>Sun, 13 Jul 2008 13:07:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[Impressions]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://discretevector.com/2008/07/impressions-why-the-iphone-3g-won%e2%80%99t-sell-for-199-in-india.html</guid>
		<description><![CDATA[The iPhone 3G launched couple of days back in 22 countries. There was the usual frenzy, people camping outside stores overnight, mile long queues. Just another day for the iPhone. While the 22 countries got their iPhones at $199 (INR 8515) a pop, only a miracle will make that happen when the phone launches in [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><a href="http://lh4.ggpht.com/bobbyalex/SHn3FLYi6gI/AAAAAAAAA9w/QG-XoA6KXoA/s1600-h/image%5B15%5D.png"><img style="border-width: 0px; width: 131px;" title="Apple iPhone 3G" src="http://lh4.ggpht.com/bobbyalex/SHn3GJaWghI/AAAAAAAAA90/5O9tfG_FfPI/image_thumb%5B11%5D.png?imgmax=800" border="0" alt="Apple iPhone 3G" width="131" height="137" /></a></p>
<p>The iPhone 3G launched couple of days back in 22 countries. There was the usual frenzy, people camping outside stores overnight, mile long queues. Just another day for the iPhone.</p>
<p><a href="http://lh3.ggpht.com/bobbyalex/SHn3HKdRewI/AAAAAAAAA94/xK_ZKBfpaa4/s1600-h/image%5B24%5D.png"><img style="border: 0px none; width: 176px;" title="Apple iPhone 3G" src="http://lh4.ggpht.com/bobbyalex/SHn3IKzSftI/AAAAAAAAA98/i3I4IrcZB90/image_thumb%5B18%5D.png?imgmax=800" border="0" alt="Apple iPhone 3G" width="176" height="35" /></a></p>
<p>While the 22 countries got their iPhones at $199 (INR 8515) a pop, only a miracle will make that happen when the phone launches in India later this year. Lets see why.</p>
<p>The reason why the iPhone is being sold at a ridiculously low price is because of Apple’s exclusive contract tie up with network providers around the world. Lets take the case of US. The only way you can get an iPhone in the US (legally) is by buying it through AT&amp;T. Anyone purchasing the iPhone through AT&amp;T has to sign up a <a href="http://www.wireless.att.com/cell-phone-service/specials/iPhone.jsp">2 year contract</a> during purchase.</p>
<p>The lowest plan available is <a href="http://www.wireless.att.com/cell-phone-service/specials/iphone-info.jsp">$69.99.</a> Do the math and that comes to around <strong>$1680 for 2 years</strong>. So your TCO (minimum)for an 8Gb iPhone is 199+1680 = $1879 over a span of 2 years. No doubt, some of the money goes straight to Apple’s piggy bank.</p>
<p>Now, this model is totally unfeasible in India as no network ties the user to the phone here ,except for Reliance and Indicomm. But that is a moot point because the players in question are Vodafone and Airtel. Moreover, even if that is the case, a monthly plan of $69.99 (~INR 2995) will ensure that no one queues up on launch day.</p>
<p>Also don’t forget the ridiculously high duties levies on imported electronics in India. Why do you think a 32 inch LCD TV costs 45K? Go figure.</p>
<p>So now we have two alternatives: Cheaper plans or the ability to buy the phone without a contract but paying a much bigger amount up front.</p>
<p>Lets look at the latter option first. Incidentally, Vodafone New Zealand lets you do exactly that: buy the phone, no questions asked at USD 740. A lowly sum of <strong>INR 31664.60</strong>! No queues again.</p>
<p>Getting back to the first option: Airtel and Vodafone locks the phones they sell to their respective networks and provide an iPhone only plan, lets say INR 990/month (free minutes, data etc included) and sells the phone around lets say around 14K? This is the best sweet spot I can think of to ensure mass consumption.</p>
<blockquote><p><strong>Do note that neither provider has a 3G network as of today so the only data plan, even if bundled, will be over GPRS (EDGE).</strong></p></blockquote>
<p>The call plan of 990/month can be a deterrent for most people except for the most hard core users. People in India mostly stick to plans around the 300 – 600 INR range. What about prepaid users? They are a huge base in India. College students, casual users, hell… even some of my colleagues are still on pre-paid. Again,  most people in this category are in the 200 – 300 INR call plan. What will the providers have in store for them?</p>
<p>I conclude: A price range between INR 13K – 16K plus a call plan around INR 500 – 900 is the best price brackets I can think of. Anything more will ensure that the phone remains an exclusive purchase for the rich, in short more crowd, less purchase.</p>
<p>Again, a launch price of 19K will not surprise me. We’ll have to just wait and see.</p>
<p><em><span style="color:#008040;">Happy drooling<br />
</span><span style="color:#008040;"><strong>Alex</strong></span></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2008/07/impressions-why-iphone-3g-wont-sell-for.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Common warnings in C#: Cause, effect and resolution</title>
		<link>http://www.discretevector.com/2008/06/common-warnings-in-c-cause-effect-and.html</link>
		<comments>http://www.discretevector.com/2008/06/common-warnings-in-c-cause-effect-and.html#comments</comments>
		<pubDate>Sun, 29 Jun 2008 03:19:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://discretevector.com/2008/06/common-warnings-in-c-cause-effect-and-resolution.html</guid>
		<description><![CDATA[Ah, warnings. Those little indicators that we constantly ignore. Lets sweep them under the carpet and carry on with our lives. I mean, they are just warnings right? Not as if you are going to break something if you don&#8217;t fix it right? It&#8217;s like smoking, some people pay the price, some get away with [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><strong>A</strong>h, warnings. Those little indicators that we constantly ignore. Lets sweep them under the carpet and carry on with our lives. I mean, they are just warnings right? Not as if you are going to break something if you don&#8217;t fix it right? It&#8217;s like smoking, some people pay the price, some get away with it. The Doctor warns you all the same.</p>
<p>Its the same in coding, the warnings are there for exactly that: to warn you that you may screw up down the line somewhere or probably face undesirable side effects. Application crashes anybody?</p>
<p>In this edition I shall list some of the common warnings you will encounter, its reason and solution.</p>
<p>Note: The framework considered is 2.0</p>
<p><strong>Field &#8216;<em>field name</em>&#8216; is never assigned to, and will always have its default value null</strong> &#8211; You declared a class member variable but never used it. Check why. If not required, remove the member.</p>
<p><strong>The variable <em>&#8216;variable name&#8217;</em> is declared but never used</strong> &#8211; You declared a variable in a scope but it was never used. Check why. If it is no longer required, remove it.</p>
<p><strong>The variable <em>&#8216;variable name&#8217;</em> is assigned but its value is never used</strong> &#8211; You declared a variable and assigned a value to it. But the variable was never used in the specified scope. Check why. If not required, remove it.</p>
<p><strong>The private field <em>&#8216;field name&#8217;</em> is never used</strong> &#8211; Same reason as above.</p>
<p>Note: The compiler checks whether variables that have been declared have ever been used on the right hand side of an expression or as an out parameter to a method. If not, the compiler generates a <em>&#8216;<strong>variable not used&#8217;</strong></em> warning. Unused variables add to the clutter and makes code confusing and difficult to read. Check the variable in question and remove it if its not required.</p>
<p><strong>&#8216;<em>member1</em>&#8216; hides inherited member &#8216;<em>member2</em>&#8216;. Use the new keyword if hiding was intended</strong> &#8211; You declared a member in a derived class that has the same name as a member in the base class. If you really intended to hide the base class member use the new modifier before the member declaration. Even if you don&#8217;t explicitly use the new keyword, the compiler adds it anyway. Why is this a warning, you may ask. Well, you may have unknowingly declared a member with the same name. This warning acts a heads up. Explicitly adding the new keyword tells the compiler that you were aware of the member in the base class and you intended to hide it.</p>
<p><strong>&#8216;<em>function 1</em>&#8216; hides inherited member &#8216;<em>function 2</em>&#8216;. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword -<em> </em></strong>I would have preferred if this was thrown as an error than just a warning. This warning show a flaw in design or outright lack of understanding.</p>
<p>Lets understand this warning with an example:</p>
<blockquote><pre class="code"><span style="color: blue">public class </span>Base<br />{<br />   <span style="color: blue">public virtual void </span>DoSomeWork()<br />   {<br />       Console.WriteLine(&quot;Base called&quot;);<br />   }<br />}<br /><span style="color: blue">public class </span>Derived: Base<br />{<br />   <span style="color: green">//Did you mean this method to override<br /></span><span style="color: green">    //the base class method<br />   //or is it just another method<br /></span><span style="color: green">    //having the same base class name?<br />   </span><span style="color: blue">public void </span>DoSomeWork()    <span style="color: green">//Warning!<br />   </span>{<br />       Console.WriteLine(&quot;Derived called&quot;);<br />   }<br />}</pre>
<p></p></blockquote>
<p>Note that the base class method is virtual. This means that the Derived class can supercede the implementation with its own method with the same name and signature.</p>
<p>As my comment says, the derived class method&#8217;s name might have been unintended (like the previous warning). For all you care the derived class method might have been called TrimTheHedge or something like that. In that the warning gives you a chance of changing the method name (for clarity&#8217;s sake). If you really want the method to be called DoSomeWork (because you have a penchant for abstract looking names) then add the new modifier to it to tell the compiler that the derived class method WAS NOT written to override the base class&#8217;s virtual method. If you really meant to override the base class method, use the override keyword in the derived class method.</p>
<p>Again, why? Lets say, the intention of the derived class method was indeed to override the base class method, which works perfectly fine in the example above. Now you decide to change the base class methods signature by adding a parameter to the method, say a string.</p>
<blockquote><p> 
<pre class="code"><span style="color: blue">public virtual void </span>DoSomeWork(<span style="color: blue">string </span>mystring)<br />{<br />      Console.WriteLine(&quot;Base called with &quot;<br />                        + mystring);<br />}</pre>
<p></p></blockquote>
<p>
<p>This means that your derived class methods signature also should be modified (since it is supposed to override the base class method and hence the signatures are supposed to match). If you are one of those few people who keep track of all the classes that derived from a particular class then you could possibly find all the overridden methods and change their signature. What if you miss a method? Would it give an error? (which is what you would expect). Well, unfortunately it wont. The compiler just thinks that you intended to hide the method and implicitly adds the new modifier to that method you forgot to modify and life goes on as usual till the day arrives when your application uses that method and the output didn&#8217;t turn out quite what you expected. (In the above example you would get &quot;Derived called&quot; instead of &quot;Derived called with Take Out The Trash&quot;, assuming you pass &quot;Take out the trash&quot; as the parameter)</p>
<p>To ensure that you get an error when this happens, add the override keyword after public.</p>
<blockquote><p> 
<pre class="code"><span style="color: blue">public override void </span>DoSomeWork()    <span style="color: green">//Error<br /></span>{<br /> Console.WriteLine(&quot;Derived called with &quot;<br />                    + mystring);<br />}<br /></pre>
<p></p></blockquote>
<p><em>Error: &#8216;Derived.DoSomeWork()&#8217;: no suitable method found to override</em></p>
<p>Now you will realize that you have missed out a method and make the required changes.</p>
<p>Some warning, huh?</p>
<p><strong>Possible unintended reference comparison; to get a value comparison, cast the left hand side to type &#8216;<em>type</em>&#8216; &#8211; </strong>Look ma, no cast.</p>
<p><strong>class is obsolete:&#8217;<em>class name 1</em> &#8216;This class has been deprecated. Please use &#8216;<em>class name 2</em>&#8216; instead</strong> &#8211; The specified framework class/type is no longer supported. The class may have been reworked to improve performance or may have been enhanced and/or moved to a different namespace or may have been renamed. The warning specifies the alternative type to use.</p>
<p><strong>Unreachable code detected</strong> &#8211; The compiler has detected that the specified code block will never be executed. Check if this is expected. This is usually caused due to a misplaced return statement or a conditional block that will never be true. Another common scenario is putting a return statement inside a case block of a switch&#8230;case statement. In this case the break statement following the case block is marked as unreachable. Demonstrates shoddy programming.</p>
<blockquote><p> 
<p>int i = 0;</p>
<p>CheckValidity(i);</p>
<p>AppendToLog(i);</p>
<p>return;</p>
<p>i++; //Unreachable code!</p>
<p></p></blockquote>
<p>&#160;</p>
<blockquote><p> 
<p>bool isValid = false; </p>
<p>if (isValid) </p>
<p>{</p>
<p>//This block is unreachable because isValid is never true! </p>
<p>int i=0; </p>
<p>CheckValidity(i);</p>
<p>}</p>
<p></p></blockquote>
<p><strong>Accessing a member on &#8216;member&#8217; may cause a runtime exception because it is a field of a marshal-by-reference class &#8211; </strong>This will take an article in itself but I&#8217;ll try to keep it short for your sanity&#8217;s sake. An application in one App domain can access objects in other app domains in two ways. One is by copying the entire object over to the other side and the other is by setting up a proxy. The app domain that needs to communicate with the object makes calls to the proxy which in turn are routed to the actual object on the other App domain. Classes that derive from MarshalByRefObject class communicate by using proxies.</p>
<p>Now, why would you want to do that? Well if you design a class that has members that are unusable outside the app domain on which it was created you would derive from MarshalByRefObject. (System.Windows.Forms.Form is one such class and most of such warnings originate from your forms). A subtle piece of information that the warning message leaves out (but mentioned in MSDN) is that the warning occurs only if the member you are trying to access in a value type.</p>
<p>When you try to operate directly on a value type across app domains say by calling a method on it, an attempt is made to calculate the address of the member in the remote app domain which is illegal and will fail. Do note that if the member was a reference type there would be no warning (due to the virtue of it being a reference type).</p>
<p>Lets look at the MSDN example as it is short and simple:</p>
<blockquote><p> 
<pre><span style="color: #0000ff">class</span> WarningCS1690: MarshalByRefObject<br />{<br />  <span style="color: #0000ff">int</span> i = 5;<br /><br />  <span style="color: #0000ff">public static void</span> Main()<br />  {<br />    WarningCS1690 e = new WarningCS1690();<br />    e.i.ToString();   <span style="color: #008000">// CS1690</span><br /><br />    <span style="color: #008000">// OK</span><br />    <span style="color: #0000ff">int</span> i = e.i;<br />    i.ToString();<br />    e.i = i;<br />  }<br />}</pre>
<p></p></blockquote>
<p>As you can see an attempt is being made to operate on the value type ‘i’ directly by calling the <em>ToString()</em> method on it.</p>
<p>The recommended practice is to first copy the member in question to a local variable and then to call the method on it as shown in the latter part of the code.</p>
<p>Why should you be bothered? If the class that derives from MarshalByRefObject is ever used across app domains and an attempt is made to access a member as mentioned, then your application will throw an InvalidOperationException and if not handled, will crash. If your class will NEVER be accessed across app domains then you can safely ignore this warning but I suggest that you code it as mentioned to prevent future headaches.</p>
<p><strong>Assignment made to same variable; did you mean to assign something else?</strong> &#8211; You did something silly like this: myValue = myValue; Were you trying to do something else?</p>
<p>Well, there you have it; the most common warnings you will encounter in C#. This list may vary a bit depending on the type and complexity of your project. So if you encounter a warning you cant make head or tail of, drop me a line and I&#8217;ll try to add it to this article. All the best for your very own <em>0 errors, 0 warnings.</em></p>
<p>Code safely, </p>
<p><em><strong>Alex</strong></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2008/06/common-warnings-in-c-cause-effect-and.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Report: iPhone 3G and India Launch</title>
		<link>http://www.discretevector.com/2008/06/report-iphone-3g-and-india-launch.html</link>
		<comments>http://www.discretevector.com/2008/06/report-iphone-3g-and-india-launch.html#comments</comments>
		<pubDate>Tue, 10 Jun 2008 19:42:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Reports]]></category>

		<guid isPermaLink="false">http://discretevector.com/2008/06/report-iphone-3g-and-india-launch.html</guid>
		<description><![CDATA[For everyone who has been drooling in anticipation, the iPhone 3G is finally here. Steve Jobs revealed the new iPhone on June 9th at the WWDC. The major changes are 3G, Microsoft Exchange support, built in GPS and IMHO, a headset port that is flush on the body and not recessed. Thank Apple for small [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.apple.com/iphone/"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; width: 270px; border-right-width: 0px" height="131" alt="image" src="http://lh5.ggpht.com/bobbyalex/SE7R4SIBhjI/AAAAAAAAA8I/6XbnBNKaONs/image%5B44%5D.png?imgmax=800" width="270" border="0" /></a>For everyone who has been drooling in anticipation, the iPhone 3G is finally here. Steve Jobs revealed the new iPhone on June 9th at the <strong>WWDC</strong>.</p>
<p>The major changes are <strong>3G, Microsoft Exchange support, built in GPS</strong> and IMHO, a <strong>headset port that is flush</strong> on the body and not recessed. Thank Apple for small favors.</p>
<p>And of course the MAJOR announcement is the price drop: The <strong>8GB</strong> version is available for (drum rolls please) <strong>$199</strong>! And the 16Gb at $299.</p>
<p>Apple will be releasing the iPhone in 70, read it again, <strong>70 countries</strong> in the coming months. Of this it will be available in <strong>22 countries @ $199 by July 11th</strong>. That&#8217;s right, for $199 in ALL those 22 countries.</p>
<p>Unfortunately India is not on that list but it is on the list of 70 countries that will be getting the iPhone this year (we were #63 on Steve&#8217;s list). Of course that doesn&#8217;t mean that we can&#8217;t get it for $199 nor am I saying that we can. It would be an industry first if we could though.</p>
<p>And of course the most interesting bit of news: The network on which it will be available. Well, as it turns out, Apple might follow the dual network model in India as both <strong>Bharti and Vodafone</strong> are on the list. So Airtel subscribers can rejoice and start saving up. I have a minuscule of doubt about Vodafone as they operate in other countries too and hence the contract may not apply for India. But then that&#8217;s just my observation. We&#8217;ll have to just wait and see.</p>
<p>The iPhone 3G will be available starting July 11th 2008 in 22 countries.</p>
<h3>The announcement in pictures</h3>
<p> (Click to zoom)<br />
<table cellspacing="0" cellpadding="2" width="368" border="0">
<tbody>
<tr>
<td valign="top" width="172"><a href="http://lh3.ggpht.com/bobbyalex/SE7R56_BcfI/AAAAAAAAA8M/ZQnAK0TOZ3I/s1600-h/image%5B8%5D.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="100" alt="image" src="http://lh6.ggpht.com/bobbyalex/SE7R7ULi9MI/AAAAAAAAA8Q/FQGlreomcnw/image_thumb%5B4%5D.png?imgmax=800" width="138" border="0" /></a> </td>
<td valign="top" width="194"><a href="http://lh4.ggpht.com/bobbyalex/SE7R8qyvgCI/AAAAAAAAA8U/NowywU86p2s/s1600-h/image%5B32%5D.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="102" alt="image" src="http://lh3.ggpht.com/bobbyalex/SE7R-X5jPHI/AAAAAAAAA8Y/F1hu71MKT1I/image_thumb%5B18%5D.png?imgmax=800" width="149" border="0" /></a> </td>
</tr>
<tr>
<td valign="top" width="172">
<h6>No one&#8217;s complaining now!</h6>
</td>
<td valign="top" width="194">
<h6>The chosen ones.</h6>
</td>
</tr>
<tr>
<td valign="top" width="172"><a href="http://lh6.ggpht.com/bobbyalex/SE7SAP9vW5I/AAAAAAAAA8c/6xh2wJSSAsM/s1600-h/image%5B19%5D.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="113" alt="image" src="http://lh6.ggpht.com/bobbyalex/SE7SCowBhpI/AAAAAAAAA8g/IIZ3ArDEX-8/image_thumb%5B11%5D.png?imgmax=800" width="141" border="0" /></a> </td>
<td valign="top" width="194"><a href="http://lh3.ggpht.com/bobbyalex/SE7SEgI6thI/AAAAAAAAA8k/WJwQTvwOs2Y/s1600-h/image%5B33%5D.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="112" alt="image" src="http://lh5.ggpht.com/bobbyalex/SE7SFzXzRKI/AAAAAAAAA8o/I38O1H17MN4/image_thumb%5B19%5D.png?imgmax=800" width="147" border="0" /></a> </td>
</tr>
<tr>
<td valign="top" width="172">
<h6>There we are, number 63</h6>
</td>
<td valign="top" width="194">
<h6>And a grand total of 70</h6>
</td>
</tr>
</tbody>
</table>
<h3><strong>Updates</strong></h3>
<p><strong>Update (June 11, 2008): </strong>Sources indicate that the iPhone will be available in India from Airtel by October 2008. Prices and plans have not yet been disclosed. For more information send the word <strong><em>iPhone</em></strong> to <strong>54321</strong> from your Airtel phone.</p>
<p><span style="font-weight: bold">Update (June 25, 2008):</span> Well it turns out that I was right about the dual network model. Vodafone (on which I had a minuscule of doubt) officially announced the iPhone on its network in India today. Dates have not yet been announced but it shouldn&#8217;t be long now. Pre-registrations have started. You can pre-register for the iPhone on the <a href="http://www.vodafone.in/existingusers/iphone/pages/preregister-iPhone.aspx">Vodafone India site</a> or send an SMS with the word <span style="font-weight: bold">IPHONE </span>to <span style="font-weight: bold">56789 </span>(Rs 3/SMS). You should be aware that Vodafone does not have a 3G network in India yet so the 3G iPhone is &#8230;well&#8230; 2G for you.</p>
<p>All eyes are on Airtel now. Fingers crossed. I am on Airtel. Airtel’s SMS number is available in the last update. Not sure if its for pre-registration, the message just says that Airtel will contact you with more information.   </p>
<p><strong>Update (June 25, 2008, 9:15 PM):</strong> Well, Airtel too has made the announcement on their site. But they are not building any hype: they have placed an ad on their home page as part of a small rotating ad banner which links to the booking page. In fact it is easy to miss it because the ad keeps shuffling between other inconsequential stuff such as m-commerce, lower tariffs etc. Vodafone on the other hand had a front page Ad in today’s paper.</p>
<p>You can book the iPhone online at <a href="http://www.airtel.in/iphone3g">Airtel’s site.</a> They too have a disclaimer similar to Vodafone: <em>Some features and services are not available in many areas. </em>No outright denial of the lack of 3G but I suspect it.</p>
<p>Now that both networks have made the announcement, next item on the menu: tariffs. Let the games begin.</p>
<table cellspacing="0" cellpadding="2" width="308" border="0">
<tbody>
<tr>
<td valign="top" width="151"><a href="http://lh4.ggpht.com/bobbyalex/SGJ7mhx7tBI/AAAAAAAAA9U/cvoVSMFcMRo/s1600-h/image%5B13%5D.png"><img title="image" style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="85" alt="image" src="http://lh6.ggpht.com/bobbyalex/SGJ7ozzQdII/AAAAAAAAA9Y/-u6FdoK2AhY/image_thumb%5B5%5D.png?imgmax=800" width="126" border="0" /></a> </td>
<td valign="top" width="155"><a href="http://lh5.ggpht.com/bobbyalex/SGJ7qHhyMMI/AAAAAAAAA9c/sAb4c3akIgY/s1600-h/image%5B20%5D.png"><img title="image" style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="85" alt="image" src="http://lh6.ggpht.com/bobbyalex/SGJ7rG-TKrI/AAAAAAAAA9g/aNhs38_IvNQ/image_thumb%5B8%5D.png?imgmax=800" width="126" border="0" /></a> </td>
</tr>
<tr>
<td valign="top" width="151">
<p align="center"><a href="http://www.airtel.in/iphone3g">Airtel iPhone booking page</a></p>
</td>
<td valign="top" width="155">
<p align="center"><a href="http://www.vodafone.in/existingusers/iphone/pages/preregister-iPhone.aspx">Vodafone iPhone pre-registration page</a></p>
</td>
</tr>
</tbody>
</table>
<p>Keep watching this space for more updates.   </p>
<p><strong><em>Alex</em></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2008/06/report-iphone-3g-and-india-launch.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Impressions: A Prisoner of Birth</title>
		<link>http://www.discretevector.com/2008/05/impressions-prisoner-of-birth.html</link>
		<comments>http://www.discretevector.com/2008/05/impressions-prisoner-of-birth.html#comments</comments>
		<pubDate>Tue, 27 May 2008 05:37:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Impressions]]></category>

		<guid isPermaLink="false">http://discretevector.com/2008/05/impressions-a-prisoner-of-birth.html</guid>
		<description><![CDATA[Jeffrey Archer really outdid himself this time. I didn&#8217;t want to belittle such great writing by reviewing it. Just one word: Unputdownable. John Grisham fans would be surprised to see how well Archer handles the courtroom scenes. This is the probably the fastest I have finished a book: 7 Hours. I really mean it, once [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.panmacmillan.com/titles/displayPage.asp?PageTitle=Individual%20Title&amp;BookID=404355&amp;Category="><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; width: 104px; border-right-width: 0px" height="144" alt="Jeffrey Archer: Prisoner of Birth" src="http://lh3.ggpht.com/bobbyalex/SDxGzjg8ayI/AAAAAAAAA8A/f2vNygvc2As/image%5B9%5D.png?imgmax=800" width="114" border="0" /></a> Jeffrey Archer really outdid himself this time. I didn&#8217;t want to belittle such great writing by reviewing it. Just one word: <span style="font-style: italic">Unputdownable</span>. John Grisham fans would be surprised to see how well Archer handles the courtroom scenes.</p>
<p>This is the probably the fastest I have finished a book: 7 Hours. I really mean it, once you start reading there is no way you can put it down without finishing it.</p>
<p>A modern day rendition of Dumas&#8217;s classic The count of Monte Cristo, the story tells the tale of a man wrongly accused of the murder of his best friend and how he escapes from prison to have his revenge. The way Archer developed the plot to have Danny Cartwright, the protagonist, escape prison is quite ingenious (though he does stretch the envelope a bit). Damn good story telling and it never drags a bit.</p>
<p>I had the good fortune of getting the book signed by Archer himself when he was on a tour of India last week. And I am glad that of all his books, I got this one signed.</p>
<p>Get it. You wont regret it.</p>
<h4>CW Rating: 5/5</h4>
<p>Happy Reading,    <br /><strong><em><span style="color: #008040">Alex</span></em></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2008/05/impressions-prisoner-of-birth.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Impressions: Losing Steam</title>
		<link>http://www.discretevector.com/2008/05/impressions-losing-steam.html</link>
		<comments>http://www.discretevector.com/2008/05/impressions-losing-steam.html#comments</comments>
		<pubDate>Thu, 22 May 2008 19:32:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Gaming]]></category>
		<category><![CDATA[PC Gaming]]></category>

		<guid isPermaLink="false">http://discretevector.com/2008/05/impressions-losing-steam.html</guid>
		<description><![CDATA[I am pissed and hence this article. In fact I am still pissed while writing this article. And it will probably remain that way for an hour or so. That&#8217;s approximately the amount of time Lost Planet: Extreme edition will take to update itself on my Broadband connection. And the last time I checked the [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><img style="width: 157px; border: 0px;" src="http://lh3.ggpht.com/bobbyalex/SDXDRTg8auI/AAAAAAAAA7U/W-md7r7Icgs/image14%5B2%5D.png?imgmax=800" border="0" alt="steam logo" width="156" height="57" /> I am pissed and hence this article. In fact I am still pissed while writing this article. And it will probably remain that way for an hour or so. That&#8217;s approximately the amount of time Lost Planet: Extreme edition will take to update itself on my Broadband connection. And the last time I checked the meter it was downloading at around 190 Kbps which is very good by Indian standards let me tell you.</p>
<p>(Why am I, a connoisseur of fine games, playing this game so late? Its a long story. Maybe some other time. Loosely revolves around the game&#8217;s unavailability in India, <a href="http://www.play-asia.com/SOap-23-83-80ka-71-bm-49-en-84-k-40-extended.html">play-asia.com</a>, and the Indian postal service)</p>
<p>The problem is not with the update, the problem is that I am being forced to. Let me clarify. Many publishers (Capcom, Id, Valve to name a few)choose to deliver their games on a platform called <a href="http://steampowered.com/">Steam</a>. Steam is like a game manager of sorts. Its a digital content and rights management platform. Its also a digital distribution system. What that means is that you no longer have to buy a shrink wrapped game CD from a store. You can buy the game on Steam and have it downloaded to your machine and start playing instantly&#8230; er&#8230; I mean as soon as you complete downloading your 3 GB game. You can still buy these games from stores but the activation is through Steam.</p>
<p>Ok, back to shrink wrapped games. So I buy Lost planet, pop it into my DVD drive, run the mammoth installation (4.something GB). Then I have to activate it online using Steam. Oh, and people without Internet? Losers. Now I can play the game right? Eh, well, you see after installation, Steam automatically starts downloading patches for the game without even asking you. It also downloads additional content so that your game can be played &#8216;offline&#8217;. And till this is done you cant play the game. Zip. Its as simple as that. Now you know why I am waiting.</p>
<blockquote><p><strong>Remember the Half life 2 launch fiasco in 2004? The authentication servers went down for 5 hours preventing gamers from logging in (and hence authenticating &amp; playing). All thanks to Steam.</strong></p></blockquote>
<p>If you try to launch the game while the update is in progress, you will get an informative dialog very similar to the one shown below.</p>
<table border="0" cellspacing="0" cellpadding="2" width="334">
<tbody>
<tr>
<td width="332" valign="top"><img style="width: 315px; border-width: 0px;" src="http://lh3.ggpht.com/bobbyalex/SDXDSTg8avI/AAAAAAAAA7c/UDlAAnV5yyU/image7.png?imgmax=800" border="0" alt="image" width="315" height="125" /></td>
</tr>
<tr>
<td width="332" valign="top">A familiar screen while trying to play many Steam powered games.</td>
</tr>
</tbody>
</table>
<p>What pisses me off is this: I install an almost 5 GB game and I have to DOWNLOAD ADDITIONAL content to play it? Activation is one thing but forcing you to download stuff you don&#8217;t want? I don&#8217;t think so. The content I am currently downloading are multiplayer maps and some other stuff I will never use. I don&#8217;t even play online!</p>
<p><a href="http://lh3.ggpht.com/bobbyalex/SDXDTTg8awI/AAAAAAAAA7k/ZhfRpffY7YE/s1600-h/image%5B7%5D.png"><img style="width: 215px; border: 0px;" src="http://lh4.ggpht.com/bobbyalex/SDXDUjg8axI/AAAAAAAAA7s/pxnjGXqGYLw/image_thumb%5B2%5D.png?imgmax=800" border="0" alt="image" width="215" height="167" /></a>If I am smart I will disable Steam automatic update option for this game after this download is over. I made a mistake of not doing this after I installed Half life 2. Oh by the way, it&#8217;s the guys at Valve who owns Steam. Give credit where it is due. Amen. Ok, so I installed HL2, waited for the game to download whatever crap it was downloading and eagerly started the game. In the excitement, I forgot to turn off automatic update. So the next time I started my machine and went online, it started downloading more digital crap (patches they call it) forcing me to wait AGAIN. <span style="font-weight: bold">Its painfully funny because there is no way around it, once you allow it to start you have to wait for it to stop</span>. Its like your nagging girlfriend; there is no way around it.</p>
<p>[A quick update on the progress of my download: The download started off at 85% (I guess the 5G installation was the 85%!!) Now its at 87% and it has already downloaded 450 MB! I have a 4GB download limit of which a good chunk has been used already. I shall not elaborate further for the fear of breaking down. Real men don't cry]</p>
<p>So there you have it, yet another ingenious way of warding off genuine customers and encouraging piracy. I mean whatever happened to the good old days of popping in a disc and shooting some monsters? The only reason why people are putting up with Steam is because some of the best games are delivered this way. Half life 2: Episode 3 anyone?</p>
<ul><strong>What&#8217;s good about the Steam Platform</strong></p>
<li>Helps beat piracy</li>
<li>You automatically get important patches</li>
<li>Dedicated servers and hence very high download speeds</li>
<li>Pay and download games (I personally don&#8217;t care about this. Give me shrink wrapped any day)</li>
</ul>
<ul>Valve/Steam, please clean up your mess. We just want to play the game. The extras? Keep them, for all I care. Important patches? We gamers are intelligent. Really. Let us decide whether we need them or not.</ul>
<ul>[Update (27 May 2008): The download required to play LP offline turned out to be a whopping 1.5 GB. I remember days when 2GB used to be your entire hard disk capacity! Clearly unacceptable. I wonder what Capcom was thinking.]</ul>
<p>Happy Gaming,<br />
<em><strong><span style="color: #008000">Alex</span></strong></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2008/05/impressions-losing-steam.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What you did not know about Structs in C#</title>
		<link>http://www.discretevector.com/2008/05/what-you-did-not-know-about-structs-in.html</link>
		<comments>http://www.discretevector.com/2008/05/what-you-did-not-know-about-structs-in.html#comments</comments>
		<pubDate>Thu, 01 May 2008 05:25:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[structs]]></category>
		<category><![CDATA[what you did not know about]]></category>

		<guid isPermaLink="false">http://discretevector.com/2008/05/what-you-did-not-know-about-structs-in-c.html</guid>
		<description><![CDATA[What is the difference between structs and classes in C#? I have asked this question in most of the interviews I have taken and most people give the following standard answer: &#34;They are exactly like classes but they don&#8217;t support inheritance.&#34; &#34;That&#8217;s it?&#34; &#34;Uh huh&#8230; more or less.&#34; &#34;A lot less than more&#34; I told [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>What is the difference between structs and classes in C#?</p>
<p>I have asked this question in most of the interviews I have taken and most people give the following standard answer:</p>
<p><em>&quot;They are exactly like classes but they don&#8217;t support inheritance.&quot;</em></p>
<p><em>&quot;That&#8217;s it?&quot;</em> </p>
<p><em>&quot;Uh huh&#8230; more or less.&quot;</em></p>
<p><em>&quot;A lot less than more&quot; I told myself      <br /></em></p>
<p>Actually there are several more subtle differences which you, as a programmer, should know. We shall cover the important ones in this edition.    </p>
<p><strong>Structs do not support inheritance nor can they be used as the base for inheritance for a class</strong>. Please note that (ironically) all struct types implicitly inherit from System.ValueType.</p>
<p><strong>A struct is a value type whereas a class is a reference type</strong>. So when you create an instance of a structure, the instance is created on the stack. You can use the new keyword with a struct but its not for the reason you think.</p>
<p><strong>You cannot declare a default constructor for a struct</strong>. This is a very interesting &#8216;gotcha&#8217;. We shall soon see why.</p>
<p><strong>You can create an instance of a struct using the new keyword or even without it.</strong></p>
<p>The reason for the above two statements are as follows: When you create a struct, the compiler <strong>automatically creates a default constructor</strong> for you and where it <strong>initializes all the members</strong> of the structure to <strong>default values</strong>. Integral variables get initialized to 0, reference types to null etc. This is an inherent property of a struct in .net and the compiler does not want us to break this behavior by allowing us to override the default constructor. This constructor is called by using the new keyword, like this:</p>
<p><span style="font-size: 78%; font-family: courier">struct Widget      <br />{       <br />public string widgetName;       <br />public int widgetId;       <br />public void UpdateWidget()       <br />{       <br />//Some Code       <br />}</span><span style="font-size: 78%; font-family: courier">      <br />}       <br />Widget w = new Widget();</span></p>
<div>The above code automatically initializes <em>widgetName</em> to null and <em>widgetId</em> to 0.</div>
<div>Structs can also be created without using the new keyword (unlike classes) as follows:     <br /><span style="font-size: 78%; font-family: courier">Widget w;</span></div>
<div><span style="font-size: 78%; font-family: courier new"></span>    <br />But in the above case, you <strong>have to initialize all the members of w explicitly before it (w) can be used</strong>.     </div>
<div><span style="font-size: 78%; font-family: courier new"></span></div>
<div><span style="font-size: 78%"><span style="font-family: courier">       </p>
<p></span></span></div>
<p> <span style="font-size: 100%"><span style="font-family: courier new">w.UpdateWidget()</span></span>   </p>
<p>So if you write the above line of code immediately after the Widget declaration, the compiler will throw an error saying:   </p>
<div><em><span style="color: rgb(255,0,0)">Use of unassigned local variable &#8216;w&#8217;</span></em></div>
<p>To get the code to compile, you have to assign values to all the members first.</p>
<p><span style="font-size: 100%; font-family: courier">Widget w;      <br />//Assign values to all the members       <br />w.widgetName = &quot;search widget&quot;;       <br />w.widgetId = &quot;66&quot;;       <br /></span></p>
<p><span style="font-size: 100%; font-family: courier">//Use the instance      <br /></span><span style="font-size: 100%">w.UpdateWidget(); </span>    </p>
</p>
<p>This complete assignment rule also applies if you add a <span style="font-weight: bold">parameterized constructor for a struct</span>. Look at the code below. </p>
<p> <span style="font-size: 100%"><span style="font-family: courier new">struct Widget </span>    <br /></span>
<p style="font-family: courier new"><span style="font-size: 100%">{      <br />public string widgetName;       <br />public int widgetId;       <br />public Widget(string name)       <br />{       <br />widgetName = name;       <br />}       <br />}</span></p>
<div></div>
<div>Observe that I didn&#8217;t assign any value to <span style="font-style: italic">widgetId</span>. The above code will give a compilation error saying:     </p>
<p><em><span style="color: rgb(255,0,0)">Field &#8216;StructDemo.Widget.widgetId&#8217; must be fully assigned before control leaves the constructor</span>.</em></div>
<p>The reason and solution is the same as before.    </p>
<p></p>
</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; width: 37px; border-right-width: 0px" height="30" alt="idea_bulb" src="http://lh3.ggpht.com/bobbyalex/SBoTNnjq8uI/AAAAAAAAA5M/di07LjQYGFw/idea_bulb%5B2%5D.jpg?imgmax=800" width="37" border="0" /> The default value of a class is null. Since structs are reference types, its default value is the value obtained by setting all its value type members to its default values and reference type members to null. The inability to override the default constructor for a struct guarantees this default state.     </p>
<p></p>
</p>
</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; width: 37px; border-right-width: 0px" height="30" alt="idea_bulb" src="http://lh3.ggpht.com/bobbyalex/SBoTNnjq8uI/AAAAAAAAA5M/di07LjQYGFw/idea_bulb%5B2%5D.jpg?imgmax=800" width="37" border="0" /><strike>Note that in a class, if you declare a parameterized constructor, it is mandatory that you override the default (parameterless) constructor. In a struct however this restriction is obviously not valid because of the above reasons.</strike>     </p>
<p><strong>Unlike a class, you cannot initialize instance fields members directly</strong> as shown below. You have to rely on a constructor or some other form of explicit assignment to initialize variables to the values you want.     <br />
<style type="text/css">
<p>.csharpcode, .csharpcode pre<br />{<br /> font-size: small;<br /> color: black;<br /> font-family: consolas, "Courier New", courier, monospace;<br /> background-color: #ffffff;<br /> /*white-space: pre;*/<br />}<br />.csharpcode pre { margin: 0em; }<br />.csharpcode .rem { color: #008000; }<br />.csharpcode .kwrd { color: #0000ff; }<br />.csharpcode .str { color: #006080; }<br />.csharpcode .op { color: #0000c0; }<br />.csharpcode .preproc { color: #cc6633; }<br />.csharpcode .asp { background-color: #ffff00; }<br />.csharpcode .html { color: #800000; }<br />.csharpcode .attr { color: #ff0000; }<br />.csharpcode .alt <br />{<br /> background-color: #f4f4f4;<br /> width: 100%;<br /> margin: 0em;<br />}<br />.csharpcode .lnum { color: #606060; }</style>
<style type="text/css">
<p>.csharpcode, .csharpcode pre<br />{<br /> font-size: small;<br /> color: black;<br /> font-family: consolas, "Courier New", courier, monospace;<br /> background-color: #ffffff;<br /> /*white-space: pre;*/<br />}<br />.csharpcode pre { margin: 0em; }<br />.csharpcode .rem { color: #008000; }<br />.csharpcode .kwrd { color: #0000ff; }<br />.csharpcode .str { color: #006080; }<br />.csharpcode .op { color: #0000c0; }<br />.csharpcode .preproc { color: #cc6633; }<br />.csharpcode .asp { background-color: #ffff00; }<br />.csharpcode .html { color: #800000; }<br />.csharpcode .attr { color: #ff0000; }<br />.csharpcode .alt <br />{<br /> background-color: #f4f4f4;<br /> width: 100%;<br /> margin: 0em;<br />}<br />.csharpcode .lnum { color: #606060</style>
</p>
<p><span style="font-size: 100%">struct Widget      <br />{       <br />public string widgetName = &quot;download widget&quot;;       <br />//Compilation error: &#8216;Widget.widgetName&#8217;:       <br />//cannot have instance field initializers       <br />//in structs       <br />}</span></p>
<p><strong>The keyword <em>this</em> has different meanings when used in a class and a struct.</strong> In a class, <em>this</em> is treated as a value. That is, <em>this</em> can be used for assignment (like newVar = this) but cannot be assigned to (like this = newVar). In a struct, however, <em>this</em> is treated as a variable. In an instance constructor, <em>this</em> corresponds to an out parameter whose type is the struct. <span style="font-weight: bold">This is why you get an error if you don&#8217;t assign values to all the members in a struct before leaving the constructor</span>. This rule is a property of a regular out parameter in C#. You have to assign it before leaving the method. For a structure, &#8216;it&#8217; is the entire structure. In a instance method however it is treated as a ref parameter which means that it is possible to assign a whole new struct to the instance that called the method. In short, the code below is valid for a struct.</p>
<p><span style="font-size: 78%; font-family: courier">struct Widget      <br />{       <br />public string widgetName;       <br />public int widgetId;       <br />public Widget(string name, int id)       <br />{       <br />widgetName = name;       <br />widgetId = id;       <br />}       <br />public void SomeMethod()       <br />{       <br />this = new Widget(); //This is valid for structs       <br />}       <br />}</span></p>
<p><span style="font-size: 78%; font-family: courier">Widget w = new Widget(&quot;Search Widget&quot;, 66);      <br />MessageBox.Show(w.widgetName); //Displays &quot;Search Widget&quot;       <br />MessageBox.Show(w.widgetId.ToString()); //Displays &quot;66&quot;</span></p>
<p><span style="font-size: 78%; font-family: courier">m.SomeMethod();      <br />MessageBox.Show(w.widgetName); //Displays &quot;&quot; (was assigned null)       <br />MessageBox.Show(w.widgetId.ToString()); //Displays &quot;0&quot;</span></p>
<p>As you can see the method replaced its caller with a whole new instance!    </p>
<p>So when would you want to use structs? One is obviously if you don&#8217;t need the all the features provided by a class such as inheritance. Structs should be used for <strong>light weight objects</strong>. The guideline is that if the size of a class is around <strong>16 bytes</strong> it might be better to make it a struct. Also consider the fact that if you are creating an array of a class, memory has to be <strong>allocated on the heap</strong> for the actual object in addition to the memory used for the <span style="font-weight: bold">reference on the stack</span>. And this has to be done as many times as the size of the array.</p>
<p>For example, in the following case, a struct would be more efficient.</p>
<p> <span style="font-size: 100%"></span>
<p><span style="font-size: 78%; font-family: courier"><span style="font-size: 100%">(struct/class) Point        <br />{         <br />int x;         <br />int y;         <br />} </span>      <br /></span></p>
<p> 
<p>So there you have it, the lesser known facts about structs. Watch out for more articles in the &quot;<em>What you did not know about&#8230;&quot;</em> series.     </p>
<p><strong>Code safely,      <br /><em><span style="color: rgb(0,128,128)">Alex</span></em></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2008/05/what-you-did-not-know-about-structs-in.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Review: Playstation 3 &#8211; Gran Turismo Edition</title>
		<link>http://www.discretevector.com/2008/04/impressions-playstation-3-gran-turismo.html</link>
		<comments>http://www.discretevector.com/2008/04/impressions-playstation-3-gran-turismo.html#comments</comments>
		<pubDate>Sun, 27 Apr 2008 05:50:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[Comparison]]></category>
		<category><![CDATA[Console Gaming]]></category>
		<category><![CDATA[Gran Turismo]]></category>
		<category><![CDATA[Playstation 3]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[Xbox 360]]></category>

		<guid isPermaLink="false">http://discretevector.com/2008/04/review-playstation-3-gran-turismo-edition.html</guid>
		<description><![CDATA[In one of the earlier editions I had hinted at the fact that I would love to get my hands on a console&#8230; well, that happened a little earlier than expected. Remember The one ring in Lord of the Rings? How people who see it have a fatal attraction towards it? Well.. its the same [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>In one of the earlier editions I had hinted at the fact that I would love to get my hands on a console&#8230; well, that happened a little earlier than expected. Remember The one ring in Lord of the Rings? How people who see it have a fatal attraction towards it? Well.. its the same with me and shiny gadgets. Good for my ego&#8230; not so great for my wallet.</p>
<p>I had more or less made up my mind that if I was to ever get a console in the foreseeable future, it would be an Xbox 360. My primary incentive being the relatively larger number of game titles available for it as compared to the PS3. In fact I was so sure of it that I even stopped researching the PS3! I am the kind of person who digs the grave before making a purchase.</p>
<p>But you the reader would have guessed by now (no small thanks to the title) that things didn&#8217;t go quite as planned.</p>
<p><em>PS: If you don&#8217;t want listen to me ranting about my buying experience, click <a href="#experience">here</a> to skip the section. It&#8217;s ok. I understand.</em></p>
<p>This is what happened:</p>
<p>I was out window shopping with a friend on sunny Saturday afternoon and I was at one of my regular shops where they know me on the first name basis. I happened to be at the electronics section and I decided to ask (for the 10th time this month) the price of the Xbox.</p>
<p>To my surprise the price was 27K (INR)! A week back it was 24K and they were giving 4 games free along with it. &quot;<em>That offer is closed Sir</em>&quot;, the sales guy told me politely. I cursed myself. He smiled sympathetically. &quot;<em>But there a new PS3 edition hitting the market soon. Why don&#8217;t you leave your number with me and I&#8217;ll ensure that you get the first piece when we get the stock? And what&#8217;s more, it seems they are giving a game away with it for free!</em>&quot; The guy sounded so enthusiastic that I didn&#8217;t have the heart to tell him that I wasn&#8217;t interested in a PS3. I gave him my cell number and left, my friend shaking her head all the way out.</p>
<p>Once outside she said: &quot;<em>Look if you really want it why don&#8217;t you buy it? Makes no sense coming here every week and ogling at it</em>.&quot; And with that simple encouragement, the decision was made. I would buy a console today! We headed out to another store just to check whether I could get a better deal. And we did! We found a store that was still running the Xbox promotion: The Pro console @ 24K with 4 games thrown in. &quot;<span style="font-style: italic">Great</span>&quot;, my friend said picking up the box. &quot;<span style="font-style: italic">Which way is the billing counter?</span>&quot;</p>
<p>&quot;<span style="font-style: italic">Uh.. now that we are here anyway, why don&#8217;t we checkout the Playstation too?</span> &quot; I found myself asking.</p>
<p>&quot;WHAT?! I thought you had decided&#8230;.&quot; and her voice trailed off. She knew there was no point in arguing with me. At the PS counter, the sales guy showed off a demo in all it HD glory&#8230; on a Sony Bravia.</p>
<p>I was awestruck&#8230;. and confused. The Xbox 360 for all its games&#8230; or the PS3 for all its HD glory (among several other things). And while I was ticking away the pros and cons in my mind, my phone rang. It was the guy from the store where I had left my number. &quot;We expected the stock to come in next week but the company sent it over today. They usually don&#8217;t do that but hey we cant complain. We got like &#8230; 5 and as promised I am holding on to yours. Come over anytime. See ya&quot;. Click.</p>
<p>Divine intervention you say? Maybe.</p>
<p>And that&#8217;s how I became the proud owner of a Playstation 3 console.</p>
<p> <a name="experience"></a><br />
<h3>Opening the Box</h3>
<p>I have checked all over the net but I couldn&#8217;t find this bundling anywhere. An India exclusive? What are the chances of that happening! This bundle is basically PS3 with the Gran Turismo 5 Prologue thrown in. That&#8217;s it. Oh, the box has Gran Turismo images on it. And guess what, when you open the box, you get ANOTHER box inside, the regular PS3 box. They just dropped an PS3 box into a new box! lol !</p>
<p>And that&#8217;s not all. There are discrepancies is the information too. The outer box lists the Euro AV converter as one of the contents, the inner box doesn&#8217;t and of course, no converter inside the box. The outer box lists the DVD and BD region codes as 2 and B respectively. The inner box? 5 and C!</p>
<h3>The Experience:</h3>
<p>You wont believe how heavy the damn thing is. 5 Kgs! I almost slipped a disc carrying it home.</p>
<p>The XMB menu is easy to use and even more so if you already own a PSP. All my PS3 experience till now was on my 17&quot; computer LCD monitor. I have seen the PS3 on a Sony HD TV and I definitely know what I am missing. Buy hey, got to face the facts. Not enough moolah to buy one (yet).</p>
<p>I previewed a movie (Open season &#8211; Blu-ray) and a game (GT) at the store and they were nothing short of breath taking. Seriously, this is no exaggeration. I call &#8216;em as I see &#8216;em.</p>
<p>RemotePlay works like a charm and I had it setup in a jiffy. You can stream video and audio off to your PSP. No games support yet although I have read somewhere that one of the driving games allow you to use the PSP as a rearview mirror.</p>
<p>As I was used to the Xbox controller on my PC, the sixaxis felt awfully light in my hand. No complaints on the performance although they could have placed the analog sticks at different heights. The system comes with the USB cable that can be used to charge the controller. An additional use of the USB is to connect your PSP to the PS3. I immediately tried to use it to connect the PSP to my PC and guess what? It works! Some Playstation store downloads require your PSP to be connected to your PC to start the download. Now I can have them all.</p>
<p>Got the PS3 connected to the net, albeit, with a few trial and errors. The browser works on most of the sites. I was able to check my mail on Gmail and even the youtube videos played fine.</p>
<p>The GT 5 prologue comes in a Blu-ray disk. One of the things I hate about the PS3 is that it requires the game to be installed on the HDD before playing. But I guess its helps in faster loading times and less time spent in loading between levels. The GT installation shaved off a cool 6 GB of my hard disk. Standard DVD games wont take this much space of course. By the way the user space available on the PS3 is 37Gb (of 40GB); just like a PC.</p>
<p>Oh, did you know that you could install Linux on your PS3? From firmware 1.60 onwards, Sony lets you install a third party OS on the PS3. Read more <a href="http://www.playstation.com/ps3-openplatform/index.html">here</a>. I wonder what this means for homebrew. Hmmm.</p>
<h3>What I loved about the PS3:</h3>
<p><strong>Remote Play:</strong> The ability to stream videos and music wirelessly from the PS3 to your PSP is really cool. You can also connect the PSP to the net using your PS3</p>
<p><strong>Blu-Ray:</strong> I have to admit, this is probably THE feature that changed my mind. The next gen format war has ended with Blu-ray declared the winner. Microsoft who was in the HD-DVD camp (May its disturbed soul rest in peace.) decided to stop making HD-DVD players for the XBOX. And to add insult to injury, it tried to put up a bold front that they wont be considering Blu-ray players for the Xbox. Microsoft believes that HD downloads are the way to go in the future. All the best guys. 5 GB download. Hmmm sounds tempting. Come on guys, whom are you kidding? The PS3, on the other hand, has a really good Blu-ray player that comes inbuilt. Instant HD movies and games anyone?</p>
<p><strong>Wireless</strong>: The PS3 has wireless (Wi-Fi) connectivity built in. The XBOX requires a separate adapter.</p>
<p><strong>Impressive hardware:</strong> When you come to sheer hardware spec, the PS3 beats all other consoles in the market hands down. Now if only Sony could get developers to take advantage of that power. All that untapped power also means that your PS3 is a bit more future proof than your XBOX.</p>
<p><strong>No region protection for games:</strong> Two thumbs up for Sony for taking that decision. Now I can tell my cuz in the US to send me a game and it would simply work on my machine. A good way of cutting down on the piracy too.</p>
<p><strong>Reliability:</strong> I can see the XBOX fan boys leave the room when this word is mentioned. Cooling issues have been the bane of Xbox consoles. And with the ring of death it got a real bad name. Though you have to hand it to Microsoft; they agreed to replace all the broken consoles for free. And they have made real good progress in ensuring that it doesn&#8217;t happen again. But it comes no where near the PS3 when it comes to reliability. Read <a href="http://www.ps3vault.com/how-to-kill-a-ps3-console-1975">this article</a> to see what I mean.</p>
<p><strong>Slot loading drive:</strong> Not exactly a ground breaking feature. But its there and I love slot loading drives. No trays to break and it looks so suave. </p>
<p><strong>Bigger hard disk:</strong> The Xbox, even at 25 grand comes only with a 20 GB hard disk. For a mere thousand bucks more, the PS3 gives you 40.</p>
<p><strong>Silence:</strong> Whether you are watching a movie or playing a game, that&#8217;s all you would want to hear. The PS3 is quiet. The same cannot be said for the Xbox though.</p>
<p><span style="font-weight: bold">User replaceable HDD:</span> You can upgrade your PS3 HDD with a standard 3.5&quot; SATA HDD that&#8217;s available in the market. Its pretty simple actually. Watch <a href="http://www.youtube.com/watch?v=AuyQPW3bDS0">this video</a> to find out how. You can upgrade the XBOX HDD too but they are proprietary so you have to depend on Microsoft to release the capacity you want. </p>
<h3>What I didn&#8217;t quite like about the PS3:</h3>
<p><strong>The Controller:</strong> The Sixaxis that comes with the console has no rumble. All Xbox controllers have rumble by default. Of course you can buy a DualShock 3 controller which has the rumble functionality, separately. But hey, rumble is old news. We really don&#8217;t want to pay extra for it. Wake up guys! I personally like the Xbox controller better (I use it on my PC). The weight is just about right, the buttons feels sturdy and the analog controllers are placed at sensibly different heights. Not to mention the fact that you can hookup the wired headset directly to the controller. The Sixaxis feels cheap and light (not to mention the boring design) but gets the job done though.</p>
<p><strong>No backward compatibility:</strong> The 60 GB version had BC with PS2 games but they are no longer available around here. The 40 GB version has nothing, not even emulation. How do I play God of War 2? Simple. I cant.</p>
<p><strong>Title list not as long as Xbox&#8217;s:</strong> All right, All right, they don&#8217;t have Halo and Gears of war. Sigh! The one of the greatest games for the Playstation, God of War, is not available for the PS3 yet. But Sony is catching up, albeit, slowly. Heavenly sword is fantastic. And the DMC4 trailer looks great. Of all the drawbacks I have mentioned, this is the only one worth caring about. Sony better do something, and quick.</p>
<p><strong>Online Play:</strong> What online play? The Xbox wins in this section unchallenged, no questions asked.</p>
<p><strong>Untapped potential:</strong> The PS3 is technically superior but the games are yet to show it. Some games seem to look/run worse on the PS3 even though it has a better graphics sub system. Lost Planet is a classical example. Check out <a href="http://www.gamespot.com/ps3/action/lostplanet/review.html">this review</a> on Gamespot.</p>
<p>[<span style="font-style: italic">Author's note: Added May 6th 2008</span>]     </p>
<h2><span style="font-size: 130%">The Playstation 3 Vs Xbox 360 Question</span></h2>
<p> You want an unbiased short answer? Here it is: if you want to play some really neat games TODAY and you don&#8217;t care a hoot about anything else except games then an Xbox is your best bet. If you want an all in one entertainment solution which supports the next gen video format and you are willing to count on Sony to deliver on the untapped potential of their console then get a Playstation 3. Ok, that was not exactly short but you get the point. Of course its not as simple as how I put it but then again it never is and never will be. Prioritize on what you want and the choice will be a lot simpler. Oh and it would really help if you stayed away from the comments section of certain game sites where fan boys fight it out day in and day out without reaching any conclusion. (Some are real fun to read though). And you should definitely avoid them once you have made a purchase because no matter what console you bought, they will end up making you feel bad about it. Choose your console, buy couple of the best games on it, get a beer and start playing like there is no tomorrow.   </p>
<p><span style="font-style: italic">[End note]</span>   <br /> <br />
<h3>Conclusion</h3>
<p>Just one complaint. Not enough games. And considering the fact its a gaming console before anything else, that&#8217;s one hell of a complaint. Now that I have one, the only thing I can do is cross my fingers and pray.</p>
<p>If its an all round reliable home entertainment system you are looking for, well, look no further. If you are choosy about the games you play and the names of those games happen to be Halo and Gears of war (among others) then XBOX 360 is your best bet.</p>
<p>Oh I almost forgot, if you get a PS3, update your firmware first before doing anything else.</p>
<h3>CW Rating: 4 Widgets</h3>
<h3>Box Contents</h3>
<blockquote><ul>
<li>The Playstation 3 console system        </li>
<li>Sixaxis wireless controller (x1)        </li>
<li>USB Cable for the Controller        </li>
<li>HDMI to AV cable </li>
<li>Power Cable        </li>
<li>Instruction Manuals        </li>
<li>Gran Turismo 5 Prologue Blu-ray Disc </li>
</ul>
</blockquote>
<p><strong>Specs: <a title="http://www.us.playstation.com/PS3/About/Specs" href="http://www.us.playstation.com/PS3/About/Specs">http://www.us.playstation.com/PS3/About/Specs</a>       <br /></strong><strong>Price:</strong> INR 24,990     <br /><strong>Date:</strong> 19-April-2008</p>
</p>
<h3>Images</h3>
<table cellspacing="0" cellpadding="2" width="400" border="0">
<tbody>
<tr>
<td valign="top" width="133"><a href="http://lh3.ggpht.com/bobbyalex/SBTO-Hjq8gI/AAAAAAAAA3E/gu78eJx5cJI/DSCF02784.jpg"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="92" alt="PS3 - Gran Turismo Edition Box - Front" src="http://lh3.ggpht.com/bobbyalex/SBTO_Hjq8hI/AAAAAAAAA3M/8dikKMic6Cc/DSCF0278_thumb2.jpg" width="121" border="0" /></a> </td>
<td valign="top" width="133"><a href="http://lh4.ggpht.com/bobbyalex/SBTPAXjq8iI/AAAAAAAAA3U/kRPIZ6PDZCA/DSCF02814.jpg"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="92" alt="PS3 - Gran Turismo Edition Box - Back" src="http://lh4.ggpht.com/bobbyalex/SBTPBXjq8jI/AAAAAAAAA3c/OqUYdHVaYg0/DSCF0281_thumb2.jpg" width="121" border="0" /></a> </td>
<td valign="top" width="133"><a href="http://lh4.ggpht.com/bobbyalex/SBTPCXjq8kI/AAAAAAAAA3k/GLNvTE3VBXE/DSCF02883.jpg"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="92" alt="The original PS3 box inside the GT box!" src="http://lh3.ggpht.com/bobbyalex/SBTPDHjq8lI/AAAAAAAAA3s/5uzzJ8YlgS4/DSCF0288_thumb1.jpg" width="121" border="0" /></a> </td>
</tr>
<tr>
<td valign="top" width="133">PS3 &#8211; Gran Turismo Edition Box &#8211; Front</td>
<td valign="top" width="133">PS3 &#8211; Gran Turismo Edition Box &#8211; Back</td>
<td valign="top" width="133">The original PS3 box inside the GT box!</td>
</tr>
<tr>
<td valign="top" width="133"><a href="http://lh4.ggpht.com/bobbyalex/SBTPEXjq8mI/AAAAAAAAA30/2_g306qoUwc/DSCF02903.jpg"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="92" alt="The PS3 in all its shiny glory" src="http://lh4.ggpht.com/bobbyalex/SBTPFXjq8nI/AAAAAAAAA38/5zaM0tIQUPw/DSCF0290_thumb1.jpg" width="121" border="0" /></a> </td>
<td valign="top" width="133"><a href="http://lh5.ggpht.com/bobbyalex/SBTPGnjq8oI/AAAAAAAAA4E/FaLPCo2QkiQ/DSCF02913.jpg"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="92" alt="Playstation 3. Oh yeah!" src="http://lh5.ggpht.com/bobbyalex/SBTPHnjq8pI/AAAAAAAAA4M/BgPPZ4PYGAw/DSCF0291_thumb1.jpg" width="121" border="0" /></a> </td>
<td valign="top" width="133"><a href="http://lh6.ggpht.com/bobbyalex/SBTPI3jq8qI/AAAAAAAAA4U/NE8V7Tm6zdc/DSCF0293_MOD3.jpg"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="92" alt="Box contents" src="http://lh5.ggpht.com/bobbyalex/SBTPJnjq8rI/AAAAAAAAA4c/lzBc7ha0CUI/DSCF0293_MOD_thumb1.jpg" width="121" border="0" /></a> </td>
</tr>
<tr>
<td valign="top" width="133">The PS3 in all its shiny glory</td>
<td valign="top" width="133">Playstation 3. Oh yeah!</td>
<td valign="top" width="133">Box contents</td>
</tr>
</tbody>
</table>
<h3></h3>
<p><strong>Happy Gaming      <br /></strong><em><strong><span style="color: rgb(0,128,128)">Alex</span></strong></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2008/04/impressions-playstation-3-gran-turismo.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Report: Microsoft.com on Firefox</title>
		<link>http://www.discretevector.com/2008/04/report-microsoftcom-on-firefox.html</link>
		<comments>http://www.discretevector.com/2008/04/report-microsoftcom-on-firefox.html#comments</comments>
		<pubDate>Mon, 14 Apr 2008 05:28:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Reports]]></category>

		<guid isPermaLink="false">http://discretevector.com/2008/04/report-microsoft-com-on-firefox.html</guid>
		<description><![CDATA[This is as good as it gets: Firefox on my machine cannot open Microsoft.com! Have a look at the screenshot below. Microsoft.com on Firefox (2.0.0.13) Microsoft.com on IE6 Microsoft.com on Safari The page just says Runtime Error and dumps the standard Aspx error text. I cleared the Firefox cache, cookies&#8230; everything, even reinstalled the damn [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>This is as good as it gets: Firefox on my machine cannot open Microsoft.com! Have a look at the screenshot below.</p>
<table border="0" cellpadding="2" cellspacing="0" width="385">
<tbody>
<tr>
<td valign="top" width="132"><a href="http://lh6.ggpht.com/bobbyalex/SAOT_33rWJI/AAAAAAAAA1s/eDAIJ9YRLLs/ms%20on%20firefox%5B3%5D.jpg"><img style="border-width: 0px;" alt="Microsoft.com on Firefox" src="http://lh6.ggpht.com/bobbyalex/SAOUA33rWKI/AAAAAAAAA10/CsDEA6BqqV8/ms%20on%20firefox_thumb%5B1%5D.jpg" border="0" width="109" height="86" /></a> </td>
<td valign="top" width="133"><a href="http://lh6.ggpht.com/bobbyalex/SAOUE33rWLI/AAAAAAAAA18/I7OUfnNxlS4/ms%20in%20IE%5B3%5D.jpg"><img style="border-width: 0px;" alt="Microsoft.com in IE6" src="http://lh5.ggpht.com/bobbyalex/SAOUGn3rWMI/AAAAAAAAA2E/vXA6NrpV1kU/ms%20in%20IE_thumb%5B1%5D.jpg" border="0" width="109" height="86" /></a> </td>
<td valign="top" width="118"><a href="http://lh6.ggpht.com/bobbyalex/SAOUM33rWNI/AAAAAAAAA2M/Fl8o4OrgHQQ/ms%20in%20safari%5B5%5D.jpg"><img style="border-width: 0px;" alt="Microsoft.com in Safari" src="http://lh6.ggpht.com/bobbyalex/SAOUO33rWOI/AAAAAAAAA2U/Ynr58l70v-8/ms%20in%20safari_thumb%5B3%5D.jpg" border="0" width="109" height="86" /></a> </td>
</tr>
<tr>
<td valign="top" width="132">Microsoft.com on Firefox (2.0.0.13)</td>
<td valign="top" width="133">Microsoft.com on IE6</td>
<td valign="top" width="118">Microsoft.com on Safari</td>
</tr>
</tbody>
</table>
<p>The page just says Runtime Error and dumps the standard Aspx error text. I cleared the Firefox cache, cookies&#8230; everything, even reinstalled the damn thing but to no avail.</p>
<p>I wonder if its a case of Firefox hating Microsoft or vice versa. Just kidding. I am sure there is a reasonable explanation to it although I am yet to figure it out. I have reported the problem to Mozilla but no word from them yet. If I figure out the problem, I shall update it here. In the mean time if any of you is facing this issue, please leave a comment.</p>
<p>But really, you have to admire the beauty of the problem.</p>
<p>Happy Surfing,   <br /><strong><em>Alex</em></strong></p>
<blockquote><h3>Update: 17 April 2008</h3>
<p> It seems the trouble was because of a corrupt profile. I uninstalled Firefox once more but this time deleted the leftover installation folder in Program Files and the profile data in C:\Documents and Settings\&lt;username&gt;\Application Data\Mozilla. Then I reinstalled Firefox and viola! microsoft.com in all its glory.</p>
<table border="0" cellpadding="2" cellspacing="0" width="146">
<tbody>
<tr>
<td valign="top" width="144"><a href="http://lh4.ggpht.com/bobbyalex/SAeJ4X3rWPI/AAAAAAAAA20/9pa1CPq4fig/ms%20on%20firefox_fixed%5B8%5D.jpg"><img style="border: 0px none ;" alt="ms on firefox_fixed" src="http://lh4.ggpht.com/bobbyalex/SAeJ6X3rWQI/AAAAAAAAA28/BolXTKgDm0U/ms%20on%20firefox_fixed_thumb%5B4%5D.jpg" border="0" width="133" height="105" /></a> </td>
</tr>
<tr>
<td valign="top" width="144">Its alive!</td>
</tr>
</tbody>
</table>
<p> 
<p>Incidentally, doing the above procedure cleared up some of the slow browsing issues I have been having. So if you have been using Firefox for some time now, this activity might be good idea. Warning: Doing so will delete all your saved data, addons, themes, customizations etc, so make sure that you take a backup of the Mozilla folder under Application Data before attempting this.</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2008/04/report-microsoftcom-on-firefox.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Review: Fuji FinePix S9600</title>
		<link>http://www.discretevector.com/2008/04/review-fuji-finepix-s9600.html</link>
		<comments>http://www.discretevector.com/2008/04/review-fuji-finepix-s9600.html#comments</comments>
		<pubDate>Wed, 09 Apr 2008 19:52:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[Camera]]></category>
		<category><![CDATA[Fuji Finepix S9600]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Reviews]]></category>

		<guid isPermaLink="false">http://discretevector.com/2008/04/review-fuji-finepix-s9600.html</guid>
		<description><![CDATA[So there I was, out with my friends on a day trip. I had my handy Kodak V570 with me and was all set for some great nature photography. But to my dismay I found myself short handed during some of the shots. Oh, only if I could zoom a bit more, that failed macro [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>So there I was, out with my friends on a day trip. I had my handy Kodak V570 with me and was all set for some great nature photography. But to my dismay I found myself short handed during some of the shots. Oh, only if I could zoom a bit more, that failed macro shot which I just couldn&#8217;t get right, ahh the luxury of going manual. Lets face it, there were so many times where the &#8216;Auto&#8217; was just not good enough.</p>
<p>So when I got back I told myself, never again! I was going to get myself something more decent than a compact. Several reviews later I had my mind all set for a Canon S5 IS or a Panasonic FZ 18. More latter than the former. But alas, the next day found me hunting all the large electronic stores in Bangalore with no luck. The FZ 18 was not to be found anywhere and the S5 IS was not in stock.</p>
<p>So finally I ended up in Whizz (The Forum) where I had bought my previous camera from. The guy said that he could get me the S5 IS in a couple of days but in the meantime he asked me to check out one of his personal favorites, and out came the Fuji S9600.</p>
<p>You wont be blamed for mistaking it for a SLR. Weighing 650gm and at 128x93x129 mm this camera falls in the bridge or prosumer category. The one thing that struck me that most and biased my buying decision towards this camera was the manual zoom. Not many bridge cameras have manual zoom, not even the S5 IS and for that matter, no other cameras in that shop! (except for the SLRs of course).</p>
<p>The shop assistant was pretty knowledgeable when it came to cameras. Some of the other shops I went to had pretty girls who didn&#8217;t know the difference between aperture and hair spray. (For all they know, aperture might be a very expensive manicure)</p>
<p>He let me play with it for sometime to get the feel of it. For a big camera, it fits well into your hand. The controls are easy to reach but the buttons could have been a little big bigger and slightly raised. The manual zoom was a joy to use and it really gives you that extra flexibility in terms of zoom. Electronic zooming moves the lens in steps and sometimes you end up with too much or too less and that can be a disadvantage especially in macro shots. And of course, there is the saving on the battery to consider.</p>
<p>There is virtually no shutter lag and the time between shots are less than 1.5 seconds. The lens&#8217;s focal length of 28 &#8211; 300 mm can give sufficiently wide shots as well as telephoto ones. Saves on the trouble of having to carry separate lenses (and get dust into your camera in the process)</p>
<p>The standard manual modes such as Aperture priority, Shutter priority, Programmed as well as manual is available.</p>
<p>The shots were great in auto and personally, excellent in manual. Very less noise in higher ISOs. The pictures are sharp and if you don&#8217;t like what you see, there is always the manual focus. The S9600 lacks optical image stabilization. An anti-shake mode is present but not as effective as optical stabilization on the S5 IS.</p>
<p>The one gripe I have about the S9600 is the flexibility of the display. It can be shifted to only three predefined positions unlike the S5 IS which allows the screen to be turned on an axis.</p>
<p>At its highest resolution (9MP Fine mode) images sizes were around 4 &#8211; 4.5 MB and in normal mode takes around 2.5 MB. RAW shots will take up to a whopping 18 MB per picture.</p>
<p>The camera uses CF and xD. CF comes for around 850 Rs for 1 Gig. xD is more than a grand for the same capacity. Get nothing less than one GB if you are buying cameras in this range. More if you can afford it. If you take videos at max resolution, your 1GB card will last you only for approximately 30 minutes.</p>
<p>Overall I was impressed with the camera. But I don&#8217;t like to be hasty when it comes to expensive buys. The sales guy (who spent a good half an hour with me) was nice enough to tell me to take my time, check out a few more reviews and then come back.</p>
<p>I did exactly that. And the next time I went to that shop, it was to walk out as a proud owner of a Fuji S9600.</p>
<p><strong>PS:</strong> A strong warning. This camera is not for people who believe that expensive cameras automatically create great looking pictures. If you are the type who goes click click clicking on auto, this is not the camera for you. Stick to you compact. If you don&#8217;t have the patience with experimenting with manual focus, ISOs and such, give this one a wide berth. For such people, my Kodak v570 is for sale. If you are interested, drop me a mail.</p>
<p><span style="font-weight: bold;">Product Rating: 4 Widgets</span></p>
<p><strong>Happy Shooting,     <br /><em><span style="color:#008040;">Alex</span></em></strong></p>
<h3>Specs</h3>
<table border="0" cellpadding="2" cellspacing="0" width="400">
<tbody>
<tr>
<td valign="top" width="150">Pixels</td>
<td valign="top" width="248">9 MegaPixels (Effective)</td>
</tr>
<tr>
<td valign="top" width="150">Zoom</td>
<td valign="top" width="248">10.7X optical zoom (Manual)</td>
</tr>
<tr>
<td valign="top" width="150">CCD</td>
<td valign="top" width="248">1/1.6&#8243; Super CCD HR</td>
</tr>
<tr>
<td valign="top" width="150">Aperture</td>
<td valign="top" width="248">F2.8 &#8211; F11</td>
</tr>
<tr>
<td valign="top" width="150">Display</td>
<td valign="top" width="248">2 Inch (3 positions)</td>
</tr>
<tr>
<td valign="top" width="150">Maximum resolution</td>
<td valign="top" width="248">3488&#215;2616 at 9 MP</td>
</tr>
<tr>
<td valign="top" width="150">File format</td>
<td valign="top" width="248">JPG and RAW</td>
</tr>
<tr>
<td valign="top" width="150">Storage</td>
<td valign="top" width="248">xD, Compact Flash/Microdrive</td>
</tr>
<tr>
<td valign="top" width="150">Focal Length</td>
<td valign="top" width="248">28-300 mm (35mm Eqv)</td>
</tr>
<tr>
<td valign="top" width="150">Shutter Speed</td>
<td valign="top" width="248">30s &#8211; 1/4000s (Manual)</td>
</tr>
<tr>
<td valign="top" width="150">Video recording</td>
<td valign="top" width="248">640&#215;480 @ 30fps</td>
</tr>
<tr>
<td valign="top" width="150">Weight</td>
<td valign="top" width="248">650 gm</td>
</tr>
<tr>
<td valign="top" width="150">Power</td>
<td valign="top" width="248">4 AA Alkaline</td>
</tr>
<tr>
<td valign="top" width="150">Warranty</td>
<td valign="top" width="248">2 Years</td>
</tr>
<tr>
<td valign="top" width="150">Home Page</td>
<td valign="top" width="248"><a href="http://www.fujifilm.com/products/digital_cameras/s/finepix_s9600/index.html" target="_blank">Fuji Finepix S9600</a></td>
</tr>
<tr>
<td valign="top" width="150">Price (April 2008)</td>
<td valign="top" width="248"><strong>Rs 22000/-</strong></td>
</tr>
</tbody>
</table>
<h3>What&#8217;s in the Box:</h3>
<blockquote><p>The Camera (Duh!)     <br />Lens Cap      <br />Lens Cap Holder (Strap Attachment)      <br />Lens Hood      <br />Shoulder Strap      <br />A/V Cable      <br />USB Cable      <br />Owner&#8217;s Manual      <br />Software &amp; Drivers CD ROM (Picture viewer, RAW file converter)      </p>
</p>
<p>The following additional accessories were thrown in when I bought the camera and are not part of the standard package     </p>
</p>
<p>FujiCell AA Ni-MH Rechargeable Batteries (x4)     <br />FujiCell Battery charger      <br />Camera Pouch      </p>
</blockquote>
<h3>Pictures</h3>
<p>The pictures of the S9600 were taken with a <a href="http://www.kodak.com/eknec/PageQuerier.jhtml?pq-path=7402&amp;pq-locale=en_US&amp;_requestid=899" target="_blank">Kodak V570</a>. The Sample photos were, of course, taken with the S9600</p>
<table border="0" cellpadding="2" cellspacing="0" width="394">
<tbody>
<tr>
<td valign="top" width="202">
<h4><a href="http://lh4.google.com/bobbyalex/R_0Zev3wefI/AAAAAAAAAxg/ak_Cmo0t--k/100_1165%5B1%5D.jpg"><img style="border-width: 0px;" alt="100_1165" src="http://lh4.google.com/bobbyalex/R_0VOv3weAI/AAAAAAAAAxo/WvGfDIdAe-Y/100_1165_thumb%5B1%5D.jpg" border="0" height="141" width="187" /></a> </h4>
</td>
<td valign="top" width="190">
<h4><a href="http://lh6.google.com/bobbyalex/R_0VTP3weBI/AAAAAAAAAxs/Hy1NXtPwxSI/100_1149%5B1%5D.jpg"><img style="border-width: 0px;" alt="100_1149" src="http://lh3.google.com/bobbyalex/R_0VVf3weCI/AAAAAAAAAxw/2GjoP11MWeM/100_1149_thumb%5B1%5D.jpg" border="0" height="141" width="187" /></a> </h4>
</td>
</tr>
<tr>
<td valign="top" width="206">
<h4><a href="http://lh5.google.com/bobbyalex/R_0Vb_3weDI/AAAAAAAAAx0/Oi0NJzP-TpM/100_1150%5B1%5D.jpg"><img style="border-width: 0px;" alt="100_1150" src="http://lh5.google.com/bobbyalex/R_0Vd_3weEI/AAAAAAAAAx4/uSa15zanSQo/100_1150_thumb%5B1%5D.jpg" border="0" height="141" width="187" /></a></h4>
</td>
<td valign="top" width="190">
<h4><a href="http://lh5.google.com/bobbyalex/R_0V0_3weJI/AAAAAAAAAx8/jXEz1WyigZc/100_1153.jpg"><img style="border-width: 0px;" alt="100_1153" src="http://lh5.google.com/bobbyalex/R_0V2_3weKI/AAAAAAAAAyA/pMjUEXMMxmw/100_1153_thumb.jpg" border="0" height="141" width="187" /></a></h4>
</td>
</tr>
<tr>
<td valign="top" width="209">
<h4><a href="http://lh5.google.com/bobbyalex/R_0Vg_3weFI/AAAAAAAAAyE/-9BKkA2vkYw/100_1151%5B1%5D.jpg"><img style="border-width: 0px;" alt="100_1151" src="http://lh5.google.com/bobbyalex/R_0Vn_3weGI/AAAAAAAAAyI/EMnx_Gx-bfY/100_1151_thumb%5B1%5D.jpg" border="0" height="141" width="187" /></a> </h4>
</td>
<td valign="top" width="190">
<h4><a href="http://lh4.google.com/bobbyalex/R_0Vtv3weHI/AAAAAAAAAyM/N4lF9_OMl_0/100_1152%5B1%5D.jpg"><img style="border-width: 0px;" alt="100_1152" src="http://lh4.google.com/bobbyalex/R_0Vxv3weII/AAAAAAAAAyQ/-DfK5FeT8o8/100_1152_thumb%5B1%5D.jpg" border="0" height="141" width="187" /></a> </h4>
</td>
</tr>
<tr>
<td valign="top" width="211">
<h4><a href="http://lh5.google.com/bobbyalex/R_0V5_3weLI/AAAAAAAAAyU/Qjwh21hxgEk/100_1154%5B1%5D.jpg"><img style="border-width: 0px;" alt="100_1154" src="http://lh5.google.com/bobbyalex/R_0V7_3weMI/AAAAAAAAAyY/Do4t9kj3Gkc/100_1154_thumb%5B1%5D.jpg" border="0" height="141" width="187" /></a> </h4>
</td>
<td valign="top" width="190">
<h4><a href="http://lh6.google.com/bobbyalex/R_0V_P3weNI/AAAAAAAAAyc/Jfce9ZegNY8/100_1155%5B1%5D.jpg"><img style="border-width: 0px;" alt="100_1155" src="http://lh3.google.com/bobbyalex/R_0WBf3weOI/AAAAAAAAAyg/IhNQblXe4NI/100_1155_thumb%5B1%5D.jpg" border="0" height="248" width="187" /></a> </h4>
</td>
</tr>
<tr>
<td valign="top" width="213">
<h4><a href="http://lh3.google.com/bobbyalex/R_0bHf3wegI/AAAAAAAAAyk/zCgtoE22o5Y/100_1159%5B1%5D.jpg"><img style="border-width: 0px;" alt="100_1159" src="http://lh3.google.com/bobbyalex/R_0WMf3weSI/AAAAAAAAAys/jFaF69b03qk/100_1159_thumb%5B1%5D.jpg" border="0" height="141" width="187" /></a> </h4>
</td>
<td valign="top" width="190">
<h4><a href="http://lh6.google.com/bobbyalex/R_0WRP3weTI/AAAAAAAAAyw/TVvNW24YRaE/100_1161%5B1%5D.jpg"><img style="border-width: 0px;" alt="100_1161" src="http://lh3.google.com/bobbyalex/R_0WUf3weUI/AAAAAAAAAy0/1NRLTAA7urM/100_1161_thumb%5B1%5D.jpg" border="0" height="141" width="187" /></a> </h4>
</td>
</tr>
<tr>
<td valign="top" width="214">
<h4><a href="http://lh5.google.com/bobbyalex/R_0XE_3weVI/AAAAAAAAAy4/ovSPFavMS3M/100_1163%5B1%5D.jpg"><img style="border-width: 0px;" alt="100_1163" src="http://lh4.google.com/bobbyalex/R_0XGv3weWI/AAAAAAAAAy8/L8gFZiM-MIU/100_1163_thumb%5B1%5D.jpg" border="0" height="141" width="187" /></a></h4>
</td>
<td valign="top" width="190">
<h4><a href="http://lh3.google.com/bobbyalex/R_0WFf3wePI/AAAAAAAAAzA/l7S5sjivuho/100_1157%5B1%5D.jpg"><img style="border-width: 0px;" alt="100_1157" src="http://lh4.google.com/bobbyalex/R_0WHv3weQI/AAAAAAAAAzE/0EvvYoQMjus/100_1157_thumb%5B1%5D.jpg" border="0" height="141" width="187" /></a></h4>
</td>
</tr>
<tr>
<td valign="top" width="215">
<h4><a href="http://lh3.google.com/bobbyalex/R_0XLf3weXI/AAAAAAAAAzI/i7j38j0kVQg/100_1147%5B1%5D.jpg"><img style="border-width: 0px;" alt="100_1147" src="http://lh4.google.com/bobbyalex/R_0XNv3weYI/AAAAAAAAAzM/KgpTJWUNCSw/100_1147_thumb%5B1%5D.jpg" border="0" height="141" width="187" /></a> </h4>
</td>
<td valign="top" width="190">
<h4><a href="http://lh6.google.com/bobbyalex/R_0XQP3weZI/AAAAAAAAAzQ/ZeCjoJgK1pc/100_1148%5B1%5D.jpg"><img style="border-width: 0px;" alt="100_1148" src="http://lh5.google.com/bobbyalex/R_0XS_3weaI/AAAAAAAAAzU/NQ5NX-Ncj04/100_1148_thumb%5B1%5D.jpg" border="0" height="141" width="187" /></a> </h4>
</td>
</tr>
<tr>
<td valign="top" width="216">
<h4>Sample Photos</h4>
</td>
<td valign="top" width="190"> </td>
</tr>
<tr>
<td valign="top" width="217"><a href="http://picasaweb.google.com/bobbyalex/CodeWidgets02/photo?authkey=FNNKbvDgoyo#5187652900996807202" target="_blank"><img style="border: 0px none ;" alt="DSCF0015" src="http://lh3.ggpht.com/bobbyalex/SADW7v3wekI/AAAAAAAAA1g/Z-RQkVRBds0/DSCF0015%5B1%5D.jpg" border="0" height="141" width="187" /></a> </td>
<td valign="top" width="190"><a href="http://picasaweb.google.com/bobbyalex/CodeWidgets02/photo?authkey=FNNKbvDgoyo#5188382216508439090"><img style="border: 0px none ;" alt="DSCF0022" src="http://lh4.ggpht.com/bobbyalex/R_0Xcv3weeI/AAAAAAAAA1o/joGvLThur5c/DSCF0022%5B1%5D.jpg" border="0" height="141" width="187" /></a> </td>
</tr>
<tr>
<td valign="top" width="217">Mode: Auto, Flash: On, Lighting: Fluorescent         <br />9MP (N)</td>
<td valign="top" width="190">Mode: Auto, Flash: Off, Lighting: Fluorescent         <br />9MP (N)</td>
</tr>
</tbody>
</table>
<h3>More reviews</h3>
<p><a href="http://www.trustedreviews.com/digital-cameras/review/2007/01/31/Fujifilm-FinePix-S9600/p1" target="_blank">TrustedReviews</a></p>
<p><a href="http://www.dpreview.com/news/0608/06082412fujis9600.asp" target="_blank">DPReview</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2008/04/review-fuji-finepix-s9600.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Report: Ready At Dawn&#8217;s Last PSP Game</title>
		<link>http://www.discretevector.com/2008/03/report-ready-at-dawn-last-psp-game.html</link>
		<comments>http://www.discretevector.com/2008/03/report-ready-at-dawn-last-psp-game.html#comments</comments>
		<pubDate>Sun, 30 Mar 2008 04:33:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[Console Gaming]]></category>
		<category><![CDATA[Gaming]]></category>
		<category><![CDATA[PSP]]></category>
		<category><![CDATA[Ready At Dawn]]></category>
		<category><![CDATA[Reports]]></category>

		<guid isPermaLink="false">http://discretevector.com/2008/03/report-ready-at-dawns-last-psp-game.html</guid>
		<description><![CDATA[Ready at Dawn studios has announced that God of War: Chains of Olympus will be their last game for the PSP. The God of War developer said that they will be moving to other projects and will begin to work on ideas for other consoles. Ready At Dawn developed two of the best games for [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.readyatdawn.com/"><img style="border: 0px none ; width: 254px;" alt="Ready At Dawn Logo" src="http://lh4.google.com/bobbyalex/R-_Hs3jB3RI/AAAAAAAAAlI/ZOjDnLxbdGs/readyatdawnlogo.jpg" border="0" height="48" width="198" /></a> Ready at Dawn studios has announced that God of War: Chains of Olympus will be their last game for the PSP. The God of War developer said that they will be moving to other projects and will begin to work on ideas for other consoles.</p>
<p>Ready At Dawn developed two of the best games for the Playstation Portable: Daxter and God of War: Chains of Olympus. They set the bar for the rest of the developers for the PSP, and they set it really, really high. I am yet to see another developer who has released a game for the console which has won so much acclaim.</p>
<p>Graphics, game play &#8230; you name it, they are the benchmark to beat.</p>
<p>Kudos to you guys and all the best in your future ventures.</p>
<p>PS: I am crossing my fingers and hoping against all hopes that they will change their mind <img src="http://www.discretevector.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /> </p>
<p>Read the full statement <a href="http://www.readyatdawn.com/news.php">here</a></p>
<p>Happy Gaming,   <br /><strong><em><span style="color: rgb(0, 128, 0);">Alex</span></em></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2008/03/report-ready-at-dawn-last-psp-game.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Impressions: Is PC Gaming Dying?</title>
		<link>http://www.discretevector.com/2008/03/impressions-is-pc-gaming-dying.html</link>
		<comments>http://www.discretevector.com/2008/03/impressions-is-pc-gaming-dying.html#comments</comments>
		<pubDate>Fri, 21 Mar 2008 20:00:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[Console Gaming]]></category>
		<category><![CDATA[Gaming]]></category>
		<category><![CDATA[Impressions]]></category>
		<category><![CDATA[PC Gaming]]></category>

		<guid isPermaLink="false">http://discretevector.com/2008/03/impressions-is-pc-gaming-dying.html</guid>
		<description><![CDATA[I bought Crysis a couple of months back. And now its sitting snug in my cupboard along with my other games. The only difference is that I have PLAYED all my other games. Crysis, on the other hand, turned out to be too high and mighty to be played on my computer&#8230; at least at [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I bought Crysis a couple of months back. And now its sitting snug in my cupboard along with my other games. The only difference is that I have PLAYED all my other games. Crysis, on the other hand, turned out to be too high and mighty to be played on my computer&#8230; at least at an acceptable frame rate and with decent visual effects. </p>
<p>Don&#8217;t get me wrong, my computer is by no means underpowered: It runs a decent Core2 duo 2.2 Ghz processsor (overclocked to 2.6), 1 Gig of RAM and a nVidia 8600 GT graphics card with 256 MB VRAM (slightly overclocked). It meets (and in some cases exceeds) the required configuration for playing <a href="http://www.ea.com/crysis/home.jsp">Crysis</a>. But guess what, the game stutters all the way. It struggles as if I was forcing it to be run on a Pentium 3 machine. I mean, this is a machine that runs <a href="http://www.2kgames.com/bioshock/">Bioshock</a> with most of the visual effects turned on and it doesn&#8217;t even break a sweat. <a href="http://www.quake4game.com/">Quake 4</a>? Check. <a href="http://half-life2.com/">Halflife-2</a>? Check.</p>
<p> Sure, I could probably manage to play it with all the graphics dumbed down. But that&#8217;s not what I bought Crysis for. What happened to all the mind boggling visuals you saw in the <a href="http://www.gamespot.com/pc/action/crysis/media.html?om_act=convert&amp;om_clk=tabs&amp;tag=tabs;videos">videos</a>? I wonder how many people on earth managed to got to see that on their own computer screens. Not many I assure you.</p>
<p>PC game developers need to wake up face reality. What is the point of churning out visually great games if the only people who can play it are the ones with Alienware machines? How many people at least have the configuration that I have?</p>
<p>As a result of this we are now seeing a shift in trend. Gamers are seemingly moving away from the PC and setting their sights on consoles like the XBOX or PS3.</p>
<p>The good thing with consoles is that it puts all gamers under a common belt. Halo 3 will look as good on your machine as mine. No more boasting about the rig that you have. Consoles give you a certain amount of future proofing. At least for a couple of years. No more running around for component upgrades the moment the latest title hits the shelves. </p>
<p>This is exactly where the problem lies with PC game developers. They consider a PC to be an infinitely extendable platform. This is true to a certain extent. Components can be upgraded or replaced to run the latest and greatest games. And hardware developers like Intel and nVidia will only be too glad to churn out the new processors to up the ante.</p>
<p>But at what cost? I bought my graphics card for a premium towards the end of last year and it struggles to run a game released around the same time frame! Outrageous. I do admit that PC graphics are unrivalled. The kind of eye candy you can achieve by using a top of the line graphics card cannot be attained even on the PS3 which is (at least hardware spec wise ) the most powerful console to date. A classic example is <a href="http://games.teamxbox.com/xbox-360/1396/Crysis/">Crysis for the Xbox</a> which currently under development. It is not a port of the PC version because the XBOX has no support for DirectX 10. And I personally feel that the other real reason is that the XBOX cannot handle that kind of graphics. Period.</p>
<p> Also, some PC games don&#8217;t get released for the consoles. Even if they do, it may be well after the PC release. Not to mention the fact that it may not be released for the console you have (such as Halo, which is exclusive to the XBOX). Of course, the other way round is also true. Some games are released exclusively for consoles.</p>
<p>So unless PC game developers take a long hard look at the kind of system requirements their games are dictating and do something about it, we will soon see a shift in camps. I have been a loyal PC fan all these years. (where else would I play Age of Empires ?!) But with the kind of games that are being released for the consoles these days and the fact that games released for a console are GUARANTEED to work on that console (try saying that for a PC), I shall soon be in the market for an XBOX 360 or a PS3.</p>
<p>I wonder what TV I should buy to go with it. Hmm.</p>
<p>And as for Age of Empires? Well&#8230; my friend still plays that on a P3 celeron machine with all of 64 MB of RAM.</p>
<p>Happy Gaming, <br /><strong><em>Alex</em></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2008/03/impressions-is-pc-gaming-dying.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mind Your Language: Naming Conventions in C#</title>
		<link>http://www.discretevector.com/2008/03/mind-your-language-naming-conventions.html</link>
		<comments>http://www.discretevector.com/2008/03/mind-your-language-naming-conventions.html#comments</comments>
		<pubDate>Sun, 16 Mar 2008 03:16:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[camel case]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[naming conventions]]></category>
		<category><![CDATA[pascal case]]></category>

		<guid isPermaLink="false">http://discretevector.com/2008/03/mind-your-language-naming-conventions-in-c.html</guid>
		<description><![CDATA[Ever heard of the infinite monkey theorem? A smart guy called Emile Borel introduced it in one of his books on probability. It goes something like this: &#8220;If you have enough monkeys banging randomly on typewriters, they will eventually type the works of William Shakespeare&#8221; Well now that&#8217;s quite something isn&#8217;t it? This got me [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Ever heard of the infinite monkey theorem? A smart guy called Emile Borel introduced it in one of his books on probability. It goes something like this:</p>
<p>&#8220;If you have enough monkeys banging randomly on typewriters, they will eventually type the works of William Shakespeare&#8221;</p>
<p>Well now that&#8217;s quite something isn&#8217;t it? This got me wondering: If you can get them to write a play, maybe we can get them to write code! Before you start panicking, let me rest assure you that what is stated in the theorem is, well, quite impossible. If I get the time, I shall try to do an edition of Code Widgets describing why.</p>
<p>But even though it is impossible for the primates to code like us, we have shown time and again that we are fully capable of producing the same &#8216;quality&#8217; of code that they can. (But then again, if you pay people peanuts then&#8230; well, you get the point)</p>
<p>Writing great code is a talent; writing code that doesn&#8217;t look like Greek&#8230; well that&#8217;s an art. </p>
<p>In this edition of Code Widgets, we shall look at naming conventions used in C#. Naming conventions go a long way in writing clean, understandable and code that is easy to maintain.</p>
<p>Remember: the objective of your code should NOT only be to get the functionality working somehow. If this is your mind set, congratulations; you are well on your way to joining a long list mediocre programmers whose code is seldom read by fellow programmers unless there is a gun to their head.</p>
<p>The naming conventions described in this article are largely based on Microsoft&#8217;s suggested naming conventions for .net. Microsoft&#8217;s conventions concentrate largely on how classes and other public types should be named. There are some gray areas in it which I shall try to supplement using commonly accepted practices.</p>
<h3><strong>Hungarian Naming Convention</strong></h3>
<p>The Hungarian naming convention is dead. Well that is that and we can get on with our lives now. The practice of prefixing variable names with their types may have had its uses for a while but it soon became unwieldy. I mean who would want to remember a variable named lpszInterfaceLogFile. There are extensions to this convention that originated sometime around when VB became popular. This included prefixing all variable names with three letter types such as strName (come on admit it, how many times have you used this in C++?), arrItems for array of items. Then people started prefixing EVERYTHING with three letters such as database tables with t_ or tbl_ ! I mean, come on, if you hadn&#8217;t prefixed it would you have mistaken the name for a&#8230; window handle?!!</p>
<p>Microsoft itself has given up on this convention. So what this means in .net is, well, sensible looking variable names. a variable name to store a user name would simply be userName; no str prefix, no sz, nothing.</p>
<h3>Casing</h3>
<p>The first thing to remember is casing. .net follows both Camel casing and Pascal casing. Camel casing specifies that the first letter of your identifier should be in lower case. If the identifier consists of more than one word, the beginning of each other word should be in upper case.</p>
<p>For eg: myUserAccount</p>
<p>Observe that m is small and U and A are caps.</p>
<p>Pascal casing is similar except that the first letter is capital. The rest of the words follow the same rule as camel casing.</p>
<p>For eg: GetUserAccountInformation</p>
<p>Observe that G,U,A and I are in uppercase.</p>
<p>Class names, structs, enums use Pascal casing whereas method parameters, local variables use camel casing.</p>
<h3>Acronyms/Abbreviations</h3>
<p>Use only well known acronyms such as html, xml etc. You should use camel or Pascal casing for acronyms that are more that two characters long.</p>
<p>So <em>htmlDocument</em> or <em>HtmlDocument</em> instead of <em>HTMLDocument</em></p>
<p>Two letter acronyms should be capitalized.</p>
<p>So <em>diskIO</em> NOT <em>diskIo</em>.</p>
<p>There is a popular argument going around regarding the fate of &#8216;ID&#8217;. Should it be batchID or batchId? Since it has only two letters it might seem that batchID is the correct version. But this is not the case. Contrary to popular belief, ID is an abbreviation for identification and not an acronym. Hence it should be batchId and not batchID. Hope I have cleared this for once and for all. Arguments are welcome as comments.</p>
<p>Avoid abbreviations at all costs for variable names and methods. Abbreviations cause a lot of confusion, are hard to maintain and makes no sense to anybody except you. A month down the line it wouldn&#8217;t make sense to you either!</p>
<p>So instead of <em>InitSrvHandler()</em>, you should expand it to <em>InitializeServerHandler()</em>. Don&#8217;t try to save on a few keystrokes at the cost of clarity.</p>
<h3>Underscores</h3>
<p>The rule for using underscores is simple: Don&#8217;t use them. Ever. The only exception for this rule is for private class members. Private class members should use camel casing <strong>prefixed with an _</strong>(underscore). This also means that the C++ convention of using <strong>m_ has been discarded</strong>. Good riddance!</p>
<h3>Spell Check</h3>
<p>I despair when I see code that is rampant with bad spellings. It shows how careless and disinterested you are with the code you are writing. Sure, theoretically anything can be a variable name. It doesn&#8217;t have to make sense. After all, the compiler doesn&#8217;t give a fig whether you name a method FormatFile() and FomatFile(). But think of your poor fellow programmer who might need to make sense of your code. I have lost track of the times when I take a glance at a method I need to call, assume that it is spelt properly and go ahead and use it, only to get a compilation error saying the method has not been defined.</p>
<p>So the rule is that every word that makes up your variable name should ideally be a word in the dictionary. Exceptions can be made for product names, feature names, acronyms and such. But for God&#8217;s sake don&#8217;t make mistakes in the words you invented!</p>
<h3>Constants</h3>
<p>So, you name constants like this: MY_SPECIAL_PORT_NUMBER. Well that&#8217;s simply great. Let me give you some friendly advise: STOP USING SCREAMING CAPS FOR CONSTANTS! Ooops, did I just shout? I hope that settles it. Constants should be treated like just any other variable: use camel case if its a private variable and Pascal case if its public. No prefixes or suffixes to denote that its a constant.</p>
<h3>Public Methods and Properties</h3>
<p>Public methods and properties should differ by more than just their case. This ensures that they are accessible from case insensitive languages like VB.net.</p>
<h3>Summary</h3>
<p>Here is a quick summary of the naming conventions to be followed for different types.</p>
<p><strong>Classes</strong>: Pascal Casing. Should NOT be prefixed with a C. Should NOT have the same name as the namespace in which it resides. Do not use abbreviations.</p>
<p><strong>Interfaces</strong>: Pascal case. Prefix with I. Class naming conventions apply.</p>
<p><strong>Enums</strong>: Follow class naming convention. Do not prefix of suffix the enum with the word &#8216;enum&#8217;.</p>
<p><strong>Delegates</strong>: Pascal casing. Add the word Delegate to the end of the name.</p>
<p><strong>Exception classes</strong>: Pascal casing. End the class with the word Exception. Class naming conventions apply.</p>
<p><strong>Event arguments</strong>: If you are defining your own event arguments class that inherits from the EventArgs class, end the class name with the EventArgs. Class naming conventions apply.</p>
<p><strong>Class members</strong>: camel casing. Prefix with an _ (underscore).</p>
<p><strong>Method Parameters</strong>: Camel case.</p>
<p><strong>Method variables</strong>: Camel case.</p>
<p><strong>Properties</strong>: Pascal case.</p>
<p><strong>Public members</strong>: Pascal case.</p>
<p>Well there you have it, the most commonly used types and suggested naming conventions. If you think I have left out any that are commonly used, add a comment and I shall update the article.</p>
<p><strong>Code Safely     <br /><em>Alex</em></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2008/03/mind-your-language-naming-conventions.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>And finally a bit of masking tape.</title>
		<link>http://www.discretevector.com/2008/02/and-finally-bit-of-masking-tape.html</link>
		<comments>http://www.discretevector.com/2008/02/and-finally-bit-of-masking-tape.html#comments</comments>
		<pubDate>Wed, 27 Feb 2008 07:41:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[cross thread exceptions]]></category>
		<category><![CDATA[deadlocks]]></category>
		<category><![CDATA[examples]]></category>
		<category><![CDATA[invoke]]></category>
		<category><![CDATA[locks]]></category>
		<category><![CDATA[threading]]></category>

		<guid isPermaLink="false">http://discretevector.com/2008/02/and-finally-a-bit-of-masking-tape.html</guid>
		<description><![CDATA[As promised, today we will look at a scenario which uses threads, locks and invokes that can lead to hard to find deadlocks. Scenario: You have an application which has a treeview control. Let&#8217;s call it myFamilyTreeView . The tree will list, you guessed it, you family tree all the way from Adam. (uh well [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>As promised, today we will look at a scenario which uses threads, locks and invokes that can lead to hard to find deadlocks.</p>
<p><span style="font-weight: bold;">Scenario</span>: You have an application which has a treeview control. Let&#8217;s call it <span style="font-style: italic;">myFamilyTreeView</span> . The tree will list, you guessed it, you family tree all the way from Adam. (uh well kind of)</p>
<p>Next, we have a global (static) image list, <span style="font-style: italic;">familyTreeImageList</span>, which will be populated with pictures of your nagging aunts, uncles and everyone in between. The filename of each picture used to populate the imagelist is a unique id such as P11.jpg, P45.jpg etc. We then associate this imagelist to the treeview, like this:</p>
<p><span style="color: rgb(51, 51, 255);">myFamilyTreeView.ImageList = familyTreeImageList ;</span></p>
<p>The application works like this. You have a database containing a list of names and a primary key corresponding to the his or her picture&#8217;s filename.</p>
<p>So uncle John, who still runs a chicken farm in Texas at the age of 70, has a primary key of 36. So his picture will stored in a file named P36.jpg.</p>
<p>So far so good? Great.</p>
<p>The program goes through the database table and adds each family member to <span style="font-style: italic;">myFamilyTreeView</span>. When you add a node to the treeview, you can specify the index of the image in the imagelist corresponding to the person&#8217;s picture which will be displayed as an icon next to the persons name.</p>
<p>Now, since you may have hundreds (!) of relatives, this process may take some time. And since you just finished reading my other articles, you decide to do the treeview population in a different thread.</p>
<p>So you write a thread handler for your worker thread that looks something like this:</p>
<p><span style="color: rgb(51, 51, 255);">void PopulateTrees()</span><br /><span style="color: rgb(51, 51, 255);">{</span></p>
<p><span style="color: rgb(51, 51, 255);">//loop through the database entries</span><br /><span style="color: rgb(51, 51, 255);">{</span><br /><span style="color: rgb(51, 51, 255);">    &#8230;</span><br /><span style="color: rgb(51, 51, 255);">    &#8230;</span><br /><span style="color: rgb(51, 51, 255);">    //id is the primary key of the  database item</span><br /><span style="color: rgb(51, 51, 255);">    int photoIndex = GetImageIndex(id);</span></p>
<p><span style="color: rgb(51, 51, 255);">    //and finally</span><br /><span style="color: rgb(51, 51, 255);">    //name: Name of the person</span><br /><span style="color: rgb(51, 51, 255);">    if (InvokeRequired)</span><br /><span style="color: rgb(51, 51, 255);">        this.Invoke(AddNodeDelegate,new object[]{name, photoIndex});</span><br /><span style="color: rgb(51, 51, 255);">    else</span><br /><span style="color: rgb(51, 51, 255);"></span><span style="color: rgb(51, 51, 255);">        AddNode(name, photoIndex);</span><br /><span style="color: rgb(51, 51, 255);">}</span></p>
<p><span style="color: rgb(51, 51, 255);">}</span></p>
<p><span style="color: rgb(51, 51, 255);">//Method wrapped by the AddNodeDelegate</span><br /><span style="color: rgb(51, 51, 255);">void AddNode(string name, int photoIndex)</span><br /><span style="color: rgb(51, 51, 255);">{</span><br /><span style="color: rgb(51, 51, 255);">    myFamilyTreeView.Nodes.Add(new TreeNode(name, photoIndex, photoIndex));</span><span style="color: rgb(51, 51, 255);"></span><br /><span style="color: rgb(51, 51, 255);">}</span></p>
<p><span style="color: rgb(51, 51, 255);">//Static method to operate on the static (global) </span><span style="font-style: italic; color: rgb(51, 51, 255);">familyTreeImageList</span><br /><span style="color: rgb(51, 51, 255);">static int GetImageIndex(int id)</span><br /><span style="color: rgb(51, 51, 255);"> {</span><br /><span style="color: rgb(51, 51, 255);">     //Get photo from id</span><br /><span style="color: rgb(51, 51, 255);">     //if id = 36, file name will be P36.jpg</span><br /><span style="color: rgb(51, 51, 255);">     //Load the file into a System.Drawing.Image, say, someonesImage</span><br /><span style="color: rgb(51, 51, 255);">         </span><br /><span style="color: rgb(51, 51, 255);">     //and finally</span><br /><span style="color: rgb(51, 51, 255);">     familyTreeImageList.Images.Add(someonesImage);    </span><br /><span style="color: rgb(51, 51, 255);"> }</span></p>
<p>If you had read the last edition of Code Widgets, you would know that<br />since <span style="font-style: italic;">familyTreeImageList </span>is not a control, you can modify it from another thread. That means  <span style="font-style: italic;">GetImageIndex </span>can be called from a worker thread. Right?</p>
<p>Well, right &#8230;. and wrong. There is a very <span style="font-weight: bold;">unique (and interesting) catch</span> in this scenario. Remember that we had associated the imageList to the treeview. So when you add an image to the imagelist, it will in turn cause the treeview to be updated (because of the association). So it is as if you are updating the treeview from a different thread, albeit, indirectly. So the <span style="font-style: italic;">GetImageIndex</span> method will throw the <span style="font-weight: bold;">dreaded cross-thread exception.</span></p>
<p>Quite a revelation wasn&#8217;t it?</p>
<p>The fix is as easy as using invoke. So we we rewrite the method as follows:</p>
<p><span style="color: rgb(51, 51, 255);">int GetImageIndex(int id)</span><br /><span style="color: rgb(51, 51, 255);"> {</span><br /><span style="color: rgb(51, 51, 255);">     //Get photo from id</span><br /><span style="color: rgb(51, 51, 255);">     //if id = 36, file name will be P36.jpg</span><br /><span style="color: rgb(51, 51, 255);">     //Load the file into a System.Drawing.Image, say, someonesImage</span><br /><span style="color: rgb(51, 51, 255);">         </span><br /><span style="color: rgb(51, 51, 255);">     //and finally</span><br /><span style="color: rgb(51, 51, 255);">     if (InvokeRequired)</span><br /><span style="color: rgb(51, 51, 255);">         this.Invoke( AddImageToListDelegate, new object[]{someonesImage});</span><br /><span style="color: rgb(51, 51, 255);">     else</span><br /><span style="color: rgb(51, 51, 255);">        AddImageToList(someonesImage);</span><br /><span style="color: rgb(51, 51, 255);">    </span><br /><span style="color: rgb(51, 51, 255);"> }</span></p>
<p><span style="color: rgb(51, 51, 255);">int AddImageToList(System.Drawing.Image someonesImage )</span><br /><span style="color: rgb(51, 51, 255);">{</span><br /><span style="color: rgb(51, 51, 255);">    familyTreeImageList.Images.Add(someonesImage);    </span><br /><span style="color: rgb(51, 51, 255);">}</span></p>
<p><span style="font-weight: bold;">That was lesson number one.</span></p>
<p>Now let us complicate things a bit. Let us suppose that the database you are using is being updated continuously as you are populating the treeview. Probably you have set up a website somewhere where your relatives can login and change their pictures.</p>
<p>As soon as someone updates their details, your treeview will have to reflect that change. For this purpose you have a thread that is running continuously looking for changes. The moment it detects a change, it pushes the change notification information into a queue. Another thread picks up these notifications from the queue and makes updates to the treeview according to the notification data.</p>
<p><span style="color: rgb(51, 51, 255);">//This is the thread handler which processes notifications</span><br /><span style="color: rgb(51, 51, 255);">void ProcessUpdateNotifications()</span><br /><span style="color: rgb(51, 51, 255);">{</span><br /><span style="color: rgb(51, 51, 255);">    &#8230;.</span><br /><span style="color: rgb(51, 51, 255);">    &#8230;.</span><br /><span style="color: rgb(51, 51, 255);">    //extract the name of the person whose data was modified, from the notification data</p>
<p>//</span><span style="color: rgb(51, 51, 255);">UpdateNodeDelegate wraps </span><span style="color: rgb(51, 51, 255);">UpdateNode method</p>
<p></span><span style="color: rgb(51, 51, 255);">    this.Invoke(UpdateNodeDelegate,new object[]{name});</span></p>
<p><span style="color: rgb(51, 51, 255);">}</span></p>
<p><span style="color: rgb(51, 51, 255);">void UpdateNode(string name)</span><br /><span style="color: rgb(51, 51, 255);">{</span><br /><span style="color: rgb(51, 51, 255);">    //find the node index corresponding to the name</span><br /><span style="color: rgb(51, 51, 255);">    //lets call it nameIndex</span><br /><span style="color: rgb(51, 51, 255);">    //update the image with the new index</span></p>
<p><span style="color: rgb(51, 51, 255);">    int newIndex = GetImageIndex(name);</span><br /><span style="color: rgb(51, 51, 255);">    myFamilyTreeView.Nodes[nameIndex].ImageIndex = newIndex;</span><br /><span style="color: rgb(51, 51, 255);">}</span></p>
<p>You will notice that now there are there are two threads trying to access GetImageIndex(). One is the thread populating the treeview and the other is the one doing the update To ensure data consistency we will add a lock to the method. The uninitiated will  add a lock as follows:</p>
<p><span style="color: rgb(51, 51, 255);">int GetImageIndex(int id)</span><br /><span style="color: rgb(51, 51, 255);">  {</span><br /><span style="color: rgb(204, 0, 0);">lock(this)</span><br /><span style="color: rgb(51, 51, 255);">{</span><br /><span style="color: rgb(51, 51, 255);">      //Get photo from id</span><br /><span style="color: rgb(51, 51, 255);">      //if id = 36, file name will be P36.jpg</span><br /><span style="color: rgb(51, 51, 255);">      //Load the file into a System.Drawing.Image, say, someonesImage</span><br /><span style="color: rgb(51, 51, 255);">          </span><br /><span style="color: rgb(51, 51, 255);">      //and finally</span><br /><span style="color: rgb(51, 51, 255);">      if (InvokeRequired)</span><br /><span style="color: rgb(51, 51, 255);">          this.Invoke( AddImageToListDelegate, new object[]{someonesImage});</span><br /><span style="color: rgb(51, 51, 255);">      else</span><br /><span style="color: rgb(51, 51, 255);">         AddImageToList(someonesImage);</span><br /><span style="color: rgb(51, 51, 255);">}   </span><br /><span style="color: rgb(51, 51, 255);">  }</span></p>
<p>Remember my earlier article warning you of obtaining a lock on <span style="font-style: italic;">this</span>? Now we will see why. The above method will cause a <span style="font-weight: bold;">deadlock</span>. You didn&#8217;t see that coming did you? The reason why this happens is as follow:<br />A thread enters the method and obtains a lock on <span style="font-style: italic;">this</span>. When it reaches the invoke method, application tries to switch to the UI thread to execute <span style="font-style: italic;">AddImageToListDelegate</span>. But the UI thread is <span style="font-weight: bold;">already locked by the worker thread</span>. To switch to the UI thread, it has to exit the block. But to exit the block, the invoke method has to be executed. <span style="font-weight: bold;">The lock and invoke are waiting for each other</span>. To put it simply ladies and gentlemen, we have a deadlock.</p>
<p><span style="font-weight: bold;">This is lesson number two.</span></p>
<p>To fix this, we use a static object instead to lock on to. Refer my <a href="http://codewidgets.blogspot.com/2008/02/locks-threads-and-this-huh-most-people.html">previous article </a>for more <a href="http://codewidgets.blogspot.com/2008/02/locks-threads-and-this-huh-most-people.html"></a>details.</p>
<p><span style="color: rgb(51, 51, 255);">int GetImageIndex(int id)</span><br /><span style="color: rgb(51, 51, 255);">   {</span><br /><span style="color: rgb(204, 0, 0);">lock(lockObject)</span><br /><span style="color: rgb(51, 51, 255);"> {</span><br /><span style="color: rgb(51, 51, 255);">       //Get photo from id</span><br /><span style="color: rgb(51, 51, 255);">       //if id = 36, file name will be P36.jpg</span><br /><span style="color: rgb(51, 51, 255);">       //Load the file into a System.Drawing.Image, say, someonesImage</span><br /><span style="color: rgb(51, 51, 255);">           </span><br /><span style="color: rgb(51, 51, 255);">       //and finally</span><br /><span style="color: rgb(51, 51, 255);">       if (InvokeRequired)</span><br /><span style="color: rgb(51, 51, 255);">           this.Invoke( AddImageToListDelegate, new object[]{someonesImage});</span><br /><span style="color: rgb(51, 51, 255);">       else</span><br /><span style="color: rgb(51, 51, 255);">          AddImageToList(someonesImage);</span><br /><span style="color: rgb(51, 51, 255);"> }   </span><br /><span style="color: rgb(51, 51, 255);">   }</span></p>
<p>The static <span style="font-style: italic;">lockobject </span>ensures that only one thread enters the critical section at a time and guess what? No more deadlock.</p>
<p>Well, those are all the lessons we have time for in this edition of Code Widgets. Stay tuned for more revelations</p>
<p>Code Safely<br /><span style="color: rgb(0, 153, 0); font-weight: bold;">Alex</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2008/02/and-finally-bit-of-masking-tape.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Review: Xbox 360 Controller for the PC</title>
		<link>http://www.discretevector.com/2008/02/xbox-360-controller-for-pc.html</link>
		<comments>http://www.discretevector.com/2008/02/xbox-360-controller-for-pc.html#comments</comments>
		<pubDate>Sat, 23 Feb 2008 07:17:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[Gaming]]></category>
		<category><![CDATA[PC Gaming]]></category>
		<category><![CDATA[Prince of persia: Two thrones]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[Xbox 360 controller]]></category>

		<guid isPermaLink="false">http://discretevector.com/2008/02/review-xbox-360-controller-for-the-pc.html</guid>
		<description><![CDATA[I dug up one of my older games yesterday: Prince of Persia: Two thrones. I had abandoned it a few days after I bought it last year because it was a pain to play using the keyboard&#8230; and I didn&#8217;t want to buy a game controller just for one game. But today I thought, what [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_izTBHqIkTp4/R8CFIce9fqI/AAAAAAAAAgQ/dph3GMUf64g/s1600-h/Xbox+360+wired+controller.gif"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://1.bp.blogspot.com/_izTBHqIkTp4/R8CFIce9fqI/AAAAAAAAAgQ/dph3GMUf64g/s320/Xbox+360+wired+controller.gif" alt="" id="BLOGGER_PHOTO_ID_5170278752352829090" border="0" /></a><br />I dug up one of my older games yesterday: <span style="font-weight: bold;">Prince of Persia: Two thrones</span>. I had abandoned it a few days after I bought it last year because it was a pain to play using the keyboard&#8230; and I didn&#8217;t want to buy a game controller just for one game.</p>
<p>But today I thought, what the heck, maybe it would help me play my other games better. So I went out and bought an <span style="font-weight: bold;">Xbox 360 controller</span>. I was initially bent on buying the wireless version. But to cut a long story short I couldn&#8217;t find one compatible with the PC. And the regular (wired) one was guaranteed to work seamlessly on both the Xbox and the PC.</p>
<p>The Xbox 360 Controller plugs into your USB port. You will have to first install the controller software available at <a href="http://www.microsoft.com/hardware/gaming/download.mspx">http://www.microsoft.com/hardware/gaming/download.mspx</a>. The documentation that came with the controller said the software was available at www.windowsgaming.com but I could never get that site to open. I wonder if it even exists.</p>
<p>So I installed the software, plugged in the controller and I was all set to go. Configuring the controller in POP was pretty straightforward. It detected all the buttons on the controller except for the RT and LT buttons. Probably I can use the <a href="http://xbcd360guide.50webs.com/">XBCD drivers</a> to get them to work.</p>
<p>The controller comes with t<span style="font-weight: bold;">wo analog sticks</span>, <span style="font-weight: bold;">one D-Pad</span>, <span style="font-weight: bold;">4 standard buttons (X,Y,A,B)</span>, <span style="font-weight: bold;">two shoulder buttons (LB, RB)</span> and <span style="font-weight: bold;">two trigger buttons (LT, RT)</span>. In addition to this there is the <span style="font-weight: bold;">guide button</span> (the big X button on the top) and a back and start button. The guide button is pretty useless on a PC. It just brings a small window where you can launch the help documentation. The guide button is surrounded by a green light strip which is divided into 4 quadrants called the ring of light (like on the Xbox system). You can hookup up to 4 controllers to a system and a different quadrant will light up for each controller.</p>
<p>And boy, does this controller rock or what. The analog sticks are so <span style="font-weight: bold;">precise and sensitive</span> to the slightest touch. In POP, pushing the analog stick softly makes the prince walk slowly and if you push on it a bit further, he starts running. On the keyboard you would have to first press the walk toggle key and then use the direction keys. I had to say, WOW (Microsoft would have loved that). You really have to play the game to experience it.</p>
<p>On supported games (such as POP) the controller provides <span style="font-weight: bold;">vibration feedback</span> for certain actions. For example, in POP, when you hit an enemy or land after a jump, the controller vibrates to acknowledge this. Pretty cool! The controller is ergonomic and fits comfortably into your hand. All the buttons are easily reachable and you don&#8217;t have to stretch your fingers for any of them. And to top it all off, the controller is unbelievably light for its size.</p>
<p>The controller also supports connecting a Xbox 360 head set or a 2.5 mm headset to it. Haven&#8217;t tested it though.</p>
<p>I bought it at Rs. 2150. I was thinking of getting it from PlayAsia, but the delivery takes over three weeks. I am still waiting for my Lost planet CD that I ordered on the 12th. Now that would be a cool game to play with my new controller. Fingers crossed. Hope it come soon.</p>
<p><span style="font-weight: bold;">Conclusions:</span></p>
<p>The Xbox 360 controller is a tad expensive but if you are a passionate gamer you really wouldn&#8217;t mind spending that kind of moolah for this amazing piece of hardware. Probably the best gaming controller for the PC. Period.</p>
<p>The wireless version of this provides exactly the same features except that it is, well, wireless. It comes with  a rechargeable battery pack or you can pop in a couple of AA batteries. The charger for the battery pack has to be bought separately though. And its slightly more heavier that the wired one because of the battery. So the TCO for the wireless controller is pretty high because either you&#8217;ll have to buy the charger for the rechargeable battery (thats another 1200 odd rupees) or keep buying AA batteries. Take your pick.</p>
<p>Personally, I am glad I stuck to the wired one. The wire is a small price to pay.</p>
<p>PS: I looked up windowsgaming.com in the WHOIS database and the site is indeed registered to Microsoft. I strongly suspect the site was replaced by www.gamesforwindows.com. The download link at gamesforwindows points the link I mentioned earlier</p>
<p><strong>CW Rating: <em>4 Widgets</em></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2008/02/xbox-360-controller-for-pc.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A little more of the Invoke magic</title>
		<link>http://www.discretevector.com/2008/02/little-more-of-invoke-magic.html</link>
		<comments>http://www.discretevector.com/2008/02/little-more-of-invoke-magic.html#comments</comments>
		<pubDate>Fri, 22 Feb 2008 07:02:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[invoke]]></category>

		<guid isPermaLink="false">http://discretevector.com/2008/02/a-little-more-of-the-invoke-magic.html</guid>
		<description><![CDATA[A query by one of my colleagues prompted me to add this addendum to my Invoke article. He wanted to know whether you would ever need to invoke an event and if so, why. The answer is yes and the reason is pretty simple actually. Remember what I said about invoke in the previous article? [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>A query by one of my colleagues prompted me to add this addendum to my Invoke article. He wanted to know whether you would ever need to invoke an event and if so, why.</p>
<p>The answer is yes and the reason is pretty simple actually. Remember what I said about invoke in the previous article? If you wanted to modify a control&#8217;s properties from any thread other than the one it was created on, you will have to use invoke to call a delegate which would in turn call a method which would be executed on the thread on which the control was created on. The method, of course would contain the code to modify the control.</p>
<p>Now if you were to fire an event, and the handler for that event were to modify a control that was created on the main thread, it would throw an exception. This is because, since the event was fired on the non-UI thread, the handler for that event will end up being executed in the same thread and as we know by now, this is illegal.</p>
<p>The solution is, of course, to use invoke. So the event to modify a progress bar would look like this:</p>
<p><span style="color: rgb(51, 51, 255);">this.Invoke(updateProgressEvent,new object[]{updateValue});</span></p>
<p>Without using invoke this event would have been fired like this:</p>
<p><span style="color: rgb(51, 51, 255);">updateProgressEvent(updateValue);</p>
<p><span style="color: rgb(51, 51, 51);">Its pretty simple when you understand why <img src="http://www.discretevector.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /> </p>
<p>P.S: Guess what? I actually managed to keep this short.</p>
<p>Code Safely<br /><span style="font-weight: bold; font-style: italic; color: rgb(0, 102, 0);">Alex</span><br /></span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2008/02/little-more-of-invoke-magic.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Invoke: Is that like&#8230; magic?</title>
		<link>http://www.discretevector.com/2008/02/invoke-is-that-like-magic.html</link>
		<comments>http://www.discretevector.com/2008/02/invoke-is-that-like-magic.html#comments</comments>
		<pubDate>Tue, 12 Feb 2008 05:02:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[invoke]]></category>
		<category><![CDATA[threading]]></category>

		<guid isPermaLink="false">http://discretevector.com/2008/02/invoke-is-that-like-magic.html</guid>
		<description><![CDATA[First there were threads and then there were invokes. Then came along developers and well the rest is history. Understanding threads and solving timing issues related to threads is an art. In fact, finding the exact origin a threading related issue is a talent in itself. The kind that comes with experience and solid understanding [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>First there were threads and then there were invokes. Then came along developers and well the rest is history.</p>
<p>Understanding threads and solving timing issues related to threads is an art. In fact, finding the exact origin a threading related issue is a talent in itself. The kind that comes with experience and solid understanding of the framework and CLR.  Of course, it wouldn&#8217;t hurt to read my articles once in a while.</p>
<p>Some people complained that my last article as a tad too long. So I&#8217;ll try to keep this one as short as possible. [Alex 1:33 AM: I tried but I couldn't] For those of you who are starting off on threading in C# will benefit from reading my previous article <a href="http://codewidgets.blogspot.com/2008/02/locks-threads-and-this-huh-most-people.html">here</a>.</p>
<p>Except for the most simplest of applications, most windows forms apps will end up using multiple threads to speed up application execution. Let us say you have a database and you want to perform a database write of 10,000 records which is expected to take a significant amount of time to complete. If you were to  execute this operation on the main thread, the UI would appear to be hung till the execution of the operation completes. By todays standards, this is totally unacceptable.</p>
<p>Let me give you a little more background on why this happens. Every Windows forms application (even a console app) starts off with one thread. This is known as the application&#8217;s main thread or in case of Windows forms application, the <span style="font-weight: bold;">UI thread</span>. Unless otherwise created, this will be the one and only thread available to the application till it terminates. If you add a button to your form, that button is created by the main thread on the main thread, and the <span style="font-weight: bold;">main thread owns it</span>. Remember this. Its important.</p>
<p>Windows communicates user events such as mouse clicks to your application through messages. Your application handles these messages through a mechanism called as the <span style="font-weight: bold;">message pump</span>. So where is the message pump in your application? Well, have a look inside your main method and you will see this line:</p>
<p><span style="color: rgb(0, 0, 153);">Application.Run(new MyForm());</span></p>
<p>Application.Run creates an instance of your form and displays it. It also maintains the message pump for your application. So when you click on a button in your form, windows notifies your application regarding the mouse click by sending a message. Your message pump intercepts the message and makes it available in your application in the form of events. You, as a developer, wire up the event to an event handler and viola&#8230; Hello World.</p>
<p>What you should also know is this: the message pump also executes inside, drum roll please, the UI thread! So when your application is performing that database operation, it is doing so inside the main thread. What this means is that no one is running the message pump anymore as the only available thread is busy. During this time if you try to interact with your application, it appears to be hung because no one is processing the messages that are being sent to your application.</p>
<p>Now that we fully understand the problem, the solution seems to be simple: launch the lengthy operation in a separate thread. This leaves the UI thread free to pump away.</p>
<p>Now lets say while you are doing this lengthy operation (in a different thread), you want to inform the user of the progress of the operation. For this you have a progress bar in your main form and as you progress through your lengthy operation, you update the progress bar. Sounds simple doesn&#8217;t it? How would you do it?</p>
<p><span style="font-weight: bold;">Listing 1:</span><br /><span style="color: rgb(0, 0, 153);">DoDatabaseUpdate()</span><br /><span style="color: rgb(0, 0, 153);">{</span><br /><span style="color: rgb(0, 0, 153);">for (;;)    //Some loop</span><br /><span style="color: rgb(0, 0, 153);">{</span><br /><span style="color: rgb(0, 0, 153);"> //Code for the lengthy operation</span><br /><span style="color: rgb(0, 0, 153);"> &#8230;</span><br /><span style="color: rgb(0, 0, 153);"> &#8230;</span><br /><span style="color: rgb(0, 0, 153);"> progressBar.PerformStep();    //Update the progress bar</span><br /><span style="color: rgb(0, 0, 153);">}</span><br /><span style="color: rgb(0, 0, 153);">}</span></p>
<p>If you thought the above listing was the right then you really, really need to read the rest of this article. Twice.</p>
<p>In the beginning of this article I had asked you to keep in mind something that I said was important, which in all probability, you would have forgotten by now. Here it is again: The <span style="font-weight: bold;">thread that creates the control owns the control</span>. What this means in short is that your application window, the buttons, text boxes and all other controls that you dragged and dropped into your form are owned by your UI thread.</p>
<p>Engrave the next statement in your brain: <span style="font-weight: bold;">You should only manipulate a control on the thread on which it was created.</span></p>
<p>If you use listing 1 to update your progress bar you will get an error similar to the one below:</p>
<p><span style="font-style: italic;">General Exception: System.InvalidOperationException: Cross-thread operation not valid: Control &#8216;progressBar&#8217; accessed from a thread other than the thread it was created on.</span></p>
<p><span style="font-weight: bold;">A very important note:</span><br />In .net 1.1 the code in listing 1 will compile and run without any exception. But from .net 2.0 onwards this will cause a runtime exception as shown above.</p>
<p>There is a way to ignore this check in 2.0 though. Just set the control&#8217;s <span style="font-weight: bold;">CheckForIllegalCrossThreadCalls </span>property to <span style="font-weight: bold;">false</span></p>
<p><span style="font-weight: bold;">Control</span><span style="font-weight: bold;" class="nu">.</span><span style="font-weight: bold;">CheckForIllegalCrossThreadCalls = false;</span></p>
<p><span style="font-style: italic;">PS: This property does not exist in .net 1.1</span></p>
<p>In .net 2.0 if you set the above property for a control and make an illegal cross thread call such as the one in listing 1, no runtime exception will be thrown. In .net 3.0 and above, setting this property will  make the debugger  to stop notifying you when such an exception occurs, but it will still cause a runtime exception in your release build.</p>
<p>All said and done, I highly recommend that you <span style="font-weight: bold;">DO NOT set this property to false</span> if you are using .net 2.0. The framework is giving you a chance of uncovering such issues as and when they happen. <span style="font-weight: bold;">Take the hint and fix the problem</span>. Setting this property is like ignoring a time bomb. Its just a matter of time.</p>
<p>Before the question comes up, let me answer it myself. If .net 1.1 doesn&#8217;t give an error does it mean that this operation is legal? Thats like stealing and not getting caught. Just because you can do it doesn&#8217;t make it right. Its a matter of timing and a bit of luck. If you are using .net 1.1 and you find that your application suddenly crashes or completely disappears from the screen for no particular reason, check your code for cross thread calls. And I highly recommend that you move your code to 2.0 as soon as possible. Microsoft has fixed a lot of performance and functional issues in 2.0. Do it now. You can thank me later.</p>
<p>Now lets see how we can solve our little problem. For situations like this, .net provides a special method: Invoke. Invoke executes  delegate on the thread that owns the control&#8217;s underlying window handle.</p>
<p>Invoke is an overloaded method.</p>
<p><span style="font-style: italic;">Control.Invoke(delegate)</span><br /><span style="font-style: italic;">Control.Invoke(delegate, object[])</span></p>
<p>Lets understand them by solving our problem shown in listing 1.</p>
<p><span style="font-weight: bold;">Listing 2:</span><br /><span style="color: rgb(0, 0, 153);">//Declare a delegate (class member)</span><br /><span style="color: rgb(0, 0, 153);">private delegate void UpdateProgressBar();</span></p>
<p><span style="color: rgb(0, 0, 153);">//Create an instance of the delegate for us to use (class member)</span><br /><span style="color: rgb(0, 0, 153);">private UpdateProgressBar updateProgressDelegate;</span></p>
<p><span style="color: rgb(0, 0, 153);">void StepProgressBar()</span><br /><span style="color: rgb(0, 0, 153);">{</span><br /><span style="color: rgb(0, 0, 153);">            progressBar.PerformStep();</span><br /><span style="color: rgb(0, 0, 153);">}</span></p>
<p><span style="color: rgb(0, 0, 153);">//Method executed on a different thread</span><br /><span style="color: rgb(0, 0, 153);">DoDatabaseUpdate()</span><br /><span style="color: rgb(0, 0, 153);">{</span></p>
<p><span style="color: rgb(0, 0, 153);">//Associate a method to our delegate (defined above)</span><br /><span style="color: rgb(0, 0, 153);">updateProgressDelegate = new UpdateProgressBar(StepProgressBar);</span><br /><span style="color: rgb(0, 0, 153);">for (;;)    //Some loop</span><br /><span style="color: rgb(0, 0, 153);">{</span><br /><span style="color: rgb(0, 0, 153);"> //Code for the lengthy operation</span><br /><span style="color: rgb(0, 0, 153);"> &#8230;</span><br /><span style="color: rgb(0, 0, 153);"> &#8230;</span><br /><span style="color: rgb(0, 0, 153);">this.Invoke(updateProgressDelegate );//Update the progress bar by calling the delegate</span><br /><span style="color: rgb(0, 0, 153);">}</span><br /><span style="color: rgb(0, 0, 153);">}</span></p>
<p>There you have it, the new an improved thread safe version of our little program. Lets analyze each step. Since Invoke takes a delegate as a parameter, we have to create a delegate first. A delegate is like a function pointer in C++. A delegate encapsulates a method inside it. Think of it as an indirect way of calling the method. A delegate can only encapsulate methods that matches the delegate&#8217;s signature. For example, our delegate <span style="font-style: italic;">UpdateProgressBar </span>can encapsulate any method that returns void and takes zero parameters. If we wanted the delegate to to encapsulate a method that returns an int and accepts one integer parameter the delegate would look like this:<br /><span style="color: rgb(0, 0, 0); font-style: italic;">private delegate int UpdateProgressBar(int step);</span></p>
<p>The next step is to create an instance of the delegate. This is done in the next line:<br /><span style="font-style: italic;">private UpdateProgressBar updateProgressDelegate;</span></p>
<p>Then encapsulate the method by doing<br /><span style="font-style: italic;">updateProgressDelegate = new UpdateProgressBar(StepProgressBar);</span><br />and inside the <span style="font-style: italic;">StepProgressBar </span>method we call the ProgressBar&#8217;s <span style="font-style: italic;">PerformStep </span>method.</p>
<p>This delegate object is then passed to the Invoke method.</p>
<p>Ok, now comes the interesting part. Note that we are calling Invoke on <span style="font-style: italic;">this</span>. This means that you are calling Invoke on your form. You could also have called invoke on the <span style="font-style: italic;">progressbar </span>control. It really doesn&#8217;t make a difference since both the form and the progressbar are created on the same thread. Invoke requires a <span style="font-weight: bold;">windows handle</span> to execute the delegate. If for some reason the control&#8217;s handle has not been created yet, invoke will search up the controls parent chain till it finds a control with a handle and executes the delegate on the thread that owns the handle. Whew!</p>
<p>Here is some information you wont find in most articles. Many people think that Invoke is an asynchronous operation. It is not. When you call invoke, your application <span style="font-weight: bold;">switches to the thread</span> that owns the control, executes the method and returns. Also if you try to call invoke on a control and invoke cannot find a handle anywhere in the chain, it will <span style="font-weight: bold;">throw a runtime exception</span>  Understanding this little bit of information can go a long way in detecting deadlocks in multithreaded applications.</p>
<p>Lets quickly go through the overloaded version of Invoke:<br /><span style="font-style: italic;">Control.Invoke(delegate, object[])</span></p>
<p>The first parameter is again a delegate and the second parameter is a list of arguments that you can pass to the delegate. Lets rewrite the program so that <span style="font-style: italic;">StepProgressBar </span>now takes an int parameter.</p>
<p><span style="font-weight: bold;">Listing 3:</span></p>
<p><span style="color: rgb(0, 0, 153);">//Declare a delegate (class member)</span><br /><span style="color: rgb(0, 0, 153);"> private delegate void UpdateProgressBar(int step);</span></p>
<p><span style="color: rgb(0, 0, 153);"> //Create an instance of the delegate for us to use (class member)</span><br /><span style="color: rgb(0, 0, 153);"> private UpdateProgressBar updateProgressDelegate;</span></p>
<p><span style="color: rgb(0, 0, 153);"> void StepProgressBar(int step)</span><br /><span style="color: rgb(0, 0, 153);"> {</span><br /><span style="color: rgb(0, 0, 153);">             progressBar.Value += step;    //Update the progress bar with the value that is passed</span><br /><span style="color: rgb(0, 0, 153);"> }</span></p>
<p><span style="color: rgb(0, 0, 153);">DoDatabaseUpdate()</span><br /><span style="color: rgb(0, 0, 153);"> {</span></p>
<p><span style="color: rgb(0, 0, 153);"> //Associate a method to our delegate (defined above)</span><br /><span style="color: rgb(0, 0, 153);"> updateProgressDelegate = new UpdateProgressBar(StepProgressBar);</span><br /><span style="color: rgb(0, 0, 153);">for (i=0;i<10;><br /><span style="color: rgb(0, 0, 153);"> {</span><br /><span style="color: rgb(0, 0, 153);">  //Code for the lengthy operation</span><br /><span style="color: rgb(0, 0, 153);">  &#8230;</span><br /><span style="color: rgb(0, 0, 153);">  &#8230;</span><br /><span style="color: rgb(0, 0, 153);"> this.Invoke(updateProgressDelegate, <span style="color: rgb(204, 0, 0);">new object[]{i}</span> );//Update the progress bar by calling the delegate</span><br /><span style="color: rgb(0, 0, 153);"> }</span><br /><span style="color: rgb(0, 0, 153);"> }</span></p>
<p><span style="color: rgb(0, 0, 0);">The above program is pretty self explanatory. I&#8217;ll leave it to you to figure out.</span></p>
<p><span style="color: rgb(0, 0, 0);">One more thing before we wrap up. What if </span><span style="font-style: italic; color: rgb(0, 0, 0);">DoDatabaseUpdate </span><span style="color: rgb(0, 0, 0);">was executed on the main thread instead of a worker thread? In this case we really don&#8217;t need to do an Invoke. In fact we shouldn&#8217;t. Invoke carries a small performance hit which we can avoid if the method was being executed on the main thread. So in cases where we have methods that may be executed on the main thread and/or on a  worker thread depending on the program logic, .net provides a property by which we can figure out whether Invoke is really required or not. This property is called (no points for guessing) </span><span style="font-weight: bold; font-style: italic; color: rgb(0, 0, 0);">InvokeRequired</span><span style="color: rgb(0, 0, 0);">.</span></p>
<p><span style="color: rgb(0, 0, 0);">Lets rewrite listing 2 using InvokeRequired.</span></p>
<p><span style="font-weight: bold;"><span style="color: rgb(0, 0, 0);">Listing 4:</span></p>
<p></span><span style="color: rgb(0, 0, 153);">DoDatabaseUpdate()</span><br /><span style="color: rgb(0, 0, 153);"> {</span></p>
<p><span style="color: rgb(0, 0, 153);"> //Associate a method to our delegate (defined above)</span><br /><span style="color: rgb(0, 0, 153);"> updateProgressDelegate = new UpdateProgressBar(StepProgressBar);</span><br /><span style="color: rgb(0, 0, 153);"> for (;;)    //Some loop</span><br /><span style="color: rgb(0, 0, 153);"> {</span><br /><span style="color: rgb(0, 0, 153);">  //Code for the lengthy operation</span><br /><span style="color: rgb(0, 0, 153);">  &#8230;</span><br /><span style="color: rgb(0, 0, 153);">  &#8230;</span><br /><span style="color: rgb(0, 0, 153);">if (InvokeRequired)</span><br /><span style="color: rgb(0, 0, 153);">    this.Invoke(updateProgressDelegate );//Update the progress bar by calling the delegate</span><br /><span style="color: rgb(0, 0, 153);">else</span><br /><span style="color: rgb(0, 0, 153);">    progressBar.PerformStep();</span><br /><span style="color: rgb(0, 0, 153);"> }</span><br /><span style="color: rgb(0, 0, 153);"> }</span></p>
<p><span style="color: rgb(0, 0, 0);">There, now our program is complete. If </span><span style="font-style: italic; color: rgb(0, 0, 0);">DoDatabaseUpdate </span><span style="color: rgb(0, 0, 0);">is called from the main thread, it will access the control directly (and avoid the invoke overhead) and if its being called from a different thread, an invoke is performed.</span></p>
<p><span style="font-weight: bold; color: rgb(0, 0, 0);">Note:</span><br /><span style="color: rgb(0, 0, 0);">For a control .net guarantees one property and three methods to be thread safe: </span><span style="font-style: italic; font-weight: bold; color: rgb(0, 0, 0);">InvokeRequired</span><span style="font-weight: bold; color: rgb(0, 0, 0);">, </span><span style="font-style: italic; font-weight: bold; color: rgb(0, 0, 0);">Invoke</span><span style="font-weight: bold; color: rgb(0, 0, 0);">, </span><span style="font-style: italic; font-weight: bold; color: rgb(0, 0, 0);">BeginInvoke </span><span style="color: rgb(0, 0, 0);">and </span><span style="font-style: italic; font-weight: bold; color: rgb(0, 0, 0);">CreateGraphics</span><span style="font-weight: bold; color: rgb(0, 0, 0);">.</span></p>
<p><span style="color: rgb(0, 0, 0);">I know that I promised to describe a deadlock scenario when we use Invokes and locks, in the last edition. But its already 1:30 AM where I live and my eyes are slowly giving up on me. So that will have to wait till next time. Stay tuned.</p>
<p><span style="font-weight: bold; font-style: italic;">Author&#8217;s Note [Added 19-02-2008] :</span><br />Please do keep in mind that invoke is required <span style="font-weight: bold;">only for controls</span> (such as forms, buttons, treeviews etc). You don&#8217;t have to use invoke if you are modifying, say, an integer variable or an array list from another thread. They can be directly accessed from other threads. You will, of course, need to provide some synchronization mechanism if multiple threads will be accessing them simultaneously.<br /></span><br /><span style="color: rgb(0, 0, 0);">Code safely.</span><br /><span style="font-weight: bold; color: rgb(0, 102, 0); font-style: italic;">Alex</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2008/02/invoke-is-that-like-magic.html/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Locks, threads and this (huh?)</title>
		<link>http://www.discretevector.com/2008/02/locks-threads-and-this-huh-most-people.html</link>
		<comments>http://www.discretevector.com/2008/02/locks-threads-and-this-huh-most-people.html#comments</comments>
		<pubDate>Mon, 11 Feb 2008 06:26:00 +0000</pubDate>
		<dc:creator><![CDATA[Bobby Alexander]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[locks]]></category>
		<category><![CDATA[threading]]></category>

		<guid isPermaLink="false">http://discretevector.com/2008/02/locks-threads-and-this-huh.html</guid>
		<description><![CDATA[In this article we will explore a commonly misunderstood and misused keyword in C#: lock Let’s say you have block of code being accessed by multiple threads. This piece of code needs to be protected in such a way that you allow only one thread to access the block at any given point of time. [&#8230;]]]></description>
				<content:encoded><![CDATA[<p class="MsoNormal"><span style="font-weight: bold;">In this article we will explore a commonly misunderstood and misused keyword in C#: <span style="font-style: italic;">lock</span></span></p>
<p class="MsoNormal">Let’s say you have block of code being accessed by multiple threads. This piece of code needs to be protected in such a way that you allow only one thread to access the block at any given point of time. This is known as mutual exclusion and the block of code you are trying to protect is called the critical section. I won’t go into details of thread synchronization here. There are lots of articles out there that explain it in great detail.</p>
<p class="MsoNormal">One way of achieving this in C# is by using the <span style="font-style: italic;">lock()</span> keyword. The lock keyword marks a block of code as a critical section by obtaining mutual exclusion lock on an object.</p>
<p class="MsoNormal">Lock takes one parameter, an expression which specifies the <span style="font-weight: bold;">object to lock on to</span>. The expression should be a reference type.</p>
<p class="MsoNormal"><span style="font-weight: bold;">Syntax:</span><br />
<span style="font-style: italic;">lock(expression)</span><br />
{<span style="font-size:0;"><br />
</span></p>
<p class="MsoNormal">//Critical section</p>
<p class="MsoNormal">}</p>
<p class="MsoNormal">We will have a look at what happens if you don&#8217;t protect your code from simultaneous thread access.</p>
<p><span style="font-size:0;"> </span></p>
<p class="MsoNormal">Take a look at the method below:</p>
<p class="MsoNormal"><span style="font-weight: bold;">Listing 1:</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;">void DoSomeJob()<br />
{</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;"><span style="font-size:0;"> </span>for (int i=0 ; i &lt;10;++i)</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;"><span style="font-size:0;"> </span>{</span></p>
<p class="MsoNormal" style="margin-left: 0.5in; color: #000099;"><span style="font-size:85%;"><span style="font-size:0;"> </span>//Start critical section</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;"><span style="font-size:0;"> </span>Console.WriteLine(&#8220;\r\n &#8221; </span></p>
<p class="MsoNormal" style="margin-left: 0.5in; color: #000099;"><span style="font-size:85%;">+ <span style="font-size:0;"> </span>System.Threading.Thread.CurrentThread.Name </span></p>
<p class="MsoNormal" style="margin-left: 0.5in; color: #000099;"><span style="font-size:85%;">+ &#8221; is STARTING Transaction &#8221; + i.ToString());</span></p>
<p class="MsoNormal" style="margin-left: 1in;"><span style="font-size:85%;"><span style="font-size:0;"> </span><br />
<span style="color: #000099;">System.Threading.Thread.Sleep(300);</span></span></p>
<p class="MsoNormal" style="margin-left: 0.5in; color: #000099;"><span style="font-size:85%;"><span style="font-size:0;"> </span>Console.WriteLine(&#8220;\r\n &#8221; </span></p>
<p class="MsoNormal" style="margin-left: 0.5in; color: #000099;"><span style="font-size:85%;">+ System.Threading.Thread.CurrentThread.Name </span></p>
<p class="MsoNormal" style="margin-left: 0.5in; color: #000099;"><span style="font-size:85%;">+ &#8221; is ENDING Transaction &#8221; + i.ToString());</span></p>
<p class="MsoNormal" style="margin-left: 0.5in; color: #000099;"><span style="font-size:85%;">//End critical section</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;"><span style="font-size:0;"> </span>}</span></p>
<p class="MsoNormal"><span style="color: #000099;font-size:85%;"> </span><span style="font-size:11;"><span style="color: #000099;font-family:verdana;font-size:85%;">}</span></span></p>
<p class="MsoNormal">
<p class="MsoNormal">The <span style="font-style: italic;">DoSomeJob </span>method prints a line to console, then sleeps for 300 ms and then prints the second line. It does this 10 times. Pretty simple, isn’t it. Now let’s get TWO threads to execute the same method simultaneously and see what happens.</p>
<p>Let’s add the creation of the two threads on the click handler of a button named <span style="font-style: italic;">uxStartThreadsButton</span>.</p>
<p class="MsoNormal"><span style="font-weight: bold;">Listing 2:</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;">private void uxStartThreadsButton_Click</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;">(object sender, System.EventArgs e)</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;">{</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;"><span style="font-size:0;"> </span></span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;"><span style="font-size:0;"> </span>Thread thread1 = new Thread(new ThreadStart(DoSomeJob));</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;"><span style="font-size:0;"> </span>thread1.Name = &#8220;Thread 1&#8243;;</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;"><span style="font-size:0;"> </span></span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;"><span style="font-size:0;"> </span>Thread thread2 = new Thread(new ThreadStart(DoSomeJob));</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;"><span style="font-size:0;"> </span>thread2.Name = &#8220;Thread 2&#8243;;</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;"><span style="font-size:0;"> </span></span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;"><span style="font-size:0;"> </span>thread1.Start();</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;"><span style="color: #000099;">thread2.Start();</span></span></p>
<p class="MsoNormal"><span style="font-size:10;"><span style="color: #000099;font-family:verdana;font-size:85%;">}</span></span></p>
<p class="MsoNormal"><span style="font-size:0;"> </span></p>
<p><span style="font-size:0;"><span style="font-weight: bold;font-size:100%;"> </span></span></p>
<p class="MsoNormal"><span style="font-size:0;"> </span></p>
<p class="MsoNormal"><span style="font-size:85%;"><span style="font-size:100%;">When you click on the button, two threads names thread1 and thread2 are created and started. The output of this operation is shown below:</span></span></p>
<p><span style="font-weight: bold;">Listing 3:</span></p>
<p class="MsoNormal"><span style="font-size:85%;">Thread 1 is STARTING Transaction 0</span></p>
<p class="MsoNormal"><span style="font-size:85%;"><span style="font-size:0;"> </span></span></p>
<p class="MsoNormal"><span style="font-size:85%;">Thread 2 is STARTING Transaction 0</span></p>
<p class="MsoNormal"><span style="font-size:85%;"> </span></p>
<p class="MsoNormal"><span style="font-size:85%;"> </span></p>
<p class="MsoNormal"><span style="font-size:85%;">Thread 2 is ENDING Transaction 0</span></p>
<p class="MsoNormal"><span style="font-size:85%;"> </span></p>
<p class="MsoNormal"><span style="font-size:85%;"><span style="font-size:0;"> </span>Thread 2 is STARTING Transaction 1</span></p>
<p class="MsoNormal"><span style="font-size:85%;"> </span></p>
<p class="MsoNormal"><span style="font-size:85%;"><span style="font-size:0;"> </span>Thread 1 is ENDING Transaction 0</span></p>
<p class="MsoNormal"><span style="font-size:85%;"> </span></p>
<p class="MsoNormal"><span style="font-size:85%;"><span style="font-size:0;"> </span>Thread 1 is STARTING Transaction 1</span></p>
<p class="MsoNormal"><span style="font-size:85%;"> </span></p>
<p class="MsoNormal"><span style="font-size:85%;"><span style="font-size:0;"> </span>Thread 1 is ENDING Transaction 1</span></p>
<p class="MsoNormal"><span style="font-size:85%;"> </span></p>
<p class="MsoNormal"><span style="font-size:85%;"><span style="font-size:0;"> </span><span style="font-weight: bold; color: #ff0000;">Thread 1 is STARTING Transaction 2</span></span></p>
<p class="MsoNormal" style="font-weight: bold; color: #ff0000;"><span style="font-size:85%;"> </span></p>
<p class="MsoNormal" style="font-weight: bold; color: #ff0000;"><span style="font-size:85%;">Thread 2 is ENDING Transaction 1</span></p>
<p class="MsoNormal" style="font-weight: bold; color: #ff0000;"><span style="font-size:85%;"> </span></p>
<p class="MsoNormal" style="font-weight: bold; color: #ff0000;"><span style="font-size:85%;">Thread 2 is STARTING Transaction 2</span></p>
<p class="MsoNormal" style="font-weight: bold; color: #ff0000;"><span style="font-size:85%;"> </span></p>
<p class="MsoNormal" style="font-weight: bold; color: #ff0000;"><span style="font-size:85%;">Thread 2 is ENDING Transaction 2</span></p>
<p class="MsoNormal" style="font-weight: bold; color: #ff0000;"><span style="font-size:85%;"> </span></p>
<p class="MsoNormal"><span style="font-weight: bold; color: #ff0000;font-size:85%;">Thread 2 is STARTING Transaction 3</span><span style="font-size:85%;"> </span></p>
<p class="MsoNormal"><span style="font-size:85%;"> </span></p>
<p class="MsoNormal"><span style="font-size:85%;"><span style="font-size:0;"> </span>Thread 1 is ENDING Transaction 2</span></p>
<p class="MsoNormal"><span style="font-size:85%;"> </span></p>
<p class="MsoNormal"><span style="font-size:85%;"><span style="font-size:0;"> </span>Thread 1 is STARTING Transaction 3</span><span style="font-size:0;"> </span></p>
<p class="MsoNormal"><span style="font-size:100%;"> </span></p>
<p class="MsoNormal"><span style="font-size:100%;">(rest of the output has been truncated for clarity)</span></p>
<p class="MsoNormal"><span style="font-size:100%;"> </span></p>
<p class="MsoNormal"><span style="font-size:100%;">Uh, not exactly what we expected eh? The expectation was that thread A starting operation X would complete the same operation before allowing other operations to be started. The sleep statement has been inserted to force a context switch so that we can easily make out what is happening. This is a trivial case, consider what would have happened if we had a bank transaction. One thread would start a transaction to deduct cash from an account which would have resulted in zero balance. Before the change could be reflected, another thread starts a similar operation to deduct some more cash. Ideally this transaction should be rejected because the balance is zero, but the system doesn’t realize it and proceeds to deduct the funds. Then the first thread resumes operation and commits changes and the bank balance turns negative!</span></p>
<p class="MsoNormal"><span style="font-size:100%;"> </span></p>
<p class="MsoNormal"><span style="font-size:100%;">This requirement is known as <span style="font-weight: bold;">atomicity </span>of operations. Atomicity dictates that a set of instructions have to executes sequentially without interruption and HAS to run to completion before allowing other operations to operate on the same data. In thread synchronization terms, the critical section should not be entered by any other thread while one thread is accessing it.</span></p>
<p class="MsoNormal">This is where lock comes in. Let&#8217;s execute the same program, but this time add the lock statement as shown.</p>
<p class="MsoNormal"><span style="font-size:100%;"> </span></p>
<p class="MsoNormal"><span style="font-size:100%;"><span style="font-weight: bold;">Listing 4</span>:</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;">void DoSomeJob()<br />
{</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;">for (int i=0;i&lt;10;++i)</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;">{<br />
</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;"><span style="font-size:0;"> </span><span style="font-size:0;"> </span><span style="font-weight: bold; color: #ff0000; font-style: italic;">lock(lockObject) </span><br />
{</span></p>
<p class="MsoNormal" style="margin-left: 1in; color: #000099;"><span style="font-size:85%;">//Start critical section</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;"><span style="font-size:0;"> </span><span style="font-size:0;"> </span>Console.WriteLine(&#8220;\r\n &#8221; </span></p>
<p class="MsoNormal" style="margin-left: 1in; color: #000099;"><span style="font-size:85%;">+<span style="font-size:0;"> </span>System.Threading.Thread.CurrentThread.Name </span></p>
<p class="MsoNormal" style="margin-left: 1in; color: #000099;"><span style="font-size:85%;">+ &#8221; is STARTING Transaction &#8221; + i.ToString());</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;"><span style="font-size:0;"> </span></span></p>
<p class="MsoNormal" style="margin-left: 1in; color: #000099;"><span style="font-size:85%;">System.Threading.Thread.Sleep(300);</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;"><span style="font-size:0;"> </span></span></p>
<p class="MsoNormal" style="margin-left: 1in; color: #000099;"><span style="font-size:85%;">Console.WriteLine(&#8220;\r\n &#8221; </span></p>
<p class="MsoNormal" style="margin-left: 1in; color: #000099;"><span style="font-size:85%;">+ System.Threading.Thread.CurrentThread.Name </span></p>
<p class="MsoNormal" style="margin-left: 1in; color: #000099;"><span style="font-size:85%;">+ &#8221; is ENDING Transaction &#8221; + i.ToString());</span></p>
<p class="MsoNormal" style="margin-left: 1in; color: #000099;"><span style="font-size:85%;">//End critical section</span></p>
<p class="MsoNormal" style="margin-left: 0.5in; color: #000099;"><span style="font-size:85%;">}</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;"> </span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;"><span style="font-size:0;"> </span>}</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;"> </span></p>
<p class="MsoNormal"><span style="font-size:100%;"><span style=";font-family:verdana;font-size:85%;"><span style="color: #000099;">}</span></span></span></p>
<p class="MsoNormal"><span style="font-size:100%;"> </span></p>
<p class="MsoNormal" style="font-weight: bold;"><span style="font-size:100%;">Listing 5:</span></p>
<p class="MsoNormal"><span style="font-size:85%;">The output below is as expected:</span></p>
<p class="MsoNormal"><span style="font-size:85%;"> </span></p>
<p class="MsoNormal"><span style="font-size:85%;"> </span></p>
<p class="MsoNormal"><span style="font-size:0;"><span style="font-size:0;"> </span><span style="font-size:85%;">Thread 1 is STARTING Transaction 0</span></span></p>
<p class="MsoNormal"><span style="font-size:85%;"> </span></p>
<p class="MsoNormal"><span style="font-size:85%;"><span style="font-size:0;"> </span>Thread 1 is ENDING Transaction 0</span></p>
<p class="MsoNormal"><span style="font-size:85%;"> </span></p>
<p class="MsoNormal"><span style="font-size:85%;"><span style="font-size:0;"> </span>Thread 2 is STARTING Transaction 0</span></p>
<p class="MsoNormal"><span style="font-size:85%;"> </span></p>
<p class="MsoNormal"><span style="font-size:85%;"><span style="font-size:0;"> </span>Thread 2 is ENDING Transaction 0</span></p>
<p class="MsoNormal"><span style="font-size:85%;"> </span></p>
<p class="MsoNormal"><span style="font-size:85%;"><span style="font-size:0;"> </span>Thread 1 is STARTING Transaction 1</span></p>
<p class="MsoNormal"><span style="font-size:85%;"> </span></p>
<p class="MsoNormal"><span style="font-size:85%;"><span style="font-size:0;"> </span>Thread 1 is ENDING Transaction 1</span></p>
<p class="MsoNormal"><span style="font-size:85%;"> </span></p>
<p class="MsoNormal"><span style="font-size:85%;"><span style="font-size:0;"> </span>Thread 2 is STARTING Transaction 1</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:85%;">Thread 2 is ENDING Transaction 1</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:85%;">Thread 1 is STARTING Transaction 2</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:85%;">Thread 1 is ENDING Transaction 2</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:85%;">Thread 2 is STARTING Transaction 2</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:85%;">Thread 2 is ENDING Transaction 2</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:85%;">Thread 1 is STARTING Transaction 3</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:85%;">Thread 1 is ENDING Transaction 3</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:100%;">So what did lock do? Well, thread 1 entered the for loop first and printed the first line and then went off to sleep. Seizing this opportunity, thread 2 begins execution and enters the for loop, but alas, it finds that thread 1 has obtained a <span style="font-weight: bold;">mutually exclusive lock</span> on <span style="font-style: italic;">lockObject </span>before it entered the critical section. (I will explain what <span style="font-style: italic;">lockObject </span>is in just a bit) This means that thread 2 will have to <span style="font-size:0;">WAIT </span>till thread 1 exits the block. By this time (after 300ms), thread 1 resumes, prints the second line, exits the block and <span style="font-size:0;">releases </span>the lock on <span style="font-style: italic;">lockObject. </span>Thread 2 is can now obtain lock on the <span style="font-style: italic;">lockObject </span>and enter the critical section.</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:100%;">The biggest problem I found with people who use lock is <span style="font-style: italic;">this</span><span style="font-style: italic;">. </span>No really, it is literally <span style="font-style: italic;">this</span>. Most people use lock as shown below:</span></p>
<p class="MsoNormal" style="font-weight: bold;"><span style="font-size:100%;">Listing 6:</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;">void DoSomeJob()<br />
{<br />
</span><span style="font-size:85%;">for (int i=0 ; i&lt;10;++i){</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;">lock(this)</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;">{</p>
<p class="MsoNormal" style="margin-left: 1in; color: #000099;"><span style="font-size:85%;">//Start critical section</span></p>
<p class="MsoNormal" style="margin-left: 1in; color: #000099;"><span style="font-size:85%;">//Code here</span></p>
<p class="MsoNormal" style="margin-left: 1in; color: #000099;"><span style="font-size:85%;">//End critical section</span></p>
<p class="MsoNormal" style="margin-left: 0.5in; color: #000099;"><span style="font-size:85%;">}</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"> </p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;">}</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"> </p>
<p class="MsoNormal"><span style="font-size:100%;"><span style="color: #000099;font-family:verdana;font-size:85%;">}</span></span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:100%;"><br />
</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:100%;">A lot of people think that this is the best way to use lock. In fact it is the worst. You really don&#8217;t need to lock the whole object you are in to obtain mutual exclusion. This also means that two running threads that need to operate on two different critical sections which don&#8217;t share any common objects are <span style="font-weight: bold;">unable to run concurrently</span> because they are locked by the same reference object, <span style="font-style: italic;">this</span>. I would blame Microsoft partially for this. When most people started learning C#, they, like most windows developers, referred MSDN and in the help page for lock for .net 1.1 found the following explanation:</span></p>
<p class="MsoNormal"> </p>
<blockquote>
<p class="MsoNormal"><span style="font-size:100%;">lock(<span style="font-style: italic;">expression</span>)<br />
</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal" style="font-style: italic;"><span style="font-size:100%;">expression</span></p>
<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size:100%;">&#8220;Specifies the object that you want to lock on. <em>expression</em> must be a reference type. </span></p>
<p style="margin-left: 0.5in;"><span style="font-size:100%;">Typically, <em>expression</em> will either be this, if you want to protect an instance variable, or typeof<strong>(</strong><em>class</em><strong>)</strong>, if you want to protect a static variable.&#8221;</span></p>
</blockquote>
<p style="margin-left: 0.5in;"> </p>
<p>But Microsoft did an about turn for .net 2.0 and pointed this out as a big no no.</p>
<p class="MsoNormal"><span style="font-size:100%;">Another reason why I recommend not locking on this is because you might be passing the same reference object to several other classes, all of which can potentially use it to lock on to, thereby leading to a <span style="font-weight: bold;">deadlock</span>. And trust me you don’t want to be debugging threading related deadlocks. I have lost half my sanity this way.<br />
</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:100%;">Of course, a genuine case might arise which would require you to guard two critical sections using the same lock to really ensure sequential access, as shown in listing 4. So if using <span style="font-style: italic;">this </span>is a bad practice, what is the suggested method?</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:100%;">Well my recommendation is to declare a private object for each critical section to be protected:</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;">private Object _lockObject =</span><span style="font-size:85%;"> </span><span style="font-size:85%;">new Object();</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:100%;">This was the lockObject I showed you in listing4. Note that this will protect critical section only for that instance of the class. What does that mean? Well, Consider the code below. Lets assume that <span style="font-style: italic;">DoSomeWork</span>() is a now a public method of class <span style="font-style: italic;">MyClass </span>and <span style="font-style: italic;">myObj1 </span>and <span style="font-style: italic;">myObj2 </span>are objects of that class.</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal" style="font-weight: bold;"><span style="font-size:100%;">Listing 7:</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;">private</span><span style="font-size:85%;"> void uxStartThreadsButton_Click</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;">(object sender, System.EventArgs e)</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;">{</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;"></span></p>
<p class="MsoNormal" style="margin-left: 1in; color: #000099;"><span style="font-size:85%;">Thread thread1 = new Thread(new ThreadStart(myObj1.DoSomeJob));</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;">thread1.Name = &#8220;Thread 1&#8243;;</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;"></span></p>
<p class="MsoNormal" style="margin-left: 1in;"><span style="font-size:85%;"><span style="color: #000099;">Thread thread2 = new Thread(new ThreadStart(myObj2.DoSomeJob));</span></span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;">thread2.Name = &#8220;Thread 2&#8243;;</span></p>
<p class="MsoNormal" style="color: #000099;font-family:verdana;"><span style="font-size:85%;"></span></p>
<p class="MsoNormal" style="color: #000099;"><span style="font-size:85%;">thread1.Start();</span></p>
<p class="MsoNormal" style="color: #000099; font-family: verdana;"><span style="font-size:85%;">thread2.Start();</span></p>
<p class="MsoNormal"><span style="font-size:0;"><span style="color: #000099;font-family:verdana;font-size:85%;">}</span></span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:100%;">Note that the above code will create two threads that execute on two separate instances on <span style="font-style: italic;">DoSomeJob</span>(). Since the lock is <span style="font-weight: bold;">instance specific</span> (each thread will lock on to the object’s corresponding private object) thread 1 and thread 2 <span style="font-weight: bold;">will execute in parallel</span>. This might be alright is most cases as the data inside the critical section we are trying to protect will be instance specific. On the other hand, if both the methods are of the same instance, they would take turns is accessing the critical section as shown in listing 4.<br />
</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:100%;">And lastly, to lock critical sections across all instances, use a private static object</span></p>
<p class="MsoNormal" style="color: #000099;"><span style="font-size:85%;">private static Object _lockObject =</span><span style="font-size:85%;"> </span><span style="font-size:85%;">new Object();</span></p>
<p class="MsoNormal" style="color: #000000;"><span style="font-size:100%;">For completeness sake I&#8217;ll mention two other expressions that can be used with lock. I highly recommend that you <span style="font-weight: bold;">don&#8217;t</span> use them because of the pitfalls mentioned.</span></p>
<p class="MsoNormal" style="color: #000000;"><span style="font-size:100%;">1. lock(typeOf(<span style="font-style: italic;">type</span>)): typeOf() returns a System.Type of the type you pass. Using lock this way is not recommended if the type is public. Same problem as <span style="font-style: italic;">this</span>.<br />
eg: lock(typeOf(MyClass))<br />
</span></p>
<p class="MsoNormal" style="color: #000099;"><span style="color: #000000;font-size:85%;"><span style="color: #000000;font-size:100%;">2. lock(&#8220;<span style="font-style: italic;">somestring</span>&#8220;):</span></span><span style="color: #000000;font-size:100%;"> This is a classic. Using lock this way is also not recommended because any other code using the same <span style="font-style: italic;">string </span>will share the lock!</span><span style="font-size:85%;"><br />
</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:100%;">Well, that’s it for this edition. Hopefully you are better off that when you started reading this article. If not, the blame is all mine. I should have done a better job. But if you promise to keep reading and commenting, I promise to keep improving.</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:100%;">In the next edition I shall be covering problems and best practices on accessing UI controls from non UI threads, invokes and a real life deadlock problem that happens when you put them all together using masking tape.</span></p>
<p class="MsoNormal"><span style="font-size:100%;">Code Safely.<br />
<span style="font-weight: bold; color: #009900; font-style: italic;">Alex</span><br />
</span></p>
<p class="MsoNormal"><span style="font-size:85%;"></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.discretevector.com/2008/02/locks-threads-and-this-huh-most-people.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
