<?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-4417875739806963199</id><updated>2012-01-31T03:45:02.985-08:00</updated><title type='text'>Reporting from Mumbai</title><subtitle type='html'>[I Code]</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>72</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-7783187342877049949</id><published>2012-01-07T04:11:00.000-08:00</published><updated>2012-01-07T04:12:15.178-08:00</updated><title type='text'>Book overload</title><content type='html'>&lt;div&gt;I love reading books. Technical books, techy stuff, love it! Programming stuff, new languages, new frameworks, ok I think I have made the point. I plan my week to read a book per week. Sometimes I manage to complete it, sometimes I do not.  In the age of tablets and my passion for reading, I got an iPad for myself. I used for some time to read several ebooks and really liked it. But after a while, not sure if it was the continuos staring at the screen or something else, I did not find it the best way to read a book. And hence, I went to back to the old school way of reading paper books. Nothing beats this let me tell you. Not even Apple can make anything better than an "actual book in hand experience", atleast for me. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Although in the excitement of learning new stuff, I tend to get boat load of books from the library near my house. For example, at this moment I have books these lying on my table with disappointed looks on their faces,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;- Real World Functional Programming  With Examples in F# and C#&lt;/div&gt;&lt;div&gt;- Programming F#&lt;/div&gt;&lt;div&gt;- Domain Driven Design: Tackling Complexity In The Heart Of Software&lt;/div&gt;&lt;div&gt;- Domain Driven Design Using Naked Objects&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I should say I am sure I am not going to get through each of them soon. I think there is a reason for this, I look at these books and think, ahh.. got to read all these books, get this done, get that done, yada yada yada and l pretty much skip the reading completely! To solve this,  all I did was followed the one of the principles of software development: If you got to deliver a set of features of your software in some predecided time and the conclusion is all the features are impossible to be done in this time by yourself, you can either get more people to do this, or reduce the number of features.  Getting more people in my reading activity would be absurd, so just reduce the number of books to read. I decided to get something cool done with F#, so left the F# cousins on the table and returned everything else. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;At this moment, I have one of the F# books, sitting besides my lap, I think it is smiling at me, not sure!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Happy Reading!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-7783187342877049949?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/7783187342877049949/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2012/01/book-overload.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/7783187342877049949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/7783187342877049949'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2012/01/book-overload.html' title='Book overload'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-1393711832018725512</id><published>2012-01-07T03:45:00.000-08:00</published><updated>2012-01-07T03:46:18.176-08:00</updated><title type='text'>The Married Life of a Developer...</title><content type='html'>&lt;div&gt;I will not hesitate to accept that I am just an average developer who loves the joy of creation. I achieve this by building applications for the customers of my clients. At the same time, I love to share my experiences by blogging and learning from others. To quench my thirst of ever evolving technologies around us, I do like to spend time on some personal projects at home, it just keeps my brain lubricated. &lt;/div&gt;&lt;div&gt;I am married now, and boy, this changes things a bit okay...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I have to say, I find it difficult to take out time from my daily activities to blog, write some cool code at home and then talk about how awesome this code is on my own blog :). For some reason, at home I am always doing something! Not sure it ends up that way, but I am doing some household "stuff", be it after office on a weekday, or over the weekend. &lt;/div&gt;&lt;div&gt;And hence my blog posts are so rare these days. I want to change this..., uh wait, ya Ill get it from the store in a minute.....&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Back to the blog, I was using Windows Live Writer for blogging and it is the best tool for the job I think. But I do not own a Windows machine anymore at home, so hooked on Mac. I am using a nice editor called Ommwriter. It does not have all the super cool, hip features of the Windows Live Writer for sure, but what it does have is the soothing music that flows in the background. The collective effect of all this is, it tries to put me back into the zone, and that is exactly what I want. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So if you, dear reader, are facing such dire situations, consider this writer http://www.ommwriter.com/. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Happy Blogging!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-1393711832018725512?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/1393711832018725512/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2012/01/married-life-of-developer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/1393711832018725512'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/1393711832018725512'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2012/01/married-life-of-developer.html' title='The Married Life of a Developer...'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-2158483503143276387</id><published>2011-10-29T22:33:00.000-07:00</published><updated>2011-10-29T22:34:43.493-07:00</updated><title type='text'>Change is hard</title><content type='html'>&lt;div&gt;Somehow I feel I am pretty much always in a state of dilemma about my job. On one side I think my job sucks, my salary sucks, my company sucks. On the other hand I feel, doing a job switch now would suck too. Change is hard no doubt on that. A new company means new people, new culture probably, new rules, new things that suck (may be less than current company). And of course the fact that you need to prove yourself all over again.&lt;/div&gt;&lt;div&gt;If you are currently thinking of switching jobs, there are certain points which we need to remember. I am absolutely sure that you, the reader would be perfectly aware of these things, but just to get it out of my system I am throwing them on the table,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;- You will never be satisfied with your job. You will always feel at some point that your job sucks, and your friend has a better job . &lt;/div&gt;&lt;div&gt;- You will always feel you are being paid less than others.&lt;/div&gt;&lt;div&gt;- Life is way to short to complain about your job. &lt;/div&gt;&lt;div&gt;- Doing frequent job jumps does hurt your loyalty level to some extent, but at least in my industry (Software), my company is my project. If the project sucks, company sucks. Well, there are cases where you can change projects, but I somehow always take the big exit than the small exit.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So... ok. When are you sending that email :).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Happy Programming!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-2158483503143276387?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/2158483503143276387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2011/10/change-is-hard.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/2158483503143276387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/2158483503143276387'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2011/10/change-is-hard.html' title='Change is hard'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-7703214691561721041</id><published>2011-10-29T22:31:00.000-07:00</published><updated>2011-10-29T22:33:17.013-07:00</updated><title type='text'>Agile or Fr"agile"</title><content type='html'>&lt;div&gt;Do you follow Agile at your project? Whenever someone asks me this question, I do not have an immediate "YES" or "NO" answer. It goes like ummm... ya we do. Probably I am not fortunate enought (yet) to be under a strict Agilist manager who lays out certain "rules" that the team follows under any and all circumstances. One such rule is the scrum meeting a team has every morning. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Whatever happens a day before, the scrum meeting should be conducted at the same time each day. No exceptions. There are cases where people work late, very late (cough.. Banks cough). If the member is unable to make to office early next day, then he/she should make sure to send their update via mail atleast. But just for that member to attend the meeting, the scrum time should not be altered. It just disturbs the way a agile team member works.  Once you get to office, may be check mails, then have the scrum, then get into the zone (or try to get into the zone). Delaying the scrum time causes a ripple effect on stuff that each team member tries to achieve in the day. Just my 2 cents.&lt;/div&gt;&lt;div&gt;So if you are in a team where you are doing something like this, and you can say "NO" to your manager, then please try to make this point.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Happy Programming!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-7703214691561721041?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/7703214691561721041/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2011/10/agile-or-fragile.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/7703214691561721041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/7703214691561721041'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2011/10/agile-or-fragile.html' title='Agile or Fr&quot;agile&quot;'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-7193586920102791344</id><published>2011-07-30T20:02:00.001-07:00</published><updated>2011-07-30T20:10:46.512-07:00</updated><title type='text'>Adding openssl support to Python (the right way)</title><content type='html'>&lt;p&gt;Recently I have been doing some Python stuff on Linux. For the most part, I am either using Windows for my job and Mac probably for the entertainment stuff. But whenever I get to do something on Linux, may it be installing something or working on it, I find one thing every time. Its not straight forward.&lt;/p&gt;  &lt;p&gt;So what I wanted was to install Python, run my Python script which does some webservice calls, and go for my lunch. One caveat, the service needs to be accessed using https. So I need ssl support in Python. I am like, this is something that needs to be there by default. But its not. Argh!!!! Some mortals like me posted queries &lt;a href="http://stackoverflow.com/questions/979551/adding-ssl-support-to-python-2-6"&gt;http://stackoverflow.com/questions/979551/adding-ssl-support-to-python-2-6&lt;/a&gt;. So I asked my friends to ahead with their lunch, its going to take a while!&lt;/p&gt;  &lt;p&gt;Enough of my sarcasm, to get to the point, follow these steps to add ssl support on a box running RHEL. My box has RHEL5.&lt;/p&gt;  &lt;p&gt;Download Python source, I was installing 2.7.2, &lt;a title="http://python.org/ftp/python/2.7.2/Python-2.7.2.tgz" href="http://python.org/ftp/python/2.7.2/Python-2.7.2.tgz"&gt;http://python.org/ftp/python/2.7.2/Python-2.7.2.tgz&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Extract it in a folder, say Python2.7.2. Do ./configure with any switches you need. In my case, I needed to add zlib support so, did this,&lt;/p&gt;  &lt;p&gt;./configure –with-zlib=/usr/include&lt;/p&gt;  &lt;p&gt;This creates a file called Setup and Setup.dist in Modules folder. To be safe, edit the Setup file. Locate the commented ssl section,&lt;/p&gt;  &lt;pre&gt;# Socket module helper for socket(2)&lt;br /&gt;#_socket socketmodule.c&lt;br /&gt;&lt;br /&gt;# Socket module helper for SSL support; you must comment out the other&lt;br /&gt;# socket line above, and possibly edit the SSL variable:&lt;br /&gt;#SSL=/usr/local/ssl&lt;br /&gt;#_ssl _ssl.c \&lt;br /&gt;#&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \&lt;br /&gt;#&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; -L$(SSL)/lib -lssl –lcrypto&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;For those who have no clue what this file is, # means a commented line :). Uncomment few lines and change the SSL variable as below,&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# Socket module helper for socket(2)&lt;br /&gt;_socket socketmodule.c&lt;br /&gt;&lt;br /&gt;# Socket module helper for SSL support; you must comment out the other&lt;br /&gt;# socket line above, and possibly edit the SSL variable:&lt;br /&gt;SSL=/usr/ssl&lt;br /&gt;_ssl _ssl.c \&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;br /&gt;-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;br /&gt;-L$(SSL)/lib -lssl -lcrypto&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Save the file. Now do a make.&lt;br /&gt;Now you might need to enter a root password. So do su – and then enter the root password. Once done, do make install. This should do it. At least it did for me and finally I had my lunch. Did you have your lunch yet! &lt;br /&gt;&lt;br /&gt;&lt;p&gt;Happy Programming!!!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-7193586920102791344?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/7193586920102791344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2011/07/adding-openssl-support-to-python-right.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/7193586920102791344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/7193586920102791344'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2011/07/adding-openssl-support-to-python-right.html' title='Adding openssl support to Python (the right way)'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-523933854303047376</id><published>2011-07-30T08:30:00.001-07:00</published><updated>2011-07-30T08:30:14.812-07:00</updated><title type='text'>Using Fiddler on Linux</title><content type='html'>&lt;p&gt;If you are a web programmer, I am sure you would have come across a juncture where you needed some kind of tool that kept a steady eye on the network traffic. On Windows, a sexy tool that does this is Fiddler. You are using Windows, doing your programming, observing what requests flow in and out, all is well. Your boss asks you to write some kind of wise script that would some magic on the network like calling some webservice, ftp etc. You say, ‘huh… piece of cake’. Oh ya, the boss says, just one thing, this script runs on Linux. &lt;/p&gt;  &lt;p&gt;Doh!!!!&lt;/p&gt;  &lt;p&gt;Not really a “Doh” moment. Fiddler has a nice feature of remote connections. What you do is set the proxy on your Linux box, the proxy would have the ip address/computer name of a windows machine that is running Fiddler. That’s it, all the network traffic is routed to the Fiddler instance running on your beloved Windows machine. For those who understand in terms of some screenshots, here is the link from Fiddler website, &lt;a href="http://www.fiddler2.com/fiddler/help/hookup.asp#Q-NonWindows"&gt;http://www.fiddler2.com/fiddler/help/hookup.asp#Q-NonWindows&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In my case, I had to put the IP address of my Windows machine and the port 8888 on which Fiddler was running. Computer names might not be searchable on all networks.&lt;/p&gt;  &lt;p&gt;Happy Programming!!!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-523933854303047376?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/523933854303047376/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2011/07/using-fiddler-on-linux.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/523933854303047376'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/523933854303047376'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2011/07/using-fiddler-on-linux.html' title='Using Fiddler on Linux'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-6959336127820195021</id><published>2011-02-23T07:47:00.001-08:00</published><updated>2011-02-23T07:47:45.828-08:00</updated><title type='text'>Did you wish the BackgroundWorker had a generic method?</title><content type='html'>&lt;p&gt;We all love Generics. I love a little too much. It just makes me feel clean and tidy whenever I use it in my code. Awesome. Ok, enough of my incest for Generics. &lt;/p&gt;  &lt;p&gt;It is quite common thing in a Windows desktop client application to have a user interface, which in response to some user actions performs certain tasks in the background. You certain would not want to make things like database/webservice calls on the UI thread. This could end up in showing the nice “Not Responding” message in your application title bar. If it is Vista you are running, it might be the Blue Screen of death who knows. In a normal Windows Forms application you would spawn a background thread and perform the tasks there. In a WPF application, well you could do the same but there is a BackgroundWorker available that does it for you. A straightforward usage of this class can be as below,&lt;/p&gt;  &lt;pre class="brush: csharp;"&gt;var backgroundWorker = new BackgroundWorker();&lt;br /&gt;backgroundWorker.DoWork += BackgroundWorkerDoWork;&lt;br /&gt;backgroundWorker.RunWorkerCompleted += BackgroundWorkerRunWorkerCompleted;&lt;br /&gt;backgroundWorker.RunWorkerAsync();&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The problem is, say you have 10 buttons on your UI and you want to make 10 different webservice calls one for each button click event. You would end up with 10 different BackgroundWorker objects each with their handlers scattered in some class. I think it can be made a little tidier, you would require 10 different BackgroundWorker objects for sure, but a Generic wrapper around this could make life a little easier. We can do this by using a generic class and a generic delegate in it. Enough words, lets see some code,&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: csharp;"&gt;internal class ServiceHelper&amp;lt;T&amp;gt;&lt;br /&gt;        where T: class&lt;br /&gt;    {&lt;br /&gt;        private readonly BackgroundWorker backgroundWorker;&lt;br /&gt;        internal delegate void Completed(T result);&lt;br /&gt;        internal event Completed CompletedHandler;&lt;br /&gt;&lt;br /&gt;        internal ServiceHelper()&lt;br /&gt;        {&lt;br /&gt;            backgroundWorker = new BackgroundWorker();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        internal void InvokeMethod(Func&amp;lt;T&amp;gt; method)&lt;br /&gt;        {&lt;br /&gt;            backgroundWorker.DoWork += BackgroundWorkerDoWork;&lt;br /&gt;            backgroundWorker.RunWorkerCompleted += BackgroundWorkerRunWorkerCompleted;&lt;br /&gt;            backgroundWorker.RunWorkerAsync();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void BackgroundWorkerRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)&lt;br /&gt;        {&lt;br /&gt;            if (e == null)&lt;br /&gt;                return;&lt;br /&gt;            var result = e.Result as T;&lt;br /&gt;            if (result == null)&lt;br /&gt;                throw new InvalidCastException(&amp;quot;The result obtained is not of the requested type.&amp;quot;);&lt;br /&gt;            if (CompletedHandler != null)&lt;br /&gt;                CompletedHandler(result);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        private void BackgroundWorkerDoWork(object sender, DoWorkEventArgs e)&lt;br /&gt;        {            &lt;br /&gt;            if (e == null)&lt;br /&gt;                return;&lt;br /&gt;            var method = e.Argument as Func&amp;lt;T&amp;gt;;&lt;br /&gt;            if (method == null)&lt;br /&gt;                return;&lt;br /&gt;            e.Result = method();&lt;br /&gt;        }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;All we have done is wrapped the BackgroundWorker inside a generic class and provided a generic event handler for clients to subscribe to. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Happy Programming!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-6959336127820195021?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/6959336127820195021/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2011/02/did-you-wish-backgroundworker-had.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/6959336127820195021'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/6959336127820195021'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2011/02/did-you-wish-backgroundworker-had.html' title='Did you wish the BackgroundWorker had a generic method?'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-5756198228349883374</id><published>2011-01-15T22:53:00.001-08:00</published><updated>2011-01-15T22:54:54.546-08:00</updated><title type='text'>Custom email with Hudson continuous integration</title><content type='html'>&lt;p&gt;If you are using continuous integration for your project, you are cool. If you are using Hudson, you are uber cool. Anyways, regardless of the continuous integration (CI) tool you are using, sending emails via it is very useful. Hudson, certainly has a default Email Notification system. I was excited to see this feature, but once I saw the default email content, I was like, mmhhe!, this needs some revamp. There is a plugin available for custom email notification, &lt;a href="http://wiki.hudson-ci.org/display/HUDSON/Email-ext+plugin"&gt;http://wiki.hudson-ci.org/display/HUDSON/Email-ext+plugin&lt;/a&gt;. This plugin allows us to send HTML content in the email. Now we are talking. You would find tons of links in the cloud on how to setup this plugin to get things started. But, in my experience, the requirements for the contents of the email, its format etc. varies from team to team. Just to put be a little helpful here, below is the HTML content of the email I am using for a test project of mine, &lt;/p&gt;  &lt;pre class="brush: js;"&gt;&amp;lt;div class=&amp;quot;panelMacro&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;table&amp;gt;&lt;br /&gt;       &amp;lt;tbody&amp;gt;&lt;br /&gt;              &amp;lt;tr&amp;gt;&lt;br /&gt;                     &amp;lt;td class=&amp;quot;noteMacro&amp;quot;&amp;gt;&lt;br /&gt;                           Hudson project, &amp;lt;a&lt;br /&gt;                            href=&amp;quot;${PROJECT_URL}&amp;quot;&amp;gt;${PROJECT_NAME}&amp;lt;/a&amp;gt;, is &amp;lt;b&amp;gt;${BUILD_STATUS}&amp;lt;/b&amp;gt; for&lt;br /&gt;                            build number &amp;lt;a href=&amp;quot;${BUILD_URL}&amp;quot;&amp;gt;${BUILD_NUMBER}&amp;lt;/a&amp;gt;&lt;br /&gt;                    &amp;lt;/td&amp;gt;&lt;br /&gt;             &amp;lt;/tr&amp;gt;&lt;br /&gt;             &amp;lt;tr&amp;gt;&lt;br /&gt;                     &amp;lt;td class=&amp;quot;infoMacro&amp;quot;&amp;gt;&lt;br /&gt;                           Build cause: ${CAUSE}&lt;br /&gt;                    &amp;lt;/td&amp;gt;&lt;br /&gt;             &amp;lt;/tr&amp;gt;&lt;br /&gt;             &amp;lt;tr&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;             &amp;lt;tr&amp;gt;&lt;br /&gt;                    &amp;lt;td&amp;gt;&lt;br /&gt;                    &amp;lt;div&amp;gt;&amp;lt;b&amp;gt;Changes&amp;lt;/b&amp;gt;&amp;lt;/div&amp;gt; &lt;br /&gt;                        &amp;lt;br /&amp;gt;                         &lt;br /&gt;                        &amp;lt;div class=&amp;quot;changesList&amp;quot;&amp;gt;${CHANGES, showPaths=true, format=&amp;quot;&amp;lt;div&amp;gt;&amp;lt;b&amp;gt;[%a]&amp;lt;/b&amp;gt; - %p&amp;lt;/div&amp;gt;&amp;lt;br /&amp;gt;&amp;quot;}&amp;lt;/div&amp;gt;  &lt;br /&gt;                    &amp;lt;/td&amp;gt;&lt;br /&gt;             &amp;lt;/tr&amp;gt;&lt;br /&gt;             &amp;lt;tr&amp;gt;&lt;br /&gt;                    &amp;lt;td&amp;gt;&lt;br /&gt;                    &amp;lt;div&amp;gt;&amp;lt;b&amp;gt;Build Log&amp;lt;/b&amp;gt;&amp;lt;/div&amp;gt; &lt;br /&gt;                        &amp;lt;br /&amp;gt;                         &lt;br /&gt;                        &amp;lt;div style=&amp;quot;font-size:13px;&amp;quot;&amp;gt;${BUILD_LOG_REGEX, regex=&amp;quot;Build FAILED*&amp;quot;, linesAfter=100}&amp;lt;/div&amp;gt;  &lt;br /&gt;                    &amp;lt;/td&amp;gt;&lt;br /&gt;             &amp;lt;/tr&amp;gt;          &lt;br /&gt;       &amp;lt;/tbody&amp;gt;&lt;br /&gt;     &amp;lt;/table&amp;gt;     &lt;br /&gt;&amp;lt;/div&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;I have not included the stylesheet content used by this html. I have included the following things in the email,&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;  &lt;li&gt;Project url, project name, build status and build url. These links obviously are not accessible if you are seeing this email outside your company network. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt;Build cause says whether the build was triggered due to an SCM change, started manually by a user etc. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt;Change list, displays a list of commits done since the last change. Each entry shows the user committing the change, and the name of the file checked in. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt;Build log, shows the end of the log in case of a failure. This helps in knowing what were the build errors which caused the build failure. It is kind of important if you are not able to see the Console output as you are outside the company network and not able to access Hudson url. The way this works is, by doing a regex match on the “Build Failed” text in the Console output. &lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;This is just a sample of how you could make your email notification really useful even when you or your team is not able to access Hudson dashboard.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-5756198228349883374?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/5756198228349883374/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2011/01/custom-email-with-hudson-continuous.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/5756198228349883374'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/5756198228349883374'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2011/01/custom-email-with-hudson-continuous.html' title='Custom email with Hudson continuous integration'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-5141209513643469490</id><published>2010-12-21T07:18:00.001-08:00</published><updated>2010-12-21T07:18:19.299-08:00</updated><title type='text'>Hmm..what pattern will you use here?</title><content type='html'>&lt;p&gt;Design patterns are cool. Umm… what does that mean. At the vending machine in office, developers love to get into discussions about how they used State pattern and rescued the project. Young grasshoppers like me love to read some book or blog and think how could I make use of this newly learnt “thing” in my project. Recently our company hired a “super software guy”. He was something like 35-40 years experienced in the industry, carrying with him a whole bunch of presentation slides and a huge set of his own rules. Basically he was one of those &lt;a href="http://www.joelonsoftware.com/articles/fog0000000018.html" target="_blank"&gt;Architecture Astronauts&lt;/a&gt;. I highly recommend reading Joel’s take on such people especially for young grasshoppers like me who are at a stage where Lead position is soon to come. I had asked a quite honest (I think) question to the lecturer about the way I think about design patterns in a project. I said, when I look at a problem in my project, a coding problem, I think, what pattern can help me here. Then I go home and open my “Head First Design Patterns” copy and see if something strikes me. Am I doing the right thing? He said Yes. He added that is really how one should code in a project.&lt;/p&gt;  &lt;p&gt;I have utmost respect for the lecturer and for his immense experience in the field, but after spending some time reading blogs, books by some industry experts, I think the lecturer completely missed the point. Design patterns are recurring solution to a recurring problem, they are industry wide accepted norms. But they do make things complicated. In several simple scenarios, implementing patterns mostly leads to more code which causes unnecessary maintenance problems. The idea should be to solve the problem in the simplest possible manner, which keeps the code clean, taking care of common OOPS principles like cohesion and coupling. If proper thinking is done, you would end up with a solution probably close to some pattern that already exists. But there is absolutely no need to think of a pattern as soon as you see a problem. &lt;/p&gt;  &lt;p&gt;If programming was as easy as finding a design pattern for a problem then I think I should quit my job and live in a van down by the river eating a steady diet of government cheese.&lt;/p&gt;  &lt;p&gt;Happy Programming!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-5141209513643469490?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/5141209513643469490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2010/12/hmmwhat-pattern-will-you-use-here.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/5141209513643469490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/5141209513643469490'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2010/12/hmmwhat-pattern-will-you-use-here.html' title='Hmm..what pattern will you use here?'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-5078784590790958912</id><published>2010-10-30T08:05:00.001-07:00</published><updated>2010-10-30T08:05:43.767-07:00</updated><title type='text'>Microsoft is too fast for me?</title><content type='html'>&lt;p&gt;Microsoft is quite famous (or infamous) in throwing lots of things at the customers to see what sticks on them. The speed at which they are releasing new versions of the programming languages, upgrades to Visual Studio, new features for the ASP.NET stack, is just amazing. On one side it is a good thing that they are keen in improving the product over and over again, by either upgrading it or completely replacing it with something new. But on the other side, it is almost impossible to keep track of all the new stuff Microsoft is doing. &lt;/p&gt;  &lt;p&gt;I am a developer (for now), and I follow some awesome .NET guys on their blogs. Most of them keep on posting the steaming hot new stuff and are all excited about it. Some of these bloggers are full time bloggers and are really interested in doing this. Take C# language for example. I am not sure how many clients have moved to C# 4.0 in their production environment, at least the client I am working with, they are still using .NET 3.5 heavily. C# 4.0 comes along with loads of new features really worth learning. So I am all excited to get on it. I was not even half way and bloggers started talking about C# 5! Dude! &lt;/p&gt;  &lt;p&gt;I understand technology evolves these days at real high speed and one really need not be at par with everything in the world. For someone like me following techy blogs every morning before starting to work, I think being very eclectic is is really important. If I do not read, or at least skim through all the posts I have in my Google reader I feel a little uneasy. But its time to use that “Mark all as Read” link sometimes. &lt;/p&gt;  &lt;p&gt;Happy Reading!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-5078784590790958912?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/5078784590790958912/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2010/10/microsoft-is-too-fast-for-me.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/5078784590790958912'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/5078784590790958912'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2010/10/microsoft-is-too-fast-for-me.html' title='Microsoft is too fast for me?'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-4602210768645741043</id><published>2010-09-03T21:01:00.001-07:00</published><updated>2010-09-03T21:01:41.894-07:00</updated><title type='text'>Think of Production Support now, not later!</title><content type='html'>&lt;p&gt;Developers just love to get into the code as soon as possible. Some might also like skip writing any specs, just start and finish the fuckin code and impress your manager, and get an appraisal. Wohoo. For what they might not realize that this is a proven recipe for disaster.    &lt;br /&gt;So you and your team are hired by a really big fat organization to build a software product. The client really wants this done in 5 months, or else he is screwed, and consequently you too. This is what generally happens,     &lt;br /&gt;- Numerous white board sessions understanding what is required and different approaches to implement it.     &lt;br /&gt;- All developers in your team including you are super excited to work on this from scratch. Your team creates a sleek POC which showcases how this would work. Everyone goes home happily and drink beer.     &lt;br /&gt;- Development work starts and the developers crazily slap the keyboard punching thousands of lines of code.     &lt;br /&gt;- The product is ready in 4 months, testers have no clue what the heck this is all about, but they are asked to test it.So they do!     &lt;br /&gt;- With a go ahead from testers, it finally reaches on the desk of Production Support. As a developer you are asked to explain in brief the overall architecture and usage of the product.     &lt;br /&gt;- And they say, What the fuck is this!!!!!!!!!%^%&amp;amp;^%&amp;amp;^. &lt;/p&gt;  &lt;p&gt;You might say, Production Support guys are dumb, the developers could understand the system so well, why can't they? There lies the first mistake. You assumed all along that you or your kind, are the users of the product. As a matter of fact, when the shit hits the fan, the Production Support guys will be the real users of this product as they would have to solve issues in real time. So, how to avoid this fiasco? Well, the only time to resolve this would be the initial stages of design. Put yourselves into a Production Support role and try using the product.    &lt;br /&gt;- Try answering questions like, if someone calls about something not working in the product, how would you as a support guy, troubleshoot the     &lt;br /&gt;product.     &lt;br /&gt;- Can we remote into the users machine and overhaul the product.     &lt;br /&gt;- Can the product automatically send logs and crash dumps when something wrong happens.     &lt;br /&gt;- Can it make lunch. What?     &lt;br /&gt;- May be try involving a production support team lead or someone who accounts for their team and try to get their ideas too. &lt;/p&gt;  &lt;p&gt;If you do not think of these things, your product will be usable only from a developer's perspective and not from someone who this product was really made for. So, please think about supporting the product while designing the architecture, or else down the line, it might be the developers who will be asked to support the product all along! &lt;/p&gt;  &lt;p&gt;Happy Programming!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-4602210768645741043?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/4602210768645741043/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2010/09/think-of-production-support-now-not.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/4602210768645741043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/4602210768645741043'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2010/09/think-of-production-support-now-not.html' title='Think of Production Support now, not later!'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-4729969556276238221</id><published>2010-07-27T07:33:00.001-07:00</published><updated>2010-07-27T07:33:33.964-07:00</updated><title type='text'>Working late? Probably you are incompetent, or someone is!</title><content type='html'>&lt;p&gt;I have a colleague at my work place, he is a quite experienced guy and working on some complex algorithmic stuff in a complex team and I could throw in more complex shit but you got the point. He made a statement the other day, “I think people who work late are incompetent”. &lt;/p&gt;  &lt;p&gt;At first glance, it sounded ridiculous to me, as I do work late sometimes! I do not consider myself incompetent, others might, but that is another story. I did quite a bit of thinking on this seemingly heavy statement of his, and you know what I partially agree to it. I want to tweak that statement a little bit, “I think people who work late are incompetent, or someone above them in the food chain is incompetent”. Just ignore the time when you were working late with pizza in one hand, when you had that zeal to finish a product which was cool and all. That was for you, I am talking about working late because someone asked you too. Either you did not plan your day well to finish that task in the 8 hours or, someone above you, got the estimation wrong, may be your manager spend a little too long smoking and lost the track of the timeline or whatever.&lt;/p&gt;  &lt;p&gt;You see someone was surely incompetent due to which you are staying back late and completing your work.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-4729969556276238221?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/4729969556276238221/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2010/07/working-late-probably-you-are.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/4729969556276238221'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/4729969556276238221'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2010/07/working-late-probably-you-are.html' title='Working late? Probably you are incompetent, or someone is!'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-4894736553250429422</id><published>2010-07-02T22:49:00.001-07:00</published><updated>2010-07-02T22:49:42.453-07:00</updated><title type='text'>Is your Background Intelligent Transfer Service (BITS) download slow ???</title><content type='html'>&lt;p&gt;Well, I have been searching for an answer for this question for some time and ended up mostly on BITS articles explaining how BITS worked. I did spend some time with BITS for a recent project so I know few things around it. Here is my question from StackOverflow with 0 answers &lt;a href="http://stackoverflow.com/questions/3148114/background-intelligent-transfer-servicebits-download-speed-really-slow"&gt;http://stackoverflow.com/questions/3148114/background-intelligent-transfer-servicebits-download-speed-really-slow&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Anyways, I decided to do some experiments around downloading files with BITS on a Windows XP SP3 machine with a LAN connection of 100Mbps. I guess it is a typical office connection. There are several network related services running on my machine, like VNC, Microsoft Office Communicator, Microsoft Outlook, Symantec Antivirus, and 1 other custom service. For testing, I have about 20 files, total size of around 8.5 Mb, and 1 zip file of almost same size.&lt;/p&gt;  &lt;p&gt;Below are my observations for time taken in different conditions.&lt;/p&gt;  &lt;table border="2" cellspacing="0" cellpadding="2" width="400"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="150"&gt;&lt;strong&gt;BITS job Priority&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="127"&gt;&lt;strong&gt;20 Files (8.5Mb)&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="119"&gt;&lt;strong&gt;1 zip file (8.56Mb)&lt;/strong&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="150"&gt;Normal&lt;/td&gt;        &lt;td valign="top" width="127"&gt;35 min&lt;/td&gt;        &lt;td valign="top" width="119"&gt;16 min&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="150"&gt;Foreground&lt;/td&gt;        &lt;td valign="top" width="138"&gt;7.3 msec&lt;/td&gt;        &lt;td valign="top" width="150"&gt;2.5 msec&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;I know there is a startling difference between Normal and Foreground priority jobs, but it really depends on how much network throttling is done by BITS. But the point I want to make here is see the difference between the time taken for downloading 20 files and time taken to get 1 file or same size. BITS uses Round Robin algorithm within a queue of jobs of same priority. Thus having just 1 file improves the situation for BITS. &lt;/p&gt;  &lt;p&gt;If you are responsible for building a tool which uses BITS to download stuff from a server on client machines, and you do not have control over the network policies and all that, at least try to zip all the files into 1 and download it. It surely improves the speed. If you are allowed to change the priorities of jobs, give an option to the user saying something like “Download Now”, which would change the Job priority to Foreground and things would come blazingly fast on the machine (hopefully!)&lt;/p&gt;  &lt;p&gt;Happy Programming!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-4894736553250429422?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/4894736553250429422/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2010/07/is-your-background-intelligent-transfer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/4894736553250429422'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/4894736553250429422'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2010/07/is-your-background-intelligent-transfer.html' title='Is your Background Intelligent Transfer Service (BITS) download slow ???'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-3806437853835985444</id><published>2010-06-29T07:25:00.001-07:00</published><updated>2010-06-29T07:25:36.957-07:00</updated><title type='text'>What do you choose, your boss, or your team?</title><content type='html'>&lt;p&gt;So you are the team lead and you are responsible for arranging for a team lunch along with your team and the team’s boss in a nice restaurant. It happens so that your boss’s choices are a “little” varying from your team’s likings. You know your boss likes exotic eating places where folks eat anything that moves, and your team consists of chaps that are a little simple types. What do you do? Choose an exorbitantly expensive exotic place where the boss can have a lavish food and you and the team can at the most eat boiled vegetables, or the other way. &lt;/p&gt;  &lt;p&gt;You see this was supposed to be a team lunch and it should have been about the team and not the boss. After making so many sarcastic remarks you should certainly know that as a lead your team consists of folks who are with you in all good or bad times on a project, so such parties should be around them. As a matter of fact, if the boss knew this, then you might not even have had a choice to make in the first place. &lt;/p&gt;  &lt;p&gt;This post was just another one of those where the writer is pissed off at his job :).&lt;/p&gt;  &lt;p&gt;Happy Programming!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-3806437853835985444?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/3806437853835985444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2010/06/what-do-you-choose-your-boss-or-your.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/3806437853835985444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/3806437853835985444'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2010/06/what-do-you-choose-your-boss-or-your.html' title='What do you choose, your boss, or your team?'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-1697914238762275212</id><published>2010-06-01T19:59:00.001-07:00</published><updated>2010-06-01T20:01:34.591-07:00</updated><title type='text'>Strange Motivations</title><content type='html'>&lt;p&gt;This post is related to Jeff Atwood’s latest &lt;a href="http://www.codinghorror.com/blog/2010/06/the-vast-and-endless-sea.html" target="_blank"&gt;post&lt;/a&gt; where he quite honestly explains his views on StackOverflow and StackOverflow Exchange. I did watch the animated video by Dan Pink at the end of the post, its absolutely fascinating. All this is based on the research done at top universities in the US. Bright people huh. It all works well there and the theory is proven. &lt;/p&gt;  &lt;p&gt;I tried to place Dan’s theory in the context where I work. Whether I like it or not, I have been working for Service based firms most of my career until now. And I cannot be more frank in saying that, when a service based firm grows and has like thousands of folks working on something or the other, not all of them are “bright”. Well as a matter of fact, this is a very very rare commodity. When I say bright, I do not mean someone who can crack NP-Incomplete problems or like that, I mean folks who love their work (I am mostly concerned with coding), like to do their own stuff sometimes, share knowledge with others and other things that comes in a package of a good developer. With this knowledge, I am highly doubtful that the incentives theory would work here. The theory says something like this,&lt;/p&gt;  &lt;p&gt;&lt;em&gt;As long as the work to be done is mechanical, incentives improve the performance of individuals, but the moment you introduce some work which requires even rudimentary cognitive skills, incentives actually work the other way.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;I believe this theory when put in the context of software, assumes you have good people working for you. Dan gives an example of Atlassian, which probably hires good people only. I have come across many folks here who openly say I am here jsut for the freakin money, don care much about creative stuff and all that bullshit. The idea Atlassian uses certainly must be bringing the best out of the people there, as long as people intend to do so. We could argue that the reason this might not work here is, most of the work coming to the Indian Service firms is MECHANICAL. All the algorithms are defined, architecture is laid out, just write the freakin code. Hence more money, more performance works. So the first part of the theory does hold true in this sense. But to prove the other part of the theory, you need good people, period. Service based firms consider each one of us as a RESOURCE, parts of a machine, which can be replaced by someone and things would work as usual. &lt;/p&gt;  &lt;p&gt;This is by no means, service firms bashing, but all I want to say is theories which have used a certain class of people as experiments, might not work across all classes. Now do not ask why am I still working for a Service based firm!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-1697914238762275212?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/1697914238762275212/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2010/06/strange-motivations.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/1697914238762275212'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/1697914238762275212'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2010/06/strange-motivations.html' title='Strange Motivations'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-5930693025732006189</id><published>2010-05-28T20:40:00.001-07:00</published><updated>2010-05-28T20:40:25.808-07:00</updated><title type='text'>Bootcamp 3.1 installation error, KeyAgent could not be started…</title><content type='html'>&lt;p&gt;I am running Mac OS Leopard on my Macbook Pro. Using Bootcamp I run Windows Vista 32bit too (I am ashamed of that). Lately I have been seeing some weird behavior with my Windows side. the screen just freakin freezes, the only option is to hold the power button down and restart, Ouch!! After reading few blogs I kind of realized that this might be an issue with the NVidia graphics card and Bootcamp drivers. &lt;/p&gt;  &lt;p&gt;So I got the latest Mac OSX Snow Leopard CD. The installation could not be smoother than that. Absolutely stunning. Booted the Windows side, started installing the new Bootcamp 3.1. It upgraded several new drivers for NVidia, ATI, Intel …. And almost at the end, booom! Service “KeyAgent” could not be started. Of course nothing is straight with Windows I said. So I used the most powerful command know to a Windows user, RESTART. I restarted twice to get the same error. &lt;/p&gt;  &lt;p&gt;Then I realized Vista being a really clumsy OS, there is something annoying in it called the User Account Control. I keep it off all the times. So I turned it on, restared again, and this time guess what, the installation worked. It seems that the installer is trying to modify some bits which the UAC was not allowing. Not sure though. &lt;/p&gt;  &lt;p&gt;Try this if you are stuck with this error. Honestly a better option would be to get Windows 7 or atleast upgrade to XP.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-5930693025732006189?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/5930693025732006189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2010/05/bootcamp-31-installation-error-keyagent.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/5930693025732006189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/5930693025732006189'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2010/05/bootcamp-31-installation-error-keyagent.html' title='Bootcamp 3.1 installation error, KeyAgent could not be started…'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-7051054361657222638</id><published>2010-05-26T01:22:00.001-07:00</published><updated>2010-05-26T01:23:09.708-07:00</updated><title type='text'>Searching for the Response Header property in MessageSecurityException?</title><content type='html'>&lt;p&gt;I had a requirement in my code wherein I had to make a webservice call, catch a HTTP 401 exception returned by the service, read a value from the header, add some value in the header and call the service again. Seems not very uncommon to me. My client was a WCF application and service was written in Java. Apparently, the exception that was being thrown on client side was of type System.ServiceModel.Security.MessageSecurityException. I remember I tried for about half an hour to find where the hell is the Response object returned from the server. Here it is,&lt;/p&gt;  &lt;pre class="brush: js;"&gt;try&lt;br /&gt;{&lt;br /&gt;    Webservice Call..&lt;br /&gt;}&lt;br /&gt;catch (MessageSecurityException ex)&lt;br /&gt;{&lt;br /&gt;    if (ex.InnerException != null &amp;amp;&amp;amp; ex.InnerException is WebException)&lt;br /&gt;    {&lt;br /&gt;        WebException webException = ex.InnerException as WebException;&lt;br /&gt;        string sample = webException.Response.Headers[&amp;quot;Sample&amp;quot;];&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Happy Programming!  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-7051054361657222638?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/7051054361657222638/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2010/05/searching-for-response-header-property.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/7051054361657222638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/7051054361657222638'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2010/05/searching-for-response-header-property.html' title='Searching for the Response Header property in MessageSecurityException?'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-7614881507497737869</id><published>2010-05-13T05:47:00.001-07:00</published><updated>2010-05-13T05:47:38.125-07:00</updated><title type='text'>No one likes their code to be changed</title><content type='html'>&lt;p&gt;I consider myself really really lucky to be in the business of writing software. The reason being, this is the only creative thing I do in a day. When I am done coding a module, I am like, look at this thing, its my work :). ( It might not follow all the SOLID principles, but… well.. what the heck!). And I bet every programmer on this planet has some kind of love with the code they have written in an editor. When someone comes along and without taking your “feelings” into consideration just tears apart the code to “refactor” it, or may be remove extra white spaces for performance reasons!, you can be certain that the person is going to get pissed off at this. Be it your best friend, girl friend whatever, if you think a piece of code is not written with good standards, it is wise to explain why its not good to have it like this, and then delegate that person to refactor or take it up yourself in a friendly way. &lt;/p&gt;  &lt;p&gt;Taking someone’s code, refactoring it and checking in with an email saying that your code was not good enough so I refactored it, will only suck all the spirit out of that person and you would be basically named as a dick in the team.&lt;/p&gt;  &lt;p&gt;Happy Refactoring!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-7614881507497737869?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/7614881507497737869/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2010/05/no-one-likes-their-code-to-be-changed.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/7614881507497737869'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/7614881507497737869'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2010/05/no-one-likes-their-code-to-be-changed.html' title='No one likes their code to be changed'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-2752822915090908268</id><published>2010-05-09T04:43:00.001-07:00</published><updated>2010-05-09T04:43:21.313-07:00</updated><title type='text'>So you want to use Continuous Integration!</title><content type='html'>&lt;p&gt;Alright, this would be among the better decisions you would have taken in your project. Good for ya. Well… what next? This is what happened to me lately. Whenever a new thing comes in town, like a pragmatic programmer I do not get on the “Wow this is awesome” wagon until I have done some homework over it. So for Continuous Integration (hereafter mentioned as CI), I looked around the cloud and found several options. One option that is obvious was &lt;a href="http://cruisecontrol.sourceforge.net/" target="_blank"&gt;CruiseControl&lt;/a&gt;. It has been used for quite some time in the developer community both .NET and in Java (and others may be). Not sure if it is just me on this, but I found configuring and getting in running for my project became a project in itself. I was basically sitting in front of my laptop trying to get my local svn server, CruiseControl&amp;#160; and few other bells and whistles that come with it to try talk to each other. Not straightforward. &lt;/p&gt;  &lt;p&gt;Now you can certainly argue like, Ohhh commmmon man, you are a developer and nothing is straight forward anyways, CruiseControl is configurable in just a snap by editing xml files here and there, starting the service etc. But really I feel things like CI, Source Control which are used to enhance the efficiency of a team, should not become a management task in itself. It should just be easy to setup and get going. And so there is a relatively new kid in town &lt;a href="http://hudson-ci.org/" target="_blank"&gt;Hudson&lt;/a&gt;. It is written in Java by Kohsuke Kawaguchi of Sun. I believe its only his brain into this tool and that makes it consistent throughout. I am mainly .NET guy and needed to get my C# projects into hudson. So here is what I had to do to get Hudson talk to my other companions on my laptop –:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;If you are completely Java agnostic, and happen to have no trace of Java on your machine, you would have to download Java atleast version 1.5. Get it from here, &lt;a href="http://java.com/en/"&gt;http://java.com/en/&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Download the latest and greatest hudson.war file from &lt;a title="http://hudson-ci.org/latest/hudson.war" href="http://hudson-ci.org/latest/hudson.war"&gt;http://hudson-ci.org/latest/hudson.war&lt;/a&gt;. &lt;/li&gt;    &lt;li&gt;Place the downloaded hudson.war file at some sensible place, well I have it here C:\Hudson. &lt;/li&gt;    &lt;li&gt;Open a command prompt and get to folder location which has the hudson.war file. Issue the following command, java –jar hudson.war . &lt;/li&gt;    &lt;li&gt;Once hudson is started, visit &lt;a href="http://localhost:8080/"&gt;http://localhost:8080/&lt;/a&gt; on your browser and voila, you should have a wonderful Hudson dashboard smiling at you. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Now to configure my .NET project,&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Click ManageHudson in the left navigation links on the Dashboard. Click Manage Plugins (3rd link for the lazy ones, man I am spoiling you). Click the Available tab, Select the MSBuild Plugin and click Install and the very bottom of the page. &lt;/li&gt;    &lt;li&gt;Hudson would download everything you ask for and the automatic updates right off the web interface, so no need to upgrade manually. &lt;/li&gt;    &lt;li&gt;The MSBuild plugin is basically used to well, build your .NET projects using msbuild.exe. Configure this plugin with your msbuild settings. For really basic settings, Click Manage Hudson again. Click Configure System, navigate to MSBuild Builder section, name it something like MSBuild .NET 3.5 (can be anything really) and the path to the msbuild.exe. Typically the path would be C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe. Hit Save the very bottom of the page. &lt;/li&gt;    &lt;li&gt;Now go to the home page, click New Job. Give some Job name. Select “Build a free-style software project” which makes it all configurable. &lt;/li&gt;    &lt;li&gt;Since I use Subversion, in the Source Code Management section, I selected Subversion, and gave the repo url as my local repository path(&lt;a title="svn://localhost/myproject/trunk/ConsoleApplication8" href="svn://localhost/myproject/trunk/ConsoleApplication8"&gt;svn://localhost/myproject/trunk/ConsoleApplication8&lt;/a&gt;). Local module directory can be set to a period “.”, so that Hudson copies the code files directly into its workspace. &lt;/li&gt;    &lt;li&gt;In Build section, click Add Build Step. You should see the Msbuild name you gave in the MSBuild plugin setup. Select that, for the MsBuild file, give the name of your solution like so, ConsoleApplication8.sln. You could give any additional command like arguments to MSBuild if needed for your project. &lt;/li&gt;    &lt;li&gt;Hit Save. On the Home Page you would see a link to your project. Click that, you should see a Build Now link in the left navigation links. This would build your project. Wohoooo!! &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;This is just a basic setting I did in Hudson and got myself CI’ed with Hudson. There are several options to choose from if you know what you are doing of course. I am still overhauling this tool and no doubt it sounds promising. Here are few wonderful links for much deeper help,&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blog.bobcravens.com/2010/03/01/GettingStartedWithCIUsingHudsonForYourNETProjects.aspx"&gt;http://blog.bobcravens.com/2010/03/01/GettingStartedWithCIUsingHudsonForYourNETProjects.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://redsolo.blogspot.com/2008/04/guide-to-building-net-projects-using.html"&gt;http://redsolo.blogspot.com/2008/04/guide-to-building-net-projects-using.html&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Happy Integrating.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-2752822915090908268?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/2752822915090908268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2010/05/so-you-want-to-use-continuous.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/2752822915090908268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/2752822915090908268'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2010/05/so-you-want-to-use-continuous.html' title='So you want to use Continuous Integration!'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-293992845196268895</id><published>2010-04-21T05:36:00.001-07:00</published><updated>2010-04-21T05:36:00.748-07:00</updated><title type='text'>Generic WPF Dispatcher</title><content type='html'>&lt;p&gt;Howdy! In a medium to large WPF application, it is fairly common required to do some background stuff and update the UI asynchronously. You could use the BackgroundWorker class to do this, you could use the Dispatcher object to do this too. Most of the people know how to use the Dispatcher and for those who do not, this link will surely help &lt;a title="http://msdn.microsoft.com/en-us/magazine/cc163328.aspx" href="http://msdn.microsoft.com/en-us/magazine/cc163328.aspx"&gt;http://msdn.microsoft.com/en-us/magazine/cc163328.aspx&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;Rather than peppering the Dispatcher code all over the application, it would be nice to have it in a single place. This can be achieved using extension methods on the Dispatcher class. Below is some code which can be used as is to make your Dispatcher generic enough to do most of the stuff.&lt;/p&gt;  &lt;pre class="brush: js;"&gt;internal static class TDFDispatcher&lt;br /&gt;    {       &lt;br /&gt;internal static void Dispatch(this Dispatcher source,Nullable&amp;lt;DispatcherPriority&amp;gt; priority,Action invokedDelegate)&lt;br /&gt;{&lt;br /&gt;    if (invokedDelegate != null)&lt;br /&gt;    {&lt;br /&gt;        if (!source.CheckAccess())&lt;br /&gt;        {&lt;br /&gt;            source.Invoke(priority.HasValue ? priority.Value : DispatcherPriority.Normal, invokedDelegate);&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            invokedDelegate();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;internal static void Dispatch&amp;lt;T&amp;gt;(this Dispatcher source, Nullable&amp;lt;DispatcherPriority&amp;gt; priority, Action&amp;lt;T&amp;gt; invokedDelegate,T arg)&lt;br /&gt;{&lt;br /&gt;    if (invokedDelegate != null)&lt;br /&gt;    {&lt;br /&gt;        if (!source.CheckAccess())&lt;br /&gt;        {&lt;br /&gt;            source.Invoke(priority.HasValue ? priority.Value : DispatcherPriority.Normal, invokedDelegate,arg);&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            invokedDelegate(arg);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;internal static TResult Dispatch&amp;lt;T,TResult&amp;gt;(this Dispatcher source, Nullable&amp;lt;DispatcherPriority&amp;gt; priority, Func&amp;lt;T,TResult&amp;gt; invokedDelegate, T arg)&lt;br /&gt;{&lt;br /&gt;    TResult result = default(TResult);&lt;br /&gt;    if (invokedDelegate != null)&lt;br /&gt;    {&lt;br /&gt;        if (!source.CheckAccess())&lt;br /&gt;        {&lt;br /&gt;            result = (TResult)source.Invoke(priority.HasValue ? priority.Value : DispatcherPriority.Normal, invokedDelegate, arg);&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            result = invokedDelegate(arg);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    return result;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;You can certainly come up with even more permutations and combinations to enhance this class.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Happy Programming!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-293992845196268895?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/293992845196268895/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2010/04/generic-wpf-dispatcher.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/293992845196268895'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/293992845196268895'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2010/04/generic-wpf-dispatcher.html' title='Generic WPF Dispatcher'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-5174292943929169189</id><published>2010-04-02T23:56:00.001-07:00</published><updated>2010-04-03T00:01:48.516-07:00</updated><title type='text'>Creating instance of a type outside the current AppDomain</title><content type='html'>&lt;p&gt;Howdy Ho! So I am came across a conundrum lately in my project where I had to create instances of a type via reflection. The scenario is, there is a Sample.dll which has a type defined in it MyType. The Sample.dll refers several other 3rd party dll’s like SomeOther1.dll and SomeCrap.dll. I have an executing assembly MyExecutingAssembly.exe residing in folder MyExecutingAssembly. The Sample.dll and its referenced files are located somewhere else in a folder called Sample. &lt;/p&gt;  &lt;p&gt;Like a normal stupid developer, I wrote the following code to create the instance in MyExecutingAssembly.exe.&lt;/p&gt;  &lt;pre class="brush: js;"&gt;Assembly assembly = Assembly.LoadFrom(C:\Sample\Sample.dll);&lt;br /&gt;Type appType = assembly.GetType(MyType);&lt;br /&gt;object objClassInstance = Activator.CreateInstance(appType);&lt;/pre&gt;&lt;br /&gt;Boom! Error message for the 3rd line was something like, “Could not find assembly SomeCrap.dll, The assembly used while compiling might be different than that used while loading from …”. Blistering Barnacles, thundering typhoons… Now some straight talk, &lt;br /&gt;&lt;br /&gt;&lt;p&gt;The type MyType, resides in the Sample.dll, this dll references 2 other dlls, when the runtime tries so, it searches for the files in the folder where the MyExecutingAssembly.exe resides. This is so because the AppDomain in which we are trying to create the instance has the base directory path of the MyExecutingAssembly. Phew! Hope you get the issue here. There are several ways to tackle this,&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Method 1&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Create an appdomain, set its base directory to the folder where the Sample.dll and its referenced files reside. But this is some serious implication. Since we are in a separate AppDomain, we are creating the instance in a completely impenetrable environment. This asks for .NET remoting to communicate with the instance. The code would look as below,&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: js;"&gt;Assembly assembly = Assembly.LoadFrom(@&amp;quot;C:\Sample\Sample.dll&amp;quot;);&lt;br /&gt;AppDomainSetup setup = new AppDomainSetup();&lt;br /&gt;setup.ApplicationBase = @&amp;quot;C:\Sample\&amp;quot;;&lt;br /&gt;AppDomain appDomain = AppDomain.CreateDomain(&amp;quot;AppHostDomain&amp;quot;, null, setup);&lt;br /&gt;object obj = appDomain.CreateInstanceFromAndUnwrap(@&amp;quot;C:\Sample\Sample.dll&amp;quot;, &amp;quot;SampleProxy&amp;quot;);&lt;/pre&gt;&lt;br /&gt;Observe that the type I am creating is not the actual MyType but a class called SampleProxy which inherits from MarshalByRefObject. I create instance of the MyType inside this class. Sigh! It seems you did not like this. More information on Suzanne’s blog &lt;a href="http://blogs.msdn.com/suzcook/archive/2003/06/12/57169.aspx" target="_blank"&gt;here&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Method 2&lt;/strong&gt;&amp;#160;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Recursively check references of all the assemblies and load all of them manually in the current AppDomain. This a bit lengthy process, but, well, it works. Here is the code,&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: js;"&gt;Assembly assembly = Assembly.LoadFrom(@&amp;quot;C:\Sample\Sample.dll&amp;quot;);&lt;br /&gt;AssemblyName[] arr = assembly.GetReferencedAssemblies();                &lt;br /&gt;LoadAssembly(arr);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;private void LoadAssembly(AssemblyName[] arr)&lt;br /&gt;{&lt;br /&gt;    Assembly[] loadedAssemblies = AppDomain.CurrentDomain.GetAssemblies();&lt;br /&gt;    List&amp;lt;string&amp;gt; names = new List&amp;lt;string&amp;gt;();&lt;br /&gt;    foreach (Assembly assem in loadedAssemblies)&lt;br /&gt;    {&lt;br /&gt;        names.Add(assem.FullName);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    foreach (AssemblyName aname in arr)&lt;br /&gt;    {&lt;br /&gt;        if (!names.Contains(aname.FullName))&lt;br /&gt;        {&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                Assembly loadedAssembly = Assembly.LoadFrom(@&amp;quot;C:\Sample\&amp;quot; + aname.Name + &amp;quot;.dll&amp;quot;);&lt;br /&gt;                AssemblyName[] referencedAssemblies = loadedAssembly.GetReferencedAssemblies();&lt;br /&gt;                LoadAssembly(referencedAssemblies);&lt;br /&gt;            }&lt;br /&gt;            catch (Exception ex)&lt;br /&gt;            {&lt;br /&gt;                continue;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;Tedious eh. &lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Method 3&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Use the AppDomain’s AssemblyResolve event. Basically, whenever you are trying to load assemblies in an AppDomain, if a particular assembly is that the runtime is trying to load fails for some reason, this event is fired. We can tap into this event and load the right assembly instead. Here is the code in short,&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: js;"&gt;Assembly assembly = Assembly.LoadFrom(@&amp;quot;C:\Sample\Sample.dll&amp;quot;);&lt;br /&gt;AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);&lt;br /&gt;object obj = Activator.CreateInstanceFrom(@&amp;quot;C:\Sample\Sample.dll&amp;quot;, &amp;quot;MyType&amp;quot;);&lt;br /&gt;&lt;br /&gt;Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)&lt;br /&gt;{&lt;br /&gt;    string path = @&amp;quot;C:\Sample\Sample.dll&amp;quot;;&lt;br /&gt;    string test = path.Substring(0,path.LastIndexOf(@&amp;quot;\&amp;quot;));&lt;br /&gt;    string[] arr = args.Name.Split(',');&lt;br /&gt;    string assemblyName = args.Name.Substring(0, args.Name.IndexOf(&amp;quot;,&amp;quot;)) + &amp;quot;.dll&amp;quot;;&lt;br /&gt;    string newPath = System.IO.Path.Combine(test, assemblyName);&lt;br /&gt;    return Assembly.LoadFrom(newPath);&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Well, a little better I guess. More information on this &lt;a href="http://support.microsoft.com/kb/837908" target="_blank"&gt;here&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;&lt;p&gt;Happy Programming!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-5174292943929169189?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/5174292943929169189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2010/04/creating-instance-of-type-outside.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/5174292943929169189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/5174292943929169189'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2010/04/creating-instance-of-type-outside.html' title='Creating instance of a type outside the current AppDomain'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-5546436685535832147</id><published>2010-03-08T06:41:00.001-08:00</published><updated>2010-03-08T06:41:13.932-08:00</updated><title type='text'>Coding to the specs or “Spec”ing to the Code!</title><content type='html'>&lt;p&gt;Its March. You need to deliver a fuckin awesome all-knowing, all-seeing application to your super ambitious client. The client has found you good enough to do this work for him. All is well, your manager is happy to take on this project, things move on. Oh but, did I mention that the delivery needs to be in 2nd week of May. Blistering Barnacles!!!!! Thundering Typhoooons, Maniacs, Ectoplasmsss… &lt;/p&gt;  &lt;p&gt;In such cases, Agile, Waterfall, and other superman techniques are thrown out of the window, aren’t they? I do not give a crocodile’s ass for the manager or his boss or his boss. I am talking to the developer. Mate, the worst thing you could do in such case is to hastily start coding and get ready to deliver it and impress your boss, and may be get a free coupon to McDonald’s I(Not sure where I am going with this, but stay with me.) Although this is the thing you would be asked to do by your bosses. No specifications (specs), no clear requirements, no beer, just start the damn coding phase. A not so warm welcome to Outsourcing. &lt;/p&gt;  &lt;p&gt;You the developer, do not have much control on these happenings. But there is one thing which can save your soul and make you a better human being. Write your own specifications. They can be rudimentary, as long as you know what you are writing in it, the purpose is served. Your specs can be just simple English statements like -&lt;/p&gt;  &lt;p&gt;- Get all folders in the directory for given path.&lt;/p&gt;  &lt;p&gt;- If folder with name Sucker exists, fork new thread.&lt;/p&gt;  &lt;p&gt;- New thread will run background.&lt;/p&gt;  &lt;p&gt;….&lt;/p&gt;  &lt;p&gt;Your code then should follow this spec, and let me tell you, that really works. Jumping right into the editor might have worked for you before, but you can consider it as a coincidence. Writing such specs before coding might not get you the free coupon, but surely it will improve your code and make you feel better! Please do not go to your boss and explain him how important specs are for this project, let me say he is too smart to understand these things. &lt;/p&gt;  &lt;p&gt;This is how I work and I can tell from my experience (its not that long experience really), I feel really good about massaging my fingers with some nice specs before slapping the keyboard with my crappy code.&lt;/p&gt;  &lt;p&gt;Happy Programming!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-5546436685535832147?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/5546436685535832147/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2010/03/coding-to-specs-or-specing-to-code.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/5546436685535832147'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/5546436685535832147'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2010/03/coding-to-specs-or-specing-to-code.html' title='Coding to the specs or “Spec”ing to the Code!'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-18856773548106160</id><published>2010-02-13T11:37:00.001-08:00</published><updated>2010-02-13T11:37:57.190-08:00</updated><title type='text'>I am a duct tape programmer</title><content type='html'>&lt;p&gt;We all know what &lt;a href="http://www.joelonsoftware.com/items/2009/09/23.html" target="_blank"&gt;duct tape programming&lt;/a&gt; is. I am one of them. I am no way close to Jamie but ya, I will make sure that the cart keeps running and crosses the finish line in time, whatever it takes. All the programming practices, patterns, Agile, waterfall, yada yada, are thrown out of the window when we have to make something complicated in a very very very, did I mention very, short deadline. &lt;/p&gt;  &lt;p&gt;All the best programming practice gurus… no hard feelings, Peace.&lt;/p&gt;  &lt;p&gt;Happy Programming&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-18856773548106160?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/18856773548106160/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2010/02/i-am-duct-tape-programmer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/18856773548106160'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/18856773548106160'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2010/02/i-am-duct-tape-programmer.html' title='I am a duct tape programmer'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-1835518210733776010</id><published>2010-02-13T04:23:00.001-08:00</published><updated>2010-02-13T04:25:47.145-08:00</updated><title type='text'>Reusing types with Visual Studio Service Reference.</title><content type='html'>&lt;p&gt;I am sure this is something many folks would have come across by now. But what the heck, I thought of adding some more crap on the internet. So, this is what I want to do, I have a shared library called MySharedLib.dll. I have added a reference to it from my Console Application project. Now I want to add a WCF Service reference to my application, but the service internally uses MySharedLib.dll too. So you say whats the problem?? For newbs, if you add a reference to such a service without doing “something” in Visual Studio, the proxy generated would have defined the same type in its namespace. This type would be incompatible with the type which is in MySharedLib.dll. Enough blabbering, here is some code&lt;/p&gt;  &lt;pre class="brush: js;"&gt;public ConsoleApplication3.ServiceReference1.Assignment[] GetAssignments(ConsoleApplication3.ServiceReference1.User authenticatedUser) {&lt;br /&gt;return base.Channel.GetAssignments(authenticatedUser);}&lt;br /&gt;        &lt;br /&gt;public ConsoleApplication3.ServiceReference1.AppFolder[] GetAppFolders(ConsoleApplication3.ServiceReference1.Assignment userAssignment) {&lt;br /&gt;return base.Channel.GetAppFolders(userAssignment);&lt;/pre&gt;&lt;br /&gt;The above classes like Assignment, User, AppFolder are not the ones from MySharedLib.dll. They are generated for the proxy by Visual Studio. If you try to assign this type to a variable of type in MySharedLib.dll they would obviously be incompatible. If you want Visual Studio to reuse the types in a shared library in its proxy do the following –: &lt;br /&gt;&lt;br /&gt;In your project to which you need to add a service reference, add a reference to the shared dll you need to reuse.&lt;br /&gt;On Add Service Reference dialog, click Advanced,&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_8U4ptmqLjxo/S3aZq5H8vwI/AAAAAAAAAs4/cetQik25wl0/s1600-h/Capture1%5B7%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Capture1" border="0" alt="Capture1" src="http://lh3.ggpht.com/_8U4ptmqLjxo/S3aZr3slMVI/AAAAAAAAAs8/rdrSfMc-5rE/Capture1_thumb%5B5%5D.jpg?imgmax=800" width="485" height="457" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;And this, &lt;br /&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_8U4ptmqLjxo/S3aZtNGdnJI/AAAAAAAAAtA/9G8Ho1VJGH0/s1600-h/Capture2%5B5%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Capture2" border="0" alt="Capture2" src="http://lh5.ggpht.com/_8U4ptmqLjxo/S3aZubn1H0I/AAAAAAAAAtE/yhEoHFIgEbU/Capture2_thumb%5B3%5D.jpg?imgmax=800" width="489" height="457" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Happy Programming!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-1835518210733776010?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/1835518210733776010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2010/02/reusing-types-with-visual-studio.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/1835518210733776010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/1835518210733776010'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2010/02/reusing-types-with-visual-studio.html' title='Reusing types with Visual Studio Service Reference.'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_8U4ptmqLjxo/S3aZr3slMVI/AAAAAAAAAs8/rdrSfMc-5rE/s72-c/Capture1_thumb%5B5%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-3919268435294629284</id><published>2010-02-13T03:49:00.001-08:00</published><updated>2010-02-13T03:50:23.389-08:00</updated><title type='text'>Avoiding Temporal Coupling</title><content type='html'>&lt;p&gt;Ahh, I just love getting back to my blogging time. Its been a busy month with lots of caffeine and code. But that's divine isn't it? So, getting back to basics, I hate coupling in my code, umm.. Everyone does. I just wanted to highlight one not so apparent coupling seen all over the “&lt;a href="http://www.codinghorror.com/blog/2009/05/the-bathroom-wall-of-code.html" target="_blank"&gt;bathroom wall of code&lt;/a&gt;”, Temporal Coupling. For the definition freaks, Temporal Coupling is when your functions need to be called in a specific timeline/order to get the desired output. Well, look for yourself,&lt;/p&gt;  &lt;pre class="brush: js;"&gt;internal void BeAGuitarist()&lt;br /&gt;{&lt;br /&gt;    BuyAGuitar();&lt;br /&gt;    TuneGuitar();&lt;br /&gt;    StartRocking();&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;To BeAGuitarist, the order in which the functions are called inside it are important. If you are developing an application framework which will be used by gazzilion developers to build their applications, how would you instruct each one of them to follow this order. Sooner or later it will get out of control and you would get mails like your framework sucks to the core.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;One of the primary reasons for Temporal Coupling is global variables. In the earlier snippet, probably there is a variable “guitar” which is being modified by each of the functions. If we can localize that variable and pass it as an argument to the functions, we eventually force the usage in a particular way. The above code can also be written something like this,&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: js;"&gt;internal void BeAGuitarist()&lt;br /&gt;{&lt;br /&gt;    BuyAGuitar();&lt;br /&gt;    TuneGuitar(guitar);&lt;br /&gt;    StartRocking(tunedGuitar);&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I hope you get the point, if not, just fuck it, I am too cynical about many things in life!&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Happy Programming!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-3919268435294629284?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/3919268435294629284/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2010/02/avoiding-temporal-coupling.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/3919268435294629284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/3919268435294629284'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2010/02/avoiding-temporal-coupling.html' title='Avoiding Temporal Coupling'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-2118779132600791534</id><published>2010-01-03T02:41:00.001-08:00</published><updated>2010-01-03T02:41:41.717-08:00</updated><title type='text'>Marrying Windows Live Writer with Ommwriter</title><content type='html'>&lt;p&gt;I use Windows Live Writer to manage my blog posts in blogger.com. If you are a regular blogger, occasional or a lazy one, this writer is clearly a winner on Windows. It seamlessly integrates with most blogging sites like blogger.com, wordpress.com etc.    &lt;br /&gt;Being a follower of &lt;a href="http://www.randsinrepose.com/" target="_blank"&gt;The Rands&lt;/a&gt;, I was introduced to an elegant text editor called &lt;a href="http://www.ommwriter.com/" target="_blank"&gt;Ommwriter&lt;/a&gt;. It is exclusively available for Mac. I must say that the experience with this editor was just wonderful. The creators of Ommwriter have clearly nailed down the requirements of a serious writer. The soothing appearance, mild tones running in the background just brings out the creative in you. It just emphasizes the fact that the environment in which we work in very much affects the quality of our work. My posts suck regardless of the editor, which is a different story all together.     &lt;br /&gt;So I am like, we have a great tool in one hand, the Windows Live Writer and a brilliant idea like Ommwriter. Wouldn't it be great to have the same experience of Ommwriter while I am writing my posts in Live Writer? I will be digging deep into the Live Writer SDK to overhaul any such possibilities. I do not think anyone has tried this until now but it would be very very useful to me.     &lt;br /&gt;Until I am able to get something like this, I will continue to use Ommwriter to write all the text and then paste it into the Live Writer to add pictures and other items in it. Its painful to switch between OS to do this, but its worth it for me.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-2118779132600791534?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/2118779132600791534/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2010/01/marrying-windows-live-writer-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/2118779132600791534'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/2118779132600791534'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2010/01/marrying-windows-live-writer-with.html' title='Marrying Windows Live Writer with Ommwriter'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-830896847510911678</id><published>2010-01-02T05:48:00.001-08:00</published><updated>2010-01-02T05:48:30.866-08:00</updated><title type='text'>Ruby like command line access to an ASP.NET project</title><content type='html'>&lt;p&gt;I have been playing with Ruby on Rails in my house for some time alongside my experience with ASP.NET in my office. It is a framework worth spending some time with regardless of the technology you are working on currently for your bread and butter. In particular, I liked the idea of command line access to a web application. I guess love for command line comes with love for coding. So I thought of pulling out this feature and create a nifty utility to talk with a ASP.NET web application project via commands.    &lt;br /&gt;For now the tool works only for those web projects which have a Linq to SQL designer file generated by Visual Studio when you add a LinqToSql dataset to your project. The tool basically uses reflection to pick out the tables in your Linq Context and dynamically create instances to query the database.&lt;/p&gt;  &lt;p&gt;To use this tool, &lt;/p&gt;  &lt;p&gt;Create a WebApplication project in Visual Studio, add a Linq To Sql dbml file and let the editor create the designer file for you. For now, you would have to build the project at least once to generate the dll. I will add the project compilation code later so that you do not even have to do this build. Thats it.&lt;/p&gt;  &lt;p&gt;The tool just provides a read access to the underlying database for now, the code is pretty straight forward to add features like insert, update, delete etc.&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;Here are some screenshots –:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_8U4ptmqLjxo/Sz9OmGKKS_I/AAAAAAAAArk/WBq9aljHJNo/s1600-h/1%5B12%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="1" border="0" alt="1" src="http://lh3.ggpht.com/_8U4ptmqLjxo/Sz9Om8Yw7II/AAAAAAAAAro/IowCtan7gdY/1_thumb%5B8%5D.jpg?imgmax=800" width="640" height="212" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_8U4ptmqLjxo/Sz9Onu4FYOI/AAAAAAAAArs/XxuX9LBXnlA/s1600-h/2%5B7%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="2" border="0" alt="2" src="http://lh6.ggpht.com/_8U4ptmqLjxo/Sz9OoU4lEsI/AAAAAAAAArw/gVtmOo9vr_0/2_thumb%5B3%5D.jpg?imgmax=800" width="640" height="156" /&gt;&lt;/a&gt; &lt;a href="http://lh3.ggpht.com/_8U4ptmqLjxo/Sz9OpAe7kqI/AAAAAAAAAr0/Qv7rI18mAok/s1600-h/3%5B7%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="3" border="0" alt="3" src="http://lh4.ggpht.com/_8U4ptmqLjxo/Sz9Op4Eph0I/AAAAAAAAAr4/Ejlqf_iJGkQ/3_thumb%5B3%5D.jpg?imgmax=800" width="640" height="161" /&gt;&lt;/a&gt; &lt;a href="http://lh5.ggpht.com/_8U4ptmqLjxo/Sz9OqoK_4lI/AAAAAAAAAr8/7E0lmhTPrpE/s1600-h/4%5B7%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="4" border="0" alt="4" src="http://lh5.ggpht.com/_8U4ptmqLjxo/Sz9OraRs6UI/AAAAAAAAAsA/jEbXh7rMpG0/4_thumb%5B3%5D.jpg?imgmax=800" width="640" height="222" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-830896847510911678?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/830896847510911678/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2010/01/ruby-like-command-line-access-to-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/830896847510911678'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/830896847510911678'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2010/01/ruby-like-command-line-access-to-aspnet.html' title='Ruby like command line access to an ASP.NET project'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_8U4ptmqLjxo/Sz9Om8Yw7II/AAAAAAAAAro/IowCtan7gdY/s72-c/1_thumb%5B8%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-4813597569727772377</id><published>2009-10-13T11:23:00.001-07:00</published><updated>2009-10-13T11:25:14.470-07:00</updated><title type='text'>I create bugs for living!</title><content type='html'>&lt;p&gt;Yup, that’s what I do for living, and I get paid quite decently for doing that… As the experts in the field of software development rightly say, the biggest reason for a bug to be present in a piece of code is the code itself. If there was no code in the first place, there would not have been that freakin bug. I remember while I was watching the California Wild fire coverage on the news channel back in 2008, there was a couple shown, who lost their home in the California wildfires put up a humorous sign that reads, &amp;quot;Finally! No Termites.&amp;quot; No Home, no damn termites. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_8U4ptmqLjxo/StTFt60lGkI/AAAAAAAAAqo/Q9wLdIxYlaU/s1600-h/14445579_120X90%5B2%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="14445579_120X90" border="0" alt="14445579_120X90" src="http://lh3.ggpht.com/_8U4ptmqLjxo/StTFuuvwuXI/AAAAAAAAAqs/-oAPjVxzMeE/14445579_120X90_thumb.jpg?imgmax=800" width="124" height="94" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Well that’s common sense I know. Although I find it pretty fascinating that underneath my title of a software developer, I am actually developing ingenious ways to create bugs! &lt;/p&gt;  &lt;p&gt;Happy Programming!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-4813597569727772377?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/4813597569727772377/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2009/10/i-create-bugs-for-living.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/4813597569727772377'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/4813597569727772377'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2009/10/i-create-bugs-for-living.html' title='I create bugs for living!'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_8U4ptmqLjxo/StTFuuvwuXI/AAAAAAAAAqs/-oAPjVxzMeE/s72-c/14445579_120X90_thumb.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-2116814268175440727</id><published>2009-10-10T08:46:00.001-07:00</published><updated>2009-10-10T08:46:11.160-07:00</updated><title type='text'>How important is your website design for your business…</title><content type='html'>&lt;p&gt;I think this is a no-brainer for a successful for startup company. As the world is getting shrinking due to internet, gradually each of your family members would get the taste of it (if they haven’t got it yet). That means as people search for stuff they need, they would use Google (&lt;a href="http://www.techcrunch.com/2009/09/09/bing-loves-the-porn-hounds/" target="_blank"&gt;Bing for those who like to search for porn&lt;/a&gt;), click on the link and hopefully land on one of your site pages. This makes your website literally the starting point of your business whatever it may be. And what if your website is a real cheap job. Well.. for those who hardly care about these things might give it a shot, but frankly almost all like to see something aesthetically&amp;#160; good design. Something which is less complicated and highly usable. &lt;/p&gt;  &lt;p&gt;Lately I was rummaging several websites here in India to buy a new house, precisely in Pune. I do realize that India is not at a stage where every new business that comes in the market makes sure to have their own website. But businessman are getting aware of this mistake and taking baby steps towards changing this. Look at these sites I visited,&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.pscl.in/" href="http://www.pscl.in/"&gt;http://www.pscl.in/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.adityabuilders.com/" href="http://www.adityabuilders.com/"&gt;http://www.adityabuilders.com/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.goelganga.com/" href="http://www.goelganga.com/"&gt;http://www.goelganga.com/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Cheap ain’t&amp;#160; it? For a web developer such a website creates quite a bit of negative impact, believe it or not. Now look at one of Puranik builders site &lt;a title="http://www.spaininindia.com/" href="http://www.spaininindia.com/"&gt;http://www.spaininindia.com/&lt;/a&gt;. When you have something cool, flashhy to sell, why not make your website feel the same?&amp;#160; &lt;/p&gt;  &lt;p&gt;P.S. – I hope I can instigate this feeling in the company I work!!! &lt;a title="http://www.synechron.com/" href="http://www.synechron.com/"&gt;http://www.synechron.com/&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Happy Programming!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-2116814268175440727?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/2116814268175440727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2009/10/how-important-is-your-website-design.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/2116814268175440727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/2116814268175440727'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2009/10/how-important-is-your-website-design.html' title='How important is your website design for your business…'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-4357129280235578580</id><published>2009-09-11T09:51:00.001-07:00</published><updated>2009-09-11T09:51:29.770-07:00</updated><title type='text'>Man I love these books!</title><content type='html'>&lt;p&gt;Every time I visit a bookstore, my mind starts jumping around like that of a tiny tot in a Toy store (or like Glenn Quagmire in an adult store, whichever sounds correct here). I just wish I had the whole amazon book store in my room for use anytime! Sigh! Cannot have that. Anyways, I have a whole lot of ebooks on my machine, but I own some of them. Few of the books in my ebook collection are not available in India. Below is a snapshot of my book collection as shown by the Delicious library.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_8U4ptmqLjxo/Sqp_7NTW2HI/AAAAAAAAAo0/Cz0IA3Xizg4/s1600-h/Picture%201.png%2021-52-17-836%5B8%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Picture 1.png 21-52-17-836" border="0" alt="Picture 1.png 21-52-17-836" src="http://lh4.ggpht.com/_8U4ptmqLjxo/SqqADx0KgmI/AAAAAAAAAo4/bJchPcq4lR0/Picture%201.png%2021-52-17-836_thumb%5B4%5D.png?imgmax=800" width="955" height="654" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Each of these books are worth every friggin buck you spend on them.&lt;/p&gt;  &lt;p&gt;Happy Programming!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-4357129280235578580?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/4357129280235578580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2009/09/man-i-love-these-books.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/4357129280235578580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/4357129280235578580'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2009/09/man-i-love-these-books.html' title='Man I love these books!'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_8U4ptmqLjxo/SqqADx0KgmI/AAAAAAAAAo4/bJchPcq4lR0/s72-c/Picture%201.png%2021-52-17-836_thumb%5B4%5D.png?imgmax=800' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-3675040477057154014</id><published>2009-08-26T11:40:00.001-07:00</published><updated>2009-08-26T11:42:45.007-07:00</updated><title type='text'>IE8 compatibility mode, UserAgent, wrong CSS.. you got my point huh!</title><content type='html'>&lt;p&gt;I am running IE8 on my Windows XP machine. I am building a website for one my clients, the project is going really well. I am working on adding browser specific CSS to my site using the Request.Browser class in ASP.NET. Things are looking absolutely beautiful in Firefox, Safari, Chrome ….. you name it. Opened IE8.. wonderful as usual. Clicked compatibility mode in IE8, so running IE7 technically, looks good again. Closed the IE8 instance, opened IE8 just to make sure things were ok, YAIEEEEEEEEEEEEEEEEEEE KARAMBAAAAAAAAAAAAA!!! Someone unleashed hell on my webpage. What happened!&lt;/p&gt;  &lt;p&gt;They way I added browser specific CSS is in my code, detect the browser name and version and add css reference in the Head tag of the page. Now there is a situation where IE8 is in compatibility mode, but the UserAgent still has browser version of 8.0 in it, due to which in my case, the IE8 css was added in an IE7 scenario. The problem with my approach was I was trying to do everything on the server side. It happens so that to detect if a user has turned on Compatibility mode, we have to have some kind of client side scripting done. The magic property is document.documentMode, this value is probably only available in IE8 browser. For IE8, the value is “8”, for compatibility mode it is “7”. So one way would be to disable to IE8 css which is already added and add the IE7 css when the browser is in compatibility mode, like so,&lt;/p&gt;  &lt;pre class="brush: js;"&gt; $(document).ready(function() {&lt;br /&gt;        if(document.documentMode == &amp;quot;7&amp;quot;)&lt;br /&gt;        {&lt;br /&gt;         var head = document.getElementById('pageHead');&lt;br /&gt;         var linktg = document.createElement('link');&lt;br /&gt;         linktg.type = 'text/css';            &lt;br /&gt;         linktg.rel = 'stylesheet';            &lt;br /&gt;         linktg.href = 'MyStyle-IE7.css';   &lt;br /&gt;         linktg.media = 'all';                &lt;br /&gt;         head.appendChild(linktg);    &lt;br /&gt;         $(&amp;quot;link[href='MyStyle-IE8.css']&amp;quot;).attr('disabled','true');&lt;br /&gt;        }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;I read an article somewhere about “Letting Internet Explorer 6 die down for the Web to move on” or something like that. I wonder why not kill this whole Internet Explorer thing once in for all? &lt;br /&gt;&lt;br /&gt;&lt;p&gt;Happy Programming!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-3675040477057154014?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/3675040477057154014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2009/08/ie8-compatibility-mode-useragent-wrong.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/3675040477057154014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/3675040477057154014'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2009/08/ie8-compatibility-mode-useragent-wrong.html' title='IE8 compatibility mode, UserAgent, wrong CSS.. you got my point huh!'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-4622197462208923929</id><published>2009-08-22T01:41:00.001-07:00</published><updated>2009-08-22T01:42:39.608-07:00</updated><title type='text'>Do you get paid right?</title><content type='html'>&lt;p&gt;Salary is always a slightly weird if not uncomfortable topic to talk about during HR interviews at least for me. What should I say, would it be so much that I might be taken as a R-tard, or so less that I might be laughed at. Well believe it or not, very few folks know how much they should get paid depending on their experience, location, interview performance and other factors. When I was a fresher, it was pretty much a category in which all of us were put in when hired by a big firm. Everyone had the same amount on their paychecks. But as experience level rises, we get smarter and bolder (at least that is how it is supposed to be), we start thinking about our salary more seriously. I am yet to find a tool/website which would honestly provide a figure that would be very close to what I can ask for in an offer. Services like &lt;a href="http://www.payscale.com/" target="_blank"&gt;PayScale&lt;/a&gt;, &lt;a href="http://www.salary.com" target="_blank"&gt;Salary.com&lt;/a&gt; seem to be bullshitting us for quite long. Every time I checked my worth on these sites with my experience and other factors, I used to get a figure way less than my colleagues were getting. May be that could be a business tactics used by these services to entice us in getting their paid service to provide more information and get a better salary figure.&amp;#160; &lt;/p&gt;  &lt;p&gt;Recently a famous job site in India &lt;a href="http://www.naukri.com" target="_blank"&gt;Naukri.com&lt;/a&gt; launched a service called &lt;a href="http://my.naukri.com/PayCheck/salary" target="_blank"&gt;PayCheck&lt;/a&gt;. This service basically gives a graphical representation of where you stand among other people with similar profile as yours. A little bit of digging into this and you would realize that the data these guys are using is from the salaries reported by active profiles on Naukri.com. The problem here? Well, if we are talking about folks who have their current salary on Naukri, and are actively searching for new openings, there is a high probability that the salary they have posted is less than what they expect. Using such figures for calculating our expected salary seems a little dubious. Nevertheless, not all are searching for just a better pay, so there is some amount of good data which has helped in this analysis. I wish Naukri ties up with some kind of parallel service wherein they allow anonymous users to post their salaries alongside the companies and their satisfaction rates, something on the lines of &lt;a href="http://www.glassdoor.com" target="_blank"&gt;Glassdoor&lt;/a&gt;, &lt;a href="http://www.mouthshut.com" target="_blank"&gt;mouthshut&lt;/a&gt; etc. This way we really have a better dataset to calculate our expected salary. &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-4622197462208923929?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/4622197462208923929/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2009/08/do-you-get-paid-right.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/4622197462208923929'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/4622197462208923929'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2009/08/do-you-get-paid-right.html' title='Do you get paid right?'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-3885485294986227663</id><published>2009-08-19T10:50:00.001-07:00</published><updated>2009-08-28T06:48:42.186-07:00</updated><title type='text'>An interview with Synechron</title><content type='html'>&lt;blockquote&gt;   &lt;p align="left"&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Its been about 3 weeks I had been in a “job search” mode here in Pune, India. I got a call from &lt;a href="http://www.synechron.com/" target="_blank"&gt;Synechron&lt;/a&gt; asking me about scheduling an interview with me for a .NET position. Well, the company looked good to me, honestly the only thing we have to hang on to is the website. A quick search in the cloud did return some results about the reviews for this company. They were not show stoppers really. So I decided, heck why not, lets do this! Basically it is going to be the same thing all over, some US based clients, an offshore development center in India, and rest of the story goes on and on…(I know I sound really bored of this profession :))).&lt;/p&gt;  &lt;p&gt;So how was the interview, 2 technical rounds, 2 HR rounds and then the offer! (No free lunch, dammit). &lt;/p&gt;  &lt;p&gt;1st interview&lt;/p&gt;  &lt;p&gt;The manager certainly was heavily technical and knew what he was talking. I really felt good about that, since I have been interviewed by retards before. The questions pretty much summed up like these –:&lt;/p&gt;  &lt;p&gt;- C# programming language features&lt;/p&gt;  &lt;p&gt;- .NET underlying working.&lt;/p&gt;  &lt;p&gt;- Garbage collection working &lt;/p&gt;  &lt;p&gt;- Dispose method usage&lt;/p&gt;  &lt;p&gt;- Lots of OOPS questions like abstract classes, interfaces, inheritance, composition etc.&lt;/p&gt;  &lt;p&gt;- SQL queries, WITH NO LOCK usage, nested transactions.&lt;/p&gt;  &lt;p&gt;Done.&lt;/p&gt;  &lt;p&gt;2nd interview&lt;/p&gt;  &lt;p&gt;This guy asked my about things that were discussed with the earlier guy so that things do not get mixed. Questions were pretty tricky in some cases so it was fun,&lt;/p&gt;  &lt;p&gt;- use of usercontrols, CauseValidation usage in ASP.NET&lt;/p&gt;  &lt;p&gt;- DataRelation object in ADO.NET&lt;/p&gt;  &lt;p&gt;- Optimize an SQL query for better performance&lt;/p&gt;  &lt;p&gt;- Dispose vs Finalize method&lt;/p&gt;  &lt;p&gt;- Polymorphism and some other basic OOPS concepts.&lt;/p&gt;  &lt;p&gt;- Casting vs Unboxing.&lt;/p&gt;  &lt;p&gt;Done.&lt;/p&gt;  &lt;p&gt;Then were 2 HR rounds which, for some, are mere formalities in India. I take these interviews very seriously, probably due to my stint in US. I think HR interviews are meant for a smartness check and overall personality of an individual, good companies certainly reject candidates if these interviews do not go as per their standards. Well.. I do think in India most of the HR interviews are just a formality :(. I do not know if you guys would be interested in knowing what we discussed in these interviews, but let me know if you need some hints on these as well. &lt;/p&gt;  &lt;p&gt;Anyways, I got an offer from them,uummmm... a decent one, so lets see where things go from here. Best of luck to all you job hunters! &lt;/p&gt;  &lt;p&gt;Happy Programming!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-3885485294986227663?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/3885485294986227663/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2009/08/interview-with-synechron.html#comment-form' title='61 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/3885485294986227663'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/3885485294986227663'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2009/08/interview-with-synechron.html' title='An interview with Synechron'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>61</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-8871043935968400847</id><published>2009-08-12T07:56:00.001-07:00</published><updated>2009-08-12T07:56:20.675-07:00</updated><title type='text'>iPhone Developer jobs in India</title><content type='html'>&lt;p&gt;Howdy guys! Its been less than 2 weeks I started looking for a new job as a developer here in India. My resume has the usual stuff what a .NET developer (sensible one!) might have. One extra thing was added by me regarding my personal projects, iPhone sdk. Since the last 2 weeks, guess what kind of requirements I saw the most, from several companies here. Yup, iPhone development. iPhone is being considered as The Mobile Platform of the future and every company, whether a gallactico or a minion, are hiring iPhone developers. &lt;/p&gt;  &lt;p&gt;So, you job hunters, if you intend to switch for a iPhone developer position, there cannot be a better time than this. Post your resume with your iPhone projects and see requirements flooding your mailbox.&lt;/p&gt;  &lt;p&gt;Happy Programming!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-8871043935968400847?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/8871043935968400847/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2009/08/iphone-developer-jobs-in-india.html#comment-form' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/8871043935968400847'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/8871043935968400847'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2009/08/iphone-developer-jobs-in-india.html' title='iPhone Developer jobs in India'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-7735701539602343247</id><published>2009-07-11T14:00:00.001-07:00</published><updated>2009-07-14T03:44:56.356-07:00</updated><title type='text'>ASP.NET MVC – Validation of viewstate MAC failed error!</title><content type='html'>&lt;p&gt;If you are just kick starting with ASP.NET MVC like me, you might have stumbled across this error :). This might have caused may be due to &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;more than one form tag &lt;/li&gt;    &lt;li&gt;postback on a page containing a ViewUserControl &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;There are several other reasons for this error to pop up, but in ASP.NET MVC these 2 are the major ones. I was using RenderPartial to render one of my MVC usercontrols in one of my views on which when I did a postback I got this error.&lt;/p&gt;  &lt;p&gt;I do not want to belabor too much on this topic since there are lots of discussions on this bug in ASP.NET, here are some, &lt;/p&gt;  &lt;p&gt;&lt;a title="http://stackoverflow.com/questions/230014/postback-not-working-with-asp-net-routing-validation-of-viewstate-mac-failed" href="http://stackoverflow.com/questions/230014/postback-not-working-with-asp-net-routing-validation-of-viewstate-mac-failed"&gt;http://stackoverflow.com/questions/230014/postback-not-working-with-asp-net-routing-validation-of-viewstate-mac-failed&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a title="http://stackoverflow.com/questions/121579/im-getting-a-strange-unhandled-exception-from-my-asp-net-application-validatio" href="http://stackoverflow.com/questions/121579/im-getting-a-strange-unhandled-exception-from-my-asp-net-application-validatio"&gt;http://stackoverflow.com/questions/121579/im-getting-a-strange-unhandled-exception-from-my-asp-net-application-validatio&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In fact, this issue needs to be resolved within the ASP.NET MVC source code. Although, since we need not do that, I found a HttpModule which can be used to get rid of this error nicely.&lt;/p&gt;  &lt;p&gt;Here is the link for the same, &lt;a title="http://mvcfriendlymodule.codeplex.com/" href="http://mvcfriendlymodule.codeplex.com/"&gt;http://mvcfriendlymodule.codeplex.com/&lt;/a&gt;. This HttpModule certainly resolved my issue, for the time being!&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I realized that adding this module did some funny stuff with the external files I had in my project, like CSS and JavaScript. Somehow these files were not added to my pages while the page was rendered.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;So, the final solution, I used an extended class of ViewUserControl. Here is a link by Mauricio &lt;a href="http://bugsquash.blogspot.com/2009/02/aspnet-mvc-postback-support.html"&gt;http://bugsquash.blogspot.com/2009/02/aspnet-mvc-postback-support.html&lt;/a&gt; which explains this in detail. Basically, in the ASP.NET MVC source code, the ViewUserControl is actually rendered within a fake view page, due to which our settings in web.config do not apply to usercontrols. Finally everything works now, phew!&lt;br /&gt;&lt;/p&gt;  &lt;p&gt;Happy Programming!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-7735701539602343247?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/7735701539602343247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2009/07/aspnet-mvc-validation-of-viewstate-mac.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/7735701539602343247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/7735701539602343247'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2009/07/aspnet-mvc-validation-of-viewstate-mac.html' title='ASP.NET MVC – Validation of viewstate MAC failed error!'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-5411553536387202202</id><published>2009-06-29T11:19:00.001-07:00</published><updated>2009-06-29T11:19:52.902-07:00</updated><title type='text'>"jQuery.support.opacity is null or not an object"</title><content type='html'>&lt;p&gt;So you are one of those jQuery newbies who get baffled with such maddening errors :). Me too! One thing to remember while working with jQuery in Visual Studio, the vsdoc.js file is solely built for jQuery intellisense at design time for we intellisense-ridden folks. It should not be used at runtime because doing so might result in unexpected errors as the one mentioned in the title. So the solution for the above mentioned error.. remove the reference to the vsdoc.js file from your page and run it. &lt;/p&gt;  &lt;p&gt;Also just for sanity check, if you happen to use ASP.NET MVC, by default, when you drag the jquery files onto the Master Page for example, they are added as below&lt;/p&gt;  &lt;pre class="brush: xml;"&gt;&amp;lt;script src=&amp;quot;../../Scripts/jquery-1.3.2.min.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The ../../ prefix might create problems for the child pages. The child pages would not be able to refer to the script files referenced like this. Get rid of the ../.. so that it looks as below&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: xml;"&gt;&amp;lt;script src=&amp;quot;/Scripts/jquery-1.3.2.min.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Happy Programming!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-5411553536387202202?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/5411553536387202202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2009/06/is-null-or-not-object.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/5411553536387202202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/5411553536387202202'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2009/06/is-null-or-not-object.html' title='&amp;quot;jQuery.support.opacity is null or not an object&amp;quot;'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-5931448922190488934</id><published>2009-06-26T12:36:00.001-07:00</published><updated>2009-06-26T12:36:32.517-07:00</updated><title type='text'>Just a sanity check : ViewState vs PostBackData</title><content type='html'>&lt;p&gt;Surprisingly, I have come across quite a few ASP.NET developers who misjudge the exact concept of a ViewState. So here is a really simple and stupid scenario. You have the following things on a ASP.NET page –:&lt;/p&gt;  &lt;p&gt; - ASP.NET Textbox&lt;/p&gt;  &lt;p&gt; - ASP.NET Button (which just does a postback)&lt;/p&gt;  &lt;p&gt;So you load the page, enter some value in the textbox and click the&amp;#160; Button. Of course, that value in the textbox persists after postback. Now disable the ViewState of the textbox. Enter some value in the textbox again and click the Button. I have heard many folks confidently saying that there would be no text in that textbox, which is freggggginnn WRONG! The text will be there.&lt;/p&gt;  &lt;p&gt;Explanation –:&lt;/p&gt;  &lt;p&gt;ViewState has nothing to do with what you enter in an ASP.NET page while it is running. ViewState stores only the following 2 things –:&lt;/p&gt;  &lt;p&gt; - Programmatic change to the properties of a control&lt;/p&gt;  &lt;p&gt; - Dictionary storage for any value to be persisted across postbacks i.e. in ViewState[“key”].&lt;/p&gt;  &lt;p&gt;The stuff entered in a textbox is persisted due to something called as the LoadPostBackData event during a Page life cycle. As a matter of fact, the data entered inside that textbox is stored within that page like the ViewState but is not a part of the ViewState. During the LoadPostBackData event, this value is picked up and assigned to the textbox. &lt;/p&gt;  &lt;p&gt;If I am sounding nuts, please visit this detailed and point accurate explanation here &lt;a title="http://www.codeproject.com/KB/aspnet/aspnetviewstatepagecycle.aspx" href="http://www.codeproject.com/KB/aspnet/aspnetviewstatepagecycle.aspx"&gt;http://www.codeproject.com/KB/aspnet/aspnetviewstatepagecycle.aspx&lt;/a&gt;. &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-5931448922190488934?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/5931448922190488934/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2009/06/just-sanity-check-viewstate-vs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/5931448922190488934'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/5931448922190488934'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2009/06/just-sanity-check-viewstate-vs.html' title='Just a sanity check : ViewState vs PostBackData'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-7295994248889183183</id><published>2009-06-18T09:07:00.001-07:00</published><updated>2009-06-22T10:33:33.237-07:00</updated><title type='text'>Order of classes in CSS file matter to jQuery?</title><content type='html'>&lt;p&gt;Its no surprise that jQuery is becoming the latest poison for all Web Developers these days. I am no JavaScript expert, but jQuery makes even a scripting chimp like me to do some cool stuff without writing too much script! I had been playing with this library for some time and came across this small issue which took about an hour of head scratching. In my jQuery, I was adding a hover class to a &amp;lt;div&amp;gt; element. Here is the &amp;lt;div&amp;gt; as in the markup.&lt;/p&gt;  &lt;pre class="brush: xml;"&gt;&amp;lt;div id="myDiv" class="Sample"&amp;gt;&lt;br /&gt;   Stuff&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Here is the Sample class &lt;/p&gt;&lt;br /&gt;&lt;pre class="brush: xml;"&gt;.Sample&lt;br /&gt;    {&lt;br /&gt;      background-position: 0px -141px;&lt;br /&gt;    }&lt;br /&gt;Here is another class which I am going to add with jQuery.&lt;/pre&gt;&lt;br /&gt;&lt;pre class="brush: xml;"&gt;.Sample-hover&lt;br /&gt;    {&lt;br /&gt;      background-position: 0px -218px;&lt;br /&gt;    }&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;And finally, here is my jQuery,&lt;/p&gt;&lt;br /&gt;&lt;pre class="brush: xml;"&gt;$('#myDiv').addClass('Sample-hover');&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;This did not work until I figured out why!!!! In my CSS file the Sample-hover class was declared before Sample class. Due to this, the CSS properties were not being overridden as expected. Phew!! I wished I was a good at these things. Sigh!!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-7295994248889183183?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/7295994248889183183/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2009/06/order-of-classes-in-css-file-matter-to.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/7295994248889183183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/7295994248889183183'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2009/06/order-of-classes-in-css-file-matter-to.html' title='Order of classes in CSS file matter to jQuery?'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-7391000646861442438</id><published>2009-06-01T09:16:00.001-07:00</published><updated>2009-06-01T23:18:12.747-07:00</updated><title type='text'>Silverlight z-index not working!</title><content type='html'>&lt;p&gt;Hahhahaha, I know the answer to this :)). Ok, enough being a jerk. Basically Silverlight would not entertain z-index parameter which is assigned to the object tag until it has a parameter Windowless set to true. Here is a typical object tag which works with z-index as –1 on it.&lt;/p&gt;  &lt;pre class="brush: xml;"&gt;&amp;lt;object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%" style="z-index:-1;"&amp;gt;&lt;br /&gt;    &amp;lt;param name="source" value="ClientBin/SilverlightApplication4.xap"/&amp;gt;&lt;br /&gt;    &amp;lt;param name="onerror" value="onSilverlightError" /&amp;gt;&lt;br /&gt;    &amp;lt;param name="background" value="white" /&amp;gt;&lt;br /&gt;    &amp;lt;param name="minRuntimeVersion" value="2.0.31005.0" /&amp;gt;&lt;br /&gt;    &amp;lt;param name="autoUpgrade" value="true" /&amp;gt;&lt;br /&gt;    &amp;lt;param name="Windowless" value="true" /&amp;gt;&lt;br /&gt;    &amp;lt;a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"&amp;gt;&lt;br /&gt;         &amp;lt;img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/&amp;gt;&lt;br /&gt;    &amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;/object&amp;gt;&lt;/pre&gt;&lt;br /&gt;Although there is one caveat here, while creating a Silverlight object using the createObject method, be sure to use the parameter name  &lt;span style="color:#ff8000;"&gt;isWindowless&lt;/span&gt; and not Windowless.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;p&gt;Peace!&lt;/p&gt;  &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-7391000646861442438?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/7391000646861442438/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2009/06/silverlight-z-index-not-working.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/7391000646861442438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/7391000646861442438'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2009/06/silverlight-z-index-not-working.html' title='Silverlight z-index not working!'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-9114391646639301293</id><published>2009-06-01T09:05:00.001-07:00</published><updated>2009-06-01T09:05:52.144-07:00</updated><title type='text'>Sleek JavaScript search box for Live Search</title><content type='html'>&lt;p&gt;May be I am a little late in talking about this :), but Live Search provides a really elegant solution for embedding search functionality on your site. Here is the link &lt;a href="http://www.bing.com/siteowner"&gt;http://www.bing.com/siteowner&lt;/a&gt; . Here is a snapshot taken on my Vista.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_8U4ptmqLjxo/SiP8XD45MZI/AAAAAAAAAdw/aPeRMarKKuY/s1600-h/search%5B5%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="search" border="0" alt="search" src="http://lh5.ggpht.com/_8U4ptmqLjxo/SiP8X_k6N0I/AAAAAAAAAd0/BMx8aIum0rM/search_thumb%5B3%5D.jpg?imgmax=800" width="365" height="276" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;It allows you to search sites you mention. You can add your own sites which you have created and Live Search would crawl them. It is just few lines of JavaScript and some markup which can be customized to change the look and feel of the box. &lt;/p&gt;  &lt;p&gt;Happy Programming!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-9114391646639301293?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/9114391646639301293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2009/06/sleek-javascript-search-box-for-live.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/9114391646639301293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/9114391646639301293'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2009/06/sleek-javascript-search-box-for-live.html' title='Sleek JavaScript search box for Live Search'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_8U4ptmqLjxo/SiP8X_k6N0I/AAAAAAAAAd0/BMx8aIum0rM/s72-c/search_thumb%5B3%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-6314667186125789759</id><published>2009-05-30T13:14:00.001-07:00</published><updated>2009-05-30T13:14:27.523-07:00</updated><title type='text'>Google Wave – The way Email should be.</title><content type='html'>&lt;p&gt;Google has unveiled yet another cool idea for communication in the cloud. &lt;strong&gt;&lt;font color="#009100"&gt;Google wave&lt;/font&gt;&lt;/strong&gt; allows communication across email, blogs, social networks seamlessly. The fact that email being considered as a bulletin board application gives a different face to the traditional email system we have accustomed to until now. Although it is much more than just email and scraps. &lt;/p&gt;  &lt;p&gt;And yes, it is Open Source! &lt;/p&gt;  &lt;p&gt;Check out the awesome Developer Preview video here &lt;a href="http://www.youtube.com/watch?v=v_UyVmITiYQ" target="_blank"&gt;http://www.youtube.com/watch?v=v_UyVmITiYQ&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Happy Programming!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-6314667186125789759?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/6314667186125789759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2009/05/google-wave-way-email-should-be.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/6314667186125789759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/6314667186125789759'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2009/05/google-wave-way-email-should-be.html' title='Google Wave – The way Email should be.'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-801488145662198171</id><published>2009-05-09T00:34:00.001-07:00</published><updated>2009-05-09T00:36:30.125-07:00</updated><title type='text'>Facebook Connect on iPhone</title><content type='html'>&lt;p&gt;Yup. This is just another attempt to showcase Facebook Connect stuff in an iPhone application. I was working since last few days (taking time from my office) to get some Facebook Connect stuff working on an iPhone. As a summary of what this app does –:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Detects your current location using the &lt;strong&gt;iPhone Core Location framework&lt;/strong&gt;. &lt;/li&gt;    &lt;li&gt;Gets the closest Zip Code using &lt;strong&gt;GeoNames&lt;/strong&gt; webservice.&amp;#160; &lt;/li&gt;    &lt;li&gt;Allows to search for a place/thing near you, using the &lt;strong&gt;Google Local Search API&lt;/strong&gt;. &lt;/li&gt;    &lt;li&gt;Allows to &lt;strong&gt;publish a story&lt;/strong&gt; onto your Facebook home page. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Thats all my app does. Here are some snap shots. The app is very much functional but might not look awesome like those sexy apps on &lt;a href="http://www.apple.com"&gt;www.apple.com&lt;/a&gt;. Sigh!, I can never be a designer.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_8U4ptmqLjxo/SgUx1s6ie2I/AAAAAAAAAbw/IeqCLhQndR8/s1600-h/Picture%202.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Picture 2" border="0" alt="Picture 2" src="http://lh5.ggpht.com/_8U4ptmqLjxo/SgUx2P2r5SI/AAAAAAAAAb4/P3fkhk6t8U4/Picture%202_thumb.png?imgmax=800" width="150" height="279" /&gt;&lt;/a&gt; &lt;a href="http://lh4.ggpht.com/_8U4ptmqLjxo/SgUx21m37eI/AAAAAAAAAb8/2ekQWpqJiK4/s1600-h/Picture%201.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Picture 1" border="0" alt="Picture 1" src="http://lh6.ggpht.com/_8U4ptmqLjxo/SgUx3X1fwqI/AAAAAAAAAcI/0DBfNEWgR1k/Picture%201_thumb.png?imgmax=800" width="150" height="279" /&gt;&lt;/a&gt;&amp;#160; &lt;a href="http://lh4.ggpht.com/_8U4ptmqLjxo/SgUx4DH2RDI/AAAAAAAAAcM/MOEg6s9KPro/s1600-h/Picture%2010.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Picture 10" border="0" alt="Picture 10" src="http://lh6.ggpht.com/_8U4ptmqLjxo/SgUx5ajT-BI/AAAAAAAAAcQ/cDNEGdZZZu8/Picture%2010_thumb.png?imgmax=800" width="150" height="279" /&gt;&lt;/a&gt; &lt;a href="http://lh3.ggpht.com/_8U4ptmqLjxo/SgUx5xQe2qI/AAAAAAAAAcg/9Rqw-Vf_4ug/s1600-h/Picture%204.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Picture 4" border="0" alt="Picture 4" src="http://lh5.ggpht.com/_8U4ptmqLjxo/SgUx66OEquI/AAAAAAAAAco/V2XTuFEIL4w/Picture%204_thumb.png?imgmax=800" width="150" height="279" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_8U4ptmqLjxo/SgUx7t5eO5I/AAAAAAAAAcw/SlFecmy2pMs/s1600-h/Picture%208.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Picture 8" border="0" alt="Picture 8" src="http://lh3.ggpht.com/_8U4ptmqLjxo/SgUx8YK8rqI/AAAAAAAAAc0/qXFhtMaQE-A/Picture%208_thumb.png?imgmax=800" width="150" height="279" /&gt;&lt;/a&gt; &lt;a href="http://lh6.ggpht.com/_8U4ptmqLjxo/SgUx9KqswcI/AAAAAAAAAc4/fGHzqj0F_1g/s1600-h/Picture%205.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Picture 5" border="0" alt="Picture 5" src="http://lh6.ggpht.com/_8U4ptmqLjxo/SgUx9vM638I/AAAAAAAAAdE/dKw4ld_Q9Ds/Picture%205_thumb.png?imgmax=800" width="150" height="279" /&gt;&lt;/a&gt; &lt;a href="http://lh5.ggpht.com/_8U4ptmqLjxo/SgUx-V0Ca0I/AAAAAAAAAdM/5ExUko4NeBU/s1600-h/Picture%206.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Picture 6" border="0" alt="Picture 6" src="http://lh6.ggpht.com/_8U4ptmqLjxo/SgUx-4wx2pI/AAAAAAAAAdU/eI_-jeFlulg/Picture%206_thumb.png?imgmax=800" width="150" height="279" /&gt;&lt;/a&gt; &lt;a href="http://lh3.ggpht.com/_8U4ptmqLjxo/SgUx_tlncLI/AAAAAAAAAdg/D7Z79JXvlgw/s1600-h/Picture%207.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Picture 7" border="0" alt="Picture 7" src="http://lh6.ggpht.com/_8U4ptmqLjxo/SgUyAES04kI/AAAAAAAAAdk/G6GedgkwF2s/Picture%207_thumb.png?imgmax=800" width="150" height="279" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;So here is a quick summary of the tools I used to put this functionalities in an iPhone.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#ff8000"&gt;iPhone Core Location Framework&lt;/font&gt;&lt;/strong&gt; – This is an inbuilt SDK component which is available for all iPhone developers. Its pretty straight forward to use this framework to get the current longitude and latitude of the place where you are with your iPhone. Here is a link which explains a step by step details for the same &lt;a title="http://iappdevs.blog.co.in/2008/12/06/get-current-location-sample-example-iphone-programming/" href="http://iappdevs.blog.co.in/2008/12/06/get-current-location-sample-example-iphone-programming/"&gt;http://iappdevs.blog.co.in/2008/12/06/get-current-location-sample-example-iphone-programming/&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#800080"&gt;GeoNames&lt;/font&gt;&lt;/strong&gt; – Once you have the geo positions, you can use Google Api’s directly to get different kinds of places around you. Although I intend to have a small weather widget and the name of the city/state you are in right now. So I used the GeoNames webservices which provide a list of probably zipcodes for a given longitude and latitude combination. Here is a link for more information about different services provided by GeoNames &lt;a title="http://www.geonames.org/export/" href="http://www.geonames.org/export/"&gt;http://www.geonames.org/export/&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#008000"&gt;Google API’s&lt;/font&gt;&lt;/strong&gt; – Now since I know your correct location (as per the webservice), I would be using google Local search API to get the nearby results for the search term entered. Google Ajax API for Local Search accepts longitude/latitude combination and a search query which returns the result in a JSON format. Here is the link for the Google API’s for local search &lt;a title="http://code.google.com/apis/ajaxsearch/documentation/reference.html#_intro_fonje" href="http://code.google.com/apis/ajaxsearch/documentation/reference.html#_intro_fonje"&gt;http://code.google.com/apis/ajaxsearch/documentation/reference.html#_intro_fonje&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;Of course this arises a question about how to parse the JSON result on the iPhone. Chill out! You are not alone in this world. You will find several results for JSON parsing on iPhone when searched on the net, but here is a link which helped me a lot &lt;a title="http://iphonedevelopertips.com/cocoa/json-framework-for-iphone-part-2.html" href="http://iphonedevelopertips.com/cocoa/json-framework-for-iphone-part-2.html"&gt;http://iphonedevelopertips.com/cocoa/json-framework-for-iphone-part-2.html&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#004080"&gt;Facebook Connect&lt;/font&gt;&lt;/strong&gt; – By now, everyone knows that Facebook has shown interests in the iPhone a lot. Facebook connect is awesome and on iPhone is even better. It is a bit flaky in some cases but most of the time, it works as it should. I am sure it ain’t difficult to get a link for this topic :), but what the heck(lazy bums), here is the link &lt;a title="http://developers.facebook.com/connect.php?tab=iphone" href="http://developers.facebook.com/connect.php?tab=iphone"&gt;http://developers.facebook.com/connect.php?tab=iphone&lt;/a&gt;. Do check out the video on Facebook implementation on iPhone and you are good to go.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Happy Programming!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-801488145662198171?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/801488145662198171/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2009/05/facebook-connect-on-iphone.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/801488145662198171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/801488145662198171'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2009/05/facebook-connect-on-iphone.html' title='Facebook Connect on iPhone'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_8U4ptmqLjxo/SgUx2P2r5SI/AAAAAAAAAb4/P3fkhk6t8U4/s72-c/Picture%202_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-2809500814356498168</id><published>2009-05-06T11:32:00.001-07:00</published><updated>2009-05-06T11:32:06.331-07:00</updated><title type='text'>The project type is not supported by this installation Error – VS 2008 and SilverLight</title><content type='html'>&lt;p&gt;If you have installed some version of VS 2008 and then discovered that the existing SilverLight projects do not open, you are not alone. Here are 2 things one can try –:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Close VS. Open the Visual Studio 2008 command prompt. Give the command &lt;strong&gt;devenv /setup&lt;/strong&gt;. This command takes some time to complete. This command actually resets the VS environment. Once complete, open VS and check if SilverLight projects open.&lt;/li&gt;    &lt;li&gt;Try out this &lt;a href="http://blogs.msdn.com/amyd/archive/2008/08/11/silverlight-tools-must-be-updated-after-installing-visual-studio-2008-sp1.aspx" target="_blank"&gt;MSDN blog&lt;/a&gt; which suggests installing a patch for SilverLight Tools for VS 2008. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Best of Luck :).&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-2809500814356498168?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/2809500814356498168/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2009/05/project-type-is-not-supported-by-this.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/2809500814356498168'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/2809500814356498168'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2009/05/project-type-is-not-supported-by-this.html' title='The project type is not supported by this installation Error – VS 2008 and SilverLight'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-5628185849885065812</id><published>2009-04-11T14:18:00.001-07:00</published><updated>2009-04-11T14:18:29.875-07:00</updated><title type='text'>jquery 1.3.2 intellisense problem</title><content type='html'>&lt;p&gt;I was scratching my head for about an hour figuring out where the hell did the intellisense go for jquery 1.3.2. For those who have got an error or are able to get VS 2008 intellisense whatsoeever, you need to do the following –:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Download jquery-1.3.2.js file&lt;/li&gt;    &lt;li&gt;Download jquery-1.3.2-vsdoc2.js file&lt;/li&gt;    &lt;li&gt;Rename the vsdoc file to jquery-1.3.2-vsdoc.js :)&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;That worked for me. Let me know if you are still scratching!&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Happy Programming!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-5628185849885065812?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/5628185849885065812/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2009/04/jquery-132-intellisense-problem.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/5628185849885065812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/5628185849885065812'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2009/04/jquery-132-intellisense-problem.html' title='jquery 1.3.2 intellisense problem'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-2106291523650049525</id><published>2009-04-07T09:18:00.001-07:00</published><updated>2009-06-01T22:44:51.250-07:00</updated><title type='text'>Facebook Connect App for localhost domain.</title><content type='html'>&lt;p&gt;I am sure there are lots of guys out there are basking in the Facebook Connect API these days. I saw quite a few people trying out the Facebook Connect with a &lt;a href="http://localhost/"&gt;http://localhost&lt;/a&gt; domain on their machine and having difficulties getting it work correctly. I got it right after a couple of tries, so I thought of sharing that simple app to display a Connect button on your site.&lt;/p&gt;  &lt;p&gt;Here is the xd_receiver.htm file. I have placed it under C:\inetpub\wwwroot. Although I believe you can place it under a specific web application root too. &lt;strong&gt;In Facebook, I have &lt;/strong&gt;&lt;a href="http://localhost/"&gt;&lt;strong&gt;http://localhost&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; as the Connect Url for my application.&lt;/strong&gt;&lt;/p&gt;  &lt;pre class="brush: xml;"&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml" &amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/XdCommReceiver.js" type="text/javascript"&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Here is the htm file which actually displays the facebook button.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: xml;"&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript" src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;div id="comments_post"&amp;gt; &amp;lt;h3&amp;gt;Leave a comment:&amp;lt;/h3&amp;gt;&lt;br /&gt;  &amp;lt;form method="POST"&amp;gt;&lt;br /&gt;  &amp;lt;div id="user"&amp;gt; Name: &amp;lt;input name="name" size="27"&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;    &amp;lt;fb:login-button&amp;gt;&amp;lt;/fb:login-button&amp;gt;&lt;br /&gt;  &amp;lt;/div&amp;gt;&lt;br /&gt;  &amp;lt;textarea name="comment" rows="5" cols="30"&amp;gt;&amp;lt;/textarea&amp;gt;&lt;br /&gt;  &amp;lt;br /&amp;gt;&lt;br /&gt;  &amp;lt;input type="submit" value="Submit Comment"&amp;gt;&lt;br /&gt; &amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;    FB.init("29af44916c9284d774abfdf84ba2da486", "http://localhost/xd_receiver.htm");&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Observe that the script reference for the FeatureLoader.js.php has to be before you use any FB functions, also the xd_receiver.htm path should be the one where you have kept that file under your IIS. I have tried the same kind of settings for displaying a facebook connect button on a ASP.NET usercontrol too. &lt;/p&gt;&lt;br /&gt;Let me know if this blows for you.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Happy Programming!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-2106291523650049525?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/2106291523650049525/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2009/04/facebook-connect-app-for-localhost.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/2106291523650049525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/2106291523650049525'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2009/04/facebook-connect-app-for-localhost.html' title='Facebook Connect App for localhost domain.'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-7377302646530619594</id><published>2009-04-06T09:36:00.001-07:00</published><updated>2009-04-06T09:37:27.795-07:00</updated><title type='text'>PageMethods is undefined error!</title><content type='html'>&lt;p&gt;Welcome to the club of “wht the fuck is this” group! I believe you are using a ASP.NET master page or a user control ( something other than a normal ASP.NET page). This stuff works just fine on a ASP.NET Page with a ScriptManager but gives itches in other scenarios. Rather than wasting time, Ill show how it works in a Master page.&lt;/p&gt;  &lt;p&gt;Here is a Master Page. Nothing but a ScriptManager with EnablePageMethods=”true”.&lt;/p&gt;  &lt;pre class="brush: xml;"&gt;&amp;lt;%@ Master Language=&amp;quot;C#&amp;quot; AutoEventWireup=&amp;quot;true&amp;quot; CodeBehind=&amp;quot;Site1.master.cs&amp;quot; Inherits=&amp;quot;WebApplication2.Site1&amp;quot; %&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot; &amp;gt;&lt;br /&gt;&amp;lt;head runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;    &amp;lt;asp:ContentPlaceHolder ID=&amp;quot;head&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;/asp:ContentPlaceHolder&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;    &amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;    &lt;br /&gt;        &amp;lt;asp:ScriptManager ID=&amp;quot;ScriptManager1&amp;quot; runat=&amp;quot;server&amp;quot; EnablePageMethods=&amp;quot;true&amp;quot; &amp;gt;&lt;br /&gt;            &lt;br /&gt;&lt;br /&gt;        &amp;lt;/asp:ScriptManager&amp;gt;&lt;br /&gt;        &amp;lt;asp:ContentPlaceHolder ID=&amp;quot;ContentPlaceHolder1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;        &lt;br /&gt;        &amp;lt;/asp:ContentPlaceHolder&amp;gt;&lt;br /&gt;    &lt;br /&gt;    &amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Here is a sample Content Page.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: xml;"&gt;&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; AutoEventWireup=&amp;quot;true&amp;quot; CodeBehind=&amp;quot;Default.aspx.cs&amp;quot; MasterPageFile=&amp;quot;~/Site1.Master&amp;quot; Inherits=&amp;quot;WebApplication2.Default&amp;quot; %&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:Content ID=&amp;quot;Content1&amp;quot; ContentPlaceHolderID=&amp;quot;head&amp;quot; Runat=&amp;quot;Server&amp;quot;&amp;gt;&lt;br /&gt;       &amp;lt;script runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;    [System.Web.Services.WebMethod]&lt;br /&gt;    // Get session state value.&lt;br /&gt;    public static string GetSessionValue(string key)&lt;br /&gt;    {&lt;br /&gt;        return (string)HttpContext.Current.Session[key];&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    [System.Web.Services.WebMethod]&lt;br /&gt;    // Set session state value.&lt;br /&gt;    public static string SetSessionValue(string key, string value)&lt;br /&gt;    {&lt;br /&gt;        HttpContext.Current.Session[key] = value;&lt;br /&gt;        return (string)HttpContext.Current.Session[key];&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/asp:Content&amp;gt;&lt;br /&gt;    &lt;br /&gt;&amp;lt;asp:Content ID=&amp;quot;Content2&amp;quot; ContentPlaceHolderID=&amp;quot;ContentPlaceHolder1&amp;quot; Runat=&amp;quot;Server&amp;quot; &amp;gt;&lt;br /&gt;    &amp;lt;asp:ScriptManagerProxy ID=&amp;quot;ScriptManagerProxy1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;           &amp;lt;Scripts&amp;gt;&lt;br /&gt;                &amp;lt;asp:ScriptReference Path=&amp;quot;PageMethod.js&amp;quot;/&amp;gt;&lt;br /&gt;            &amp;lt;/Scripts&amp;gt;&lt;br /&gt;    &amp;lt;/asp:ScriptManagerProxy&amp;gt;&lt;br /&gt; &amp;lt;input type=&amp;quot;Button&amp;quot; &lt;br /&gt;                        onclick=&amp;quot;SetSessionValue('SessionValue', Date())&amp;quot; &lt;br /&gt;                        value=&amp;quot;Write&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;  &amp;lt;input type=&amp;quot;Button&amp;quot; &lt;br /&gt;                        onclick=&amp;quot;GetSessionValue('SessionValue')&amp;quot; &lt;br /&gt;                        value=&amp;quot;Read&amp;quot; /&amp;gt;&lt;br /&gt;                        &lt;br /&gt;                        &amp;lt;span style=&amp;quot;background-color:Aqua&amp;quot; id=&amp;quot;ResultId&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/asp:content&amp;gt;&lt;/pre&gt;&lt;br /&gt;And here is the PageMethod.js file, if anyone needs to see whats in it, it has the javascript functions for my button events and other functions for callback, nothing special here! &lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: js;"&gt;var displayElement;&lt;br /&gt;&lt;br /&gt;// Initializes global variables and session state.&lt;br /&gt;function pageLoad() {&lt;br /&gt;    displayElement = $get(&amp;quot;ResultId&amp;quot;);&lt;br /&gt;    &lt;br /&gt;    PageMethods.SetSessionValue(&amp;quot;SessionValue&amp;quot;, Date(),&lt;br /&gt;        OnSucceeded, OnFailed);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Gets the session state value.&lt;br /&gt;function GetSessionValue(key) {&lt;br /&gt;    PageMethods.GetSessionValue(key,&lt;br /&gt;        OnSucceeded, OnFailed);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//Sets the session state value.&lt;br /&gt;function SetSessionValue(key, value) {&lt;br /&gt;    PageMethods.SetSessionValue(key, value,&lt;br /&gt;        OnSucceeded, OnFailed);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Callback function invoked on successful &lt;br /&gt;// completion of the page method.&lt;br /&gt;function OnSucceeded(result, userContext, methodName) {&lt;br /&gt;    if (methodName == &amp;quot;GetSessionValue&amp;quot;) {&lt;br /&gt;        displayElement.innerHTML = &amp;quot;Current session state value: &amp;quot; +&lt;br /&gt;            result;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Callback function invoked on failure &lt;br /&gt;// of the page method.&lt;br /&gt;function OnFailed(error, userContext, methodName) {&lt;br /&gt;    if (error !== null) {&lt;br /&gt;        displayElement.innerHTML = &amp;quot;An error occurred: &amp;quot; +&lt;br /&gt;            error.get_message();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if (typeof (Sys) !== &amp;quot;undefined&amp;quot;) Sys.Application.notifyScriptLoaded();&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;There, thats it. Astalavista!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-7377302646530619594?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/7377302646530619594/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2009/04/pagemethods-is-undefined-error.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/7377302646530619594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/7377302646530619594'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2009/04/pagemethods-is-undefined-error.html' title='PageMethods is undefined error!'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-6517078647758513561</id><published>2009-04-05T04:36:00.001-07:00</published><updated>2009-04-05T05:32:45.435-07:00</updated><title type='text'>Looking for a job in recession!</title><content type='html'>&lt;p&gt;Yes its bad time to talk about the job scene not just in the US, but all over the globe. Most of the bigger companies are laying off her employees or cutting down their pay. Its truly a situation which was never seen by me in my lifetime and will be talked upon for decades, may be centuries, from now. Well I am not here to belabor on what is already a world fact. I intend to know what can a typical software developer here in India needs to think about his/her career during these horrible times. &lt;/p&gt;  &lt;p&gt;A major portion of the Indian IT industry depends directly or indirectly on the US clients which is by the way a common sense statement. They go down, we go down. Well… not sure though. Following is an approximate rate structure of different roles employees have in a software firm in US and in India.&lt;/p&gt;  &lt;table border="2" cellspacing="0" cellpadding="2" width="400"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="133"&gt;&lt;strong&gt;&lt;font color="#0080c0"&gt;Role&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="133"&gt;&lt;strong&gt;&lt;font color="#0080c0"&gt;USA based firm&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="133"&gt;&lt;strong&gt;&lt;font color="#0080c0"&gt;India based firm&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="133"&gt;Developer&lt;/td&gt;        &lt;td valign="top" width="133"&gt;$90 - $100&lt;/td&gt;        &lt;td valign="top" width="133"&gt;$25 - $30&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="133"&gt;Sr. Developer&lt;/td&gt;        &lt;td valign="top" width="133"&gt;$100 - $110&lt;/td&gt;        &lt;td valign="top" width="133"&gt;$28 - $35&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="133"&gt;Team Lead&lt;/td&gt;        &lt;td valign="top" width="133"&gt;$115 - $120&lt;/td&gt;        &lt;td valign="top" width="133"&gt;$30 - $38&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="133"&gt;Project Leader&lt;/td&gt;        &lt;td valign="top" width="133"&gt;$120 - $130&lt;/td&gt;        &lt;td valign="top" width="133"&gt;$35 - $40&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;strong&gt;Above figures show a price range which a consulting firm ( a services firm) would charge to a client based in US&lt;/strong&gt;. I am not sure about the rates for a product based firm. &lt;/p&gt;  &lt;p&gt;Looking at the above figures an entrepreneur in US would certainly rethink her options about “offshore”ing her development tasks. They can have a strong quality assurance module based in US but the expensive job of development can be passed to the cheaper places. Of course this has its own risks and problems of having a “bad product” due to lack of communication and eventually not succeding in the business. But it is a much viable option in these times if carefully planned for. Since these thoughts are on my mind all the time, I feel that the Indian services firms should expect more projects coming from overseas. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#808080"&gt;Where to place yourself?&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Now that’s a million dollar question. I can categorize the software firms in 4 major types –:&lt;/p&gt;  &lt;p&gt;Small Product based firms ( start ups)&lt;/p&gt;  &lt;p&gt;Large Product Based firms (may be someone like BMC, Symantec)&lt;/p&gt;  &lt;p&gt;Small Services firms (Small consulting firms, which are in millions in India :))&lt;/p&gt;  &lt;p&gt;Large Services firms (someone like, Cap Gemini, Accenture, Satyam!!)&lt;/p&gt;  &lt;p&gt;These times specifically hit the first category the most since startups require them to generate enthusiasm among the general public to buy their product. In such times, people resist most of the new spending ideas and see at how they can reduce the daily costs by adjusting in what they already have. So if you are looking for a job in a product based startup in India, rethink your option considering the product value.&lt;/p&gt;  &lt;p&gt;Large product based firms would not be hiring now as per my observation, although some of them might come up with an awesome product which they think would bring up some good revenue. In that case they might be looking for experience candidates mostly with probably a little stripped down pay.&lt;/p&gt;  &lt;p&gt;Small services firms are the largest in number in India. These firms are, in some cases, 3rd or 4th in line from the client.&amp;#160; What I mean is a client &lt;strong&gt;X&lt;/strong&gt; would give the project to a firm &lt;strong&gt;Y&lt;/strong&gt;, which would hire some firm &lt;strong&gt;Z&lt;/strong&gt; to may be find a right resource and finally some developer from firm &lt;strong&gt;A&lt;/strong&gt; would work on it! This is not new in Indian consulting firms. I guess these firms are getting the most of&amp;#160; projects due to their lesser development costs. Although this category might be the most tempting and easy to get in option, the work environment could be highly compromised. I’ve know people working like crazy as support teams in such firms for a meager salary while they could do much better somewhere else. I strongly suggest to find some more information about the work culture followed in such a firm. I do not recommend this option to someone just returning from a wonderful work culture like that in US. Although this is just my thought, if one enjoys his/her job, so be it.&lt;/p&gt;  &lt;p&gt;Alright, the large services firms are the ones I feel are certainly hit by the crisis tsunami, but have their seat belts fastened. What I mean is these firms would continue to get almost same treatment from the overseas clients due to their relative lesser rates compared to their counterparts in US. These firms I believe have a reasonable work culture in India, and also provide intermittent onsite opportunities for those interested. Salary might also be better than the small firms in some cases. Thus looks like the next pits stop for me :)). &lt;/p&gt;  &lt;p&gt;These are just my observations on the Indian software industry, although I am not a hugely experienced person to give a perfect insight on what is best for you, I believe you have the&amp;#160; right inner sense to see what is best for you and act accordingly. After all, if you have good qualifications and a reasonable amount of experience in the industry, I think you are good to go in any part of the world, isn’t it?&lt;/p&gt;  &lt;p&gt;Best of Luck!!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-6517078647758513561?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/6517078647758513561/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2009/04/looking-for-job-in-recession.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/6517078647758513561'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/6517078647758513561'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2009/04/looking-for-job-in-recession.html' title='Looking for a job in recession!'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-7389838311498857809</id><published>2009-03-22T01:18:00.001-07:00</published><updated>2009-03-22T01:21:39.586-07:00</updated><title type='text'>Online market in India</title><content type='html'>&lt;p align="justify"&gt;It sucks! Ya that’s right, it sucks. Try find a site to buy something really common place like a good desktop, may be a technical book or may be a cell phone. Does anyone know if there is something like Amazon or eBay in India. There is eBay (formerly known as bazee) but try finding things that you need out there. There is barely 20-30% chance of finding it there. Why? Because there is hardly anyone selling it there. Consider this scenario, I have never been in India before, I land here and need to get a computer for myself. It could be a desktop or a laptop. Where should I go? I do not know anyone here, although I have internet in my house. The most sensible thing to do would be to get out of the house, ask some sane looking person about the whereabouts of such a store. If lucky, there might be one close by, if not get back to your room. &lt;/p&gt;  &lt;p align="justify"&gt;Next, may be try Google maps to locate an electronic store near your current location. As far as my experience goes, you would end up with nothing really useful. Businesses here are not really harnessing the power of Google. The stationery store near by apartment can be found in the map but a bank adjacent to that store is nowhere to be seen on the map. The main reason is people still heavily rely on “word of mouth” information rather than looking for it online. That is the main reason why there is nothing like Amazon here. I myself used to visit the Amazon website at least once a day to check out the recommendations of books and other stuff. Well, its true that a website becomes famous when it is useful to her users in the region. India does not have that internet savvy population as it is in the US, but I firmly believe that the percentage of the population getting interested in owning a nice flat screen TV, a sleek laptop or may be a gaming console is increasing at a rapid rate. It certainly makes sense for a customer to closely look at the item or even touch it before buying it, a well organized and well thought website arouses her interests to go for a product. Right now this interest building activity is loyally performed by the TV and friends. I am no comScore analyst, but the difference between the online transactions for home usage products in US is huge compared to that in India. And that is why we need something like Amazon for India. I do not know how it would look, for sure it would require a shift in minds of the retailers and buyers. Retailers should somehow be interested in the online business which would eventually drive the interests of the buyers. Let me tell you there are a large number of buyers out here who don’t mind spending lakhs of rupees on a TV.&lt;/p&gt;  &lt;p align="justify"&gt;I gave some thought on what the website should have to make it a success in a an upcoming economy like India.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div align="justify"&gt;Really easy and intuitive interface for the users. (may be something like &lt;a href="http://www.jagore.com"&gt;www.jagore.com&lt;/a&gt; ).&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Multilingual, the site should be able to change the culture to English, Hindi and other major languages.&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Powerful search functionality. Since people are so “Googlelized” these days, everything they need to find is searched on Google and things move on after that. &lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;A recommendation system that works, like that of Amazon or Netflix. People would just love stuff being recommended to them which they might be interested in. &lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Flexible payment options. India is predominantly still a “Cash based” market. People mostly buy all kinds of stuff, from an orange to a house, just by paying hard cash/check. Online options need to be there, but there must be a system in place for the customer to pay cash on delivery or something on that lines. &lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Free or nominal delivery charge. &lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p align="justify"&gt;These are the major features which the site must have to capture the Indian public interests. I hope there is something in the making like this, since there certainly are several other folks out in the wild thinking about getting a customer friendly experience on the internet. &lt;/p&gt;  &lt;p align="justify"&gt;&amp;#160;&lt;/p&gt;  &lt;p align="justify"&gt;Happy Programming!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-7389838311498857809?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/7389838311498857809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2009/03/online-market-in-india.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/7389838311498857809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/7389838311498857809'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2009/03/online-market-in-india.html' title='Online market in India'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-8795318415699981841</id><published>2009-03-07T22:58:00.001-08:00</published><updated>2009-03-07T22:58:43.081-08:00</updated><title type='text'>An iPhone app that knows your mood!</title><content type='html'>&lt;p&gt;While getting my hands dirty with Microsoft technologies all day in the office, I though of doing some more of that cool thing called iPhone development. I had built a RSS reader which I use to follow blogs on my iPhone. Well, I thought of creating something more useful and fun to use. I think &lt;strong&gt;creativity comes out of a need&lt;/strong&gt;. I needed an application which &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;would be with me all the time ( so on my phone) &lt;/li&gt;    &lt;li&gt;would know where the hell I am. &lt;/li&gt;    &lt;li&gt;would suggest some nice places nearby my current location. Although it should be smart enough to know that if it is 750 degrees where I am, I am really not in a mood to get in a spa or may be have a hot cup of soup. &lt;/li&gt;    &lt;li&gt;Also if necessary I should be able to change the settings which would affect the search results, like if I change my mood to say mischievous, the app include search items like an adult store or a strip club. Awweeeeeeerightttt!!!!!! (Not sure how practical this is in India, but would certainly give lots of results anywhere in US). &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;May be there are apps already created with such intentions, but nothing is more fun than using your own app to do day to day things. So I am in the process of designing the screens and collecting information considering the requirements of the app. Following are my companions during this development process -:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Use the iPhone Core Location framework. &lt;/li&gt;    &lt;li&gt;Use Google Ajax API &lt;/li&gt;    &lt;li&gt;Use Google Weather webservice &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I hope to get this done as soon as possible, kind of having a tight schedule at my office these days. Here are a couple of screenshots which might just scrap the surface of what I have in mind, although these screens might change as I dig deep in my thoughts.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_8U4ptmqLjxo/SbNsjtBkaQI/AAAAAAAAAXs/xo2Qy3uSIRs/s1600-h/Picture18.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Picture 1" border="0" alt="Picture 1" src="http://lh6.ggpht.com/_8U4ptmqLjxo/SbNslOnuk9I/AAAAAAAAAXw/3ykT2JvIrWU/Picture1_thumb6.png?imgmax=800" width="218" height="406" /&gt;&lt;/a&gt; &lt;a href="http://lh5.ggpht.com/_8U4ptmqLjxo/SbNsmroTK5I/AAAAAAAAAX0/fi40OKoPeVg/s1600-h/Picture24.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Picture 2" border="0" alt="Picture 2" src="http://lh3.ggpht.com/_8U4ptmqLjxo/SbNsoSBS1YI/AAAAAAAAAX4/jkQsjIp04no/Picture2_thumb2.png?imgmax=800" width="218" height="406" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Happy programming!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-8795318415699981841?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/8795318415699981841/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2009/03/iphone-app-that-knows-your-mood.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/8795318415699981841'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/8795318415699981841'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2009/03/iphone-app-that-knows-your-mood.html' title='An iPhone app that knows your mood!'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_8U4ptmqLjxo/SbNslOnuk9I/AAAAAAAAAXw/3ykT2JvIrWU/s72-c/Picture1_thumb6.png?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-6339015442416628551</id><published>2009-03-07T22:57:00.001-08:00</published><updated>2009-03-07T22:57:02.050-08:00</updated><title type='text'>Broadband in India</title><content type='html'>&lt;p&gt;After living in US for a while, returning back to your home is something that can only be experienced rather than talked about. But things do change after living away. Before moving to US I was ok with a mediocre Internet connection which had a speed of, I don’t know may be 10 Kbps. But after using Comcast High speed internet with&amp;#160; 6Mbps lightning speed, Yeh Dil Mange More!! So I planned to switch to broadband connection here in Pune. Pardon me for my language because I am pretty frustrated how things work here.&lt;/p&gt;  &lt;p&gt;Options available – TATA Indicom, Reliance, BSNL. (There is Airtel too but I thought they were a little expensive so I never called them, and others like Hathway and Sify, they are just there to suck blood). &lt;/p&gt;  &lt;p&gt;They share one verb in common. They all suck, right from getting the connection to using it. I intend to use internet as much as possible so I needed an unlimited data plan. Now if anyone is new to this broadband connection mania in India, let me tell&amp;#160; you what are the typical steps the service provider would follow before you get your damn connection.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;First call the service center in your city and ask for a connection. &lt;/li&gt;    &lt;li&gt;The person would ask your address details etc and put a request to check for fucking feasibility of providing the service at your address. &lt;/li&gt;    &lt;li&gt;For the next 2-3 days there would be some damn feasibility check to verify the service can be given. I was called by Tata&amp;#160; times to verify where exactly my building was, I mean exactly where respective to a landmark may be. &lt;/li&gt;    &lt;li&gt;If that goes well, you need to select a plan. Overall I have seen that for home usage, 256 Kbps seems to be the most widely used speed here. Unlimited plan with 256 Kbps speed costs from about 750 – 1000 Rs/month. &lt;/li&gt;    &lt;li&gt;Once the plan is conveyed in the next 2-3 days you might have your connection if everything goes well. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Now honestly speaking for someone who has spent quite some time abroad may be the price of broadband would seem cheap, but for residents here, unlimited plans seems pretty expensive compared to what we paid in US. Well I have to agree that internet is like having a TV in US, but in India, in a good locality, I think there would be 3/10 ratio of internet wired homes.&lt;/p&gt;  &lt;p&gt;Here is a table which shows the bird’s eye comparison between these fuckin ISP’s.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="400"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="100"&gt;&amp;#160;&lt;/td&gt;        &lt;td valign="top" width="100"&gt;TATA&lt;/td&gt;        &lt;td valign="top" width="100"&gt;Reliance&lt;/td&gt;        &lt;td valign="top" width="100"&gt;BSNL&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="100"&gt;Price&lt;/td&gt;        &lt;td valign="top" width="100"&gt;1000&lt;/td&gt;        &lt;td valign="top" width="100"&gt;799 + 50(phone needed)&lt;/td&gt;        &lt;td valign="top" width="100"&gt;750(phone needed)&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="100"&gt;Customer Service&lt;/td&gt;        &lt;td valign="top" width="100"&gt;Best&lt;/td&gt;        &lt;td valign="top" width="100"&gt;Ok (Until now)&lt;/td&gt;        &lt;td valign="top" width="100"&gt;Sucks rat’s ass&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="100"&gt;Speed (Kbps)&lt;/td&gt;        &lt;td valign="top" width="100"&gt;256&lt;/td&gt;        &lt;td valign="top" width="100"&gt;300&lt;/td&gt;        &lt;td valign="top" width="100"&gt;256&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="100"&gt;Time to get the service in days&lt;/td&gt;        &lt;td valign="top" width="100"&gt;2-4 &lt;/td&gt;        &lt;td valign="top" width="100"&gt;1 week&lt;/td&gt;        &lt;td valign="top" width="100"&gt;&amp;gt; 1 month&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;strong&gt;Please do not draw conclusions just by looking at the figures.&lt;/strong&gt; &lt;/p&gt;  &lt;p&gt;BSNL is a government service, and for those who do not know, in general, a government service in India is dreaded by everyone unless you have someone high up the ladder to pull some strings in their office. For BSNL, you need to apply for a landline phone, it took me almost a month to get that. Once that is in place and working, we need to apply for broadband which might take another month who knows. &lt;/p&gt;  &lt;p&gt;I have chosed Reliance for now, its been almost a week and I do not have a connection yet. There is wiring being done in my house today and hopefully Ill be surfing 2 days from now. I always smell something fishy with Reliance since their service is much cheaper than TATA and the speed they promise to give is 300 Kbps. Lets see how that goes in the coming days. Please let me know if you need more information about any of the above mentioned services since I spent some time researching on them.&lt;/p&gt;  &lt;p&gt;Finally a special note for those planning to come back after a long time or those who are coming for the first time and need a broadband connection.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Getting a connection is the easier part of the equation, but getting good service once you have the connection is really important. I would recommend TATA Indicom for all of you since they really take customer service seriously, atleast that was my experience with TATA sky which is their cable TV service. Although their service is a little on the higher price side but I am sure you won’t mind that :).&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Happy Programming!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-6339015442416628551?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/6339015442416628551/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2009/03/broadband-in-india.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/6339015442416628551'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/6339015442416628551'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2009/03/broadband-in-india.html' title='Broadband in India'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-886115587407313590</id><published>2009-03-07T22:56:00.001-08:00</published><updated>2009-03-07T22:56:17.633-08:00</updated><title type='text'>Typed Datasets vs Normal Datasets</title><content type='html'>&lt;p&gt;I know there are gazillions of posts explaining about the difference between these 2 data interaction approaches in .NET, but I still would like to contribute a bit. I spent couple of days analyzing the performance of typed vs normal datasets using ASP.NET and SQL Server 2005. Since typed datasets gives so much ease of development and of course, compile time type safety, it is pretty obvious that there is a performance price. I wanted to observe the one to one comparison of these 2 candidates. &lt;/p&gt;  &lt;p&gt;Following is the environment in which I did this analysis –:&lt;/p&gt;  &lt;p&gt;Database – AdventureWorks in SQL Server 2005&lt;/p&gt;  &lt;p&gt;Dev environment – Visual Studio 2008, ASP.NET Web Application&lt;/p&gt;  &lt;p&gt;Profiler – Redgate ANTS profiler. &lt;/p&gt;  &lt;p&gt;I created a data access layer for each type of dataset, so for typed dataset it consisted of the xml schema and other designer files generated and for the normal dataset, I created classes which essentially did the same thing as some of the classes generated by typed datasets, but with less code. (By less I means the designer generated code has lots of things which are unnecessary for simple operations but nevertheless they are good programming practices, I omitted them). I created a simple, complex and very complex queries in the database so that I see their performance at different levels. Also I analyzed the results for small number of rows, medium and large number of rows in the each of the query result. To explain the kind of queries I wrote, simple query was just a normal select statement, complex query had couple of joins and very complex query had couple of inserts and then a select with couple of joins.&lt;/p&gt;  &lt;p&gt;Following are the results of the experiment –:&lt;/p&gt;  &lt;p&gt;Small data set (about 100 rows in final result set)    &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="199"&gt;           &lt;p&gt;Type of query&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;Normal Dataset&lt;/p&gt;            &lt;p&gt;(sec.)&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;Typed Dataset&lt;/p&gt;            &lt;p&gt;(sec.)&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="199"&gt;           &lt;p&gt;Simple Query/Procedure&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;0.012/0.0005&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;0.0144/0.0008&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="199"&gt;           &lt;p&gt;Complex Query/procedure&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;0.0197/0.004&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;1.923/0.007&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="199"&gt;           &lt;p&gt;Very Complex Procedure&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;0.041&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;0.072&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;p&gt;Medium data set (about 7000 rows in final result set)    &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="199"&gt;           &lt;p&gt;Type of query&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;Normal Dataset&lt;/p&gt;            &lt;p&gt;(sec.)&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;Typed Dataset&lt;/p&gt;            &lt;p&gt;(sec.)&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="199"&gt;           &lt;p&gt;Simple Query/Procedure&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;0.194/0.164&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;4.19/0.44&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="199"&gt;           &lt;p&gt;Complex Query/procedure&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;0.48/0.54&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;4.96/0.76&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="199"&gt;           &lt;p&gt;Very Complex Procedure&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;0.64&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;0.79&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;p&gt;Large Data set (&amp;gt; 500000 rows in final result set)    &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="199"&gt;           &lt;p&gt;Type of query&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;Normal Dataset&lt;/p&gt;            &lt;p&gt;(sec.)&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;Typed Dataset&lt;/p&gt;            &lt;p&gt;(sec.)&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="199"&gt;           &lt;p&gt;Simple Query/procedure&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;1.675/1.44&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;4.62/4.27&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="199"&gt;           &lt;p&gt;Complex Query/procedure&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;8.46/7.61&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;18.19/17.98&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="199"&gt;           &lt;p&gt;Very Complex Query/procedure&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;7.921&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;19.935&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;p&gt;From the data collected, it is not surprising that typed datasets take a performance hit compared to normal datasets. As you can observe, for simple queries, typed datasets create quite a bit of overhead. The major reason is, in this case, the table which was used for this simple query was pretty big (about 30 columns) hence the typed data table created was a large object.&lt;/p&gt;  &lt;p&gt;Although typed datasets cannot outperform normal datasets in terms of execution time, they were introduced for a reason right! That reason is to reduce the development time and generate good quality code. Following table shows the development time needed to build the same functionality with these 2 approaches.&lt;/p&gt;  &lt;p&gt;Development Time (same for all size of datasets) &lt;/p&gt;  &lt;p&gt;These values show the coding time required to create the actual functions which retrieve values from the database and return to the calling client.    &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="199"&gt;           &lt;p&gt;Type of query&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;Normal Dataset&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;Typed Dataset&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="199"&gt;           &lt;p&gt;Simple Query/Procedure&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;2.8/2.5 min&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;2/1.5 min&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="199"&gt;           &lt;p&gt;Complex Query/procedure (not parameters for the procedure)&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;3.5/2.5 min&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;2.4/1.5 min&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="199"&gt;           &lt;p&gt;Very Complex Procedure (About 30 parameters)&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;14.5 min&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="220"&gt;           &lt;p&gt;4 min&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;To sum up this discussion, following are the pros and cons of Typed Datasets. Since Typed Datasets are just wrapper classes over normal datasets, their pros and cons are pretty much the same. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;Pros:&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;· Visual Studio intellisense available to access the individual table fields. Compared to normal dataset code, typed dataset code is shorter making it more readable, maintainable and more intuitive. &lt;/p&gt;  &lt;p&gt;· Compile time type checking is achieved for individual fields for tables. Since the columns of a typed dataset are strongly typed, there is no explicit casting required while retrieving the values from the dataset unlike in normal dataset.&lt;/p&gt;  &lt;p&gt;· The dataset provides a replica of the underlying database including the relationships between the tables and their indices. This gives the developer the ability to check constraints within the code itself.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Cons:&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;· In order to achieve the type safety, typed datasets need to have the underlying information of the table schema. Creating a typed dataset or a typed DataTable is an expensive operation. For simple operations, you might end up having lots of unnecessary code in the designer file of the typed dataset. For example, to perform a simple read of say 3 columns from a table with 30 columns, the designer would still create a DataTable consisting of 30 properties and 30 type safe columns. One can certainly delete unwanted columns but that becomes an extra task as schema changes frequently. &lt;/p&gt;  &lt;p&gt;Although one can store this datatable in a Session or some other place where he could just do DataTable.Clear() and return it after it has been created once. I implemented this method and saw about 40 – 50% improvement. Please visit this link to read more about it.&lt;/p&gt;  &lt;p&gt;· Every time the database schema changes, one has to refresh the .xsd file to generate the class again. &lt;/p&gt;  &lt;p&gt;· Using the typed adapter could be an overhead for simple operations. The typed adapter consists of table mappings, transaction support which might not be what you want for a simple operation like select.&lt;/p&gt;  &lt;p&gt;Happy Programming!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-886115587407313590?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/886115587407313590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2009/03/typed-datasets-vs-normal-datasets.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/886115587407313590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/886115587407313590'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2009/03/typed-datasets-vs-normal-datasets.html' title='Typed Datasets vs Normal Datasets'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-7031652702511085713</id><published>2009-02-18T20:37:00.001-08:00</published><updated>2009-02-18T20:54:58.260-08:00</updated><title type='text'>Task Scheduler vs Windows Service</title><content type='html'>&lt;p&gt;It is not uncommon in a project where in we need to schedule some operation. It might be some database call or a webservice call or some simple call to a dll. There are several options one might consider in such a situation.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Create a Windows Service (background process) with a Timer which would initiate the operation at regular intervals as specified to the Timer. &lt;/li&gt;    &lt;li&gt;Create a task in the Windows Task Scheduler which would initiate the application. &lt;/li&gt;    &lt;li&gt;Create a timer in the global.asax file which would fire at regular intervals to initiate the required operation. &lt;/li&gt;    &lt;li&gt;If the operation is about reading and writing to a SQL database, then SQL CLR integration can also be considered. Here SQL jobs could be used to call a procedure which calls the managed dll. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The project which I worked on required a similar functionality where a scheduler needed to call my dll which in turn would do the required webservice calls and some database operations. Me and my team went through several discussions about which option suits the best for our needs. Following were the highlights of the discussion –:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Windows Service is a nice option since it has inbuilt logging features and can gracefully handle failures. They are really easy to write ( We were working with .NET). The biggest constraint is writing a scheduler. We needed the operation to occur on a specific day at a specific time. Now we could have written a scheduler with lots of efforts, but if we needed to change the schedule we would have had to change the scheduler parameters somehow. Well a config file can help here but again, it is a technical task and certainly some normal Windows User (non technical) would not know these things by default. &lt;/li&gt;    &lt;li&gt;Windows has a well tested Task Scheduler which can be used to schedule applications to be run at specific intervals. The scheduler is very usable and has pretty good granular control. Although to schedule tasks within seconds once would require to do some trick but we did not want that level of granularity. After rummaging in the cloud we found that once a password of the user Windows account changes, the task needs to be updated with the new credentials. This is kind of an admin task but pretty irritating. Although since with the task scheduler we would be running the application only when needed and not causing a resource hog like a Windows Service. Just to mention though, Windows Task Scheduler is actually implemented as a Service in Windows OS. There are some reports saying that the scheduler is a poorly written application and causes to fail several times. &lt;/li&gt;    &lt;li&gt;A timer in the global.asax file also has the same problem of writing our scheduler. It also causes a needless dependency on the IIS server. &lt;/li&gt;    &lt;li&gt;SQL CLR is a pretty compact option, but me and my team were not completely familiar with writing managed code in SQL and we had to come up with a cheap option in a small time frame. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;We finally decided to go with the Windows Task Scheduler. Our application was really simple, it just had few function calls to our core engine which in turn took care of the webservice and database calls. So we did not have much worry about the logging features absent since we could write our own. In turn we got a well tested and easily usable scheduler and an application which ran only when needed. &lt;/p&gt;  &lt;p&gt;You can try to find information about such a situation, you would stumble over lots of blogs stating one is better than the other and vice versa. Mostly people have chosen between a Service and the Windows Scheduler, but honestly it depends on the requirements of your application. For few hours I was hanging in limbo, between Service and Windows Scheduler but some of the blogs like &lt;a href="http://weblogs.asp.net/jgalloway/archive/2005/10/24/428303.aspx"&gt;Jon Galloway’s blog post&lt;/a&gt; helped me make my decision. I state again that our decision of Windows Task Scheduler was based on the information we could gather and our requirements more importantly. &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Happy Programming!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-7031652702511085713?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/7031652702511085713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2009/02/task-scheduler-vs-windows-service.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/7031652702511085713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/7031652702511085713'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2009/02/task-scheduler-vs-windows-service.html' title='Task Scheduler vs Windows Service'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-4685405431581550971</id><published>2009-02-18T20:28:00.001-08:00</published><updated>2009-03-31T08:51:37.056-07:00</updated><title type='text'>Stackpanel scrollbar visibility issue</title><content type='html'>&lt;p&gt;It is not new for someone playing around with Silverlight to realize that the ScrollViewer class does not behave as it should when used with a container control like StackPanel.&amp;nbsp; I spent an hour scratching my head over this issue until finally I got it right ( that is what I think!). All I wanted to do was dynamically add my usercontrols as children to a StackPanel, and the StackPanel needs to display the scrollbars once the child controls go beyond the view of the StackPanel. If you do the following you would not achieve what I said earlier –: &lt;/p&gt;&lt;pre class="brush: xml;"&gt;&amp;lt;StackPanel Height="228" x:Name="stackStores" Width="380" Orientation="Vertical" &lt;br /&gt;&lt;br /&gt;   ScrollViewer.HorizontalScrollBarVisibility="Auto" &lt;br /&gt;&lt;br /&gt;   ScrollViewer.VerticalScrollBarVisibility="Auto"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/StackPanel&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;The key here is the scrollviewer must move a container as a whole and not its individual children. What I mean is if we add all the usercontrols inside a stackpanel and put this stackpanel inside a scrollviewer, the scrollbars would be visible provided the stackpanel dimensions goes beyond the scrollviewer dimensions. Below is the snippet illustrating the same –: &lt;/p&gt;&lt;pre class="brush: xml;"&gt;&amp;lt;StackPanel&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Width="500" Height="400"&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;StackPanel Height="Auto" x:Name="stackStores" Width="300" Orientation="Vertical" &lt;br /&gt;&lt;br /&gt;      //Add the children here.&lt;br /&gt;&lt;br /&gt;    &amp;lt;/StackPanel&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/ScrollViewer&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/StackPanel&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;The above snippet works for me. I have seen quite a few blogs explaining stuff about this but none had solved my issue. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Happy Programming!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-4685405431581550971?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/4685405431581550971/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2009/02/stackpanel-scrollbar-visibility-issue.html#comment-form' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/4685405431581550971'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/4685405431581550971'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2009/02/stackpanel-scrollbar-visibility-issue.html' title='Stackpanel scrollbar visibility issue'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-3004338798681941479</id><published>2009-01-09T02:56:00.001-08:00</published><updated>2009-03-24T04:16:07.966-07:00</updated><title type='text'>Is your object oriented design SOLID?</title><content type='html'>&lt;p&gt;I believe object oriented design is the most widely used technique to develop applications in most of the industries today. It is a great concept of modeling real world objects into software paradigm. But not all object oriented designs are good designs. Just because your design uses the important concepts of object orientation does not make it a robust, scalable and extensible design. Experts in this field have, over the years studied various aspects of object oriented design and have come up with some guidelines or principles to create a good design. For us mortals, following these principles could, probably not guarantee, but certainly increase the probability of developing high quality software.&lt;/p&gt;&lt;p&gt;Following are the principles which form an acronym of SOLID as laid out by Robert C Martin.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;S&lt;/strong&gt;ingle responsibility principle – Each class (or a method) must have one and only one reason to change.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;O&lt;/strong&gt;pen closed principle – A class (or a method) must be open for extension but closed for change.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;L&lt;/strong&gt;iskov substitution principle – Derived classes must be substitutable with their base class.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;I&lt;/strong&gt;nterface segregation principle – Make more granular interfaces which are client specific.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;D&lt;/strong&gt;ependency inversion principle – Depend upon abstractions, not on concrete classes.&lt;/p&gt;&lt;p&gt;Scott Hanselman has posted a great great podcast with the Uncle Bob ( Robert C Martin) where he talks about each and every principle listed above in a very lucid manner. Here is the link to that podcast &lt;a href="http://www.hanselman.com/blog/HanselminutesPodcast145SOLIDPrinciplesWithUncleBobRobertCMartin.aspx" target="_blank"&gt;http://www.hanselman.com/blog/HanselminutesPodcast145SOLIDPrinciplesWithUncleBobRobertCMartin.aspx&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-3004338798681941479?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/3004338798681941479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2009/01/is-your-object-oriented-design-solid.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/3004338798681941479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/3004338798681941479'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2009/01/is-your-object-oriented-design-solid.html' title='Is your object oriented design SOLID?'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-6995763754374101813</id><published>2008-12-31T03:27:00.001-08:00</published><updated>2008-12-31T03:27:11.344-08:00</updated><title type='text'>Almost Code Complete</title><content type='html'>&lt;p&gt;It is my belief that every good developer must have read or is reading or atleast intends to read Steve McConnell’s Code Complete. The book essentially is considered to be a bible for software developers. For those focusing more on the coding part of software construction process, reading from Chapter 6 onwards makes sense. I have tried to select some important points out of the chapters focused on coding aspects. Although the whole book is made of important points I just want to underline some key thoughts to take away.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;A class is a collection of data and routines that share a cohesive, well-defined responsibility. &lt;/li&gt;    &lt;li&gt;Tap into the power or being able to work in the problem domain rather than at the low-level implementation domain. &lt;/li&gt;    &lt;li&gt;Abstraction is the ability to view a complex operation in a simplified form. &lt;/li&gt;    &lt;li&gt;Each class should implement one and only one abstract data type. If a class implements more than one type or you can’t figure out what ADT a class implements then reorganize&amp;#160; that class into more organized classes. &lt;/li&gt;    &lt;li&gt;When you design a class, check each public routine if there is a need for its complement. &lt;/li&gt;    &lt;li&gt;Each interface consists of a programmatic part and a semantic part. Programmatic part consists of the data types and other attributes of interface that can be enforced by compiler, semantic part contains assumptions about how the interface will be used which cannot be enforced by compiler. Look for ways to convert semantic interface elements to programmatic interface elements using Asserts or other techniques. &lt;/li&gt;    &lt;li&gt;Don’t put a routine into a public interface just because it uses only public routines. &lt;/li&gt;    &lt;li&gt;Code is read far more times than it is written even during initial development. &lt;/li&gt;    &lt;li&gt;To avoid tight coupling, make data private in base classes rather than protected. &lt;/li&gt;    &lt;li&gt;Be critical of classes containing more than about seven data members. &lt;/li&gt;    &lt;li&gt;Follow the Liskov Substitution Principle, which in simple words state that, all the routines defined in the base class should mean the same thing when used in each of it’s derived classes. &lt;/li&gt;    &lt;li&gt;Minimize indirect routine calls, if a object A instantiates an object B, then a routine in A can call routines on object B but should not call any routines of objects provided in object B. &lt;/li&gt;    &lt;li&gt;For better readability, put the parameters in an input modify output order. List the parameters in input only, input and output, and output only order. &lt;/li&gt;    &lt;li&gt;Don’t use routine parameters as working variables, store it in a local copy and use that for modification. &lt;/li&gt;    &lt;li&gt;Use error handling code for conditions you expect to occur, use assertions for conditions that should never occur. &lt;/li&gt;    &lt;li&gt;Use access routines instead of global data. It just makes it easy to modify them at a single place. &lt;/li&gt;    &lt;li&gt;Don’t dump all the global data at a single place. Make sure that information hiding and ADT are maintained, which might result into global data stored into their meaningful classes. &lt;/li&gt;    &lt;li&gt;Don’t make up phony variables to be used for a case statement. Since they are confusing, use if then statements instead. &lt;/li&gt;    &lt;li&gt;If you have a loop, put any initialization required by the loop just before the loop to make it more readable. &lt;/li&gt;    &lt;li&gt;Loop should follow the rule of a routine, they must perform one and only one function. Its better to break a loop into two to perform unrelated things. &lt;/li&gt;    &lt;li&gt;It is bad practice to use the last value of an index of a loop in the code after the loop. Never assume that a loop will be executed until it’s last step. &lt;/li&gt;    &lt;li&gt;The fact that a design uses inheritance and polymorphism does not make it a good design. Table driven methods sometimes can produce elegant solutions instead. &lt;/li&gt;    &lt;li&gt;Use terms named true and false to check boolean value, using 0 and 1 makes code confusing in some cases. &lt;/li&gt; &lt;/ul&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-6995763754374101813?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/6995763754374101813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2008/12/almost-code-complete.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/6995763754374101813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/6995763754374101813'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2008/12/almost-code-complete.html' title='Almost Code Complete'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-210864664681610736</id><published>2008-12-24T00:40:00.001-08:00</published><updated>2008-12-24T00:40:27.049-08:00</updated><title type='text'>An Interview with Thoughtworks</title><content type='html'>&lt;p&gt;Recently I had been in a job search mode, got interviewed by Thoughtworks and Microsoft(when I was in US). I was keen in focusing on the “fundu” companies if you know what I mean. Lots of people know how Microsoft Seattle interview process goes, I would certainly like to belabor on Thoughtworks India process. I would say it was a fascinating experience where I learnt quite a few things like test driven development, pair programming and no cubicle culture. Also it did refreshed my old school problem solving techniques, white boarding etc.&lt;/p&gt;  &lt;p&gt;So it all started by receiving an email from an HR person about an opportunity at Thoughtworks. Since I already followed Martin Fowler’s blog I knew quite a bit about them. They set up a informal like conversation with a HR person that week. We discussed a lot about what I do, I want to do, about my blog, projects on my resume. It was really a conversation about me marketing myself and the HR person doing his part for Thoughtworks. It went for about one and half hour which ended with he asking about my salary expectations. &lt;/p&gt;  &lt;p&gt;After about 2-3 days I got a call from the same person explaining me the next step. He sent me an email which consisted of 2 problem statements Mars Rover problem and Sales Tax problem. You could certainly find these statements by surfing on the net. Here is a link to the sales tax statement I found &lt;a target="_blank" href="http://www.experts-exchange.com/Programming/Languages/Java/Q-23985207-SALES-TAX-Java-problem-solution.html"&gt;http://www.experts-exchange.com/Programming/Languages/Java/Q-23985207-SALES-TAX-Java-problem-solution.html&lt;/a&gt;. I chose the Mars Rover problem just thinking it was more interesting to solve. It is important to that this stage really decides many things about your onsite interview. They do not just need a working solution, anyone could write one in less than an hour. What makes a good solution is how well the objects are designed, the naming convention and an overall decent to good OOPS knowledge implementation. I mean how well encapsulated your objects are, do you program too much to the implementation rather than to an interface, is your solution extensible because in an onsite interview you would be asked to extend this solution with a more complex requirement. I would suggest you to get a design patterns book just to improve the object design strategy in your solution, I do not say that design patterns must be used but they do help in achieving good object oriented code most of the times :). &lt;/p&gt;  &lt;p&gt;After this, I got a call in 3-4 days for an onsite interview in their Pune office. The office, as I expected after reading few blogs, was different than my earlier offices. No cubicles, just one big room with round tables surrounded by chairs, people working on their laptops, a ping pong table at one side and nice lunch room. It was a really innovative idea to have such an office structure. I reached there a little early and I asked for restroom just to get my bearings! I asked a person working there,whether the restroom had cubicles atleast, thank god he took it lightly. The onsite process was designed as follows –:&lt;/p&gt;  &lt;p&gt;- A self assessment test – 50 super easy questions in 12 minutes. These consists question like Miner and Minor, are they 1) same meaning, 2) contradictory, 3) Neither.&lt;/p&gt;  &lt;p&gt;- A logic test – 11 flowchart questions in 1 hour 15 min. These problems are like following a flowchart, executing the instruction at each step and writing a final output. You just need utter concentration for this one but its fun. &lt;/p&gt;  &lt;p&gt;These tests are by no means show stoppers, I think everyone gets through these unless you are really dumb. So no worries until now. &lt;/p&gt;  &lt;p&gt;- Pair programming – Here a well seasoned person for Thoughtworks would pair with you and go about refactoring your code submission. This has to be an interactive session where we have to put our own ideas in improving the design and that person would do his part. Make sure you think about some improvements in your design if possible before getting in this stage. You should not be really adamant on your idea if you have any about solving some issue, pair programming is about good interactive programming. At the same time you should not be too submissive and agree to everything for obvious reasons. &lt;/p&gt;  &lt;p&gt;- 1st technical interview – This involves 2 Thoughtworkers interviewing you at the same time. There would be discussion about technical expertise you possess, for me lots of questions on .NET were asked. I had to white board some of them to explain some code. There is OOPS design problem to be solved, here they see your capability of creating a decent high level design on the fly within the time span given. The problem could be something like design a video store library application or something on those lines. I kinda screwed up during this stage, my solution for the problem was not really good as far as I know. White boards do make me uncomfortable sometimes :) This interview lasted for like more than 1 and half hour. &lt;/p&gt;  &lt;p&gt;- 2nd technical interview – This is a similar interview like the earlier one. I guess its another chance to see if a candidate can show better performance this time. By the way I left my home in Mumbai at 6 in morning and it was 7 in the evening for this interview. I was fucked up pretty much talking all day but I did experience such a day with Microsoft too. There is nothing really different to talk about this interview since it basically is targeted again on OOPS concepts and some problem solving techniques like creating a XOR gate from AND and OR gate.&lt;/p&gt;  &lt;p&gt;So that was my experience and I guess it resonates with any other person who went until the final stage. I think it was a good experience knowing a different culture in the software field. Also to be honest it did help me to improve my coding skills by coding for some fun problem statement and getting it reviewed by a coding ninja, getting their insight on improving the design. So let me know if any of you guys need any more “up close” insight on the interview process.&lt;/p&gt;  &lt;p&gt;Best of Luck! &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-210864664681610736?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/210864664681610736/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2008/12/interview-with-thoughtworks.html#comment-form' title='40 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/210864664681610736'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/210864664681610736'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2008/12/interview-with-thoughtworks.html' title='An Interview with Thoughtworks'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>40</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-8829827150570771921</id><published>2008-12-18T11:47:00.001-08:00</published><updated>2009-03-31T09:15:30.789-07:00</updated><title type='text'>RSS Reader using NSXMLParser</title><content type='html'>&lt;p&gt;I was working on building a slick RSS reader for my iphone since last week. As you might guess, the core problem in building an RSS reader is to create a way to read the XML feed data. For a newcomer, this might sound straigtforward but once they rub nose with it, it would soon be clear that the various forms of feeds that are available now, makes it a tricky task. Above that, iPhone does not support the good guys of XML world, namely NSXMLDocument etc. This class in the Cocoa framework is really helpful with its XPath support to parse XML feeds easily. The NSXMLParser is the sole fighter in the XML arena on the iPhone device (as far as I know). Some folks have tried building wrapper classes to support iPhone, an example is TouchXML which is available at &lt;a href="http://code.google.com/p/touchcode/" target="_blank"&gt;http://code.google.com/p/touchcode/&lt;/a&gt;. The class used by this method is CXMLDocument which is kinda on the same lines of NXMLDocument, but with much lesser support for parsing. It turned out that it was not good enough for what I needed to do. &lt;/p&gt;  &lt;p&gt;So… I wrote a NSXMLParser! Now lets be honest here, not many people are lovers of Event driven xml programming and I am no exception. It just seems really tedious to take care of all the conditions in such a model when used for parsing. Enough bashing, here is some code to show how it can be used to parse an XML feed at a url.&lt;/p&gt;  &lt;pre class="brush: csharp;"&gt;- (NSMutableArray *)parseXMLFeedAtURL:(NSURL *)URL parseError:(NSError **)error &lt;br /&gt;{    &lt;br /&gt;    channelFlag = NO; &lt;br /&gt;    mainTitleFlag  = 0;    &lt;br /&gt;    itemFlag = 0;    &lt;br /&gt;    linkFlag = 0; &lt;br /&gt;    feedFlag = NO; &lt;br /&gt;    entryFlag = 0; &lt;br /&gt;    appDel = (iBlogReaderAppDelegate *)[[UIApplication sharedApplication] delegate]; &lt;br /&gt;    NSXMLParser *parser = [[NSXMLParser alloc] initWithContentsOfURL:URL]; &lt;br /&gt;    // Set self as the delegate of the parser so that it will receive the parser delegate methods callbacks. &lt;br /&gt;    [parser setDelegate:self]; &lt;br /&gt;    // Depending on the XML document you're parsing, you may want to enable these features of NSXMLParser. &lt;br /&gt;    [parser setShouldProcessNamespaces:NO]; &lt;br /&gt;    [parser setShouldReportNamespacePrefixes:NO]; &lt;br /&gt;    [parser setShouldResolveExternalEntities:NO]; &lt;br /&gt;    [parser parse]; &lt;br /&gt;    NSError *parseError = [parser parserError]; &lt;br /&gt;    if (parseError &amp;amp;&amp;amp; error) { &lt;br /&gt;        *error = parseError; &lt;br /&gt;    } &lt;br /&gt;    [parser release]; &lt;br /&gt;    return tempArray; &lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: csharp;"&gt;- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict &lt;br /&gt;{ &lt;br /&gt;    if (qName) { &lt;br /&gt;        elementName = qName; &lt;br /&gt;    } &lt;br /&gt;    if([elementName isEqualToString:@&amp;quot;channel&amp;quot;]) &lt;br /&gt;    { &lt;br /&gt;        // Seems like a normal RSS feed. &lt;br /&gt;        channelFlag = YES; &lt;br /&gt;        return; &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;// More code here.&lt;br /&gt;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: csharp;"&gt;- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName &lt;br /&gt;{     &lt;br /&gt;      if([elementName isEqualToString:@&amp;quot;feed&amp;quot;] || [elementName isEqualToString:@&amp;quot;rss&amp;quot;] ) &lt;br /&gt;      { &lt;br /&gt;          [parser abortParsing]; &lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;// More code here.&lt;br /&gt;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: csharp;"&gt;- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string &lt;br /&gt;{ &lt;br /&gt;    if(tempArray != nil) &lt;br /&gt;    { &lt;br /&gt;        if(charString == nil) &lt;br /&gt;        { &lt;br /&gt;            charString = [[NSMutableString alloc] init]; &lt;br /&gt;        } &lt;br /&gt;        if(mainTitleFlag == 1 || linkFlag == 1) &lt;br /&gt;        { &lt;br /&gt;            [charString appendString:string]; &lt;br /&gt;        } &lt;br /&gt;    } &lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The above function acceps a NSURL object which is created using a url string and a pointer to pointer to an NSError object. To use NSXMLParser, the best thing would be to create a new NSObject class. In that class add the above methods so that this implementation stays away from your other application code. NSXMLParser needs didStartElement, didEndElement and foundCharacters methods to read values within elements. More methods are available if you refer to the reference library provided by Apple. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Every time a new tag is encountered, the didStartElement event is triggered, when it ends didEndElement is triggered, and when characters are found between tags the foundCharacters event is triggered. So you see the main issue is here to maintain the flow across events. It is very common to have nested “title” elements in an RSS feed, so care must be taken while parsing them. I use flags to check if certain element has been encountered by the parser or not. Well this method may vary according to your needs. In my app, I support both Atom and RSS feeds so I had to give option for the user to select which feed they need to subscribe to. Below is a snap of that view.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_8U4ptmqLjxo/SUqorhaiR5I/AAAAAAAAAWk/q4SXFz-WrA0/s1600-h/Picture%201%5B2%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Picture 1" border="0" alt="Picture 1" src="http://lh3.ggpht.com/_8U4ptmqLjxo/SUqot8_9FqI/AAAAAAAAAWo/NW5sXj9NLIY/Picture%201_thumb%5B2%5D.png?imgmax=800" width="258" height="480" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;On Done, I loop through the selection list and parse each feed using my parser. Now the way I got these three feeds is by parsing the url entered in the textbox. It would be something like&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: csharp;"&gt;&amp;lt;link rel=&amp;quot;alternate&amp;quot; type=&amp;quot;application/rss+xml&amp;quot; title=&amp;quot;RSS&amp;quot; href=&amp;quot;http://feeds.feedburner.com/codinghorror/&amp;quot; /&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;I would like to share my XCode project if anyone needs it, although I am not sure where can I upload those files. But that can be figured out later. Let me know if you need any help is using the infamous NSXMLParser :). &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Happy Programming!&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;#160;&lt;/pre&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-8829827150570771921?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/8829827150570771921/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2008/12/rss-reader-using-nsxmlparser.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/8829827150570771921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/8829827150570771921'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2008/12/rss-reader-using-nsxmlparser.html' title='RSS Reader using NSXMLParser'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_8U4ptmqLjxo/SUqot8_9FqI/AAAAAAAAAWo/NW5sXj9NLIY/s72-c/Picture%201_thumb%5B2%5D.png?imgmax=800' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-9010348108421041277</id><published>2008-12-11T04:10:00.001-08:00</published><updated>2008-12-11T06:50:57.834-08:00</updated><title type='text'>RSS Reader for iPhone</title><content type='html'>&lt;p&gt;If you have read my blog description just below the blog title you would realize where I am hanging out these days. [object message] is a way to send a message (method) to an object in objective C. I have been working on iphone sdk for a week, going through the online reference library at &lt;a href="http://developer.apple.com/"&gt;http://developer.apple.com&lt;/a&gt; and stumbling over blogs explaining some code. Let me tell you, this week was full of new learning in terms of a language, a framework and frustrations! Here are a few snapshots of an RSS reader I built for the iphone.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_8U4ptmqLjxo/SUECv59DjgI/AAAAAAAAAVM/C9x6B8dDlts/s1600-h/Picture%208%5B5%5D.png"&gt;&lt;img style="border-width: 0px; display: inline;" title="Picture 8" alt="Picture 8" src="http://lh5.ggpht.com/_8U4ptmqLjxo/SUECxUyWDuI/AAAAAAAAAVQ/5E_fBqszF6w/Picture%208_thumb%5B3%5D.png?imgmax=800" border="0" height="313" width="169" /&gt;&lt;/a&gt; &lt;a href="http://lh3.ggpht.com/_8U4ptmqLjxo/SUECzPG9ZAI/AAAAAAAAAVU/38mMdFiTUts/s1600-h/Picture%201%5B7%5D.png"&gt;&lt;img style="border-width: 0px; display: inline;" title="Picture 1" alt="Picture 1" src="http://lh5.ggpht.com/_8U4ptmqLjxo/SUEC0HinEwI/AAAAAAAAAVY/5pHQ-4Y1vCk/Picture%201_thumb%5B5%5D.png?imgmax=800" border="0" height="313" width="168" /&gt;&lt;/a&gt;&lt;a href="http://lh3.ggpht.com/_8U4ptmqLjxo/SUEC1ncrkXI/AAAAAAAAAVc/ri_ZVV4tRTQ/s1600-h/Picture%202%5B6%5D.png"&gt;&lt;img style="border-width: 0px; display: inline;" title="Picture 2" alt="Picture 2" src="http://lh4.ggpht.com/_8U4ptmqLjxo/SUEC2kfU4KI/AAAAAAAAAVg/zWwnq7YZFhU/Picture%202_thumb%5B4%5D.png?imgmax=800" border="0" height="313" width="168" /&gt;&lt;/a&gt; &lt;a href="http://lh3.ggpht.com/_8U4ptmqLjxo/SUEC4MCtOjI/AAAAAAAAAVk/Z3RgtsIQgic/s1600-h/Picture%203%5B4%5D.png"&gt;&lt;img style="border-width: 0px; display: inline;" title="Picture 3" alt="Picture 3" src="http://lh3.ggpht.com/_8U4ptmqLjxo/SUEC5Rh4nGI/AAAAAAAAAVo/mmzc-3WGL80/Picture%203_thumb%5B2%5D.png?imgmax=800" border="0" height="313" width="168" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_8U4ptmqLjxo/SUEC7dBYN8I/AAAAAAAAAVs/wnUlahybKFw/s1600-h/Picture%204%5B4%5D.png"&gt;&lt;img style="border-width: 0px; display: inline;" title="Picture 4" alt="Picture 4" src="http://lh6.ggpht.com/_8U4ptmqLjxo/SUEC8p_arWI/AAAAAAAAAVw/SnU2Qnq_ZcM/Picture%204_thumb%5B2%5D.png?imgmax=800" border="0" height="313" width="168" /&gt;&lt;/a&gt; &lt;a href="http://lh6.ggpht.com/_8U4ptmqLjxo/SUEC-yip7YI/AAAAAAAAAV0/tw_c6YKlaX4/s1600-h/Picture%206%5B4%5D.png"&gt;&lt;img style="border-width: 0px; display: inline;" title="Picture 6" alt="Picture 6" src="http://lh5.ggpht.com/_8U4ptmqLjxo/SUEDAE6bs0I/AAAAAAAAAV4/SCIkkZVO-9k/Picture%206_thumb%5B2%5D.png?imgmax=800" border="0" height="313" width="168" /&gt;&lt;/a&gt; &lt;a href="http://lh4.ggpht.com/_8U4ptmqLjxo/SUEDC2pzJNI/AAAAAAAAAV8/eUU3oUNzFwg/s1600-h/Picture%207%5B4%5D.png"&gt;&lt;img style="border-width: 0px; display: inline;" title="Picture 7" alt="Picture 7" src="http://lh4.ggpht.com/_8U4ptmqLjxo/SUEDEOCCroI/AAAAAAAAAWA/bAZ8n8LN2E8/Picture%207_thumb%5B2%5D.png?imgmax=800" border="0" height="313" width="168" /&gt;&lt;/a&gt; &lt;a href="http://lh5.ggpht.com/_8U4ptmqLjxo/SUEDGDCfZfI/AAAAAAAAAWE/u8pHSindFgA/s1600-h/Picture%205%5B4%5D.png"&gt;&lt;img style="border-width: 0px; display: inline;" title="Picture 5" alt="Picture 5" src="http://lh3.ggpht.com/_8U4ptmqLjxo/SUEDH6eaY7I/AAAAAAAAAWI/9nQY5dVDgdk/Picture%205_thumb%5B2%5D.png?imgmax=800" border="0" height="313" width="168" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Before I delve into the major discussion about the app, let me frustrate those guys who are just entering  the world of iphone development. In the XCode editor, which is used for writiing apps on Mac, there are 2 options to debug an application. One is in the iPhone Simulator whose snapshots are seen above. This is available to everyone who installs the iphone sdk. Other option is directly on the device, iPhone or iTouch. Hold On… You can debug and install apps created on an iphone ONLY IF YOU ARE A REGISTERED IPHONE DEVELOPER PAYING $99 TO APPLE EVERY YEAR. smirks!!! The account used for downloading the sdk is not  the one used here. You will notice this when you would try to build the application and install it on your iPhone/iTouch and get an error saying something like Unable to Verify device 0X160434fuc@##$#shi#$#$ :), I learnt the hard way, if you want to know more about this mess read the blog post by Ralf Rottman &lt;a target="_blank" href="http://www.talentgrouplabs.com/blog/archive/2008/11/10/iphone-sdk-mobile-provisioning-0xe800003a-0xe8000001.aspx"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Anyways, if you are done pulling your hair off, here are some functionalities of the Reader –:&lt;/p&gt;  &lt;p&gt;- Add and Remove a feed. The feed data gets stored in a property list which are basically a nice way to store application data.&lt;br /&gt;&lt;/p&gt;  &lt;p&gt;- A refresh button causes s refresh of all blogs and displays the first post of each of them on the first screen.&lt;/p&gt;  &lt;p&gt;- Read the post in a browser window itself. This is done using the UIWebVIew class which allows to open a url in a Safari browser window. &lt;/p&gt;  &lt;p&gt;Another word of caution for guys trying to build something which would need to parse XML. The NSXML library which is the one used to parse XML in Mac applications does not work on the iphone/itouch but works on the simulator! I have not personally checked this but there are lots of blogs talking about it. So instead I used TouchXML which is an open source library on &lt;a href="http://code.google.com/p/touchcode/"&gt;http://code.google.com/p/touchcode/&lt;/a&gt;. More information about how to use the parser in this library is well explained on Dean’s blog &lt;a title="http://dblog.com.au/general/iphone-sdk-tutorial-building-an-advanced-rss-reader-using-touchxml-part-1/" href="http://dblog.com.au/general/iphone-sdk-tutorial-building-an-advanced-rss-reader-using-touchxml-part-1/"&gt;http://dblog.com.au/general/iphone-sdk-tutorial-building-an-advanced-rss-reader-using-touchxml-part-1/&lt;/a&gt;. Some good references for beginners are here –:&lt;/p&gt;  &lt;p&gt;1) Aaron Hillegas book on Cocoa Programming for MacOSX. – This is an awesome book for guys like me who have been working on Windows platform for a while and want to shift gears for some time and get some Cocoa! The book really helps a lot to make us understand several aspects of the Cocoa framework and Objective C. For ebook lovers, there is an online version of this book somewhere in the cloud, I have it, just search for it.&lt;/p&gt;  &lt;p&gt;2) &lt;a href="http://developer.apple.com/"&gt;http://developer.apple.com&lt;/a&gt; Apple has provided extensive coding how to’s and other references which I found helpful. &lt;/p&gt;  &lt;p&gt;3) &lt;a href="http://theappleblog.com/"&gt;http://theappleblog.com&lt;/a&gt; has good tutorials.&lt;/p&gt;  &lt;p&gt;The iPhone sdk uses the MVC pattern, so its a good idea to follow that while building our apps.Create a separate View and View Controller for each different screen you wish to see in your app. If you righr click on the project in the left had side tree view panel of XCode you would see an option to add a Group. Click that and add a UIView and a UIViewController in it. This way you just have a clean separaion of all the files. When you create a project like a Utility Application Project or a Navigation project etc you would see some groups already created. So in short, an iPhone/iTouch app at one time displays a single View added as a subview to the main window. To change the screen, remove the view already there and add a new one. Thats how any application on iPhone/iTouch works.Since I use property lists to store the feed data, it becomes really easy to read and write to them. But do not use these lists if you expect the data to grow too much. Property lists are good for few hundred bytes. They are just XML format files which can be added to a project.&lt;br /&gt;&lt;/p&gt;  &lt;p&gt;I will be posting some code snippets in my subsequent posts since its the code that matters! By this time in a week time or so I have pretty decent understanding on how the View Controllers, Views and other elements of an iPhone application interact with each other. Ill be talking a bit about using UINavigationControllers, sharing data among views and other important things which are used more often. Please let me know if you have any questions, Ill be glad to help.&lt;/p&gt;  &lt;p&gt;Happy Programming!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-9010348108421041277?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/9010348108421041277/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2008/12/rss-reader-for-iphone.html#comment-form' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/9010348108421041277'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/9010348108421041277'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2008/12/rss-reader-for-iphone.html' title='RSS Reader for iPhone'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_8U4ptmqLjxo/SUECxUyWDuI/AAAAAAAAAVQ/5E_fBqszF6w/s72-c/Picture%208_thumb%5B3%5D.png?imgmax=800' height='72' width='72'/><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-26599157250460185</id><published>2008-11-30T07:42:00.001-08:00</published><updated>2008-12-11T11:52:28.288-08:00</updated><title type='text'>New .NET Logo</title><content type='html'>&lt;p&gt;I believe I am a little late in talking about the new .NET logo Microsoft showcased at the PDC 2008. &lt;/p&gt;  &lt;p&gt;White background&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_8U4ptmqLjxo/STK0NU5nRUI/AAAAAAAAAUs/QUk43HLSDVg/s1600-h/Snapshot%202008-11-10%2012-40-10%5B2%5D.jpg"&gt;&lt;img style="border: 0px none ; display: inline;" title="Snapshot 2008-11-10 12-40-10" alt="Snapshot 2008-11-10 12-40-10" src="http://lh6.ggpht.com/_8U4ptmqLjxo/STK0O2zQLmI/AAAAAAAAAUw/dOu-MZ9UDHU/Snapshot%202008-11-10%2012-40-10_thumb.jpg?imgmax=800" border="0" width="244" height="78" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;You could certainly get more on msdn but Scott Hanselman has posted some of them on &lt;a target="_blank" href="http://www.hanselman.com/blog/PDC2008NewNETLogo.aspx"&gt;this blog post&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-26599157250460185?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/26599157250460185/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2008/11/new-net-logo_30.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/26599157250460185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/26599157250460185'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2008/11/new-net-logo_30.html' title='New .NET Logo'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_8U4ptmqLjxo/STK0O2zQLmI/AAAAAAAAAUw/dOu-MZ9UDHU/s72-c/Snapshot%202008-11-10%2012-40-10_thumb.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-2861745135129473129</id><published>2008-11-29T10:53:00.001-08:00</published><updated>2008-11-29T12:00:31.598-08:00</updated><title type='text'>Peopleware: Aren't we missing it?</title><content type='html'>&lt;p&gt;I am sure most of the IT guys, especially managers are familiar with the word Peopleware. For those who don’t, it originated from a popular book called &lt;a target="_blank" href="http://www.amazon.com/Peopleware-Productive-Projects-Teams-Second/dp/0932633439"&gt;Peopleware: Productive Projects and Teams&lt;/a&gt; by Tom DeMarco and Timothy Lister. It actually underlines the constant conflicts between individual work and corporate ideologies, something most of the software developers face, but hardly speak about. Its a concept which if understood and followed by managers, can result in great work culture, lesser employee turnovers and higher productivity. If you intend to know just what the heck I have scribbled here, then jump to the conclusion below, although please read the book if you haven’t.&lt;/p&gt;  &lt;p&gt;I have been a full time employee in India and later in US, which has inspired me a lot to write this post. An important factor which affects the productivity of a developer is the attiture of their manager towards them in day to day activities. There is a startling difference between the companies based in India and those in US (Well other countries too but I have had experience of US only). I would quote a statement from the book mentioned above, &lt;/p&gt;  &lt;p&gt;&lt;em&gt;“Managers are not supposed to make people work, but make it possible for them to work.”.&lt;/em&gt; &lt;/p&gt;  &lt;p&gt;This statement has such a deep meaning in its own sense. I could expand on this giving my own experience at work. While in India, I constantly had a feeling that the manager to whom I was reporting, was really difficult to approach to. The extremely vertical structure of the Indian software industry results in the developers being less communicating and more bullied by the managers. If you imagine a organization structure chart, the white spaces between these levels signify the place where learning should occur. But in most of the Indian firms I feel this space is void or close to void. The result is the manager thinks of the developers as nothing more than replaceable parts of a working machine. When such a feeling is in the air, developers have a depressing attitude towards their work and company. In this case, either the developer’s performance degrades and they eventually leave. Most of the managers would get on with that by hiring a new developer in that place and life moves on. Only good managers realize that this will cost the company much more than spending some on the efforts for retaining that developer. The main theme of the book is quoted as,&lt;/p&gt;  &lt;p&gt; &lt;em&gt;“ The major problems at our work are not so much technological in nature than they are sociological in nature”.&lt;/em&gt; &lt;/p&gt;  &lt;h4&gt;Nature of an outsourced job in India&lt;/h4&gt;  &lt;p&gt;Honestly I feel there is heck of a difference in the kind of job done in majority of software firms in US and in India. The Indian office of an US counterpart is an offshore development place wherein the work is “supposed” to be done quicker and cheaper. This is the mantra of a global service firm. Although, the offshore office is not an exact counterpart of its western office since things are dealt slightly different here. A developer has to manage his/her everyday tasks along with maintaining communication with the manager. At the end of 8 hours of code crunching, he/she might have to attend a phone or video conference with the client since it is day time at the client, the client needs to talk personally what is going on in the codeville. So you see, typically in a IT service firm in India, a developer has much longer day than usual. Most of the developers have put this in their routine but they know it unknowingly, that they are losing precious amount of time of their life which is just one per person. Overtimes, late night drops are a real common thing among the IT firms here. Well the sad thing is, its the nature of the job which seem to demand it. &lt;/p&gt;  &lt;p&gt;&lt;span style="font-weight: bold;"&gt; Go Startup&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Frankly, many people have seen this dieffrence between big fat companies and startups. Most startups or small companies are more open cultured, flat due to its size with a well managed office and the meat of the dicussion, the managers have a closer relation with the team members. For me atleast, if the job does not give me the joy of work I need, the salary ain't worth sqaut. I do not say that all startups and small companies are better to work for than big companies, but as a budding developer I feel more interesting and challenging to be in a small pond rather than an ocean. Talking about startups, people interested in starting a new business, may be in IT or something else must read the blog post about &lt;a href="http://blogs.openforum.com/2008/11/25/the-art-of-bootstrapping/"&gt;The Art of Bootstrapping&lt;/a&gt; by Guy Kawasaki.&lt;br /&gt;&lt;/p&gt;  &lt;h4&gt;Conclusion&lt;/h4&gt;  &lt;p&gt;IT managers in India have to realize that developers are real asset to a project and not replaceable parts. Low quality software product, delayed projects, scrapped out projects are a result of sociological problems in a team rather than a technical one. The book mentioned above openly explains the mistakes manager have been doing until now, some still do. Good managers spend time and money in hiring good people and trust their capabilities rather than telling them what is to be done at each point of time. &lt;/p&gt;  &lt;p&gt;Developers need to realize that the reason you intend to work hard is because you like it and evetually wanna have a better life. But what is the point of that life if you spend your twenties and thirties in a cubicle or an office doing overtime crunching millions of lines of code. Most of us do realize this fact and just keep going, but when you eventually feel like stopping its all over. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Slow down you crazy child,&lt;/p&gt;    &lt;p&gt;And take the phone off the hook and disappear for a while. &lt;/p&gt;    &lt;p&gt;Its all right, you can afford to lose a day or two,&lt;/p&gt;    &lt;p&gt;When will you realize … Vienna waits for you?&lt;/p&gt;    &lt;p&gt;                                                                            -- Billy Joel.&lt;/p&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-2861745135129473129?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/2861745135129473129/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2008/11/peopleware-are-we-missing-it.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/2861745135129473129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/2861745135129473129'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2008/11/peopleware-are-we-missing-it.html' title='Peopleware: Aren&apos;t we missing it?'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-4414030886571632882</id><published>2008-11-26T08:33:00.001-08:00</published><updated>2008-12-31T04:49:23.879-08:00</updated><title type='text'>Unlocking iphone 2G safely and correctly</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://xs126.xs.to/xs126/08140/pwnagetool_small814.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; width: 256px; float: left; height: 256px; cursor: pointer;" alt="" src="http://xs126.xs.to/xs126/08140/pwnagetool_small814.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;I know I know I am a PC guy! But I could not stop myself buying an iphone as soon as it was released in 2007 being a techjunkie. I enjoyed legally using it when I was in US. Like a honest buyer I used the AT&amp;amp;T sim, paid the bills blah blah. But I had this big question in my mind, what the f*** would I do when I move to India. When I returned here earlier this year iphone was not yet released and the only way to use it was unlocking it. But yet again like an honest buyer I played the wait and watch game, I thought Apple would certainly come up with a plan for people changing their region with the old 2G iphone. But instead they released iPhone 3G here for country which is yet to have a 3G network! So I was left with 2 options, either buy a new iphone in India or unlock my 2G iphone. Hah, like I was gonna be honest anymore! &lt;/p&gt;  &lt;p&gt;Thus began my tryst with the hackers. I followed lots of blogs about unlocking it and came across lots of folks with horrible error messages on their iphone sometimes rendering the iphone in recovery mode. No doubt unlocking is a risky business but I had to do it. I spent 2 nights figuring out the error messages I used to get while unlocking it for the first time. Finally I got it right with the following steps for 3 different updates which makes it a pretty much foolproof method. Frankly Pwnage tool is really made for a non-technical person and the errors which we get are some exceptional cases only. Again, these are the steps that have worked for me for all updates until the latest 2.2 update. &lt;/p&gt;  &lt;p&gt;&lt;span style="font-weight: bold;"&gt;Steps for unlocking iphone 2G&lt;/span&gt; –:&lt;/p&gt;  &lt;p&gt;1) Remove the SIM card. I have found this step important for later activation. Take a backup of your iphone. &lt;/p&gt;  &lt;p&gt;2)This is a step many people might not follow but I have found doing this step avoid the 1600 error we get at the end of the process. If the iphone is never unlocked then jump to step 5, if it is, restore the iphone with a .ipsw file downloaded from apple. For ex. while updating to 2.2 my iphone was already pwned to 2.1.1 version. So I restored it to the 2.1 ipsw file I had from apple. If you do not have that file you can look on the internet for it, lots of guys have kept copies of these files. Same procedure must be applied for further updates.&lt;/p&gt;  &lt;p&gt;3) Restoring the iphone to an earlier version as described above will take some time. TO restore, connect the iphone, once iTunes fires up. cancel any message boxes for updating the iphone to new versions. Hold Option and click Restore. I think it is Alt on Windows. This will allow you to select a .ipsw file to restore with. While restoring the iphone will restart several times, you would see the apple logo indicating we are using a valid .ipsw file from apple. &lt;/p&gt;  &lt;p&gt;4) Once restoration is complete you would get a message of no SIM card installed which is a good sign.&lt;/p&gt;  &lt;p&gt;5) Now exit iTunes completely and fire up Pwnage tool. Select iPhone, expert mode and click Next. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_8U4ptmqLjxo/SVtklm2JtyI/AAAAAAAAAWs/OxVyhs1m-vM/s1600-h/Picture%202%5B5%5D.png"&gt;&lt;img style="border: 0px none ; display: inline;" title="Picture 2" alt="Picture 2" src="http://lh3.ggpht.com/_8U4ptmqLjxo/SVtkndSOilI/AAAAAAAAAWw/fFgUP1vq4Fk/Picture%202_thumb%5B3%5D.png?imgmax=800" border="0" height="446" width="500" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;6) Allow the tool to search for the restore bundle you downloaded from apple. By default the .ipsw file is in Library/iTunes/iphone software updates on a Mac. I generally transfer this file to a folder on a desktop to make the process easy. I have all the earlier restore bundles in this folder.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_8U4ptmqLjxo/SVtko5i8lgI/AAAAAAAAAW0/IKc1gq7ra0w/s1600-h/Picture%203%5B5%5D.png"&gt;&lt;img style="border: 0px none ; display: inline;" title="Picture 3" alt="Picture 3" src="http://lh4.ggpht.com/_8U4ptmqLjxo/SVtkwYJXRuI/AAAAAAAAAW4/1PvqnCGKVjA/Picture%203_thumb%5B3%5D.png?imgmax=800" border="0" height="446" width="500" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;7) Select the restore bundle you need, mostly you would select the latest version in this case 2.2 version. Click next. On the next screen you would see several customization options. Select General and click next.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_8U4ptmqLjxo/SVtkykr7dGI/AAAAAAAAAW8/AJGoEzxrdfY/s1600-h/Picture%204%5B4%5D.png"&gt;&lt;img style="border: 0px none ; display: inline;" title="Picture 4" alt="Picture 4" src="http://lh3.ggpht.com/_8U4ptmqLjxo/SVtk2iLlHAI/AAAAAAAAAXA/lP3lt9KyqH4/Picture%204_thumb%5B2%5D.png?imgmax=800" border="0" height="446" width="500" /&gt;&lt;/a&gt;  &lt;/p&gt;  &lt;p&gt;8) If you have a legitimate iPhone contract with your carrier (for instance, and iPhone contract with AT&amp;amp;T), you will need to uncheck the box next to “Activate” &lt;/p&gt;  &lt;p&gt;If you don't have one, like me since I am in India with a US iphone I have left it checked. &lt;/p&gt;  &lt;p&gt;Change Root Partition size to 1000MB for updating to 2.2.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_8U4ptmqLjxo/SVtk5JQ6ACI/AAAAAAAAAXE/AAONXnrLZI8/s1600-h/Picture%205%5B4%5D.png"&gt;&lt;img style="border: 0px none ; display: inline;" title="Picture 5" alt="Picture 5" src="http://lh5.ggpht.com/_8U4ptmqLjxo/SVtk6ngjE4I/AAAAAAAAAXI/HfB_IT-DpBs/Picture%205_thumb%5B2%5D.png?imgmax=800" border="0" height="446" width="500" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;8) Keep clicking Next until you reach the Build screen again. In between steps include changing icons etc which can be left as it is. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_8U4ptmqLjxo/SVtk9CZXS6I/AAAAAAAAAXM/YyuzYQc3Aic/s1600-h/Picture%206%5B4%5D.png"&gt;&lt;img style="border: 0px none ; display: inline;" title="Picture 6" alt="Picture 6" src="http://lh3.ggpht.com/_8U4ptmqLjxo/SVtk_YweQ-I/AAAAAAAAAXQ/8IgOW2KIwJE/Picture%206_thumb%5B2%5D.png?imgmax=800" border="0" height="446" width="500" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;9) Let the tool build the Custom bundle for you, have a drink till then! Store the custom restore file on your machine somewhere. This file will be used to restore the iphone.&lt;br /&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_8U4ptmqLjxo/SVtlAmtwXUI/AAAAAAAAAXU/BrW_qjRmapk/s1600-h/Picture%207%5B4%5D.png"&gt;&lt;img style="border: 0px none ; display: inline;" title="Picture 7" alt="Picture 7" src="http://lh4.ggpht.com/_8U4ptmqLjxo/SVtlCP30XKI/AAAAAAAAAXY/Rv9VNENMbW4/Picture%207_thumb%5B2%5D.png?imgmax=800" border="0" height="446" width="500" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;10) Once complete, you would get a message asking if your iphone was pwned before. Now since we have restored the iphone in the first step with a legal .ipsw file it is not pwned anymore and hence select No. In either case, if your iphone is pwned earlier or not select No in this step, of course assuming step 1 is done. Click Yes has resulted in 1600 error for me at least.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_8U4ptmqLjxo/SVtlDnBXqRI/AAAAAAAAAXc/_L9B4zWIlPw/s1600-h/Picture%208%5B4%5D.png"&gt;&lt;img style="border: 0px none ; display: inline;" title="Picture 8" alt="Picture 8" src="http://lh5.ggpht.com/_8U4ptmqLjxo/SVtlGAd9pSI/AAAAAAAAAXg/lwmOnZhKkjI/Picture%208_thumb%5B2%5D.png?imgmax=800" border="0" height="167" width="381" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;11) Now are the easy steps. Follow the instructions to get the iphone in recovery mode. You can use iTunes to do this but I prefer to use Pwnage. Once you get a message saying successfully in DRU mode or something, the Pwnage tool job is done!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_8U4ptmqLjxo/SVtlHeiUSWI/AAAAAAAAAXk/KyY0mgZXVh4/s1600-h/Picture%2010%5B4%5D.png"&gt;&lt;img style="border: 0px none ; display: inline;" title="Picture 10" alt="Picture 10" src="http://lh6.ggpht.com/_8U4ptmqLjxo/SVtlIpLYPQI/AAAAAAAAAXo/GdJzeoYqu5g/Picture%2010_thumb%5B2%5D.png?imgmax=800" border="0" height="446" width="500" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;12) Now move to iTunes. Since iPhone is in recovery mode, you will get an option of clicking the Restore button on iTunes. Hold Option and click Restore to select the Custom Restore bundle just built by Pwnage tool. &lt;/p&gt;  &lt;p&gt;13) Now its time to sit back and relax. If anything was done wrong, you would get a 1600 error message just after extracting the bundle. This error message is such a piece of s#$$ that it does no help in understanding what the problem was. &lt;/p&gt;  &lt;p&gt;14) I am assuming here that there were no errors till now and the iphone is getting restarted several times with a pineapple logo. &lt;/p&gt;  &lt;p&gt;15) Once everything is done, the iphone will show off its home screen. Insert SIM card now. Restore the iphone with the latest backup you took.&lt;/p&gt;  &lt;p&gt;16) You should have an unlocked iphone with all your data as before!&lt;/p&gt;  &lt;p&gt;I have a feeling that even Apple enjoys playing this “cat and mouse” game with the hackers out there. If you are interested in what the great “Woz” has to say about this please watch this video &lt;a title="http://news.bbc.co.uk/1/hi/programmes/click_online/7742797.stm" href="http://news.bbc.co.uk/1/hi/programmes/click_online/7742797.stm"&gt;http://news.bbc.co.uk/1/hi/programmes/click_online/7742797.stm&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Please let me know if you are stuck with some step. Hail the iphone dev team!!&lt;/p&gt;  &lt;p&gt;Happy unlocking!! Someone's gonna get PWNED!!   &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-4414030886571632882?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/4414030886571632882/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2008/11/unlocking-iphone-2g-safely-and.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/4414030886571632882'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/4414030886571632882'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2008/11/unlocking-iphone-2g-safely-and.html' title='Unlocking iphone 2G safely and correctly'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_8U4ptmqLjxo/SVtkndSOilI/AAAAAAAAAWw/fFgUP1vq4Fk/s72-c/Picture%202_thumb%5B3%5D.png?imgmax=800' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-8576310056442102790</id><published>2008-11-12T11:36:00.001-08:00</published><updated>2008-11-12T11:39:02.894-08:00</updated><title type='text'>Returning to India!</title><content type='html'>&lt;blockquote&gt;   &lt;p&gt;&lt;b&gt;“ Wherever you wander, wherever you roam&amp;#160; &lt;br /&gt;Always remember you are missed back home ”&lt;/b&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Its been a while I wanted to blog about my experience of coming back to my home, India. Living in US was awesome, the time I spent for my Masters, the work I did with an American firm was a lifetime experience. But India was at the back of my mind all the time. When I decided to leave US for good, I was kinda dreading my thought. It is one heck of a big decision in my life. Quite frankly, staying away from home, studying there alone, working there and managing all the day to day things certainly makes us really smarter than before. May be some of us have already had that experience here in India, but I was always in my house during my graduation. I never stayed in a hostel or anything of that kind.Every night after work I used to search for blogs about guys who have already made their move to India. These blogs, and few of my friends who returned to India before me, really helped me make my decision. &lt;/p&gt;  &lt;p&gt;It is really a personal choice whether to stay there or come back. I do not think there is anything unpatriotic about not being in India. But there is certainly a clear difference between the lifestyles. In US you will certainly earn well, of course expense is more but still the savings are more than done here. The work culture in American firms is just awesome. I enjoyed working every day for my company in Chicago. But you miss your family at other end. Being such a rich cultural country you certainly miss the festivals every year. I especially missed Diwali, it being such a vibrant festival :). Of course no need to mention the different cuisines we have here. Food is something Indians love from the bottom of their hearts and I bet there is no single restaurant, atleast in Chicago, which can make the kind of pav bhaji the guy at the corner of the street here in my city makes. If you love spicy fast food, Mumbai is the place to be baby! &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Things that are different here&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Internet Connection&lt;/strong&gt; – Man, I was so much attached to my wireless since I was on my Mac all the time. Blogging, “ Youtube”ing, checking out pubs to hangout etc was a routine for sure. I was using 6Mbps Comcast high speed internet which was awesome. But in India, it is hard to find such luxury since wireless is not that penetrated in people’s lives. I found it really difficult to not use internet as I was using before. But now I use MTNL’s package which is uncharacteristically pretty fast and not really expensive. I brought my Linksys router with me which I use here in my house. So I am cruising on the internet these days. My package allows me to use unlimited internet after midnight which kinda works for me. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Pollution&lt;/strong&gt; – This factor is especially for those returning to Mumbai. Pollution due to traffic has soared like hell. I had sore throat for first few days. I also had a viral infection, may be due to the vada pav I had, which went on for a week. It was just irritating being on bed all the time. After living in US for a while, my resistance power had reduced like anything which actually makes us vulnerable to infections here. But how much ever we complain about infection, fever, pollution blah blah blah, Mumbai is always missed, comon be true to yourself!&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Parents :)&lt;/strong&gt; – Yup, parents. I am currently living with my parents and brother in Mumbai. Let me tell you, after living with friends and doing all kinds of “stuff” in US, it is not very easy to give away all that freedom suddenly. Imagine to stop all that frequent pubbing and playing beer pong and what not. But all this comes with a little reward too. We are pampered like little kids all day. I do not need to do laundry, no need to cook, just get what I want. Uber cool!! &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Job Search&lt;/strong&gt; – This is something everyone would be thinking first before moving to a place after a while.&amp;#160; To be honest, having a Masters on my resume, with some cool projects done on campus, and the work experience really boosts the chances of getting an awesome job here. May be this is obvious to everyone, but having such experience on the resume certainly makes it better than the majority, so you are in a much better position in finding a job you want here. &lt;/p&gt;  &lt;p&gt;There are so many other things to talk about being back home. I really hope this experience of mine would help you make your decision to stay there or come back. Close yourself in your room and talk to yourself about this in front of a mirror. I am sure the only person who can solve this dilemma is the one looking at you. I am sure there will be a million people telling you what to do and what not to do. In my case people settled in US did persuade me in staying back. Finally I did what was in my mind all the time and I do not think my decision is the right decision. As I said, it is a personal choice after all!&lt;/p&gt;  &lt;p&gt;Best of Luck!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-8576310056442102790?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/8576310056442102790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2008/11/returning-to-india.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/8576310056442102790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/8576310056442102790'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2008/11/returning-to-india.html' title='Returning to India!'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-3420188164342368082</id><published>2008-11-11T03:08:00.001-08:00</published><updated>2008-11-11T21:44:04.906-08:00</updated><title type='text'>Recommended Readings</title><content type='html'>&lt;p&gt;I love reading books. I try to add a new book in my collection every 2 weeks or so. It’s just one of those things that I cannot quit until I die. The books I recommend are a mixture of technical and non technical books since I think it’s essential for a developer to be enlightened in all aspects of programming. Being a .NET guy my focus is mostly on C# and ASP.NET. The books are not in any particular order but I have loved reading each and every book in this list.I have provided ebook download links for some of them, go ahead and try downloading them.&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;.NET books&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;1) C# in a nutshell – O’reilly ( For a beginner in C#)&amp;#160; &lt;a href="http://www.ebook3000.com/C--3-0-in-a-Nutshell--A-Desktop-Quick-Reference_8455.html"&gt;Download Here&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;2) CLR via C# – Jeffrey Richter ( For an experienced C# developer, highly recommended to gain in depth knowledge of the .NET runtime.)&lt;/p&gt;  &lt;p&gt;3) Professional ASP.NET – Evjen, Hanselman, Rader ( A must have reference book for ASP.NET)&lt;/p&gt;  &lt;p&gt;4) Essential ASP.NET – Fritz Onion&amp;#160; (Must have book for clearing concepts in ASP.NET)&lt;/p&gt;  &lt;p&gt;5) Essential ASP.NET with examples in C# – Fritz Onion (Must have book for clearing concepts in ASP.NET)&amp;#160; &lt;a href="http://knowfree.net/2007/11/12/essential-aspnet-with-examples-in-c-2.kf"&gt;Download Here&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;6) ASP.NET Ajax in Action – Gallo, Barkol, Vavilala ( Great book for beginner and experienced in ASP.NET Ajax framework)&amp;#160; &lt;a href="http://www.free-ebooks-download.org/free-ebook/dotnet/AJAX/ASP-NET-AJAX-in-Action.php"&gt;Download Here&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;7) Windows Presentation Foundation Unleashed – Adam Nathan ( I think it is the bible for WPF developers)&amp;#160; &lt;a href="http://www.free-ebooks-download.org/free-ebook/dotnet/Framework/windows_presentation_foundation_unleashed.php"&gt;Download Here&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;8) ASP.NET 2.0&amp;#160; Website programming – Marco Bellinaso ( Good ASP.NET book with a practical project example in the book)&amp;#160;&amp;#160; &lt;a href="http://www.free-ebooks-download.org/free-ebook/dotnet/ASP.NET/asp-net-2-0-website-programming-problem-design-solution.php"&gt;Download here&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;General Programming books&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;1) Introduction to Algorithms – Thomas Cormen ( Must have book to refresh algorithm knowledge if preparing for interviews :))&lt;/p&gt;  &lt;p&gt;2) The Algorithm Design Manual – Steven Skeina ( Good book with examples on algorithm applications)&lt;/p&gt;  &lt;p&gt;3) Head First Design Patterns – Freeman and Freeman ( My favourite book on design patterns, fun and work approach to teach design patterns, highly recommended for beginners to intermediate)&lt;/p&gt;  &lt;p&gt;4) Design Patterns , Elements of reusable object oriented software – Gamma, Helm, johnson, Vlissides&amp;#160; ( The bible for design patterns, although go through the head first book before reading this book, thats my personal experience though).&lt;/p&gt;  &lt;p&gt;5) Code Complete – Steve McConnell ( &lt;strong&gt;My favourite book&lt;/strong&gt;, a must have book for every developer on this planet!)&lt;/p&gt;  &lt;p&gt;6) Rapid development, Taming wild software schedules – Steve McConnell ( An excellent book for good development practices)&amp;#160; &lt;a href="http://rapidlibrary.com/index.php?q=rapid+development+aplication"&gt;Download Here&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;7) A pragmatic programmer – ( A must have book for those who wanna be better programmers)&amp;#160; &lt;a href="http://freebookshare.com/the-pragmatic-programmer-from-journeyman-to-master.html"&gt;Download Here&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;8) Programming Interviews exposed ( A nice book for preparing for interviews with companies like Microsoft).&lt;/p&gt;  &lt;p&gt;9) Thinkertoys ( A nice book on creative thinking)&lt;/p&gt;  &lt;p&gt;Some of these books have been taken from recommended reading sections of the blogs I follow.&amp;#160; I can assure that all of these books have been “tested OK” by many important guys in the programming world. So go ahead and read them!&lt;/p&gt;  &lt;p&gt;Happy programming!!&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;&amp;#160;&lt;/font&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-3420188164342368082?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/3420188164342368082/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2008/11/recommended-readings.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/3420188164342368082'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/3420188164342368082'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2008/11/recommended-readings.html' title='Recommended Readings'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-691571881711171111</id><published>2008-11-09T22:57:00.000-08:00</published><updated>2008-11-09T22:59:35.798-08:00</updated><title type='text'>Iphone like unlock screen</title><content type='html'>Frankly speaking since WPF was introduced every thing I do I feel its an animation!!&lt;br /&gt; I used Kevin's (A guy who worked with me in my earlier company) Kinetic scrolling in my card game to display player names which was cool. I also used similar model to create a iphone like slider(the one which is used to unlock iphone).&lt;br /&gt;Following is an excerpt from the code. Other events are similar to Kevin's scrolling example.&lt;br /&gt;Here the endposition is the x coordinate of the rectangle which contains the sliding canvas.&lt;br /&gt;&lt;br /&gt;protected override void OnPreviewMouseMove(MouseEventArgs e)&lt;br /&gt; {&lt;br /&gt;   if (slidecanvas.IsMouseCaptured)&lt;br /&gt;    {                           &lt;br /&gt;                end = e.GetPosition(this);&lt;br /&gt;                if (end.X &gt;= endposition)&lt;br /&gt;                {&lt;br /&gt;                    slidecanvas.ReleaseMouseCapture();&lt;br /&gt;                    story1.Begin(this);&lt;br /&gt;                    return;&lt;br /&gt;                }&lt;br /&gt;&lt;br /&gt;                double diff = end.X - start.X;&lt;br /&gt;                if (diff &gt; 0)&lt;br /&gt;                {                  &lt;br /&gt;                    TimeSpan time = etime - stime;&lt;br /&gt;                    story = (Storyboard)FindResource("Timeline2");&lt;br /&gt;                    DoubleAnimation anim = (DoubleAnimation)story.Children[0];&lt;br /&gt;                    anim.To = start.X + diff;&lt;br /&gt;                    anim.Duration = time;                   &lt;br /&gt;                    story.Begin(this);&lt;br /&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/4417875739806963199-691571881711171111?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/691571881711171111/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2008/11/frankly-speaking-since-wpf-was.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/691571881711171111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/691571881711171111'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2008/11/frankly-speaking-since-wpf-was.html' title='Iphone like unlock screen'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-332009325748162540</id><published>2008-11-09T22:56:00.000-08:00</published><updated>2008-11-09T22:57:10.624-08:00</updated><title type='text'>WPF Basics</title><content type='html'>Recently I have been working part time on a card game (simplified version of poker) using WPF. I had built some 2D games using Windows forms earlier but let me tell you, WPF is picture perfect for such applications. I have used Expression Blend for designing the game and Visual Studio 2008 for the code behind logic. (That’s a killer combination!). I would point out some important things which I feel WPF beginners would face while building a 2D game.&lt;br /&gt;&lt;br /&gt;WPF Animation in code-behind&lt;br /&gt;&lt;br /&gt; A 2D game made in WPF with no animation is hard to imagine to me. Expression Blend facilitates with hooking up events to a particular timeline(animation) created.  But several times we might need to animate things in the code-behind. Here is a way to do it which I use a lot of times in my code.&lt;br /&gt;&lt;br /&gt;   C#&lt;br /&gt;&lt;br /&gt;   Storyboard story1 = (Storyboard)FindResource([key]);&lt;br /&gt;&lt;br /&gt;   Story1.Begin(this);&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;That was easy.  &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Mixing Windows forms with WPF forms.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Since I had few windows forms developed earlier which would be useful in this game, I thought of starting the application with a already existing windows form. This is not that difficult. A WPF application starts from the Main function located in the App.g.cs file (if C# environment) which is at the path projectrootdir/ obj/Debug. This Main function instantiates an object of class App,which is inherited from Application class, and runs it. The App.xaml file contains a StartupUri property to set the start form. Remove that property and a set an eventhandler for the Startup event of App class. In this event handler one can instantiate a form object as needed.  The Application xaml tag looks somewhat like this:&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;Application x:Class="MiniPoker.App"&lt;br /&gt;&lt;br /&gt;    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;br /&gt;&lt;br /&gt;    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&lt;br /&gt;&lt;br /&gt;    Startup="Application_Startup"&gt;&lt;br /&gt;&lt;br /&gt;     &lt;Application.Resources&gt;&lt;br /&gt;&lt;br /&gt;      &lt;br /&gt;&lt;br /&gt;    &lt;/Application.Resources&gt;   &lt;br /&gt;&lt;br /&gt;&lt;/Application&gt;&lt;br /&gt;&lt;br /&gt;I will be continuing this blog in later posts diggin into more complex parts. Be in touch.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-332009325748162540?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/332009325748162540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2008/11/wpf-basics.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/332009325748162540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/332009325748162540'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2008/11/wpf-basics.html' title='WPF Basics'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-9051606313688766257</id><published>2008-11-09T22:53:00.000-08:00</published><updated>2008-11-09T22:55:59.790-08:00</updated><title type='text'>Some cool stuff!</title><content type='html'>I am working on building a website consisting of some “cool stuff” using some of the Microsoft features like Silverlight and ASP.NET Ajax. I have pretty simple but handy chat on the web using update panel control. I think with the same structure multiple chat rooms can be built. I also made a customized listbox in Silverlight. The listbox can be modified as you want just by putting in some extra code.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Custom Silverlight ListBox&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I have used the Listbox control provided in the Silverlight.Samples.Controls.dll which is located in the Silverlight 1.1 installation directory. The complete path might look like this&lt;br /&gt;&lt;br /&gt;C:\Program Files\Microsoft Silverlight 1.1 SDK Alpha Refresh Sept 2007\Tools\SilverlightControlsStarterKit\SilverlightUIControls\ClientBin&lt;br /&gt;&lt;br /&gt;To get this path, you would have to build the project file in the directory. Sometimes Visual studio does not allow to reference a dll which is hidden under many diectories. If you add a reference to such a dll you might get an error like the reference path is too long. So copy the dll into your project Bin directory and then add a reference to it. There is a small bug in this Listbox control which was mentioned and fixed as per Vivek Dalvi’s blog. Find the UpdateLayout function in the Listbox.cs file and locate the&lt;br /&gt;&lt;br /&gt;Clip = clip;&lt;br /&gt;&lt;br /&gt;statement. Replace this by ActualControl.Clip = clip; That’s it. I should have told you this before asking you to reference the dll :).&lt;br /&gt;&lt;br /&gt;Now is the time to create items which could be added. The ListBox.Items.Add accepts parameter of FrameworkElement. So the default xaml controls could be added to it but I have not tried all of them. I created a custom control to be added as an item to the listbox. I wanted to display textblocks with rounded corners inside this listbox.  To begin with add a Usercontrol item to a Silverlight project. You could see in its code-behind a class inheriting from Control class is generated and some logic in its contructor. Observer the first line.&lt;br /&gt;&lt;br /&gt;Stream s = this.GetType().Assembly.GetManifestResourceStream("Silverlightanim.BlogItem.xaml");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To successfully run the GetManifestResourceStream function the item which is given in the string must be marked as an Embedded Resource. If not, you might not get an error but it is just not executed. Following is the xaml code for the BlogItem which I add in the listbox.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Its really nothing heavy, its just has a rectangle with rounded corners and a textblock . Following is the code-behind file.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;namespace Silverlightanim&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;  public class BlogItem : Control&lt;br /&gt;&lt;br /&gt;  {&lt;br /&gt;&lt;br /&gt;      Canvas rootCanvas;&lt;br /&gt;&lt;br /&gt;      TextBlock block;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      public BlogItem()&lt;br /&gt;&lt;br /&gt;      {&lt;br /&gt;&lt;br /&gt;          Stream s = this.GetType().Assembly.GetManifestResourceStream("Silverlightanim.BlogItem.xaml");&lt;br /&gt;&lt;br /&gt;          rootCanvas = (Canvas)this.InitializeFromXaml(new StreamReader(s).ReadToEnd());&lt;br /&gt;&lt;br /&gt;          block = (TextBlock)rootCanvas.FindName("content");&lt;br /&gt;&lt;br /&gt;          this.Height = rootCanvas.Height;&lt;br /&gt;&lt;br /&gt;          this.Width = rootCanvas.Width;         &lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;          &lt;br /&gt;&lt;br /&gt;      public string BlogContent&lt;br /&gt;&lt;br /&gt;      {&lt;br /&gt;&lt;br /&gt;          get&lt;br /&gt;&lt;br /&gt;          {&lt;br /&gt;&lt;br /&gt;              return block.Text;&lt;br /&gt;&lt;br /&gt;          }&lt;br /&gt;&lt;br /&gt;          set&lt;br /&gt;&lt;br /&gt;          {&lt;br /&gt;&lt;br /&gt;              block.Text = value;&lt;br /&gt;&lt;br /&gt;          }&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;As you see a public property has been declared which sets the text property of the textblock.&lt;br /&gt;&lt;br /&gt;Now the final act of using the listbox and this blog item control on a silverlight page. For my project I am getting the data from an xml file which makes it easier to maintain later. Here is a sample xml file&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;?&lt;/span&gt;&lt;span&gt;xml&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;version&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;"&lt;span&gt;1.0&lt;/span&gt;"&lt;span&gt; &lt;/span&gt;&lt;span&gt;encoding&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;"&lt;span&gt;utf-8&lt;/span&gt;"&lt;span&gt; ?&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;&lt;/span&gt;&lt;span&gt;ContentList&lt;/span&gt;&lt;span&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;  &lt;/span&gt;&lt;&lt;/span&gt;&lt;span&gt;Block&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Content&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;"Hey John&lt;span&gt;!!&lt;/span&gt;"&lt;span&gt;&gt;&lt;/&lt;/span&gt;&lt;span&gt;Block&lt;/span&gt;&lt;span&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;  &lt;/span&gt;&lt;&lt;/span&gt;&lt;span&gt;Block&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Content&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;"Hey Jerry&lt;span&gt;!!&lt;/span&gt;"&lt;span&gt;&gt;&lt;/&lt;/span&gt;&lt;span&gt;Block&lt;/span&gt;&lt;span&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;  &lt;/span&gt;&lt;&lt;/span&gt;&lt;span&gt;Block&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Content&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;"Hey Nick&lt;span&gt;!!&lt;/span&gt;"&lt;span&gt;&gt;&lt;/&lt;/span&gt;&lt;span&gt;Block&lt;/span&gt;&lt;span&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;  &lt;/span&gt;&lt;&lt;/span&gt;&lt;span&gt;Block&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Content&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;"Hey Peter&lt;span&gt;!!&lt;/span&gt;"&lt;span&gt;&gt;&lt;/&lt;/span&gt;&lt;span&gt;Block&lt;/span&gt;&lt;span&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;  &lt;/span&gt;&lt;&lt;/span&gt;&lt;span&gt;Block&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Content&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;"&lt;span&gt;Hey Charlie!!&lt;/span&gt;"&lt;span&gt;&gt;&lt;/&lt;/span&gt;&lt;span&gt;Block&lt;/span&gt;&lt;span&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;/&lt;/span&gt;&lt;span&gt;ContentList&lt;/span&gt;&lt;span&gt;&gt;&lt;/span&gt;&lt;/p&gt;&lt;contentlist&gt;&lt;br /&gt;&lt;block content="Hey John!!"&gt;&lt;/block&gt;&lt;/contentlist&gt;&lt;br /&gt;I would not go in detail explaination for the following code since its all obvious. It is the code-behind for the Page.xaml file.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Using Silverlight.Samples.Controls;&lt;br /&gt;&lt;br /&gt;ListBox list;&lt;br /&gt;&lt;br /&gt;public void Page_Loaded(object o, EventArgs e)&lt;br /&gt;&lt;br /&gt;      {&lt;br /&gt;&lt;br /&gt;          // Required to initialize variables&lt;br /&gt;&lt;br /&gt;          InitializeComponent();         &lt;br /&gt;&lt;br /&gt;       &lt;br /&gt;&lt;br /&gt;          InitializeList();&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void InitializeList()&lt;br /&gt;&lt;br /&gt;      {&lt;br /&gt;&lt;br /&gt;          System.IO.Stream str = this.GetType().Assembly.GetManifestResourceStream("Silverlightanim.Data.xml");&lt;br /&gt;&lt;br /&gt;          //Initialize Listbox&lt;br /&gt;&lt;br /&gt;          list = (ListBox)this.FindName("listbox");         &lt;br /&gt;&lt;br /&gt;          XmlReader xr = XmlReader.Create(str);         &lt;br /&gt;&lt;br /&gt;          while (xr.Read())&lt;br /&gt;&lt;br /&gt;          {&lt;br /&gt;&lt;br /&gt;              if (xr.IsStartElement("Block"))&lt;br /&gt;&lt;br /&gt;              {&lt;br /&gt;&lt;br /&gt;                  BlogItem item = new BlogItem();&lt;br /&gt;&lt;br /&gt;                  item.BlogContent = xr.GetAttribute("Content");&lt;br /&gt;&lt;br /&gt;                  list.Items.Add(item);&lt;br /&gt;&lt;br /&gt;              }&lt;br /&gt;&lt;br /&gt;          }&lt;br /&gt;&lt;br /&gt;       &lt;br /&gt;&lt;br /&gt;          list.UpdateItems();&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Make sure that the xml file is marked as an Embedded Resource and give its complete resource name i.e. namespace.Data.xml  for the GetManifestResourceStream function to work. You might have to adjust the width and height properties of the listbox to fit in the items.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-9051606313688766257?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/9051606313688766257/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2008/11/some-cool-stuff.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/9051606313688766257'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/9051606313688766257'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2008/11/some-cool-stuff.html' title='Some cool stuff!'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-1752047312197698036</id><published>2008-11-09T22:47:00.000-08:00</published><updated>2008-11-09T22:52:44.096-08:00</updated><title type='text'>Ajaxifying the Web</title><content type='html'>Web based Chat with Ajax&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Having a little chat window with a list of friends connected in the chat room is awesome! But the important thing is it should not be at the expense of the overall performance of the website. I created a website with other silverlight stuff on it and this Chat area as a side thing. I have used the ASP.NET Ajax framework which is pretty simple to use.&lt;br /&gt;&lt;br /&gt;Follow the steps and at the end you would be enjoying a chat area on a web page.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step1 : Creating the Chatter List&lt;br /&gt;&lt;br /&gt;Drag a Script Manager on an ASP.NET page. If you create an ASP.NET Futures website, a script manager is already present.&lt;br /&gt;&lt;br /&gt;Drag an UpdatePanel  on the page and name it,say, chatterUpdatePanel. Drag a ASP.NET listbox control in the Update Panel. Behind the scenes a contenttemplate tag is created under the Update Panel. This is the area for the chatter names which will get update asynchronously.&lt;br /&gt;&lt;br /&gt;I thought of having some basic authentication required before chatting. So I created a username and password textbox and a Sign In button outside the Update Panel. The click event of the Signin button must update the chatter listbox. To do this we need to specify a trigger to the update panel.&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;&lt;/span&gt;&lt;span&gt;asp&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;UpdatePanel&lt;/span&gt;&lt;span&gt; &lt;span&gt;ID&lt;/span&gt;&lt;span&gt;="chatterUpdatePanel"&lt;/span&gt; &lt;span&gt;UpdateMode&lt;/span&gt;&lt;span&gt;="Conditional"&lt;/span&gt; &lt;span&gt;runat&lt;/span&gt;&lt;span&gt;="server"&gt;&lt;/span&gt;&lt;span&gt;             &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;                  &lt;/span&gt;&lt;span&gt;&lt;&lt;/span&gt;&lt;span&gt;ContentTemplate&lt;/span&gt;&lt;span&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;                  &lt;/span&gt;&lt;span&gt;&lt;&lt;/span&gt;&lt;span&gt;div&lt;/span&gt; &lt;span&gt;id&lt;/span&gt;&lt;span&gt;='hello'&lt;/span&gt; &lt;span&gt;style&lt;/span&gt;&lt;span&gt;="&lt;/span&gt;&lt;span&gt;overflow&lt;/span&gt;:&lt;span&gt;auto&lt;/span&gt;;&lt;span&gt;width&lt;/span&gt;:&lt;span&gt;146px"&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;span&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;                      &lt;/span&gt;&lt;span&gt;&lt;&lt;/span&gt;&lt;span&gt;asp&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;ListBox&lt;/span&gt; &lt;span&gt;ID&lt;/span&gt;&lt;span&gt;="listChatters"&lt;/span&gt; &lt;span&gt;runat&lt;/span&gt;&lt;span&gt;="server"&lt;/span&gt; &lt;span&gt;Height&lt;/span&gt;&lt;span&gt;="180px"&lt;/span&gt; &lt;span&gt;Width&lt;/span&gt;&lt;span&gt;="200px"&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;                          &lt;/span&gt;&lt;span&gt;BackColor&lt;/span&gt;&lt;span&gt;="White"&lt;/span&gt; &lt;span&gt;Font-Names&lt;/span&gt;&lt;span&gt;="Verdana"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;                      &lt;/span&gt;&lt;span&gt;&lt;/&lt;/span&gt;&lt;span&gt;asp&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;ListBox&lt;/span&gt;&lt;span&gt;&gt;&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span&gt;&lt;/&lt;/span&gt;&lt;span&gt;div&lt;/span&gt;&lt;span&gt;&gt;&lt;/span&gt;&lt;span&gt;                                                                                                                                                           &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;                  &lt;/span&gt;&lt;span&gt;&lt;/&lt;/span&gt;&lt;span&gt;ContentTemplate&lt;/span&gt;&lt;span&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;    &lt;/span&gt;&lt;span&gt;              &lt;/span&gt;&lt;span&gt;&lt;&lt;/span&gt;&lt;span&gt;Triggers&lt;/span&gt;&lt;span&gt;&gt;&lt;/span&gt;&lt;span&gt;                &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;                  &lt;/span&gt;&lt;span&gt;&lt;&lt;/span&gt;&lt;span&gt;asp&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;AsyncPostBackTrigger&lt;/span&gt; &lt;span&gt;ControlID&lt;/span&gt;&lt;span&gt;="ChatterTimer"&lt;/span&gt; &lt;span&gt;EventName&lt;/span&gt;&lt;span&gt;="Tick"&lt;/span&gt; &lt;span&gt;/&gt;&lt;/span&gt;&lt;span&gt;     &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;                  &lt;/span&gt;&lt;span&gt;&lt;&lt;/span&gt;&lt;span&gt;asp&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;AsyncPostBackTrigger&lt;/span&gt; &lt;span&gt;ControlID&lt;/span&gt;&lt;span&gt;="signin"&lt;/span&gt; &lt;span&gt;EventName&lt;/span&gt;&lt;span&gt;="Click"&lt;/span&gt;&lt;span&gt;/&gt;&lt;/span&gt;&lt;span&gt;                                                                                            &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;                  &lt;/span&gt;&lt;span&gt;&lt;/&lt;/span&gt;&lt;span&gt;Triggers&lt;/span&gt;&lt;span&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;            &lt;/span&gt;&lt;span&gt;&lt;/&lt;/span&gt;&lt;span&gt;asp&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;UpdatePanel&lt;/span&gt;&lt;span&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;The signin controlID is the Sign In button I used for signing in users. You can see another trigger with the control ID of ChatterTimer. Now if some friend of yours signs in at his house, everyone needs to know he signed in so I update the chatter listbox every 10 seconds. For this drag a ASP.NET Timer control on the page outside the update panel. Add a Async trigger to the chatterupdate panel with the event name as “Tick”. Thus every 10 seconds the listbox is updated without refreshing the whole page.&lt;span&gt;  &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Step 2 : Creating the Messages Listbox&lt;span&gt;  &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;To display messages that are being sent, I use a listbox control. This listbox has to be updated independently of the Chatterlistbox. For this drag another Update Panel on the page and add a listbox in it. Call it say MessagesUpdatePanel. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;There has to be an area where a chatter can type his statements and send them. I created a textbox and a button “Send” under the messages listbox. Make sure these two controls are outside the MessagesUpdatePanel. Add an async trigger to this update panel with controlid of&lt;span&gt;  &lt;/span&gt;the Send button and the event name as Click. Also since the messages come more frequently an update is required in a lesser interval. So drag a timer control and assign interval of 1 second and add an async trigger to the MessagesUpdatePanel with the control id of this timer control and event name “Tick” as follows:&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;&lt;/span&gt;&lt;span&gt;asp&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;UpdatePanel&lt;/span&gt;&lt;span&gt; &lt;span&gt;ID&lt;/span&gt;&lt;span&gt;="messagesUpdatePanel"&lt;/span&gt; &lt;span&gt;UpdateMode&lt;/span&gt;&lt;span&gt;="Conditional"&lt;/span&gt; &lt;span&gt;runat&lt;/span&gt;&lt;span&gt;="server"&gt;&lt;/span&gt;&lt;span&gt;             &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;              &lt;/span&gt;&lt;span&gt;&lt;&lt;/span&gt;&lt;span&gt;ContentTemplate&lt;/span&gt;&lt;span&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;              &lt;/span&gt;&lt;span&gt;&lt;&lt;/span&gt;&lt;span&gt;asp&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;Label&lt;/span&gt; &lt;span&gt;runat&lt;/span&gt;&lt;span&gt;="server"&lt;/span&gt; &lt;span&gt;Text&lt;/span&gt;&lt;span&gt;=""&lt;/span&gt; &lt;span&gt;ID&lt;/span&gt;&lt;span&gt;="labelWelcome"&lt;/span&gt; &lt;span&gt;ForeColor&lt;/span&gt;&lt;span&gt;="#006699"&gt;&lt;/&lt;/span&gt;&lt;span&gt;asp&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;Label&lt;/span&gt;&lt;span&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;                  &lt;/span&gt;&lt;span&gt;&lt;&lt;/span&gt;&lt;span&gt;asp&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;ListBox&lt;/span&gt; &lt;span&gt;ID&lt;/span&gt;&lt;span&gt;="listMessages"&lt;/span&gt; &lt;span&gt;runat&lt;/span&gt;&lt;span&gt;="server"&lt;/span&gt; &lt;span&gt;Height&lt;/span&gt;&lt;span&gt;="280px"&lt;/span&gt; &lt;span&gt;Width&lt;/span&gt;&lt;span&gt;="392px"&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;                      &lt;/span&gt;&lt;span&gt;BackColor&lt;/span&gt;&lt;span&gt;="Black"&lt;/span&gt; &lt;span&gt;ForeColor&lt;/span&gt;&lt;span&gt;="limegreen"&lt;/span&gt; &lt;span&gt;Font-Names&lt;/span&gt;&lt;span&gt;="Verdana"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;                  &lt;/span&gt;&lt;span&gt;&lt;/&lt;/span&gt;&lt;span&gt;asp&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;ListBox&lt;/span&gt;&lt;span&gt;&gt;&lt;/span&gt;&lt;span&gt;                                                                                                 &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;              &lt;/span&gt;&lt;span&gt;&lt;/&lt;/span&gt;&lt;span&gt;ContentTemplate&lt;/span&gt;&lt;span&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;              &lt;/span&gt;&lt;span&gt;&lt;&lt;/span&gt;&lt;span&gt;Triggers&lt;/span&gt;&lt;span&gt;&gt;&lt;/span&gt;&lt;span&gt;               &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;              &lt;/span&gt;&lt;span&gt;&lt;&lt;/span&gt;&lt;span&gt;asp&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;AsyncPostBackTrigger&lt;/span&gt; &lt;span&gt;ControlID&lt;/span&gt;&lt;span&gt;="sendButton"&lt;/span&gt; &lt;span&gt;EventName&lt;/span&gt;&lt;span&gt;="Click"&lt;/span&gt; &lt;span&gt;/&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;             &lt;/span&gt;&lt;span&gt;&lt;&lt;/span&gt;&lt;span&gt;asp&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;AsyncPostBackTrigger&lt;/span&gt; &lt;span&gt;ControlID&lt;/span&gt;&lt;span&gt;="ChatTextTimer"&lt;/span&gt; &lt;span&gt;EventName&lt;/span&gt;&lt;span&gt;="Tick"&lt;/span&gt; &lt;span&gt;/&gt;&lt;/span&gt;&lt;span&gt;               &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;              &lt;/span&gt;&lt;span&gt;&lt;/&lt;/span&gt;&lt;span&gt;Triggers&lt;/span&gt;&lt;span&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;             &lt;/span&gt;&lt;span&gt;&lt;/&lt;/span&gt;&lt;span&gt;asp&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;UpdatePanel&lt;/span&gt;&lt;span&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span&gt; &lt;/span&gt;Please be aware that the textbox which would be used to type statements must be outside the update panel since we do now want to update anything in it.&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Step 3 : Storing chat data.&lt;span&gt;             &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Now since we have the desig ready we need to have a way to store the chatters which have valid accounts. Also for my website I display the latest 10 messages in the messages listbox just for the heck of it I think :).&lt;span&gt;  &lt;/span&gt;I added a Global.asax file&lt;span&gt;  &lt;/span&gt;to my project to manage application level data. I have created a List&lt;&gt; of chatters in the global.asax.cs file as follows:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;List&lt;/span&gt;&lt;span&gt;&lt;&lt;span&gt;Users&lt;/span&gt;&gt; chatters = &lt;span&gt;new&lt;/span&gt; &lt;span&gt;List&lt;/span&gt;&lt;&lt;span&gt;Users&lt;/span&gt;&gt;()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;        &lt;/span&gt;&lt;span&gt;List&lt;/span&gt;&lt;&lt;span&gt;string&lt;/span&gt;&gt; messages = &lt;span&gt;new&lt;/span&gt; &lt;span&gt;List&lt;/span&gt;&lt;&lt;span&gt;string&lt;/span&gt;&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;In the Application_Start event I do the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;Application.Add(&lt;span&gt;"chatters"&lt;/span&gt;, chatters);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;            &lt;/span&gt;Application.Add(&lt;span&gt;"chats"&lt;/span&gt;, messages);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;Now since the Application object can be accessed in the Page too, I add any user which is created on the site into this list. Also as a messages is sent I add it in the messages list. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;In the Page_Load event I load the chatters and the messages in the respective listboxes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;Following is a simple way to display List items in a listbox&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;List&lt;/span&gt;&lt;span&gt;&lt;&lt;span&gt;string&lt;/span&gt;&gt; messgs = (&lt;span&gt;List&lt;/span&gt;&lt;&lt;span&gt;string&lt;/span&gt;&gt;)Application[&lt;span&gt;"chats"&lt;/span&gt;];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;            &lt;/span&gt;listMessages.DataSource = messgs;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;            &lt;/span&gt;listMessages.DataBind();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;span&gt;Similar procedure can be followed for chatter listbox too. &lt;/span&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/4417875739806963199-1752047312197698036?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/1752047312197698036/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2008/11/ajaxifying-web.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/1752047312197698036'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/1752047312197698036'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2008/11/ajaxifying-web.html' title='Ajaxifying the Web'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-7865960929647430953</id><published>2008-11-09T22:46:00.000-08:00</published><updated>2008-11-09T22:47:12.660-08:00</updated><title type='text'>Integrating Windows Live Authentication in your Website</title><content type='html'>&lt;p class="MsoNormal"&gt;This week Microsoft launched Windows Live Tools for Visual Studio 2008 and Visual Web Developer Express. Its been an exciting experience for me to work on this project. Since I worked on these controls, I thought of sharing my ideas with you about effectively using these controls in your website. I would specifically focus on IDLogin and IDLoginView controls. &lt;/p&gt; &lt;br /&gt;&lt;p class="MsoListParagraphCxSpFirst"&gt;&lt;span&gt;&lt;span&gt;1)&lt;span&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Download the Windows Live Tools installer from &lt;a href="http://dev.live.com/tools/"&gt;here&lt;/a&gt;. The dll’s are installed in Program Files/Windows Live Tools/ directory. Once installed a new tab of Windows Live Tools is created in the Visual Studio toolbox which contains the Live controls.&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoListParagraphCxSpFirst"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoListParagraphCxSpFirst"&gt;Design View errors in visual studio&lt;/p&gt;&lt;p class="MsoListParagraphCxSpFirst"&gt;Since Visual Studio 2008 is in beta stage there might be different experiences depending on the configuration of the machines. For some reason if you have problems seeing these controls in the toolbox or there is an error in the design view saying error creating control or something like that, close the IDE, open the visual studio command prompt and issue a command devenv /setup. This will reset IDE environment and possible get rid of the errors.&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpLast"&gt;&lt;span&gt;&lt;span&gt;2)&lt;span&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Open Visual Studio 2008 and click New Website. Here you would find a new website template called ASP.NET Windows Live Website. This template has all necessary settings for running Windows Live controls on a page. If you don’t want to use this template for some reason, make sure you have necessary settings on your existing website before using the controls.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;For IDLogin control first add a Script Manager to the page since the IDLogin control is an Ajax server control and uses an Update Panel internally to do asynchronous postbacks. IDLoginView has to specific requirements. For specific requirements for Silverlight Media&lt;span&gt;  &lt;/span&gt;and Contacts control please refer to the Live website &lt;a href="http://dev.live.com/tools/"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Using IDLogin for Windows Live Authentication&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This control can be used to authenticate users with their Windows Live ID account. This account is same account used for passport authentication.&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Drag the IDLogin control on the page. This control needs a Live Application ID and Secret Key. To get this, click the action list button (little arrow button)on right top control of the control in the designer view.&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Click the Create new Application ID link which opens a browser control. Click register an application and fill the details. After submitting those details an Application ID is provided by Windows Live which is unique to your application. Escape key closes the window.&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;The new Application ID and Secret is stored in an Appsettings section in your web.config file. The control uses this section all the time to authenticate your application so do not delete this section.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;If you already have a registered application, paste the Application ID in the value field for wll_appid key and Secret in the value field for the wll_secret key. Save the Web.config file. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;The control is ready to go live :). Run the website, a SignIn link is displayed on the page which when clicked takes the user to the Windows Live login page.&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;The control supports two client side events as OnClientSignIn and OnClientSignOut and two server side evens OnServerSignIn and OnServerSignOut. Further information about these events can be found &lt;a href="http://dev.live.com/tools/idloginapi.aspx"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Important points to remember:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;After Windows Live redirects to the return url you provided, the IDLogin control performs a redirect to itself. This is done to avoid firing of the sign in and sign out events every time a page refresh is done by the user. Thus you need to be aware of this fact that a redierct is happening because of the control which you might want to handle in your code. Ill post more such points if I come across while I continue working on them.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Make sure you read the Known Issues section on this &lt;a href="https://connect.microsoft.com/content/content.aspx?ContentID=6803&amp;amp;SiteID=505"&gt;link&lt;/a&gt;. These issues would be resolved in later releases of the controls.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;In the next post I will show how to use IDLogin and IDLoginView control to effectively use ASP.NET membership account and Windows Live account and create associations between them.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-7865960929647430953?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/7865960929647430953/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2008/11/integrating-windows-live-authentication.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/7865960929647430953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/7865960929647430953'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2008/11/integrating-windows-live-authentication.html' title='Integrating Windows Live Authentication in your Website'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-5120073188449727247</id><published>2008-11-09T22:43:00.000-08:00</published><updated>2008-11-09T22:45:56.487-08:00</updated><title type='text'>Custom Powershell Cmdlets</title><content type='html'>&lt;p&gt;&lt;span style="font-size:85%;"&gt;Command line tools have always been my favorite, whether its a linux box or a windows machine. Its way cooler!! (don't know why). I use Powershell on Windows Vista and I really like for the fact that its designed in .NET environment which makes it easy to extend as you want. I am assuming you have basic information about Cmdlet and Snap-In classes for Powershell. If not, please refer to the the documentation which comes with Powershell installation. &lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:85%;"&gt;I wanted a simple program to run in Powershell to display the temperature given the zipcode. I am going to show you how easy it is to add a new command in Powershell. A command like dir, ls etc. is called as a Cmdlet in Powershell. To use a new command in Powershell you need to do the following:&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:85%;"&gt;1) Create a .NET class which inherites from PSCmdlet. Add the functionality as required. This will be the custom Cmdlet class.&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:85%;"&gt;2) Create a new class in same namespace as the above class. The base class for this class should be PSSnapIn. This will be the custom Snap In class which is required to insert any Cmdlet in Powershell.  &lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:85%;"&gt;3) Register the Cmdlet using the SnapIn class we created. &lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:85%;"&gt;That's it!!&lt;/span&gt;&lt;/p&gt;    &lt;p&gt;&lt;span style="font-size:85%;"&gt;Creating a Custom Cmdlet class&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:85%;"&gt;Nothing makes it more clear than a piece of code right. Here it goes!&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;using System.Management.Automation;   &lt;br /&gt;using System.Management.Automation.Provider;&lt;/p&gt;  &lt;p&gt;[Cmdlet(VerbsCommon.Get,"temp")]   &lt;br /&gt;    public class TempCmdlet : PSCmdlet    &lt;br /&gt;    {    &lt;br /&gt;        private string zip="60606";    &lt;br /&gt;        [Parameter(Mandatory=false,Position=0)] &lt;br /&gt;        public string ZipCode    &lt;br /&gt;        {    &lt;br /&gt;            get    &lt;br /&gt;            {    &lt;br /&gt;                return zip;    &lt;br /&gt;            }    &lt;br /&gt;            set    &lt;br /&gt;            {    &lt;br /&gt;                zip = value;    &lt;br /&gt;            }    &lt;br /&gt;        } &lt;/p&gt;  &lt;p&gt;        public object[] GetData()   &lt;br /&gt;        {           &lt;br /&gt;            Service1 service = new Service1();           &lt;br /&gt;            object[] data = service.GetWeather(ZipCode);    &lt;br /&gt;                return data;    &lt;br /&gt;        } &lt;/p&gt;  &lt;p&gt;        protected override void ProcessRecord()   &lt;br /&gt;        {           &lt;br /&gt;            object[] data = GetData();    &lt;br /&gt;            if (data.Length == 3)    &lt;br /&gt;            {    &lt;br /&gt;                WriteObject("Location : " + data[0].ToString());    &lt;br /&gt;                WriteObject("Condition : " + data[1].ToString());    &lt;br /&gt;                WriteObject("Temperature : " + data[2].ToString()+ " F");    &lt;br /&gt;            }         &lt;br /&gt;        }    &lt;br /&gt;    }&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:85%;"&gt;This is my custom Cmdlet class. Observe the attribute to the class. This attribute shows that the command I would issue at the prompt would be Get-temp. The first part has to be a predefined verb in the VerbsCommon definition. The second part could be anything meaningful to you.&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:85%;"&gt;I am using a webservice to get the weather data by passing a zipcode to it. By default its 60606. Of course you could use a data store for the same thing. If you need any parameters to your Cmdlet you should create a Property and assign an attribute called Parameter. There are a bunch of values for this attribute but I used some common ones. The important function to look out is the ProcessRecord. This function is executed when the user invokes the Cmdlet at the prompt. Writeobject function  actually writes the data to the output pipeline which is displayed to the user. There are several other functions which can be effectively used to improve the output but I did not go in that detail. &lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:85%;"&gt;Creating a SnapIn class. &lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:85%;"&gt;To register the Cmdlet , you need a custom SnapIn class. Here it goes again.&lt;/span&gt;&lt;/p&gt;    &lt;p&gt;[RunInstaller(true)]   &lt;br /&gt;    public class TempSnapIn : PSSnapIn    &lt;br /&gt;    {    &lt;br /&gt;        public TempSnapIn() : base()    &lt;br /&gt;        {    &lt;br /&gt;        } &lt;/p&gt;  &lt;p&gt;        public override string Name   &lt;br /&gt;        {    &lt;br /&gt;            get    &lt;br /&gt;            {    &lt;br /&gt;                return "TempSnapIn";    &lt;br /&gt;            }    &lt;br /&gt;        } &lt;/p&gt;  &lt;p&gt;        public override string Vendor   &lt;br /&gt;        {    &lt;br /&gt;            get    &lt;br /&gt;            {    &lt;br /&gt;                return "Microsoft";    &lt;br /&gt;            }    &lt;br /&gt;        }    &lt;br /&gt;        public override string VendorResource    &lt;br /&gt;        {    &lt;br /&gt;            get    &lt;br /&gt;            {    &lt;br /&gt;                return "TempSnapIn,Microsoft";    &lt;br /&gt;            }    &lt;br /&gt;        } &lt;/p&gt;  &lt;p&gt;        public override string Description   &lt;br /&gt;        {    &lt;br /&gt;            get    &lt;br /&gt;            {    &lt;br /&gt;                return "This is a PowerShell snap-in for the Get-temp cmdlet.";    &lt;br /&gt;            }    &lt;br /&gt;        } &lt;/p&gt;  &lt;p&gt;        public override string DescriptionResource   &lt;br /&gt;        {    &lt;br /&gt;            get    &lt;br /&gt;            {    &lt;br /&gt;                return "GetTempSnapIn,This is a PowerShell snap-in for the Get-temp cmdlet.";    &lt;br /&gt;            }    &lt;br /&gt;        }    &lt;br /&gt;    }&lt;/p&gt;    &lt;p&gt;&lt;span style="font-size:85%;"&gt;Make sure you override all these properties, if not you would get some error when you try compiling this class. Place this class in the same namespace as the Cmdlet. Although I am not sure if different namespaces would work but you can try that. &lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:85%;"&gt;Register the Cmdlet&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:85%;"&gt;We are ready to register our little Cmdlet created. This is the mose exciting part since we need to hit some commands in Powershell. Yessssssss!!&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:85%;"&gt;Open Powershell prompt. &lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:85%;"&gt;Give the following commands.&lt;/span&gt;&lt;/p&gt;  &lt;pre&gt;PS&gt; $ref = "$Env:ProgramFiles\Reference Assemblies\Microsoft\WindowsPowerShell\v1.0\System.Management.Automation.dll"&lt;br /&gt;PS&gt; $compiler = "$env:windir/Microsoft.NET/Framework/v2.0.50727/csc"&lt;br /&gt;PS&gt; &amp;amp;$compiler /target:library /r:$ref Codefile.cs &lt;/pre&gt;  &lt;p&gt;&lt;span style="font-size:85%;"&gt;Codefile.cs should be the .cs or .vb file for your classes. This is the step to compile the code, you could obviously use the IDE to do this step. &lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:85%;"&gt;Now to actually register the Cmdlet, use the InstallUtil program. &lt;/span&gt;&lt;/p&gt;  &lt;pre&gt;PS&gt;set-alias installutil $env:windir\Microsoft.NET\Framework\v2.0.50727\installutil&lt;br /&gt;PS&gt; installutil Codefile.dll&lt;/pre&gt;    &lt;p&gt;&lt;span style="font-size:85%;"&gt;Replace the Codefie.dll with your dll created in earlier step.&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:85%;"&gt;Now add the Snap In we created to the shell&lt;/span&gt;&lt;/p&gt;  &lt;pre&gt;PS&gt;add-pssnapin SnapInclassname&lt;/pre&gt;  &lt;pre&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;We are done!! You could check by doing Get-temp at the prompt. Do not close the windows since you would lose all the settings you just did. Instead to save the session export the console as below.&lt;/span&gt;&lt;/pre&gt;  &lt;pre&gt;PS&gt; export-console MyCustomShell&lt;/pre&gt;                           &lt;p&gt;If you have any particular questions about the code or anything else please reply to this post.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-5120073188449727247?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/5120073188449727247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2008/11/custom-powershell-cmdlets.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/5120073188449727247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/5120073188449727247'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2008/11/custom-powershell-cmdlets.html' title='Custom Powershell Cmdlets'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-2160517675757971178</id><published>2008-11-09T22:42:00.000-08:00</published><updated>2008-11-09T22:43:23.666-08:00</updated><title type='text'>Using IDLoginView with IDLogin Windows Live Control</title><content type='html'>&lt;p&gt;&lt;span style="font-size:85%;"&gt;The IDLoginView control shipped with the Windows Live Tools control is a pretty good control for developers who want to customize the web page look depending on the Sign In status of the user. Normally, you would use a Login control on the page and once signed in with it, you could write a piece of code to display some items on the page which you want to display only to Windows Live Signed In users. Even more, if you plan to use ASP.NET Forms authentication for your website and customize the display for the users after being authenticated with it, you would write your own code to display them. IDLoginView control takes a step ahead and makes it way easy for the developer to assign templates depending on the status of the user visiting the page. &lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:85%;"&gt;The IDLoginView control has 5 templates defined as follows:&lt;/span&gt;&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Anonymous : Not signed in Windows Live and not authenticated by ASP.NET website&lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Loggedin : Authenticated by ASP.NET but not signed in Windows Live.&lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;LoggedInId : Signed in Windows Live&lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;LoggedInAll : Signed in Windows Live and ASP.NET website. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;AssociatePrompt : A template used to prompt the user to associate the windows live ID with the ASP.NET user account. &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;p&gt;&lt;span style="font-size:85%;"&gt;The templates are self-defined here but the interesting one is the Associate Prompt. This prompt if defined for the control, will prompt the user whether to create an association between their windows live account and ASP.NTE website account. Of course for this template to appear one has to create a website account using the ASP.NET security configuration. Once an association is created, any time later if the user signs in Windows Live they will be automatically authenticated for the ASP.NET website.&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:85%;"&gt;Follow the following simple steps to use these controls on your page.&lt;/span&gt;&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Drag a IDLoginView control on the page. In the designer view, click the small arrow button over the control to view all the templates. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Drag a ASP.NET Login control and the IDLogin control in this template.&lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Since you would need to see the status of the user all the time, copy these Login and IDLogin control in all the templates.&lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;The AssociatePrompt template displays a message with Yes and No buttons. You could change this template as you want, but &lt;strong&gt;make sure that there is a button which has a command name as associate_yes and another button with a command name as associate_no. &lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;p&gt;&lt;span style="font-size:85%;"&gt;You could test your application by running the website and signing in Live and ASP.NET website. The prompt appears when you are signed in one of the accounts and then sign in the other account. To this to work you need the PromptOnAssociation to true. &lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:85%;"&gt;Internally when you give an affirmative response to the prompt, a single row is added in the aspnet_LiveIDAssociation table in ASPNETDB database. You can see this database if you do show all files for the project. If you no longer want this association to take place delete this row from the table, for now, there is no UI to remove the association for the control.&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:85%;"&gt;I avoided thorough details about the control since you can find them &lt;a href="http://dev.live.com/tools/"&gt;here&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:100%;"&gt;Cannot Open User Default database Error.&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:85%;"&gt;Bug:&lt;em&gt; If you open the table to view the association entry, and then again try running the website you might get an error like Login failed for the default user. This bug is been posted on ASP.NET forums and many other places. I tried closing the IDE and reopening it. The website works, I think this is a bug with the SQL express since when it is open in the IDE, the error appears.&lt;/em&gt;   &lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-2160517675757971178?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/2160517675757971178/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2008/11/using-idloginview-with-idlogin-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/2160517675757971178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/2160517675757971178'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2008/11/using-idloginview-with-idlogin-windows.html' title='Using IDLoginView with IDLogin Windows Live Control'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-6562029093758012959</id><published>2008-11-09T22:41:00.001-08:00</published><updated>2008-11-09T22:41:46.833-08:00</updated><title type='text'>Google gears on iphone, Ohh yeahhh!!</title><content type='html'>&lt;p&gt;Google announced the Google Gears api which can be used to manage a site data offline. Once the website is in online state, the whole site data will be refreshed with the data that was added while offline. Such a feature is really compelling to me since it happens a lot of times that I have some idea while travelling and need to blog about while fresh in my mind. Google Gears is made purely in  HTML and javascript. That brings me to the talk for iphone. Steve Jobs mentioned about iphone not able to run 3rd party applications on it. But I think it would be really interesting to develop an application using Google Gears for such smart phones without installing any other applications on it. The only caveat is the local storage. Being offline, the data entered in the site has to be stored on the phone somewhere. Cookies, not a good idea since they would be cleared sometimes. &lt;/p&gt;  &lt;p&gt;SQLite database(the one I know of) can be accessed perfectly from javascript using Ajax and its also possible to store objects like images and other HTML elements. &lt;/p&gt;  &lt;p&gt;I really hope Apple and Google comes up with some storage mechanism on the iphone which would allow developers to really create applications which can be "online while offline".&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-6562029093758012959?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/6562029093758012959/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2008/11/google-gears-on-iphone-ohh-yeahhh.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/6562029093758012959'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/6562029093758012959'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2008/11/google-gears-on-iphone-ohh-yeahhh.html' title='Google gears on iphone, Ohh yeahhh!!'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4417875739806963199.post-5076359634727574899</id><published>2008-11-09T22:39:00.000-08:00</published><updated>2008-11-09T22:40:18.870-08:00</updated><title type='text'>Clickonce Deployment</title><content type='html'>&lt;p&gt;Recently I had an opportunity to deploy a Desktop application which I was working on for few months into a production server. Microsoft has made the deployment procedure really simple and thus the name. But following the simple steps for the deployment may not succeed all the time(that is my experience). And that's why I sometime call it Click(More than) once deployment!! In general follow the steps as given below which consider some special conditions. &lt;/p&gt;  &lt;p&gt;1) Right click the startup project properties. Clickonce deployment cannot be done without signing the manifest. Assembly signing is not required. In the Signing tab, the checkbox for Sign Clickonce manifest is automatically checked when you publish the app. The app is signed with a key (.pfx) created in the project. &lt;/p&gt;  &lt;p&gt;2) Click Application Files to make sure all the files you need to be deployed in the project are present in the list. For ex, if you have added a .htm file somewhere in your solution, change its build action to Content. Since the startup project needs a link to this file to be deployed, add a link to the .htm file created in this project. To do this, click Add existing item in startup project. Select .htm file and click Add as link( a small arrow besides Add button). &lt;/p&gt;  &lt;p&gt;Set the destination publish address(virtual directory). Click Publish Wizard to customize the folders if needed or Click Publish Now. &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Some Caveats :&lt;/p&gt;  &lt;p&gt;1) If prerequisites are required by your application, then proper bootstapper package need to be created for the same. To do this the quickest and cleanest way would be to use the &lt;a href="http://www.codeplex.com/bmg" target="_blank"&gt;Bootstrap Manifest generator&lt;/a&gt;. This creates the necessary files in the required location. You can find a step by step guide to use this tool &lt;a href="http://www.codeproject.com/KB/aspnet/Add_Custom_Prerequisite.aspx" target="_blank"&gt;here&lt;/a&gt;. Many other customizations could be done like adding Registry checks, file checks etc but those are not needed frequently. Restart VS editor and you should see the created package in the prerequisite list on the publish page. Select that and publish your project again. &lt;/p&gt;  &lt;p&gt;2) Make sure that you have access to the virtual directory where you wish to publish this application. If for some reason you don't, publish them in some other folder where you have access and give this accessible folder's path to the virtual directory. &lt;/p&gt;  &lt;p&gt;3) There is a publish.htm file created which by default is the starting page for the application. This is the page users will use to install the app. Make sure that the href value of the Install button is set to "setup.exe". Sometimes the value is set to the Application file which does not make sense since the whole reason for using clickonce is to bind the application and all other prerequisite packages into one file which is the executable "setup.exe". &lt;/p&gt;  &lt;p&gt;4) There is a known bug in clickonce which I experienced too. On some machines which are used to deploy the application, once the app is published, clicking the RUN button on the publish page opens the setup dialog correctly but after that it opens a message dialog box with no text in it (wierd stuff!!). There is some discussion about this bug on this &lt;a href="http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=306677" target="_blank"&gt;microsoft forum&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;I have not covered the basics of this process assuming that you would know them. Although if you have any other questions, do leave a comment so that I can reply to it.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4417875739806963199-5076359634727574899?l=theraneman.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theraneman.blogspot.com/feeds/5076359634727574899/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theraneman.blogspot.com/2008/11/clickonce-deployment.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/5076359634727574899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4417875739806963199/posts/default/5076359634727574899'/><link rel='alternate' type='text/html' href='http://theraneman.blogspot.com/2008/11/clickonce-deployment.html' title='Clickonce Deployment'/><author><name>Abhang Rane</name><uri>http://www.blogger.com/profile/10523738689325247764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
