<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7673453</id><updated>2012-01-15T10:58:02.112-08:00</updated><title type='text'>I'm a fermion !!</title><subtitle type='html'>The ramblings of a disgruntled geek!!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ughani.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>28</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7673453.post-8351183164803537515</id><published>2011-08-09T03:54:00.001-07:00</published><updated>2012-01-15T10:58:02.119-08:00</updated><title type='text'>Ye Olde Mirror Effect!</title><content type='html'>I use a Mac normally. I have to go back to Windows from time to time. After Mac OS X Lion reverse-scrolling, switching between Mac and Windows became a pain. I started to use AutoHotKey on my Windows machines to simulate the reverse-scrolling from Lion. All was well. Until I remoted from one of my Windows machines into another Windows machine which also had AutoHotKey installed with reverse-scroll script enabled. Guess what, it went back to the original scroll direction. I couldn't figure out for a while what was happening, until I suddenly realized what had happened. I couldn't stop laughing at myself for a long time :)&lt;br /&gt;&lt;br /&gt;&lt;i&gt;(Of course the solution was to suspend AHK on the target machine when I was remoted in)&lt;/i&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-8351183164803537515?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/8351183164803537515'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/8351183164803537515'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2011/08/ye-olde-mirror-effect.html' title='Ye Olde Mirror Effect!'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-7673453.post-6337217183918795765</id><published>2010-06-07T13:21:00.004-07:00</published><updated>2010-06-07T13:22:58.618-07:00</updated><title type='text'>Windbg + SOS Cheat Sheet</title><content type='html'>This is a useful link for people who use windbg/cdb for debugging Managed code. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://blogs.msdn.com/b/alejacma/archive/2009/06/30/sos-cheat-sheet-net-2-0-3-0-3-5.aspx"&gt;Cheat Sheet&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Visual Studio debugging might not always be helpful or it might not always be available.&lt;br /&gt;Sometimes when you want to take a quick look at what's wrong, saying c:\debuggers\cdb -pn &lt;process name&gt; helps a lot.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-6337217183918795765?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/6337217183918795765'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/6337217183918795765'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2010/06/windbg-sos-cheat-sheet.html' title='Windbg + SOS Cheat Sheet'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-7673453.post-2098038112589313985</id><published>2009-06-24T11:46:00.004-07:00</published><updated>2009-06-24T11:55:37.019-07:00</updated><title type='text'>Reporting issues with Windows Azure</title><content type='html'>For those of you out there who have tried Windows Azure and face problems, here is how you are supposed to report issues at the Windows Azure forum:&lt;br /&gt;&lt;br /&gt;http://social.msdn.microsoft.com/Forums/en-US/windowsazure/threads/&lt;br /&gt;&lt;br /&gt;Steps you need to follow:&lt;br /&gt;&lt;br /&gt;1. Sign into Windows Azure portal.&lt;br /&gt;2. Go to your Hosted Service Project which is causing issues.&lt;br /&gt;3. Wait for the project info to load.&lt;br /&gt;4. Copy the private deployment id.&lt;br /&gt;5. Write a brief description of what you did, what you are seeing and add your private deployment id.&lt;br /&gt;&lt;br /&gt;Here is a screen shot of my service showing the private deployment id.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_FGzEF6yfgQo/SkJ2VpcWAvI/AAAAAAAAB5U/8r290Ii3XgE/s1600-h/how+to+report+incident.png"&gt;&lt;img style="MARGIN: 0px 10px 10px 0px; WIDTH: 320px; FLOAT: left; HEIGHT: 197px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5350969421543637746" border="0" alt="" src="http://1.bp.blogspot.com/_FGzEF6yfgQo/SkJ2VpcWAvI/AAAAAAAAB5U/8r290Ii3XgE/s320/how+to+report+incident.png" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-2098038112589313985?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/2098038112589313985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/2098038112589313985'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2009/06/reporting-issues-with-windows-azure.html' title='Reporting issues with Windows Azure'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_FGzEF6yfgQo/SkJ2VpcWAvI/AAAAAAAAB5U/8r290Ii3XgE/s72-c/how+to+report+incident.png' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-7673453.post-6887148850646267768</id><published>2009-03-03T18:49:00.002-08:00</published><updated>2009-03-04T00:12:03.915-08:00</updated><title type='text'>ThreadStaticAttribute</title><content type='html'>&lt;span xmlns="xmlns"&gt;   &lt;p&gt;Reminder to self:     &lt;br /&gt;      &lt;br /&gt;ThreadStaticAttribute only works with static fields!      &lt;br /&gt;      &lt;br /&gt;Here is why:      &lt;br /&gt;&lt;/p&gt;    &lt;p&gt;public class TestingTLS     &lt;br /&gt;{      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; [ThreadStatic]      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; public static int value = 0;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; [ThreadStatic]      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; public int value2 = 0;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;} &lt;/p&gt;    &lt;p&gt;public class MyClass     &lt;br /&gt;{      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; public static void TLSTest()      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; TestingTLS tls = new TestingTLS();      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Dictionary&amp;lt;int, Thread&amp;gt; threads = new Dictionary&amp;lt;int, Thread&amp;gt;();      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Semaphore sem = new Semaphore(100, 100);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; long count = 0;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; for ( int i = 0 ; i &amp;lt; 100 ; i ++ )      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Thread t = new Thread(state =&amp;gt; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; int tid = Thread.CurrentThread.ManagedThreadId;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; TestingTLS.value = tid;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Thread.Sleep(0);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if ( tid != TestingTLS.value )      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Console.Error.WriteLine( &amp;quot;Value 1: {0} read {1}&amp;quot;, tid, TestingTLS.value );      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Interlocked.Increment(ref count);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; tls.value2 = tid;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Thread.Sleep(0);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if ( tid != tls.value2 )      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Console.Error.WriteLine( &amp;quot;Value 2: {0} read {1}&amp;quot;, tid, tls.value2);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Interlocked.Increment(ref count); &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; threads.Remove(tid);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if ( threads.Count == 0 )      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sem.Release();      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; });      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; threads.Add(t.ManagedThreadId, t);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sem.WaitOne();      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; t.Start();&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Console.WriteLine(&amp;quot;Waiting for all threads to finish...&amp;quot;);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sem.WaitOne();      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Console.WriteLine(&amp;quot;Total races: &amp;quot; + count);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }      &lt;br /&gt;}&lt;/p&gt;    &lt;p&gt;&lt;span style="font-size: 10pt; color: white; font-family: consolas; background-color: black"&gt;       &lt;br /&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p&gt;     &lt;br /&gt;You will see races for value2 but not for value.      &lt;br /&gt;      &lt;br /&gt;Update: The code snippet was updated, since the previous example had a race where the Total Race count would reach before all threads have finished reporting the wrong number of total races in cases where there were large number of races.&lt;/p&gt; &lt;/span&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-6887148850646267768?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/6887148850646267768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/6887148850646267768'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2009/03/threadstaticattribute.html' title='ThreadStaticAttribute'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-7673453.post-4317201937348801950</id><published>2009-01-28T18:58:00.006-08:00</published><updated>2009-01-28T19:04:24.562-08:00</updated><title type='text'>First Azure Service is live!</title><content type='html'>&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dotfermion.cloudapp.net"&gt;This&lt;/a&gt; is my first Azure service that I wrote a couple of weeks ago. It only uses the front end roles and no storage. I will add other applications to this portal, which will use other services offered by Azure.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-4317201937348801950?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/4317201937348801950'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/4317201937348801950'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2009/01/first-azure-service-is-live.html' title='First Azure Service is live!'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-7673453.post-5991509600709884983</id><published>2009-01-28T18:16:00.006-08:00</published><updated>2009-01-28T19:04:48.770-08:00</updated><title type='text'>XmlTextReader fiasco</title><content type='html'>&lt;br/&gt;&lt;br /&gt;I hit a snag a few days ago while doing some Xml parsing in one of my applications. &lt;br /&gt;&lt;br /&gt;I am using XDocument for Xml parsing(XLinq is beautiful (K)).&lt;br /&gt;&lt;br /&gt;Doing XDocument.Load(urlString) or XmlTextReader(&lt;url or Stream&gt;) would make my application choke with an Xml parsing error (invalid character). Using StreamReader to wrap the actual stream (WebResponse.GetResponseStream) and passing it to XDocument works like a charm. I wrote a sample app to figure out the issue and it turns out that XmlTextReader is the culprit. Maybe it fails to correctly recognize UTF-8 markers, or maybe it's stricter than other Readers, it didn't work for me. So beware. :)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Code Snippet (fails):&lt;/b&gt;&lt;br /&gt;WebRequest req = WebRequest.Create("&lt;url&gt;");&lt;br /&gt;WebResponse res = req.GetResponse();&lt;br /&gt;XmlTextReader reader = new XmlTextReader(res.GetResponseStream());&lt;br /&gt;XDocument xdoc = XDocument.Load(reader, LoadOptions.SetLineInfo); //LoadOptions.SetLineInfo helps with debugging. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Code Snippet (works):&lt;/b&gt;&lt;br /&gt;WebRequest req = WebRequest.Create("&lt;url&gt;");&lt;br /&gt;WebResponse res = req.GetResponse();&lt;br /&gt;StreamReader reader = new StreamReader(res.GetResponseStream());&lt;br /&gt;XDocument xdoc = XDocument.Load(reader, LoadOptions.SetLineInfo); //LoadOptions.SetLineInfo helps with debugging. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Happy XLinq-ing.&lt;br /&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-5991509600709884983?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/5991509600709884983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/5991509600709884983'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2009/01/xmltextreader-fiasco.html' title='XmlTextReader fiasco'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-7673453.post-623711049916419769</id><published>2008-11-25T17:00:00.009-08:00</published><updated>2009-01-28T19:05:20.941-08:00</updated><title type='text'>A Custom SpinLock based CriticalSection Implementation</title><content type='html'>&lt;br /&gt;&lt;br /&gt;Just something I implemented for fun :)&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;PRE&gt;&lt;br /&gt;&lt;FONT color="0000ff"&gt;&lt;STRONG&gt;#include &lt;FONT color="#008000"&gt;&amp;quot;stdafx.h&amp;quot;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;&lt;FONT color="0000ff"&gt;&lt;STRONG&gt;#include &lt;FONT color="#008000"&gt;&amp;lt;intrin.h&amp;gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;&lt;FONT color="0000ff"&gt;&lt;STRONG&gt;#include &lt;FONT color="#008000"&gt;&amp;lt;process.h&amp;gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;&lt;FONT color="0000ff"&gt;&lt;STRONG&gt;#include &lt;FONT color="#008000"&gt;&amp;lt;vector&amp;gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;&lt;FONT color="0000ff"&gt;&lt;STRONG&gt;#include &lt;FONT color="#008000"&gt;&amp;lt;utility&amp;gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;&lt;FONT color="0000ff"&gt;&lt;STRONG&gt;#include &lt;FONT color="#008000"&gt;&amp;lt;algorithm&amp;gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;&lt;FONT color="0000ff"&gt;&lt;STRONG&gt;#include &lt;FONT color="#008000"&gt;&amp;lt;iostream&amp;gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;&lt;FONT color="0000ff"&gt;&lt;STRONG&gt;#pragma intrinsic (_InterlockedCompareExchange, _InterlockedExchange)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;&lt;STRONG&gt;namespace&lt;/STRONG&gt; &lt;FONT color="#2040a0"&gt;DotFermion&lt;/FONT&gt;&lt;br /&gt;&lt;FONT color="4444FF"&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;    &lt;STRONG&gt;class&lt;/STRONG&gt; &lt;FONT color="#2040a0"&gt;CCriticalSection&lt;/FONT&gt;&lt;br /&gt;    &lt;FONT color="4444FF"&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;        &lt;STRONG&gt;enum&lt;/STRONG&gt; &lt;FONT color="4444FF"&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;LOCK_IS_FREE&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;=&lt;/FONT&gt; &lt;FONT color="#FF0000"&gt;0&lt;/FONT&gt;, &lt;FONT color="#2040a0"&gt;LOCK_IS_TAKEN&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;=&lt;/FONT&gt; &lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;    &lt;STRONG&gt;private&lt;/STRONG&gt;&lt;FONT color="4444FF"&gt;:&lt;/FONT&gt;&lt;br /&gt;        &lt;STRONG&gt;long&lt;/STRONG&gt; &lt;FONT color="#2040a0"&gt;lock&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;        &lt;STRONG&gt;long&lt;/STRONG&gt; &lt;FONT color="#2040a0"&gt;ownerThreadId&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;        &lt;STRONG&gt;long&lt;/STRONG&gt; &lt;FONT color="#2040a0"&gt;acquireCount&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;    &lt;STRONG&gt;public&lt;/STRONG&gt;&lt;FONT color="4444FF"&gt;:&lt;/FONT&gt;&lt;br /&gt;        &lt;FONT color="#2040a0"&gt;CCriticalSection&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;:&lt;/FONT&gt;&lt;br /&gt;          &lt;FONT color="#2040a0"&gt;lock&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;LOCK_IS_FREE&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;,&lt;FONT color="#2040a0"&gt;ownerThreadId&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;,&lt;FONT color="#2040a0"&gt;acquireCount&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="#FF0000"&gt;0&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;          ~&lt;FONT color="#2040a0"&gt;CCriticalSection&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;br /&gt;          &lt;FONT color="4444FF"&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;              &lt;FONT color="#2040a0"&gt;Release&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;          &lt;FONT color="4444FF"&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;          &lt;FONT color="#444444"&gt;//Non-recursive Acquire. Once its called, all threads, even the one owning the lock block on this lock.&lt;/FONT&gt;&lt;br /&gt;          &lt;FONT color="#444444"&gt;//Even a subsequent AcquireRecursive call after this one blocks.&lt;/FONT&gt;&lt;br /&gt;          &lt;STRONG&gt;void&lt;/STRONG&gt; &lt;FONT color="#2040a0"&gt;Acquire&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;br /&gt;          &lt;FONT color="4444FF"&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;              &lt;STRONG&gt;while&lt;/STRONG&gt; &lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;_InterlockedExchange&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;amp;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;lock&lt;/FONT&gt;, &lt;FONT color="#2040a0"&gt;LOCK_IS_TAKEN&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;=&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;=&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;LOCK_IS_TAKEN&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;          &lt;FONT color="4444FF"&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;          &lt;FONT color="#444444"&gt;//Recursive Acquire. It doesn&amp;#39;t block if called multiple times from the same thread.&lt;/FONT&gt;&lt;br /&gt;          &lt;STRONG&gt;void&lt;/STRONG&gt; &lt;FONT color="#2040a0"&gt;AcquireRecursive&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;STRONG&gt;long&lt;/STRONG&gt; &lt;FONT color="#2040a0"&gt;threadId&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;br /&gt;          &lt;FONT color="4444FF"&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;              &lt;STRONG&gt;if&lt;/STRONG&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;ownerThreadId&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;!&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;=&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;&amp;amp;&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;amp;&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;threadId&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;=&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;=&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;ownerThreadId&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;br /&gt;              &lt;FONT color="4444FF"&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;                  &lt;FONT color="#2040a0"&gt;_InterlockedIncrement&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;amp;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;acquireCount&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;                  &lt;STRONG&gt;return&lt;/STRONG&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;              &lt;FONT color="4444FF"&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;              &lt;FONT color="#2040a0"&gt;Acquire&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;              &lt;FONT color="#2040a0"&gt;_InterlockedExchange&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;amp;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;ownerThreadId&lt;/FONT&gt;, &lt;FONT color="#2040a0"&gt;threadId&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;              &lt;FONT color="#2040a0"&gt;_InterlockedIncrement&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;amp;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;acquireCount&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;          &lt;FONT color="4444FF"&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;&lt;br /&gt;          &lt;STRONG&gt;void&lt;/STRONG&gt; &lt;FONT color="#2040a0"&gt;Release&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;br /&gt;          &lt;FONT color="4444FF"&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;              &lt;STRONG&gt;if&lt;/STRONG&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;acquireCount&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;&amp;gt;&lt;/FONT&gt; &lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;br /&gt;              &lt;FONT color="4444FF"&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;                  &lt;FONT color="#2040a0"&gt;_InterlockedDecrement&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;amp;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;acquireCount&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;                  &lt;STRONG&gt;return&lt;/STRONG&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;              &lt;FONT color="4444FF"&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;              &lt;FONT color="#2040a0"&gt;_InterlockedExchange&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;amp;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;acquireCount&lt;/FONT&gt;, &lt;FONT color="#FF0000"&gt;0&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;              &lt;FONT color="#2040a0"&gt;_InterlockedExchange&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;amp;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;ownerThreadId&lt;/FONT&gt;, &lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;              &lt;FONT color="#2040a0"&gt;_InterlockedExchange&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;amp;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;lock&lt;/FONT&gt;, &lt;FONT color="#2040a0"&gt;LOCK_IS_FREE&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;          &lt;FONT color="4444FF"&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;    &lt;FONT color="4444FF"&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;&lt;br /&gt;&lt;FONT color="4444FF"&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;&lt;br /&gt;&lt;FONT color="0000ff"&gt;&lt;STRONG&gt;#define LIST_POS = 4;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;&lt;FONT color="0000ff"&gt;&lt;STRONG&gt;#define INDEX_POS = 8;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;&lt;br /&gt;&lt;STRONG&gt;typedef&lt;/STRONG&gt; &lt;STRONG&gt;void&lt;/STRONG&gt; &lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;*&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;LPFNTHREADPROC&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;STRONG&gt;void&lt;/STRONG&gt;&lt;FONT color="4444FF"&gt;*&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;&lt;STRONG&gt;typedef&lt;/STRONG&gt; &lt;FONT color="#2040a0"&gt;std&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;:&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;:&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;vector&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;uintptr_t&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;gt;&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;THREADLIST&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;&lt;STRONG&gt;typedef&lt;/STRONG&gt; &lt;FONT color="#2040a0"&gt;THREADLIST&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;*&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;PTHREADLIST&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;&lt;STRONG&gt;typedef&lt;/STRONG&gt; &lt;STRONG&gt;struct&lt;/STRONG&gt; &lt;FONT color="#2040a0"&gt;_args_t&lt;/FONT&gt;&lt;br /&gt;&lt;FONT color="4444FF"&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;    &lt;FONT color="#2040a0"&gt;DotFermion&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;:&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;:&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;CCriticalSection&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;*&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;pCs&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;    &lt;FONT color="#2040a0"&gt;PTHREADLIST&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;pThreadList&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;    &lt;STRONG&gt;int&lt;/STRONG&gt; &lt;FONT color="#2040a0"&gt;index&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;&lt;FONT color="4444FF"&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;args_t&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;&lt;br /&gt;&lt;FONT color="#2040a0"&gt;THREADLIST&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;g_ThreadList&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;&lt;STRONG&gt;int&lt;/STRONG&gt; &lt;FONT color="#2040a0"&gt;g_ThreadCount&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;=&lt;/FONT&gt; &lt;FONT color="#FF0000"&gt;0&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;&lt;STRONG&gt;int&lt;/STRONG&gt; &lt;FONT color="#2040a0"&gt;g_SharedCounter&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;=&lt;/FONT&gt; &lt;FONT color="#FF0000"&gt;0&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;&lt;br /&gt;&lt;STRONG&gt;void&lt;/STRONG&gt; &lt;FONT color="#2040a0"&gt;ThreadProc&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;STRONG&gt;void&lt;/STRONG&gt;&lt;FONT color="4444FF"&gt;*&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;argList&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;br /&gt;&lt;FONT color="4444FF"&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;    &lt;FONT color="#2040a0"&gt;args_t&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;*&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;args&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;=&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;args_t&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;*&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;argList&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;    &lt;FONT color="#2040a0"&gt;args&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;pCs&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;AcquireRecursive&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;STRONG&gt;long&lt;/STRONG&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;args&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;pThreadList&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;at&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;args&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;index&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;    &lt;FONT color="#2040a0"&gt;g_SharedCounter&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;+&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;+&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;    &lt;FONT color="#2040a0"&gt;args&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;pCs&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;AcquireRecursive&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;STRONG&gt;long&lt;/STRONG&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;args&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;pThreadList&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;at&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;args&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;index&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;    &lt;FONT color="#2040a0"&gt;g_SharedCounter&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;+&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;+&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;    &lt;FONT color="#2040a0"&gt;args&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;pCs&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;Release&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;    &lt;FONT color="#2040a0"&gt;args&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;pThreadList&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;at&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;args&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;index&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;=&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="#FF0000"&gt;1L&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;    &lt;FONT color="#2040a0"&gt;g_ThreadCount&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;    &lt;FONT color="#2040a0"&gt;args&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;pCs&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;Release&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;    &lt;STRONG&gt;delete&lt;/STRONG&gt; &lt;FONT color="#2040a0"&gt;args&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;&lt;FONT color="4444FF"&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;&lt;br /&gt;&lt;STRONG&gt;int&lt;/STRONG&gt; &lt;FONT color="#2040a0"&gt;StartThreads&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;(&lt;/FONT&gt; &lt;STRONG&gt;int&lt;/STRONG&gt; &lt;FONT color="#2040a0"&gt;n&lt;/FONT&gt;, &lt;FONT color="#2040a0"&gt;PTHREADLIST&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;pThreadList&lt;/FONT&gt;, &lt;FONT color="#2040a0"&gt;DotFermion&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;:&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;:&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;CCriticalSection&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;*&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;cs&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;br /&gt;&lt;FONT color="4444FF"&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;    &lt;FONT color="#2040a0"&gt;pThreadList&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;resize&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;n&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;    &lt;STRONG&gt;for&lt;/STRONG&gt; &lt;FONT color="4444FF"&gt;(&lt;/FONT&gt; &lt;STRONG&gt;int&lt;/STRONG&gt; &lt;FONT color="#2040a0"&gt;i&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;=&lt;/FONT&gt; &lt;FONT color="#FF0000"&gt;0&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;;&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;i&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;&amp;lt;&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;n&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;;&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;i&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;+&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;+&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;br /&gt;    &lt;FONT color="4444FF"&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;        &lt;FONT color="#2040a0"&gt;args_t&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;*&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;args&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;=&lt;/FONT&gt; &lt;STRONG&gt;new&lt;/STRONG&gt; &lt;FONT color="#2040a0"&gt;args_t&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;        &lt;STRONG&gt;if&lt;/STRONG&gt; &lt;FONT color="4444FF"&gt;(&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;args&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;=&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;=&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;NULL&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;)&lt;/FONT&gt; &lt;STRONG&gt;continue&lt;/STRONG&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;        &lt;FONT color="#2040a0"&gt;args&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;pCs&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;=&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;cs&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;        &lt;FONT color="#2040a0"&gt;args&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;pThreadList&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;=&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;pThreadList&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;        &lt;FONT color="#2040a0"&gt;args&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;index&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;=&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;i&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;        &lt;FONT color="#2040a0"&gt;uintptr_t&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;threadId&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;=&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;_beginthread&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;ThreadProc&lt;/FONT&gt;, &lt;FONT color="#FF0000"&gt;0&lt;/FONT&gt;, &lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;STRONG&gt;void&lt;/STRONG&gt;&lt;FONT color="4444FF"&gt;*&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;args&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;        &lt;STRONG&gt;if&lt;/STRONG&gt; &lt;FONT color="4444FF"&gt;(&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;threadId&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;!&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;=&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="#FF0000"&gt;1L&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;br /&gt;        &lt;FONT color="4444FF"&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;            &lt;FONT color="#2040a0"&gt;cs&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;Acquire&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;            &lt;FONT color="#2040a0"&gt;pThreadList&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;at&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;i&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;=&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;threadId&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;            &lt;FONT color="#2040a0"&gt;g_ThreadCount&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;+&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;+&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;            &lt;FONT color="#2040a0"&gt;cs&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;-&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;Release&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;        &lt;FONT color="4444FF"&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;    &lt;FONT color="4444FF"&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;    &lt;STRONG&gt;return&lt;/STRONG&gt; &lt;FONT color="#2040a0"&gt;g_ThreadCount&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;&lt;FONT color="4444FF"&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;STRONG&gt;void&lt;/STRONG&gt; &lt;FONT color="#2040a0"&gt;Join&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;STRONG&gt;int&lt;/STRONG&gt;&lt;FONT color="4444FF"&gt;*&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;threadCount&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;br /&gt;&lt;FONT color="4444FF"&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;    &lt;STRONG&gt;while&lt;/STRONG&gt; &lt;FONT color="4444FF"&gt;(&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;*&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;threadCount&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;&lt;FONT color="4444FF"&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;&lt;br /&gt;&lt;STRONG&gt;int&lt;/STRONG&gt; &lt;FONT color="#2040a0"&gt;_tmain&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;STRONG&gt;int&lt;/STRONG&gt; &lt;FONT color="#2040a0"&gt;argc&lt;/FONT&gt;, &lt;FONT color="#2040a0"&gt;_TCHAR&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;*&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;argv&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;[&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;]&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;br /&gt;&lt;FONT color="4444FF"&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;    &lt;FONT color="#2040a0"&gt;DotFermion&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;:&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;:&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;CCriticalSection&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;cs&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;    &lt;FONT color="#2040a0"&gt;StartThreads&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="#FF0000"&gt;100&lt;/FONT&gt;, &lt;FONT color="4444FF"&gt;&amp;amp;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;g_ThreadList&lt;/FONT&gt;, &lt;FONT color="4444FF"&gt;&amp;amp;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;cs&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;    &lt;FONT color="#2040a0"&gt;Join&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;(&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;amp;&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;g_ThreadCount&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;)&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;    &lt;FONT color="#2040a0"&gt;std&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;:&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;:&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;cout&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;lt;&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;g_SharedCounter&lt;/FONT&gt; &lt;FONT color="4444FF"&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;&amp;lt;&lt;/FONT&gt; &lt;FONT color="#2040a0"&gt;std&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;:&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;:&lt;/FONT&gt;&lt;FONT color="#2040a0"&gt;endl&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;    &lt;STRONG&gt;return&lt;/STRONG&gt; &lt;FONT color="#FF0000"&gt;0&lt;/FONT&gt;&lt;FONT color="4444FF"&gt;;&lt;/FONT&gt;&lt;br /&gt;&lt;FONT color="4444FF"&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;&lt;/PRE&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-623711049916419769?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/623711049916419769'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/623711049916419769'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2008/11/custom-spinlock-based-criticalsection.html' title='A Custom SpinLock based CriticalSection Implementation'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-7673453.post-783972261504359257</id><published>2008-10-25T21:51:00.003-07:00</published><updated>2009-01-28T19:07:06.060-08:00</updated><title type='text'>My own GetWsdl tool</title><content type='html'>&lt;br/&gt;&lt;br /&gt;&lt;p&gt;I finally figured it out. It was there right in front of my eyes. I stumbled upon it so many times, but I always missed it. &lt;/p&gt;  &lt;p&gt;I have been doing web service development for quite some time now. These services are part of pretty complex systems that require a long time to deploy. Imagine, every time there was a build number change and I wanted to modify one of the services. I wrote the code, built it, deployed the services (this step was the longest and most painful), got the wsdl, generated the proxy and updated and built again. The reason it required full redeployment on build number changes is that the assemblies are bound by strong names. It was one heck of a time consuming job. All this work, just to update the proxy; WSDL generation required a live service. :)&lt;/p&gt;  &lt;p&gt;Though I still have to do this to verify that the code that I wrote actually works, proxy generation is not that much of a hassle, especially when I am writing code that I know works already and there is minimal need to try it out.&lt;/p&gt;  &lt;p&gt;This time has been drastically reduced. Thanks to &lt;font face="courier new"&gt;System.Web.Services.Description.     &lt;br /&gt;ServiceDescriptionReflector&lt;/font&gt;.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The GetWsdl tool is here. I will publish it soon. Stay tuned.&lt;/p&gt; &lt;br/&gt; &lt;p&gt;-UG&lt;/p&gt;  &lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-783972261504359257?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/783972261504359257'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/783972261504359257'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2008/10/my-own-getwsdl-tool.html' title='My own GetWsdl tool'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-7673453.post-3934735779144781860</id><published>2008-10-21T02:55:00.001-07:00</published><updated>2008-10-21T02:55:07.956-07:00</updated><title type='text'>Update</title><content type='html'>&lt;p&gt;I haven’t updated my blog for ages. This is a just a refresh post :)&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-3934735779144781860?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/3934735779144781860'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/3934735779144781860'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2008/10/update.html' title='Update'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-7673453.post-1776714175043432195</id><published>2007-11-11T16:05:00.002-08:00</published><updated>2009-01-28T19:06:27.667-08:00</updated><title type='text'>This is neat</title><content type='html'>&lt;br/&gt;&lt;br /&gt;&lt;p&gt;&lt;a title="http://scrapzilla.blogspot.com/2007/11/remember-remember_7668.html" href="http://scrapzilla.blogspot.com/2007/11/remember-remember_7668.html"&gt;http://scrapzilla.blogspot.com/2007/11/remember-remember_7668.html&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;A picture (and a good line) is worth a million words.&lt;/p&gt;  &lt;p&gt;Update: There was a picture of masks (the ones worn by revolutionaries in Vendetta)&amp;#160; stored inside a fire extinguisher container with a hammer by its side saying, “In case of revolution, break glass”. Below the picture, it says: “And the hammer hangs on”.&lt;/p&gt;  &lt;p&gt;Update 2: Here is the original picture :)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/usman.ghani/SP2vBVXBlgI/AAAAAAAABcA/M-Yo5c47kWU/s1600-h/v3%5B3%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="v3" border="0" alt="v3" src="http://lh6.ggpht.com/usman.ghani/SP2vB-spVNI/AAAAAAAABcE/b_Wf1LgGxQ8/v3_thumb%5B1%5D.jpg?imgmax=800" width="182" height="241" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-1776714175043432195?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/1776714175043432195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/1776714175043432195'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2007/11/this-is-neat.html' title='This is neat'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/usman.ghani/SP2vB-spVNI/AAAAAAAABcE/b_Wf1LgGxQ8/s72-c/v3_thumb%5B1%5D.jpg?imgmax=800' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-7673453.post-3171780611876309261</id><published>2007-11-08T13:50:00.001-08:00</published><updated>2007-11-08T13:50:28.923-08:00</updated><title type='text'>Gra(n)d Finale</title><content type='html'>&lt;span xmlns=''&gt;&lt;p&gt;This is my first exam as a grad student.&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-3171780611876309261?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/3171780611876309261'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/3171780611876309261'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2007/11/grand-finale_09.html' title='Gra(n)d Finale'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-7673453.post-6919632641887814748</id><published>2007-11-07T06:01:00.001-08:00</published><updated>2007-11-07T06:01:07.671-08:00</updated><title type='text'>The Grand Finale</title><content type='html'>&lt;span xmlns=''&gt;&lt;p&gt;The finals start from Sunday November 11, 2007. The first quarter has ended. Phew &lt;span style='font-family:Wingdings'&gt;J&lt;/span&gt;&lt;br /&gt;			&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-6919632641887814748?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/6919632641887814748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/6919632641887814748'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2007/11/grand-finale.html' title='The Grand Finale'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-7673453.post-6073728048550976748</id><published>2007-05-01T17:25:00.001-07:00</published><updated>2007-05-01T17:25:23.778-07:00</updated><title type='text'>Fear</title><content type='html'>&lt;span xmlns=''&gt;&lt;p&gt;Train yourself to let go… of everything you fear to lose.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The fear of loss is the path to the dark side.&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-6073728048550976748?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/6073728048550976748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/6073728048550976748'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2007/05/fear.html' title='Fear'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-7673453.post-115670349879839997</id><published>2006-08-27T11:31:00.000-07:00</published><updated>2006-08-27T11:31:38.803-07:00</updated><title type='text'>You're a towel!!</title><content type='html'>&lt;p&gt;You're a beaner towel.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-115670349879839997?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/115670349879839997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/115670349879839997'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2006/08/youre-towel.html' title='You&apos;re a towel!!'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-7673453.post-115670340166982626</id><published>2006-08-27T11:30:00.000-07:00</published><updated>2006-08-27T11:30:01.673-07:00</updated><title type='text'>Trying Windows Live Writer (Beta)</title><content type='html'>&lt;p&gt;This is an awesome product.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-115670340166982626?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/115670340166982626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/115670340166982626'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2006/08/trying-windows-live-writer-beta.html' title='Trying Windows Live Writer (Beta)'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-7673453.post-114432367331414778</id><published>2006-04-06T04:29:00.000-07:00</published><updated>2006-08-27T11:41:24.040-07:00</updated><title type='text'>The Microsoft Trilogy</title><content type='html'>&lt;p&gt;Microsoft ? Me ? No! it cant be like that !! That was the first question I asked for atleast one week when I got up !! It all happened in a snap and I never knew. It all started with a phone interview and the next thing I knew was a congratulations email from Microsoft telling me that I was hired. &lt;/p&gt; &lt;p&gt;It all started like this: &lt;/p&gt; &lt;p&gt;One of my friends sent me an email about Microsoft coming to Dubai to hire Pakistanis. I did not send my CV at first. But then a friend of mine sent his CV, and he got a phone interview. I sent my CV somewhere near the end of January, and got a phone interview in a couple of days. That was unbelievable. It was a lady named Priya, who emailed me and then took my phone interview. That interview was one heck of an experience for me. I thought I had a terrible interview and I never saw myself clearing that one. I got all the technical questions right, but I failed the IQ question. And as I had heard, the IQ question was the decider, which was wrong. In a week I got an email inviting me to Dubai for in-person interviews. This was the beginning of a very long and painful process.... &lt;/p&gt; &lt;p&gt;To be continued...&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-114432367331414778?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/114432367331414778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/114432367331414778'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2006/04/microsoft-trilogy.html' title='The Microsoft Trilogy'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-7673453.post-114427763670692143</id><published>2006-04-05T15:53:00.000-07:00</published><updated>2006-08-27T11:33:34.186-07:00</updated><title type='text'>http://www.sellsbrothers.com/</title><content type='html'>&lt;p&gt;This is the home of king of COM, Chris Sells. Also has some stuff related to MS interviews.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-114427763670692143?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/114427763670692143'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/114427763670692143'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2006/04/httpwwwsellsbrotherscom.html' title='http://www.sellsbrothers.com/'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-7673453.post-114427752073032794</id><published>2006-04-05T15:51:00.000-07:00</published><updated>2006-08-27T11:35:56.993-07:00</updated><title type='text'>http://www.joelonsoftware.com</title><content type='html'>&lt;p&gt;Home of the founder of FogCreek software and the former Program Manager of the Excel team, Joel Spolsky.&lt;/p&gt; &lt;p&gt;Also see &lt;a href="http://joelonsoftware.com/Archive.html" target="_blank"&gt;the archive&lt;/a&gt;&amp;nbsp;for some interesting articles by Joel.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-114427752073032794?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/114427752073032794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/114427752073032794'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2006/04/httpwwwjoelonsoftwarecom.html' title='http://www.joelonsoftware.com'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-7673453.post-114427669205635886</id><published>2006-04-05T15:38:00.000-07:00</published><updated>2006-08-27T11:37:43.376-07:00</updated><title type='text'>http://blogs.msdn.com/oldnewthing/</title><content type='html'>&lt;p&gt;The blog maintained by Raymond Chen, the Windows guru. It has some very interesting articles on Windows history.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-114427669205635886?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/114427669205635886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/114427669205635886'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2006/04/httpblogsmsdncomoldnewthing.html' title='http://blogs.msdn.com/oldnewthing/'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-7673453.post-114427605676878308</id><published>2006-04-05T15:25:00.000-07:00</published><updated>2006-04-06T04:56:06.713-07:00</updated><title type='text'>I'm a SOFTIE now !!</title><content type='html'>I am SDE ( Software Design Engineer ) with the OneCare team now. &lt;br /&gt;Oh, I cant believe it yet.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-114427605676878308?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/114427605676878308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/114427605676878308'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2006/04/im-softie-now.html' title='I&apos;m a SOFTIE now !!'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-7673453.post-114427549265167876</id><published>2006-04-05T15:15:00.000-07:00</published><updated>2006-04-05T15:18:12.653-07:00</updated><title type='text'>Being high at SOFTEC !!</title><content type='html'>Come SOFTEC 2006 and it's time to travel to Lahore ( and get high !! ).&lt;br /&gt;We had an awesome third position at SOFTEC 2005, so it was like this time, we were expected to win, or else get our asses whacked.&lt;br /&gt;&lt;br /&gt;And guess what ? We won SOFTEC 2006 !!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-114427549265167876?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/114427549265167876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/114427549265167876'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2006/04/being-high-at-softec.html' title='Being high at SOFTEC !!'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-7673453.post-114427525103553979</id><published>2006-04-05T15:07:00.001-07:00</published><updated>2006-04-05T15:14:11.036-07:00</updated><title type='text'>One heck of a year!</title><content type='html'>&lt;span style="font-style:italic;"&gt;Man !! That could keep me going for years !!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;T.E. at NED was a mess. I did all sorts of things, except studies, which I hated ( my transcript makes this more visible, if you are not convinced ).&lt;br /&gt;&lt;br /&gt;The first new great thing that I explored was going to programming competitions. Man !! That was awesome. We had three competitions, and we were like fourth, third and second, in the first, second and third competitions. So it was quite an improvement.&lt;br /&gt;&lt;br /&gt;I had a great unexpected win in a software competition also !&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;br /&gt;BILL !! You gotta come up with a better pickup line, or else, asking her SAT score is definitely not going to do it.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I did a couple of nice projects, wrote a couple of paper-like things, enjoyed hanging around with friends after school, and getting high ( not literally ;) ) !!&lt;br /&gt;&lt;br /&gt;Exams ? What are you talking about ? I'm high !!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-114427525103553979?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/114427525103553979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/114427525103553979'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2006/04/one-heck-of-year_05.html' title='One heck of a year!'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-7673453.post-114427390643916741</id><published>2006-04-05T14:47:00.000-07:00</published><updated>2006-04-06T04:50:53.036-07:00</updated><title type='text'>Microsoft Interviews in May !</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Microsoft will be interviewing candidates from Pakistan in May. Post your CVs to pakcv@microsoft.com&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Soon Microsoft will be interviewing interested and qualified candidates from Pakistan for software development positions here in the USA at our corporate headquarters working on our major products. &lt;br /&gt; &lt;br /&gt;If you know of anyone that might be interested, or a bulletin board where it would be appropriate to post this, please forward this email.  There are multiple positions open and candidates will be in competition with themselves, not each other.&lt;br /&gt; &lt;br /&gt;What is a qualified candidate?&lt;br /&gt;*          Someone who has (or will be completing this year) a bachelor’s (four year or more) degree in Computer Science or a related field&lt;br /&gt;*          Someone that has very strong abilities to write code in C/C++&lt;br /&gt;*          Someone that is very driven and passionate about technology, desiring to make software products that will go all over the world&lt;br /&gt;*          Someone with fluent English speaking skills&lt;br /&gt; &lt;br /&gt;WHATEVER YOU DO, DO IT AT MICROSOFT&lt;br /&gt;The reason so many people from various disciplines come to Microsoft is because we provide the most exciting challenges in the industry. Since our inception in 1975, Microsoft’s mission has been to create software for the personal computer that empowers and enriches people in the workplace, at school and at home. Microsoft’s early vision of a computer on every desk and in every home is coupled today with a strong commitment to Internet -related technologies that expand the power and reach of the PC and its users. You can help shape the industry in nearly countless ways, all while gaining invaluable experience. Our casual environment lends itself to freer thinking and therefore, creative problem-solving. However, the coolest part of all is the diversity of jobs. You’re guaranteed not to be bored.&lt;br /&gt; &lt;br /&gt;We invite you to join us as we move toward the .NET age, the next generation of our products. You could create a world of change in one of these pivotal, Redmond, Washington USA area positions in the Microsoft product groups.  Here is a list of the core positions we will be looking to fill.&lt;br /&gt; &lt;br /&gt;Software Design Engineer in Development&lt;br /&gt;Design and implement various new components of the next release of the Windows operating system, Office, Visual Studio, .NET, MSN, SQL Server or other key Microsoft Products. Specific areas of expertise include COM/DCOM, ActiveX, Java, Graphics, Networking, and  Base/Kernel. The candidate should have BS or MS in Computer Science, Computer Engineering, Informatics, Physics or Mathematics.  Strong C/C++ skills, sound knowledge of operating system fundamentals and server development, and preferably more than 3 years of programming experience.  &lt;br /&gt; &lt;br /&gt;Software Design Engineer in Test&lt;br /&gt;Design and develop test plans/test suites to test various components of one of our primary products- Windows , Office, Visual Studio, .NET, etc.  Work closely with the developers and other test team members to isolate and resolve problems.  The candidate should have BS or MS in Computer Science, Computer Engineering, Informatics, Physics or Mathematics.  Strong C/C++ skills, sound knowledge of operating system fundamentals and server development and preferably more than 3 years of programming experience.&lt;br /&gt; &lt;br /&gt;There are multiple positions open, so please share the information with someone as good as you are.&lt;br /&gt; &lt;br /&gt;All positions are at our corporate headquarters in Redmond, Washington, USA.  We do require functional level English language skills, written and spoken.&lt;br /&gt; &lt;br /&gt;If you are interested, please email your CV in English to pakcv@microsoft.com&lt;br /&gt; &lt;br /&gt;Microsoft is an equal opportunity employer.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-114427390643916741?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/114427390643916741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/114427390643916741'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2006/04/microsoft-interviews-in-may.html' title='Microsoft Interviews in May !'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-7673453.post-112024885094836535</id><published>2005-07-01T13:03:00.000-07:00</published><updated>2005-07-01T13:14:10.956-07:00</updated><title type='text'>Quantum Intuition</title><content type='html'>It seems that doing Quantum Mechanics at bedtime is more preferable. Maybe Feynman was right when he said that if someone claims to understand QM, he doesnot know it.&lt;br /&gt;I have never been able to gain as much insight when doing it seriously than what I am gaining by doing it at bedtime these days (if there really is a bedtime for me, I usually sleep besides my PC). It really provides me with an interesting real world bedtime story which is as exotic and esoteric as a well written mystery. Infact it is still a mystery.&lt;br /&gt;This is the first time I have been able to understand the real difference between wave functions and eigen functions. Thought they really were the same with a minor difference. But infact they are a lot more different than I thought.&lt;br /&gt;Eigen functions, it seems, only arise as solution artifacts to partial differential equations. The wave function is something more profound, more intelligent than an eigen function and tells a lot more about the system than a mere eigen function. Whoops !! I still dont understand it well. Hope Feynman was right on target.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-112024885094836535?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/112024885094836535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/112024885094836535'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2005/07/quantum-intuition.html' title='Quantum Intuition'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-7673453.post-110581158365989580</id><published>2005-01-15T09:53:00.000-08:00</published><updated>2006-04-05T15:06:56.620-07:00</updated><title type='text'>topped in guys</title><content type='html'>Yeah , though this time I stood fifth , I topped in guys.&lt;br /&gt;Gals beat us this time, no probs, their presentation is awesome.&lt;br /&gt;Better Luck Next Time ( as always, the next time never comes :( ).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-110581158365989580?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/110581158365989580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/110581158365989580'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2005/01/topped-in-guys_15.html' title='topped in guys'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-7673453.post-109821183629081871</id><published>2004-10-19T11:46:00.000-07:00</published><updated>2006-04-05T15:06:10.010-07:00</updated><title type='text'>into the exams</title><content type='html'>Seesh ! i am into the exams&lt;br /&gt;thats going to be a hard time duh&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-109821183629081871?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/109821183629081871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/109821183629081871'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2004/10/into-exams.html' title='into the exams'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-7673453.post-109371577516991065</id><published>2004-08-28T10:55:00.000-07:00</published><updated>2006-04-05T14:46:40.846-07:00</updated><title type='text'>lost grandpa</title><content type='html'>1. Lost Grandpa ( I love you grandpa ).&lt;br /&gt;2. Session ending ( I hate this time ).&lt;br /&gt;3. Worried about exams ( as always ).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-109371577516991065?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/109371577516991065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/109371577516991065'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2004/08/lost-grandpa.html' title='lost grandpa'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-7673453.post-109018235543975074</id><published>2004-07-18T13:24:00.000-07:00</published><updated>2006-04-05T15:05:33.736-07:00</updated><title type='text'>back to university tomorrow</title><content type='html'>1. dates appear to be closer than they are. back to univ. vacations are over. :(&lt;br /&gt;2. umrah. &lt;br /&gt;3. grandpa got hurt broke his leg and got operated.&lt;br /&gt;4. attended a marriage (awful)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7673453-109018235543975074?l=ughani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/109018235543975074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7673453/posts/default/109018235543975074'/><link rel='alternate' type='text/html' href='http://ughani.blogspot.com/2004/07/back-to-university-tomorrow.html' title='back to university tomorrow'/><author><name>Usman Ghani</name><uri>https://profiles.google.com/102641734724234392234</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-VJOr8up4DdU/AAAAAAAAAAI/AAAAAAAACLI/DR5isHHOo80/s512-c/photo.jpg'/></author></entry></feed>
