<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>404: Page not found &#187; development</title>
	<atom:link href="http://krishnamurthy.net.in/blog/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://krishnamurthy.net.in/blog</link>
	<description>You are what you read, and with whom you cook</description>
	<lastBuildDate>Sun, 18 Dec 2011 06:04:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>NetSVMLight: Stratified Cross Validation for Parameter Selection</title>
		<link>http://krishnamurthy.net.in/blog/2011/05/25/netsvmlight-stratified-cross-validation-for-parameter-selection/</link>
		<comments>http://krishnamurthy.net.in/blog/2011/05/25/netsvmlight-stratified-cross-validation-for-parameter-selection/#comments</comments>
		<pubDate>Wed, 25 May 2011 07:17:44 +0000</pubDate>
		<dc:creator>Krishnamurthy Koduvayur Viswanathan</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://krishnamurthy.net.in/blog/?p=338</guid>
		<description><![CDATA[SVMlight provides the option to perform leave one out cross validation using the -x switch. The problem is that leave one out is too expensive for moderately large datasets. If you want to do say 10-fold cross validation, then you need to manage the folds yourself. I finished writing an n-fold cross validation functionality for [...]]]></description>
			<content:encoded><![CDATA[<p>SVMlight provides the option to perform leave one out cross validation using the -x switch. The problem is that leave one out is too expensive for moderately large datasets. If you want to do say 10-fold cross validation, then you need to manage the folds yourself. I finished writing an n-fold cross validation functionality for <a href="http://krishnamurthy.net.in/blog/2011/05/09/netsvmlight-a-net-wrapper-for-svmlight/">NetSVMLight</a>. An example follows, which demonstrates how you can use cross validation to pick the values of parameters to train your SVM.</p>
<p>For my problem, the parameter I was trying to pick was the cost-factor -j. In general, the principled way of doing this is as follows: Perform 10-fold (or n-fold) cross validation for each value of the cost-factor, on the training dataset. Get the average accuracy, precision, and recall for each set of models (where the set of models is the n-folds). Pick the value of the cost that gives the best cross validation results. Now the best results are determined by your requirements, and whether you are willing to trade off some recall for some additional precision etc. With the selected value of the parameter (cost-factor in this case), train a new model on the entire training dataset.</p>
<p>Now the basic idea behind n-fold cross validation is that the training dataset is divided into n-folds. In case of stratified cross validation (which is what NetSVMLight does), each fold contains approximately the same proportion of positive and negative class labels as the entire dataset. Also, each feature vector is randomly assigned to one of the n folds. This ensures a fair distribution. Now using a pre-determined value for all parameters, a model is constructed using n-1 of the n folds. This model is then tested on the remaining unseen fold, which yields a value for precision, recall and accuracy. This process is then repeated n-1 times. Each fold is used once for testing. The results of each fold are averaged and reported as the results for the n-fold cross validation.</p>
<p>Hence, in order to pick a parameter, such an n-fold cross validation is performed for each value of the parameter to be chosen. The value of the parameter that gives the most desired cross validation results is picked.<br />
<script src="https://gist.github.com/990475.js?file=Program.cs"></script><br />
In the code above, the ConstructNFolds method first constructs each of the n-folds on the disk. In the first for-loop, ten different values for the parameter are tried (you can try as many as you wish). The results of each cross validation set are stored in a dictionary, along with the corresponding value of the parameter being tested. The foreach loop simply goes over the dictionary, and saves the results to a file and prints them to the console.</p>
<p>For my dataset, I tried 10 different values of the cost-parameter and recorded the corresponding precision, recall and accuracy from each run of the 10-fold cross validation.</p>
<p><a href="https://lh4.googleusercontent.com/_8DTdVNRe-EE/TdytR5EUkoI/AAAAAAAABu8/g7Qqg5q4v9E/10foldcv.jpg"><img class="alignnone" src="https://lh4.googleusercontent.com/_8DTdVNRe-EE/TdytR5EUkoI/AAAAAAAABu8/g7Qqg5q4v9E/10foldcv.jpg" alt="" width="525" height="310" /></a></p>
<p>At cost = 0.75, I think there is a reasonable tradeoff between precision and recall. Hence I pick this value and train my SVM over the entire training dataset.</p>
<p>The latest source and binaries can be downloaded <a href="http://code.google.com/p/net-svmlight/downloads/detail?name=NetSVMLightv1.1.zip&amp;can=2&amp;q=">here</a> or <a href="http://code.google.com/p/net-svmlight/source/checkout">checked out</a> using SVN.</p>
]]></content:encoded>
			<wfw:commentRss>http://krishnamurthy.net.in/blog/2011/05/25/netsvmlight-stratified-cross-validation-for-parameter-selection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NetSVMLight: A .NET Wrapper for SVMlight</title>
		<link>http://krishnamurthy.net.in/blog/2011/05/09/netsvmlight-a-net-wrapper-for-svmlight/</link>
		<comments>http://krishnamurthy.net.in/blog/2011/05/09/netsvmlight-a-net-wrapper-for-svmlight/#comments</comments>
		<pubDate>Tue, 10 May 2011 04:24:26 +0000</pubDate>
		<dc:creator>Krishnamurthy Koduvayur Viswanathan</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://krishnamurthy.net.in/blog/?p=323</guid>
		<description><![CDATA[Thorstein Joachim&#8217;s SVMlight does not need an introduction to the relevant audience. For windows it comes as a pair of binaries that can be run on the commandline. The software is originally written using gcc. I am not very good at using C/C++, but had some specific requirements where I had to run several experiments [...]]]></description>
			<content:encoded><![CDATA[<p>Thorstein Joachim&#8217;s <a href="http://svmlight.joachims.org/">SVMlight</a> does not need an introduction to the relevant audience. For windows it comes as a pair of binaries that can be run on the commandline. The software is originally written using gcc. I am not very good at using C/C++, but had some specific requirements where I had to run several experiments and analyze the results. Doing this on the commandline was extremely tedious, and naturally I was looking for an SVMlight API in Java or Python.</p>
<p>There are a bunch of extensions and additions listed on the website that provide an interface to SVMlight. Most of these (atleast the ones in python) simply provide an interface to set parameters and run the executables from within the code. Atleast one of the Python extensions did not have the ability to support different kernels. I was finding it hard to understand some of them due to insufficient documentation. Then I thought of writing one in C# simply because I did not find one featured on the SVMlight page. Here is a list of features:</p>
<ul>
<li>Well documented</li>
<li>Strongly typed parameters for svm_learn and svm_classify</li>
<li>Supports all kernels provided by svmlight</li>
<li>Supports most commonly used parameters (including kernel params and cross validation)</li>
<li>Can provide support for others parameters upon request</li>
<li>Constructs training and test sets from a given dataset and percentage split</li>
<li>Creates a list of all misclassified instances for further analysis</li>
</ul>
<p>Here is an example usage:<br />
<script src="https://gist.github.com/963041.js?file=Program.cs"></script></p>
<p>You can download the source, binaries and documentation from:</p>
<p><a href="http://code.google.com/p/net-svmlight/">http://code.google.com/p/net-svmlight/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://krishnamurthy.net.in/blog/2011/05/09/netsvmlight-a-net-wrapper-for-svmlight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thank your friends on Facebook&#8230;more Graph API</title>
		<link>http://krishnamurthy.net.in/blog/2011/05/08/thank-your-friends-on-facebook-more-graph-api/</link>
		<comments>http://krishnamurthy.net.in/blog/2011/05/08/thank-your-friends-on-facebook-more-graph-api/#comments</comments>
		<pubDate>Sun, 08 May 2011 10:29:26 +0000</pubDate>
		<dc:creator>Krishnamurthy Koduvayur Viswanathan</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://krishnamurthy.net.in/blog/?p=312</guid>
		<description><![CDATA[I am going to get a lot of flak for this post. In some sense it is like digging my own grave, but I think the geek in you might be able to appreciate the ability to do something cool (even though it may take more time to create), rather than the monotonous repetitive. It [...]]]></description>
			<content:encoded><![CDATA[<p>I am going to get a lot of flak for this post. In some sense it is like digging my own grave, but I think the geek in you might be able to appreciate the ability to do something cool (even though it may take more time to create), rather than the monotonous repetitive.</p>
<p>It was my birthday yesterday. I was overwhelmed by the number of friends who wished me on Facebook, and I really wanted to thank each one of them by commenting on each &#8220;Happy Birthday&#8221; message. But when the number of such wishes runs into an unmanageable number, then you know that manually sitting and typing &#8220;thank you&#8221; (leave alone a more personalized thank you) seems to be quite daunting. Now, I declare a disclaimer that I really do thank all my friends for their good wishes, but I could not resist the idea of automating the process of writing thank you messages in response to each birthday wish.</p>
<p>So I set out with the assumption, that for each birthday message on my wall, I will create a comment carrying a personalized thank you, with my friend&#8217;s first name. This seemed like a worthwhile thing to do, since I would be able to individually thank each of my friends; and considering that the only other alternative was to be lazy and do nothing at all (since I was not going to be able to do this task manually).</p>
<p>So I set out to hack a python script using the Facebook Graph API. A few things to be considered:</p>
<ol>
<li>When you retrieve items from your wall, facebook usually returns multiple pages of data. After playing around with this for a while, I did not want to play with it, simply because it was increasing the complexity of what I wanted to do, and I was plainly finding it difficult to understand the meaning of their paging parameters.</li>
<li>So I determined that starting from the newest post on my wall, there were not more than a hundred posts that were birthday wishes (some of them were not, and would need to be filtered away).</li>
<li>I decided to identify the birthday wishes using the criterion that such a message would contain the word &#8220;happy&#8221; in it (simply because there were different ways in which people wrote birthday e.g. bday, budday and various others). This may not be a very smart filtering mechanism, but it seemed to have pretty good precision for me, and I was willing to let go of the minor loss of recall (I would deal with these exceptional cases manually).</li>
<li>So here is the basic algorithm:
<ul>
<li>Get the list of the 100 most recent posts on my wall</li>
<li>If the post does not contain the word &#8220;happy&#8221;, or already has a comment on it, or doesn&#8217;t contain a &#8220;message&#8221; section in the JSON response, then discard it.</li>
<li>Else, extract the messageID, and make an additional HTTP request using the ID of the message sender to determine the sender&#8217;s first name</li>
<li>Make a new HTTP post to https://graph.facebook.com/messageID/comments using the <strong>appropriate</strong> access token to write the comment.</li>
</ul>
</li>
<li>One final note about access tokens: The list of wall posts could be obtained using the access token described in <a href="http://krishnamurthy.net.in/blog/2011/04/16/console-application-continued-for-facebook/">my previous post about the Facebook Graph API</a>, but in order to be able to post on my wall, I needed another access_token that would contain write permissions. So, I had to implement the OAuth authentication workflow and request the <strong>publish_stream</strong> permission. This procedure is <strong>not </strong>documented very well on <a href="http://developers.facebook.com/docs/authentication/">http://developers.facebook.com/docs/authentication/</a>.
<ul>
<li> Essentially, I made a request to
<pre>https://www.facebook.com/dialog/oauth?client_id=YOUR_APP_ID&amp;redirect_uri=http://www.facebook.com/connect/login_success.html&amp;scope=publish_stream</pre>
<p>This made my application request me for write permission to my wall. Since, I am the app creator, I authorized it.</li>
<li>This returned a <strong>code</strong> in the redirect URL, which I used to make another HTTP request to
<pre>https://graph.facebook.com/oauth/access_token?client_id=YOUR_APP_ID&amp;redirect_uri=http://www.facebook.com/connect/login_success.html&amp;client_secret=YOUR_CLIENT_SECRET&amp;code=CODE_FROM_ABOVE</pre>
</li>
<li>The response contains a new access token that can be used for write operations.
<ul></ul>
</li>
</ul>
</li>
</ol>
<p>Armed with this new access token, and the old one I already have, I could now read posts on my wall, and write comments to them. Here is the code in Python:<br />
<script src="https://gist.github.com/961236.js?file=comment.py"></script></p>
<p>One final thing: there were at-least two posts on my wall, that were completely missed by the Graph API, and no matter what I did, they were just not retrieved. I had to respond to these manually.</p>
]]></content:encoded>
			<wfw:commentRss>http://krishnamurthy.net.in/blog/2011/05/08/thank-your-friends-on-facebook-more-graph-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Console Application&#8230;continued for facebook</title>
		<link>http://krishnamurthy.net.in/blog/2011/04/16/console-application-continued-for-facebook/</link>
		<comments>http://krishnamurthy.net.in/blog/2011/04/16/console-application-continued-for-facebook/#comments</comments>
		<pubDate>Sat, 16 Apr 2011 15:25:27 +0000</pubDate>
		<dc:creator>Krishnamurthy Koduvayur Viswanathan</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://krishnamurthy.net.in/blog/?p=282</guid>
		<description><![CDATA[A couple of days ago, I was talking about how to use your private access token to extract information from your Twitter account using the Twitter API. Today, I tried using the RestFB library to extract information about my friends from facebook. Now, there is a different kind of a hack that I had to [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of days ago, I was talking about how to use your private access token to extract information from your Twitter account using the Twitter API.</p>
<p>Today, I tried using the RestFB library to extract information about my friends from facebook. Now, there is a different kind of a hack that I had to use in order to get an access token: Login to facebook and go to this page: <a href="http://developers.facebook.com/docs/reference/api/user/">http://developers.facebook.com/docs/reference/api/user/</a>. Now, click on the example link on that page. In your browser address bar, you will see an access token. Save this in your configuration file (this access token expires after a certain duration).</p>
<p>There are a few further to jump through to simply access data. The RestFB library gives you a list of your friend names and ids. Even though it has methods to access other information such as location, gender etc. of your friends, all of these method calls return null UNLESS each of your friends gives your &#8220;application&#8221; specific permissions to access these fields. Crazy ain&#8217;t it? Look at this thread on <a href="http://stackoverflow.com/questions/5516627/facebook-graph-api-get-friends-info">stackoverflow</a>. So much distress to simply programmatically access information of my friends that I already can see in my facebook account.</p>
<p>So I had to take a different approach: Calling the graph API directly using direct HTTP GET requests as myself, rather than go through the application that needs to be specifically approved by my 350+ friends on FB.</p>
<p>Since I already have my friends&#8217; user IDs (from the previous call using restFB), I made individual HTTP requests to the following URL:</p>
<p><a href="https://graph.facebook.com/id?access_token=abcd">https://graph.facebook.com/id?access_token=abcd</a> (where abcd is the access token I received using the method described above). In the HTTP response body, you receive a JSON string which represents your friend&#8217;s information.</p>
<p>One final thing: making a GET request to an https link is painful in java. I used a crude hack in order to do this (essentially install an all trusting trust manager&#8230;never do this). Here is the complete code:<br />
<script src="https://gist.github.com/918808.js?file=facebooknetwork.java"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://krishnamurthy.net.in/blog/2011/04/16/console-application-continued-for-facebook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What about the good ole&#8217; console application?</title>
		<link>http://krishnamurthy.net.in/blog/2011/04/12/what-about-the-good-ole-console-application/</link>
		<comments>http://krishnamurthy.net.in/blog/2011/04/12/what-about-the-good-ole-console-application/#comments</comments>
		<pubDate>Tue, 12 Apr 2011 22:05:10 +0000</pubDate>
		<dc:creator>Krishnamurthy Koduvayur Viswanathan</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://krishnamurthy.net.in/blog/?p=272</guid>
		<description><![CDATA[This is my second attempt at writing this post. Somehow I had a demented idea of using IE9 while writing this; and due to a stupid browser glitch, I lost my original draft. Now back on trusty old Firefox: essentially I was ranting about how I was having to jump through several hoops while using [...]]]></description>
			<content:encoded><![CDATA[<p>This is my second attempt at writing this post. Somehow I had a demented idea of using IE9 while writing this; and due to a stupid browser glitch, I lost my original draft. Now back on trusty old Firefox: essentially I was ranting about how I was having to jump through several hoops while using the Twitter and Facebook Graph APIs, mostly due to their OAuth workflow.</p>
<p>I am writing a simple console application that needs to collect some data and do some social network analysis. The complicated browser based authentication workflow supported by both FB and Twitter are a huge hindrance to this purpose, since they assume that you are making a web application with several users. Essentially the process is that your application exchanges your API key and some other secret key for an auth token (specific to each user), and this is done using the browser.</p>
<p>I discovered after a lot of digging in that, Twitter decided to be a little considerate by providing a single user auth_token that can be used for single-user scenarios like mine. So, I can simply start using my secret auth_token and completely bypass the OAuth workflow. To obtain your access token, login at dev.twitter.com, select your app, and click on &#8220;My Access Token&#8221;.</p>
<p>Given below is an example. I hope this is useful for people who have requirements similar to mine. I will follow up with a post about how to get this working for Facebook.</p>
<p><script src="https://gist.github.com/916489.js?file=gistfile1.java"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://krishnamurthy.net.in/blog/2011/04/12/what-about-the-good-ole-console-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Can&#8217;t connect to MySQL server on &#8216;server&#8217;</title>
		<link>http://krishnamurthy.net.in/blog/2010/06/04/cant-connect-to-mysql-server-on-server/</link>
		<comments>http://krishnamurthy.net.in/blog/2010/06/04/cant-connect-to-mysql-server-on-server/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 07:58:27 +0000</pubDate>
		<dc:creator>Krishnamurthy Koduvayur Viswanathan</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://krishnamurthy.net.in/blog/2010/06/04/cant-connect-to-mysql-server-on-server/</guid>
		<description><![CDATA[Its been a long time since I wrote anything here. So, I thought let me resume by sharing a little piece of information I gathered the other day. So, I have been using MySQL to manage some data related to my research. I have installations on multiple machines that I use, and recently I had [...]]]></description>
			<content:encoded><![CDATA[<p>Its been a long time since I wrote anything here. So, I thought let me resume by sharing a little piece of information I gathered the other day. So, I have been using MySQL to manage some data related to my research. I have installations on multiple machines that I use, and recently I had to install it on another ubuntu machine. I did the following:</p>
<p>&lt;code&gt;sudo apt-get install php5 mysql-server apache2 phpmyadmin&lt;/code&gt;</p>
<p>It worked fine, but then, my python script that runs on another machine began to complain that it could not connect to my MySQL server:</p>
<p><em><strong> Can&#8217;t connect to MySQL server on &#8216;server&#8217;</strong></em></p>
<p>Now that was just ridiculous because this has never happened before. So I trolled and trolled till I found what I was looking for:</p>
<p>http://www.webmasterworld.com/forum10/6141.htm</p>
<p>So, turns out that there is this tiny piece of configuration information in your /etc/mysql/my.cnf file that says:</p>
<p>bind-address = 127.0.0.1</p>
<p>which essentially means that all connections coming in from anywhere other than the local machine will not be entertained. Remove or comment that line and restart your server. Things start working!</p>
]]></content:encoded>
			<wfw:commentRss>http://krishnamurthy.net.in/blog/2010/06/04/cant-connect-to-mysql-server-on-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using multiple applications with ASPNETDB</title>
		<link>http://krishnamurthy.net.in/blog/2009/06/30/using-multiple-applications-with-aspnetdb/</link>
		<comments>http://krishnamurthy.net.in/blog/2009/06/30/using-multiple-applications-with-aspnetdb/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 13:17:21 +0000</pubDate>
		<dc:creator>Krishnamurthy Koduvayur Viswanathan</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://krishnamurthy.net.in/blog/2009/06/30/using-multiple-applications-with-aspnetdb/</guid>
		<description><![CDATA[As a web developer, I have used ASPNETDB several times to manage the membership and role information for my applications. It has been a while since I have done software development in ASP.NET. So when I try things now, I realize there are several small things that I knew at my fingertips back then, come [...]]]></description>
			<content:encoded><![CDATA[<p>As a web developer, I have used ASPNETDB several times to manage the membership and role information for my applications. It has been a while since I have done software development in ASP.NET. So when I try things now, I realize there are several small things that I knew at my fingertips back then, come with a little more effort right now. I hooked up a new application to use the ASPNETDB, and tried to create a new login. I got the error that the username already exists.</p>
<p>This was surprising, because it was a new application. I realized that the application was actually pointing to the same instance of ASPNETDB on my DB server. I knew that there was some way of isolating multiple applications in the same membership database. After a bit of research I recalled out to do it:</p>
<p>In the web.config file, look for the following section:</p>
<p>&lt;membership&gt;<br />
&lt;providers&gt;<br />
&lt;clear/&gt;<br />
&lt;add name=&#8221;AspNetSqlMembershipProvider&#8221;<br />
type=&#8221;System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&#8221;<br />
connectionStringName=&#8221;ApplicationServices&#8221;<br />
enablePasswordRetrieval=&#8221;false&#8221;<br />
enablePasswordReset=&#8221;true&#8221;<br />
requiresQuestionAndAnswer=&#8221;false&#8221;<br />
requiresUniqueEmail=&#8221;false&#8221;<br />
passwordFormat=&#8221;Hashed&#8221;<br />
maxInvalidPasswordAttempts=&#8221;5&#8243;<br />
minRequiredPasswordLength=&#8221;6&#8243;<br />
minRequiredNonalphanumericCharacters=&#8221;0&#8243;<br />
passwordAttemptWindow=&#8221;10&#8243;<br />
passwordStrengthRegularExpression=&#8221;"<br />
applicationName=&#8221;/&#8221;<br />
/&gt;<br />
&lt;/providers&gt;<br />
&lt;/membership&gt;</p>
<pre></pre>
<p>Change the value of the applicationName attribute inside the providers element to then name of your application, and you are good to go!</p>
]]></content:encoded>
			<wfw:commentRss>http://krishnamurthy.net.in/blog/2009/06/30/using-multiple-applications-with-aspnetdb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sending bulk emails using Outlook and C#</title>
		<link>http://krishnamurthy.net.in/blog/2008/12/24/sending-bulk-emails-using-outlook-and-c/</link>
		<comments>http://krishnamurthy.net.in/blog/2008/12/24/sending-bulk-emails-using-outlook-and-c/#comments</comments>
		<pubDate>Wed, 24 Dec 2008 09:27:50 +0000</pubDate>
		<dc:creator>Krishnamurthy Koduvayur Viswanathan</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://krishnamurthy.net.in/blog/2008/12/24/sending-bulk-emails-using-outlook-and-c/</guid>
		<description><![CDATA[I have always derived pleasure writing programs that solve real world problems. This is one such problem that I was able to solve. With the holiday season on, you might want to send greetings to your numerous business contacts. If you have several contacts that you want to send personalized messages to, then you very [...]]]></description>
			<content:encoded><![CDATA[<p>I have always derived pleasure writing programs that solve real world problems. This is one such problem that I was able to solve. With the holiday season on, you might want to send greetings to your numerous business contacts. If you have several contacts that you want to send personalized messages to, then you very well can imagine how much time and effort that will take.<br />
So this is what I set out to do: create an application that would send out emails to several contacts, with a personalized greeting line, but similar message body. Also, depending on the type of contact, you might want to send a different message. E.g. if it is a close colleague of yours, then you might want to send a more personalized mail rather than a one liner. Since these are personalized emails, these need to be sent from your actual email id rather than an SMTP server on your dev machine. Also, I needed this application to work for someone else who runs only MS Office on his machine. So I decided to use Microsoft Office Outlook 2007 for this task.<br />
The first thing to do was to decide the fomat in which I would store all the configuration information that would be used by the application: So I created two different text files, mail1.txt and mail2.txt each with a separate email message:</p>
<p>Hello {0}<br />
Mail body</p>
<p>Where {0} is a placeholder that will be replaced by the receiver name. mail1.txt and mail2.txt have the same structure except for the mail body depending on the requirement.<br />
Next, I needed to create a list of names and the corresponding email IDs to which the mails are to be sent. Also, I needed a flag that will indicate the type of message that is to be sent, i.e. mail1 or mail2. I created a comma separated file with the following format:</p>
<p>&lt;Receiver’s name&gt;, &lt;email id&gt;, &lt;mail body to be sent, i.e. 1 or 2&gt;</p>
<p>I wrote a console application in C# that uses the Microsoft Office 2007 Primary Interop assemblies to automate sending emails to all these contacts specified. The emails get sent using the default account configured in your Outlook. The code looks something like the following. Please note that this is a quick hack which actually works and that I have not really done a lot of error handling or exception management on this because I know the conditions under which this will be used.</p>
<pre>
Microsoft.Office.Interop.Outlook.Application app = null;
Microsoft.Office.Interop.Outlook._NameSpace ns = null;
Microsoft.Office.Interop.Outlook.PostItem item = null;
Microsoft.Office.Interop.Outlook.MAPIFolder inboxFolder = null;
Microsoft.Office.Interop.Outlook.MAPIFolder subFolder = null;
Microsoft.Office.Interop.Outlook.MailItem memo = null;
Microsoft.Office.Interop.Outlook.MAPIFolder sentFolder = null;
StreamReader addressReader = null;
StreamReader contentsReader = null;
StreamWriter logWriter = null; 

try
{
addressReader = new StreamReader(ConfigurationManager.AppSettings["addresses"]);
String currentLine = String.Empty;
String[] currentReceiver = null;
String messageBodyFile = String.Empty;
logWriter = new StreamWriter(Path.Combine(Environment.CurrentDirectory, "Log.txt"), false);
while (!addressReader.EndOfStream)
{
currentLine = addressReader.ReadLine();
currentReceiver = currentLine.Split(',');
switch (currentReceiver[2])
{
case "1":
messageBodyFile = ConfigurationManager.AppSettings["contentsFile1"];
break; 

case "2":
messageBodyFile = ConfigurationManager.AppSettings["contentsFile2"];
break; 

default:
Console.WriteLine("Could not send email to ", currentReceiver[0]);
logWriter.WriteLine("Could not send email to ", currentReceiver[0]);
currentReceiver[1] = String.Empty;
break;
} 

#region EmailInit 

app = new Microsoft.Office.Interop.Outlook.Application();
ns = app.GetNamespace("MAPI");
ns.Logon(null, null, false, false);
sentFolder = ns.GetDefaultFolder(OlDefaultFolders.olFolderSentMail);
memo = (Microsoft.Office.Interop.Outlook.MailItem)app.CreateItem(OlItemType.olMailItem); 

#endregion 

contentsReader = new StreamReader(messageBodyFile);
memo.To = currentReceiver[1].Trim();
memo.Subject = ConfigurationManager.AppSettings["mailSubject"].Trim();
memo.Body = String.Format(contentsReader.ReadToEnd(), currentReceiver[0]);
memo.BodyFormat = OlBodyFormat.olFormatHTML;
memo.Send();
Console.WriteLine("{0}: Sent email with body {1} to {2}:{3}", DateTime.Now, currentReceiver[2], currentReceiver[0], currentReceiver[1]);
logWriter.WriteLine("{0}: Sent email with body {1} to {2}:{3}", DateTime.Now, currentReceiver[2], currentReceiver[0], currentReceiver[1]);
contentsReader.Close();
contentsReader.Dispose();
}
} 

catch (System.Exception ex)
{
Console.WriteLine(ex.ToString());
EventLog.WriteEntry("Email Automation", ex.Message, EventLogEntryType.Error);
} 

finally
{
ns = null;
app = null;
inboxFolder = null;
addressReader.Close();
addressReader.Dispose();
logWriter.Close();
logWriter.Dispose();
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://krishnamurthy.net.in/blog/2008/12/24/sending-bulk-emails-using-outlook-and-c/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Styles on the Login.aspx page</title>
		<link>http://krishnamurthy.net.in/blog/2008/05/05/32/</link>
		<comments>http://krishnamurthy.net.in/blog/2008/05/05/32/#comments</comments>
		<pubDate>Mon, 05 May 2008 11:48:14 +0000</pubDate>
		<dc:creator>Krishnamurthy Koduvayur Viswanathan</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://krishnamurthy.net.in/blog/?p=32</guid>
		<description><![CDATA[I have been playing around with the ASP.NET login controls lately. After getting the membership and role management framework to work on my website (which is quite a task in itself), I set to figure out some other small things. In this case, I wanted to apply custom styles to the login control on my [...]]]></description>
			<content:encoded><![CDATA[<p><font size="2">I have been playing around with the ASP.NET login controls lately. After getting the membership and role management framework to work on my website (which is quite a task in itself), I set to figure out some other small things. In this case, I wanted to apply custom styles to the login control on my Login.aspx page.</font></p>
<p><font size="2">Doing this is as simple as assigning a class to the CssClass attribute of the Login control and to any sub-controls whose appearance  you want to modify.</font></p>
<p><font size="2"><font face="Courier New, monospace"><font color="#0000ff">&lt;</font><font color="#800000">body</font> <font color="#ff0000">class</font><font color="#0000ff">=&#8221;Body&#8221;&gt;</font></font></font></p>
<p><font size="2"><font face="Courier New, monospace"><font color="#0000ff">&lt;</font><font color="#800000">form</font> <font color="#ff0000">id</font><font color="#0000ff">=&#8221;form1&#8243;</font> <font color="#ff0000">runat</font><font color="#0000ff">=&#8221;server&#8221;&gt;</font></font></font></p>
<p><font size="2"><font face="Courier New, monospace"><font color="#0000ff">&lt;</font><font color="#800000">div</font><font color="#0000ff">&gt;</font></font></font></p>
<p><font size="2"><font face="Courier New, monospace"><font color="#0000ff">&lt;</font><font color="#800000">asp</font><font color="#0000ff">:</font><font color="#800000">Login</font> <font color="#ff0000">ID</font><font color="#0000ff">=&#8221;Login1&#8243;</font> <font color="#ff0000">runat</font><font color="#0000ff">=&#8221;server&#8221;</font> <font color="#ff0000">CssClass</font><font color="#0000ff">=&#8221;TextBox&#8221;&gt;</font></font></font></p>
<p><font size="2"><font face="Courier New, monospace"><font color="#0000ff">&lt;</font><font color="#800000">LoginButtonStyle</font> <font color="#ff0000">CssClass</font><font color="#0000ff">=&#8221;Button&#8221;</font> <font color="#0000ff">/&gt;</font></font></font></p>
<p><font size="2"><font face="Courier New, monospace"><font color="#0000ff">&lt;/</font><font color="#800000">asp</font><font color="#0000ff">:</font><font color="#800000">Login</font><font color="#0000ff">&gt;</font></font></font></p>
<p><font size="2"><font face="Courier New, monospace"><font color="#0000ff">&lt;/</font><font color="#800000">div</font><font color="#0000ff">&gt;</font></font></font></p>
<p><font size="2"><font face="Courier New, monospace"><font color="#0000ff">&lt;/</font><font color="#800000">form</font><font color="#0000ff">&gt;</font></font></font></p>
<p><font size="2"><font face="Courier New, monospace"><font color="#0000ff">&lt;/</font><font color="#800000">body</font><font color="#0000ff">&gt;</font></font></font></p>
<p><font size="2"><font face="Courier New, monospace"><font color="#0000ff">&lt;/</font><font color="#800000">html</font><font color="#0000ff">&gt;</font></font></font></p>
<p><font size="2">Now I should mention that these classes are contained in a .css file inside my App_Themes/Default/Styles folder.</font></p>
<p><font size="2">So in the &lt;head&gt; section of the page, I added the following:</font></p>
<p><font size="2"><font face="Courier New, monospace"><font color="#0000ff">&lt;</font><font color="#800000">link</font> <font color="#ff0000">rel</font><font color="#0000ff">=&#8221;stylesheet&#8221;</font> <font color="#ff0000">type</font><font color="#0000ff">=&#8221;text/css&#8221;</font> <font color="#ff0000">href</font><font color="#0000ff">=&#8221;../App_Themes/Default/Styles/LoginStyles.css&#8221;</font> <font color="#0000ff">/&gt;</font></font></font></p>
<p><font size="2">Simple enough eh? Wrong!</font></p>
<p><font size="2">No matter what I tried, no matter how much I played with the path to the css file, the styles simply won’t be rendered on my page. The same styles get applied if you use them in a &lt;style /&gt; element in the page itself. I was flummoxed.</font></p>
<p><font size="2">The thing to note here is that the authorization section in my website is configured as:</font></p>
<p><font size="2"><font face="Courier New, monospace"><font color="#0000ff">&lt;</font><font color="#800000">authorization</font><font color="#0000ff">&gt;</font></font></font></p>
<p><font color="#0000ff">      <font size="2"><font face="Courier New, monospace">&lt;</font><font color="#800000">deny</font> <font color="#ff0000">users</font><font color="#0000ff">=</font>&#8220;<font color="#0000ff">?</font>&#8220;<font color="#0000ff">/&gt;</font></font></font></p>
<p><font color="#0000ff"><font size="2"><font face="Courier New, monospace"><font color="#0000ff">&lt;/</font><font color="#800000">authorization</font><font color="#0000ff">&gt;</font></font></font></font></p>
<p><font color="#000000" size="2">This means that unauthenticated users will not be able to access the website resources: which includes style sheets and/or images on the website!!</font></p>
<p><font color="#000000" size="2">So, in order to get this to work, I had to move the stylesheets for the login page and the related images to a separate folder called “AllowAll” and make the following additions to my web.config file:</font></p>
<p><font color="#0000ff"><font size="2"><font face="Courier New, monospace"><font color="#0000ff">&lt;</font><font color="#800000">location</font> <font color="#ff0000">path</font><font color="#0000ff">=</font>&#8220;<font color="#0000ff">AllowAll</font>&#8220;<font color="#0000ff">&gt;</font></font></font></font></p>
<p><font color="#0000ff"><font color="#0000ff">    <font size="2"><font face="Courier New, monospace">&lt;</font><font color="#800000">system.web</font><font color="#0000ff">&gt;</font></font></font></font></p>
<p><font color="#0000ff"><font color="#0000ff"><font color="#0000ff">      <font size="2"><font face="Courier New, monospace">&lt;</font><font color="#800000">authorization</font><font color="#0000ff">&gt;</font></font></font></font></font></p>
<p><font color="#0000ff"><font color="#0000ff"><font color="#0000ff"><font color="#0000ff">        <font size="2"><font face="Courier New, monospace">&lt;</font><font color="#800000">allow</font> <font color="#ff0000">users</font><font color="#0000ff">=</font>&#8220;<font color="#0000ff">*</font>&#8220;<font color="#0000ff">/&gt;</font></font></font></font></font></font></p>
<p><font color="#0000ff"><font color="#0000ff"><font color="#0000ff"><font color="#0000ff"><font color="#0000ff">      <font size="2"><font face="Courier New, monospace">&lt;/</font><font color="#800000">authorization</font><font color="#0000ff">&gt;</font></font></font></font></font></font></font></p>
<p><font color="#0000ff"><font color="#0000ff"><font color="#0000ff"><font color="#0000ff"><font color="#0000ff"><font color="#0000ff">    <font size="2"><font face="Courier New, monospace">&lt;/</font><font color="#800000">system.web</font><font color="#0000ff">&gt;</font></font></font></font></font></font></font></font></p>
<p><font color="#0000ff"><font color="#0000ff"><font color="#0000ff"><font color="#0000ff"><font color="#0000ff"><font color="#0000ff"><font color="#0000ff">  <font size="2"><font face="Courier New, monospace">&lt;/</font><font color="#800000">location</font><font color="#0000ff">&gt;</font></font></font></font></font></font></font></font></font></p>
<p><font color="#000000" size="2"><font><font><font><font><font><font>Basically this section means that all users (*) should be allowed access inside the “AllowAll” folder, regardless of whether they are authenticated or not.</font></font></font></font></font></font></font></p>
<p><font color="#000000" size="2"><font><font><font><font><font><font>Then I simply changed the path to my stylesheet on the login.aspx page:</font></font></font></font></font></font></font></p>
<p><font color="#0000ff"><font color="#0000ff"><font color="#0000ff"><font color="#0000ff"><font color="#0000ff"><font color="#0000ff"><font color="#0000ff"><font size="2"><font face="Courier New, monospace"><font color="#0000ff">&lt;</font><font color="#800000">link</font> <font color="#ff0000">rel</font><font color="#0000ff">=&#8221;stylesheet&#8221;</font> <font color="#ff0000">type</font><font color="#0000ff">=&#8221;text/css&#8221;</font> <font color="#ff0000">href</font><font color="#0000ff">=&#8221;AllowAll/LoginStyles.css&#8221;</font> <font color="#0000ff">/&gt;</font></font></font></font></font></font></font></font></font></font></p>
<p><font color="#000000" size="2"><font><font><font><font><font><font>And that did the trick. Woof…so much for authorization!!</font></font></font></font></font></font></font></p>
<p><font color="#0000ff"><font color="#0000ff"><font color="#0000ff"><font color="#0000ff"></font></font></font></font></p>
<p><font color="#0000ff"><font color="#0000ff"><font color="#0000ff"><font color="#0000ff"><font color="#0000ff"><font color="#0000ff"><font color="#0000ff"> </font></font></font></font></font></font></font></p>
]]></content:encoded>
			<wfw:commentRss>http://krishnamurthy.net.in/blog/2008/05/05/32/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Server Reporting Service woes</title>
		<link>http://krishnamurthy.net.in/blog/2007/08/19/sql-server-reporting-service-woes/</link>
		<comments>http://krishnamurthy.net.in/blog/2007/08/19/sql-server-reporting-service-woes/#comments</comments>
		<pubDate>Sun, 19 Aug 2007 14:40:00 +0000</pubDate>
		<dc:creator>Krishnamurthy Koduvayur Viswanathan</dc:creator>
				<category><![CDATA[SSRS]]></category>
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://krishnamurthy.net.in/blog/?p=12</guid>
		<description><![CDATA[I just installed SQL Server 2005 on my home PC. When I opened http://localhost/reports to check out if my Reporting Service is working properly, I got the following error: The report server has encountered a configuration error. See the report server log files for more information. (rsServerConfigurationError) Access to the path &#8216;C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting [...]]]></description>
			<content:encoded><![CDATA[<p>I just installed SQL Server 2005 on my home PC. When I opened http://localhost/reports to check out if my Reporting Service is working properly, I got the following error:</p>
<p>The report server has encountered a configuration error. See the report server log files for more information. (rsServerConfigurationError)</p>
<ul>
<li>Access to the path &#8216;C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\RSReportS<wbr></wbr>erver.config&#8217; is denied.</li>
</ul>
<p>I found <a href="http://prologika.com/CS/blogs/blog/archive/2007/07/12/ssrs-setup-woes.aspx">this</a> post by Teo Lachev that shed some light on the problem. I figured that the rsreportserver.config file must be accessible by the MACHINE\ASPNET user. From Lachev&#8217;s post, I figured I could right click on the file and simply add another user to the ACL (I remember doing that sometime). But when I click on the file, I dont find any security tab anywhere. I went up to the folder &#8220;C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer&#8221; and right clicked on it:<br />
<a href="http://bp2.blogger.com/_xixVZ5lgH1U/RshY-p6y7oI/AAAAAAAAAD0/uyUiqt9k3X4/s1600-h/security.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img src="http://bp2.blogger.com/_xixVZ5lgH1U/RshY-p6y7oI/AAAAAAAAAD0/uyUiqt9k3X4/s320/security.JPG" align="middle" border="0" /></a><br />
So I was fretting that I cannot edit the ACL for the file or the folder. I dont know if this is just my machine, or if this is generic. I somehow remember right clicking on a file/folder and adding another user to the ACL of that particular file/folder. But I have done that on my work machine which is part of a domain. Is it not possible to edit ACLs on a stand alone machine which is not part of a domain? Somebody please tell me that.</p>
<p>Meanwhile I was desperate to get my SSRS running, so I wrote this small code snippet in C# to add the ASPNET user to the ReportServer folder:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp">DirectoryInfo directoryInfo <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> DirectoryInfo<span style="color: #000000;">&#40;</span><span style="color: #666666;">@&quot;C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
DirectorySecurity dirSecurity <span style="color: #008000;">=</span> directoryInfo.<span style="color: #0000FF;">GetAccessControl</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF;">try</span>
&nbsp;
<span style="color: #000000;">&#123;</span>
	DirectorySecurity directorySecurity <span style="color: #008000;">=</span> directoryInfo.<span style="color: #0000FF;">GetAccessControl</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
	FileSystemAccessRule newAccessRule <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> FileSystemAccessRule<span style="color: #000000;">&#40;</span><span style="color: #008000;">new</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Security</span>.<span style="color: #0000FF;">Principal</span>.<span style="color: #0000FF;">NTAccount</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;MYCOMP&quot;</span>, <span style="color: #666666;">&quot;ASPNET&quot;</span><span style="color: #000000;">&#41;</span>, FileSystemRights.<span style="color: #0000FF;">FullControl</span>, AccessControlType.<span style="color: #0000FF;">Allow</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
	directorySecurity.<span style="color: #0000FF;">AddAccessRule</span><span style="color: #000000;">&#40;</span>newAccessRule<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
	Directory.<span style="color: #0000FF;">SetAccessControl</span><span style="color: #000000;">&#40;</span>directoryInfo.<span style="color: #0000FF;">FullName</span>, directorySecurity<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #0600FF;">catch</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">System</span>.<span style="color: #0000FF;">Runtime</span>.<span style="color: #0000FF;">InteropServices</span>.<span style="color: #0000FF;">SEHException</span> sehException<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
       Console.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span>sehException.<span style="color: #0000FF;">Message</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0600FF;">catch</span> <span style="color: #000000;">&#40;</span>Exception e<span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #000000;">&#123;</span>
	Console.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span>e.<span style="color: #0000FF;">Message</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>After that when I viewed the ACL for this folder, I saw that ASPNET user was successfully added. But this still did not solve my problem. So I wrote a similar piece of code to allow full permissions to the ASPNET user for every file inside the ReportServer folder.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp"><span style="color: #0600FF;">try</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #0600FF;">foreach</span> <span style="color: #000000;">&#40;</span>FileInfo fileInfo <span style="color: #0600FF;">in</span> directoryInfo.<span style="color: #0000FF;">GetFiles</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		FileSystemAccessRule newAccessRule <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> FileSystemAccessRule<span style="color: #000000;">&#40;</span><span style="color: #008000;">new</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Security</span>.<span style="color: #0000FF;">Principal</span>.<span style="color: #0000FF;">NTAccount</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;MYCOMP&quot;</span>, <span style="color: #666666;">&quot;ASPNET&quot;</span><span style="color: #000000;">&#41;</span>, FileSystemRights.<span style="color: #0000FF;">FullControl</span>, AccessControlType.<span style="color: #0000FF;">Allow</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
		fileSecurity <span style="color: #008000;">=</span> fileInfo.<span style="color: #0000FF;">GetAccessControl</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
		fileSecurity.<span style="color: #0000FF;">AddAccessRule</span><span style="color: #000000;">&#40;</span>newAccessRule<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
		File.<span style="color: #0000FF;">SetAccessControl</span><span style="color: #000000;">&#40;</span>fileInfo.<span style="color: #0000FF;">FullName</span>, fileSecurity<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0600FF;">catch</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">System</span>.<span style="color: #0000FF;">Runtime</span>.<span style="color: #0000FF;">InteropServices</span>.<span style="color: #0000FF;">SEHException</span> sehException<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
	Console.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span>sehException.<span style="color: #0000FF;">Message</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0600FF;">catch</span> <span style="color: #000000;">&#40;</span>Exception e<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
	Console.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span>e.<span style="color: #0000FF;">Message</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>After this when I tried to access the ReportServer website, it worked!! Anyway, this was just a one time fix. If I reinstall SQL Server again, then I might have run this code again. Is there some way to edit ACLs for a particular file/folder? Maybe I have not done enough searching.</p>
<p>Update: Found this link for the security tab: http://www.mydigitallife.info/2006/07/19/missing-or-no-security-tab-found-in-windows-xp-professional/</p>
]]></content:encoded>
			<wfw:commentRss>http://krishnamurthy.net.in/blog/2007/08/19/sql-server-reporting-service-woes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

