<?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>Anay Kamat's Weblog</title>
	<atom:link href="http://anaykamat.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://anaykamat.com</link>
	<description>Technology, Programming, Career, Fun, Friends And Thoughts</description>
	<lastBuildDate>Mon, 24 Aug 2009 05:43:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Search Google Visually</title>
		<link>http://anaykamat.com/2009/08/24/search-google-visually/</link>
		<comments>http://anaykamat.com/2009/08/24/search-google-visually/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 05:40:21 +0000</pubDate>
		<dc:creator>Anay</dc:creator>
				<category><![CDATA[My Thoughts]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[search engine]]></category>

		<guid isPermaLink="false">http://anaykamat.com/?p=90</guid>
		<description><![CDATA[Today I came across an online tool that allows you to see the screenshot of pages in the google search result. You can give it a try at &#8220;Veesual.com&#8221;


While I found the concept to be interesting, I was wondering what could be the use of looking at screenshots of pages in search result. What matters [...]]]></description>
			<content:encoded><![CDATA[<p>Today I came across an online tool that allows you to see the screenshot of pages in the google search result. You can give it a try at &#8220;<a href="http://veesual.com" target="_blank">Veesual.com</a>&#8221;</p>
<p><a rel="attachment wp-att-91" href="http://anaykamat.com/2009/08/24/search-google-visually/veesual/"><img class="aligncenter size-medium wp-image-91" title="Veesual" src="http://anaykamat.com/wp-content/uploads/2009/08/Veesual-300x162.png" alt="Veesual" width="300" height="162" /></a></p>
<p><a rel="attachment wp-att-92" href="http://anaykamat.com/2009/08/24/search-google-visually/veesualresult/"><img class="aligncenter size-medium wp-image-92" title="Veesual Result" src="http://anaykamat.com/wp-content/uploads/2009/08/VeesualResult-300x131.png" alt="Veesual Result" width="300" height="131" /></a></p>
<p>While I found the concept to be interesting, I was wondering what could be the use of looking at screenshots of pages in search result. What matters to me is getting a list of relevant search results. A thumbnail of a particular page in search result won&#8217;t help me in determining how relevant that page is to my search.</p>
<p>However, I do see one use for getting search results along with thumbnails. It can be used to come up with ideas for designing web-sites for a particular theme. You can search on Veesual using a keyword that describes the theme of your site and then take a quick look at the design of pages in the result. This can help you to come up with your own web-page design.</p>
<p>Do let me know if you can think of some more applications of <a href="http://veesual.com" target="_blank">Veesual.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://anaykamat.com/2009/08/24/search-google-visually/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple equivalent of &#8220;With&#8221; statement in C#</title>
		<link>http://anaykamat.com/2009/08/09/simple-equivalent-of-with-statement-in-c-sharp/</link>
		<comments>http://anaykamat.com/2009/08/09/simple-equivalent-of-with-statement-in-c-sharp/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 16:06:29 +0000</pubDate>
		<dc:creator>Anay</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[DSL]]></category>
		<category><![CDATA[lambdas]]></category>

		<guid isPermaLink="false">http://anaykamat.com/?p=84</guid>
		<description><![CDATA[Consider the following class in C#

	public class Person
	{
		private string name;
		private int age;

		public string Name{
			get {return name;}
			set { name = value; }
		}

		public int Age{
			get {return age;}
			set { age = value; }
		}
	}

If I want to set the value of Name and Age property on the instance of Person class, I&#8217;ll need to refer to that instance for [...]]]></description>
			<content:encoded><![CDATA[<p>Consider the following class in C#</p>
<pre class="brush: csharp;">
	public class Person
	{
		private string name;
		private int age;

		public string Name{
			get {return name;}
			set { name = value; }
		}

		public int Age{
			get {return age;}
			set { age = value; }
		}
	}
</pre>
<p>If I want to set the value of Name and Age property on the instance of Person class, I&#8217;ll need to refer to that instance for every property I need to set in the code. For example:</p>
<pre class="brush: csharp;">
var person = new Person();
person.Name = &quot;Super Man&quot;;
person.Age = 30;
</pre>
<p>It would have been great if C# had an equivalent of VB&#8217;s &#8220;With..End&#8221; statement, where we could refer to the instance of Person class only once and then refer to properties only.</p>
<p>Today, I came across this post &#8220;<a href="http://blog.bittercoder.com/PermaLink,guid,d1831805-dbf7-4b74-a6fd-2e9ed437c3d9.aspx" target="_blank">mucking about with hashes&#8230;</a>&#8220;, which shows how C# lambdas could be used as hashes. Using this concept, I implemented a simple extension method that simulates the behavior of VB&#8217;s &#8220;With..End&#8221; statement to some extent.</p>
<p>Here is the code for extension method:</p>
<pre class="brush: csharp;">
	public static class MetaExtensions
	{
		public static void Set(this object obj,params Func&lt;string,object&gt;[] hash){
				foreach(Func&lt;string,object&gt; member in hash){
					var propertyName = member.Method.GetParameters()[0].Name;
					var propertyValue = member(string.Empty);
					obj.GetType()
						.GetProperty(propertyName)
							.SetValue(obj,propertyValue,null);
				};
		}
	}
</pre>
<p>Using this extension method, we can set the value of properties on instance of Person class as follows:</p>
<pre class="brush: csharp;">
var person = new Person();
person.Set(
	Name =&gt; &quot;Super Man&quot;,
	Age =&gt; 30
);
</pre>
<p>Isn&#8217;t that cool?</p>
]]></content:encoded>
			<wfw:commentRss>http://anaykamat.com/2009/08/09/simple-equivalent-of-with-statement-in-c-sharp/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Fixing SyntaxHighligher plugin in Wordpress Blass2 theme</title>
		<link>http://anaykamat.com/2009/08/06/fixing-syntaxhighligher-plugin-in-wordpress-blass2-theme/</link>
		<comments>http://anaykamat.com/2009/08/06/fixing-syntaxhighligher-plugin-in-wordpress-blass2-theme/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 15:47:15 +0000</pubDate>
		<dc:creator>Anay</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://anaykamat.com/?p=76</guid>
		<description><![CDATA[Yesterday I installed and activated Blass2 theme for this blog. I liked this theme as it was very simple and free from any extra graphics. After installing the theme, I discovered that &#8220;SyntaxHighlighter Evolved&#8221; plugin which I use to display code segments, was not working. I searched for other themes which are similar to blass2 [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I installed and activated Blass2 theme for this blog. I liked this theme as it was very simple and free from any extra graphics. After installing the theme, I discovered that &#8220;<a href="http://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/" target="_blank">SyntaxHighlighter Evolved</a>&#8221; plugin which I use to display code segments, was not working. I searched for other themes which are similar to blass2 and can run syntaxhighlighter plugin, but couldn&#8217;t find anything better. Finally, this is how I fixed it.</p>
<p>To fix it, I had to edit &#8216;footer.php&#8217; of Blass2 theme using inbuilt theme editor of Wordpress (Appearance &gt; Editor). The original &#8216;footer.php&#8217; looked like this:</p>
<pre class="brush: php;">
&lt;div id=&quot;footer&quot;&gt;

 &lt;p&gt;&amp;copy; &lt;?php echo date(&quot;Y&quot;)?&gt; &lt;!-- Please leave this line intact --&gt;&lt;?php if (is_home()) : ?&gt;&lt;?php bloginfo('name'); ?&gt; | Theme &lt;a href=&quot;http://1000ff.de/wordpress-theme-blass-english-version/&quot;&gt;Blass&lt;/a&gt; by &lt;a href=&quot;http://1000ff.de/&quot;&gt;1000ff&lt;/a&gt;&lt;?php else : ?&gt;Theme Blass by 1000ff&lt;?php endif; ?&gt; | Powered by &lt;a href=&quot;http://wordpress.org/&quot;&gt;WordPress&lt;/a&gt;&lt;/p&gt;

&lt;/div&gt;</pre>
<p>To fix the plugin, you need to add a call to &#8216;wp_footer&#8217; function in &#8216;footer.php&#8217;.</p>
<pre class="brush: php;">
&lt;div id=&quot;footer&quot;&gt;

 &lt;p&gt;&amp;copy; &lt;?php echo date(&quot;Y&quot;)?&gt; &lt;!-- Please leave this line intact --&gt;&lt;?php if (is_home()) : ?&gt;&lt;?php bloginfo('name'); ?&gt; | Theme &lt;a href=&quot;http://1000ff.de/wordpress-theme-blass-english-version/&quot;&gt;Blass&lt;/a&gt; by &lt;a href=&quot;http://1000ff.de/&quot;&gt;1000ff&lt;/a&gt;&lt;?php else : ?&gt;Theme Blass by 1000ff&lt;?php endif; ?&gt; | Powered by &lt;a href=&quot;http://wordpress.org/&quot;&gt;WordPress&lt;/a&gt;&lt;/p&gt;
&lt;?php wp_footer() ?&gt;
&lt;/div&gt;</pre>
<p>After making this change, syntaxhighlighter plugin started working again.</p>
]]></content:encoded>
			<wfw:commentRss>http://anaykamat.com/2009/08/06/fixing-syntaxhighligher-plugin-in-wordpress-blass2-theme/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>After file and photo sharing, it&#8217;s time for &#8220;code sharing&#8221;</title>
		<link>http://anaykamat.com/2009/08/05/after-file-photo-sharing-its-time-for-code-sharing/</link>
		<comments>http://anaykamat.com/2009/08/05/after-file-photo-sharing-its-time-for-code-sharing/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 11:19:15 +0000</pubDate>
		<dc:creator>Anay</dc:creator>
				<category><![CDATA[My Thoughts]]></category>
		<category><![CDATA[Technologies]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[sharing]]></category>
		<category><![CDATA[software developer]]></category>

		<guid isPermaLink="false">http://anaykamat.com/?p=65</guid>
		<description><![CDATA[If we want to share a file or photos while chatting with our friends on internet using IM tools like GTalk, we use file sharing services available online. These services allow us to upload a file to their servers and give us a link which we can share with our friends. But what if you [...]]]></description>
			<content:encoded><![CDATA[<p>If we want to share a file or photos while chatting with our friends on internet using IM tools like GTalk, we use file sharing services available online. These services allow us to upload a file to their servers and give us a link which we can share with our friends. But what if you are a developer and want to share a small piece of code with your friend? You are left with following choices:</p>
<ul>
<li><strong>Paste it in your chat:</strong> I know most of us do this when we quickly want to share the code. However, its annoying as it becomes unreadable and makes your code look as if its obfuscated <img src='http://anaykamat.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<ul>
<li><strong>Email:</strong> This approach is better compared to previous approach, however the recipient wil need to manually compile the code and run it if he wants to know the output.</li>
</ul>
<p>I won&#8217;t say these approaches are useless. But I would like to have a place, where I can put my code fragment and then share it using a link. I can use this link in my gtalk status, chat or even in twitter posts.</p>
<p>Luckily, there is a site called &#8220;<a href="http://codepad.org/">codepad</a>&#8221; that allows us to do exactly the same thing. It allows us to share a piece of code using a small url.</p>
<p>You can try it now at &#8220;<a href="http://codepad.org/" target="_blank">http://codepad.org/</a>&#8221; or take a look at this example code posted by me at &#8220;<a href="http://codepad.org/XZpSNngW" target="_blank">http://codepad.org/XZpSNngW</a>&#8221;</p>
<p>Finally, one thing I would like to see is support for C# code.</p>
]]></content:encoded>
			<wfw:commentRss>http://anaykamat.com/2009/08/05/after-file-photo-sharing-its-time-for-code-sharing/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>C# 3.5 in Ubuntu</title>
		<link>http://anaykamat.com/2009/07/31/c-sharp-3-5-in-ubuntu/</link>
		<comments>http://anaykamat.com/2009/07/31/c-sharp-3-5-in-ubuntu/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 10:28:57 +0000</pubDate>
		<dc:creator>Anay</dc:creator>
				<category><![CDATA[Technologies]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mono]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://anaykamat.com/?p=59</guid>
		<description><![CDATA[Today, I managed to install Mono 2.4 in Ubuntu 9.04 without affecting Ubuntu&#8217;s default mono installation. Thanks to the instructions here (Building Mono 2.4 from source on Ubuntu 8.10), I was able to install latest mono/monodevelop in a parallel environment. Now I can work on C# 3.5 code in Linux as well.
Here is the screen [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I managed to install Mono 2.4 in Ubuntu 9.04 without affecting Ubuntu&#8217;s default mono installation. Thanks to the instructions <a href="http://www.centriment.com/2009/04/01/building-mono-24-from-source-on-ubuntu-810/" target="_blank">here (Building Mono 2.4 from source on Ubuntu 8.10)</a>, I was able to install latest mono/monodevelop in a parallel environment. Now I can work on C# 3.5 code in Linux as well.</p>
<p>Here is the screen shot of MonoDevelop instance with the code given in <a href="http://anaykamat.com/2009/04/08/y-combinator-in-csharp/" target="_blank">this post</a>.</p>
<p><a rel="attachment wp-att-60" href="http://anaykamat.com/2009/07/31/c-sharp-3-5-in-ubuntu/screenshot-functionaltest-monodevelop/"><img class="aligncenter size-medium wp-image-60" title="MonoDevelop running C# 3.5 code" src="http://anaykamat.com/wp-content/uploads/2009/07/Screenshot-FunctionalTest-MonoDevelop-300x163.png" alt="MonoDevelop running C# 3.5 code" width="300" height="163" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://anaykamat.com/2009/07/31/c-sharp-3-5-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Y-Combinator in C#</title>
		<link>http://anaykamat.com/2009/04/08/y-combinator-in-csharp/</link>
		<comments>http://anaykamat.com/2009/04/08/y-combinator-in-csharp/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 14:19:26 +0000</pubDate>
		<dc:creator>Anay</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technologies]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[functional programming]]></category>

		<guid isPermaLink="false">http://anaykamat.com/?p=58</guid>
		<description><![CDATA[For last few days, I was trying to use lambda feature of C# to implement Y-Combinator. After few trial and errors, I was able to implement it in C# 3.5. I&#8217;m currently posting the code here and in my next blog, I&#8217;ll explain how I derived it.
In this code, Y-Combinator function, is used to implement [...]]]></description>
			<content:encoded><![CDATA[<p>For last few days, I was trying to use lambda feature of C# to implement Y-Combinator. After few trial and errors, I was able to implement it in C# 3.5. I&#8217;m currently posting the code here and in my next blog, I&#8217;ll explain how I derived it.</p>
<p>In this code, Y-Combinator function, is used to implement anonymous recursive-factorial function called &#8216;factorial&#8217;.</p>
<pre class="brush: csharp;">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace YCombinator
{
    class Program
    {
        delegate Func RecursiveFunction(RecursiveFunction f);

        static void Main(string[] args)
        {

            Func, Func&gt;, Func&gt; Y = (f) =&gt;
            {
                RecursiveFunction function = (h) =&gt;
                {
                    return (x) =&gt;
                    {
                        return f(h(h))(x);
                    };
                };
                return function(function);
            };

            Func factorial = Y(function=&gt;
            {
                return x =&gt;
                {
                    return x == 0 ? 1 : x * function(x - 1);
                };
            });
            Console.WriteLine(factorial(5));
            Console.ReadLine();
        }
    }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://anaykamat.com/2009/04/08/y-combinator-in-csharp/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Missing attachment detector in Gmail</title>
		<link>http://anaykamat.com/2009/02/11/missing-attachment-detector-in-gmail/</link>
		<comments>http://anaykamat.com/2009/02/11/missing-attachment-detector-in-gmail/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 10:14:56 +0000</pubDate>
		<dc:creator>Anay</dc:creator>
				<category><![CDATA[My Thoughts]]></category>
		<category><![CDATA[Technologies]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[attachments]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[gmail labs]]></category>

		<guid isPermaLink="false">http://anaykamat.com/?p=57</guid>
		<description><![CDATA[It is really embarrassing to send an email with an attachment and actually forgetting to attach the file you were supposed to mail along, isn’t it? In my case, I often forget to attach files to emails if I’m typing it in hurry. Sometimes, I even end up receiving replies from recipients of those emails [...]]]></description>
			<content:encoded><![CDATA[<p>It is really embarrassing to send an email with an attachment and actually forgetting to attach the file you were supposed to mail along, isn’t it? In my case, I often forget to attach files to emails if I’m typing it in hurry. Sometimes, I even end up receiving replies from recipients of those emails requesting me to eat food instead of attachments. I don’t know about you, but for me this is really embarrassing!!!!!!</p>
<p>Luckily, today I came across a feature in Gmail Labs, which helps you to identify missing attachments as soon as you press send button. This small functionality in Gmail warns you if you have written something like “I’m attaching” or “I am attaching” or “I have attached” in your message body and you haven’t actually attached any file. I’m not sure if it is capable of identifying any other patterns in email text which suggests that you wanted to attach something. However, I tested for above 3 patterns and I’m good with it.</p>
<p>To enable this feature, you will need to login to your Gmail account. Then go to Settings -&gt; Labs, and enable ‘Forgotten Attachment Detector’. Don’t forget to click on ‘Save changes’ after that.</p>
<p>I would like to thank Mr. Jonathan K, for creating this useful feature in Gmail lab. It is definitely an important feature for me, and for many other people who like to eat attachments instead of food.</p>
]]></content:encoded>
			<wfw:commentRss>http://anaykamat.com/2009/02/11/missing-attachment-detector-in-gmail/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Are computers really becoming user friendly?</title>
		<link>http://anaykamat.com/2009/02/09/are-computers-really-becoming-user-friendly/</link>
		<comments>http://anaykamat.com/2009/02/09/are-computers-really-becoming-user-friendly/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 14:58:38 +0000</pubDate>
		<dc:creator>Anay</dc:creator>
				<category><![CDATA[My Thoughts]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[software developer]]></category>
		<category><![CDATA[user friendliness]]></category>

		<guid isPermaLink="false">http://anaykamat.com/?p=56</guid>
		<description><![CDATA[Gone are those days when users had to learn all the shell commands (Dos or Unix), to be able to use their PCs. Now you have Graphical User Interfaces or GUIs which allow you to do all those tasks simply by pointing and clicking at icons or menus with that small device near your keyboard [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal">Gone are those days when users had to learn all the shell commands (Dos or Unix), to be able to use their PCs. Now you have Graphical User Interfaces or GUIs which allow you to do all those tasks simply by pointing and clicking at icons or menus with that small device near your keyboard called ‘Mouse’. This means that we simply need to buy a computer and sit in front of it, and soon we will be able to use it effectively to manage all required information.</p>
<p class="MsoNormal">But wait!!!!! As computers are becoming smarter and smarter, some new age pirates are also becoming smarter. They are now finding new ways of hacking into your computer to steal your information with use of Trojans and viruses. For example, read this report on BBC News called ‘<strong><a href="http://news.bbc.co.uk/2/hi/technology/7872299.stm" target="_blank">Parking ticket leads to a virus</a></strong>’.</p>
<p class="MsoNormal">This makes me feel that nothing has changed as yet. Earlier, it was difficult to use computers because users had to learn all the commands which were required to operate it. Now, common users are often scared to use their computers for doing activities like online transactions as they need to learn all the ways to protect themselves and their data from hackers.</p>
<p class="MsoNormal">Well, what does this mean for software developers? Software developers must keep themselves updated about various security issues and design stable and secure system so that more and more users will be able to use technology without even having to learn things they are not supposed to. For those who think software development is easy, I agree with you. Yes, software development is easy. BUT, developing a stable, user friendly and secure application is definitely not as easy as writing ‘var x=a+b;’.</p>
]]></content:encoded>
			<wfw:commentRss>http://anaykamat.com/2009/02/09/are-computers-really-becoming-user-friendly/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fixing NTLM authentication in Windows 2003</title>
		<link>http://anaykamat.com/2008/10/28/fixing-ntlm-authentication-in-windows-2003/</link>
		<comments>http://anaykamat.com/2008/10/28/fixing-ntlm-authentication-in-windows-2003/#comments</comments>
		<pubDate>Tue, 28 Oct 2008 05:20:46 +0000</pubDate>
		<dc:creator>Anay</dc:creator>
				<category><![CDATA[Technologies]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[alfresco]]></category>
		<category><![CDATA[NTLM]]></category>
		<category><![CDATA[windows 2003]]></category>
		<category><![CDATA[windows xp]]></category>

		<guid isPermaLink="false">http://anaykamat.com/?p=55</guid>
		<description><![CDATA[We had an application written in C# .Net, which used to communicate with Alfresco Enterprise Document/Content Management System. The application was using Alfresco’s NTLM component for authenticating users against their AD (Active Directory) user account.
The application worked perfectly while we were testing it on Windows XP system. However, on Windows 2003 64 Bit system, the [...]]]></description>
			<content:encoded><![CDATA[<p>We had an application written in C# .Net, which used to communicate with Alfresco Enterprise Document/Content Management System. The application was using Alfresco’s NTLM component for authenticating users against their AD (Active Directory) user account.</p>
<p>The application worked perfectly while we were testing it on Windows XP system. However, on Windows 2003 64 Bit system, the application started failing as it could not authenticate users on alfresco server using NTLM.</p>
<p>So we had a situation where NTLM authentication used to fail only when our application was running on Windows 2003 Operating System. We tried disabling “Internet Explorer Enhanced Security Configuration”, but it didn’t help. Finally, after spending a lot of time on Google, we came across following article on Microsoft Knowledge Base:</p>
<blockquote><p><strong>&#8220;<a title="Microsoft Knowledge Base Article Link" href="http://support.microsoft.com/kb/954387" target="_blank">You may experience authentication issues when you access a network-attached storage device after you upgrade to Windows Server 2008, to Windows Vista, to Windows Server 2003, or to Windows XP</a>&#8220;</strong></p></blockquote>
<p>This article talks about configuring the system to use appropriate NTLM version. In our Windows 2003 system, the value of <strong>“lmcompatibilitylevel” </strong>(Under <strong>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\LSA</strong> subkey) was set to <strong>2</strong>. We just changed this value to <strong>1</strong>, and the client application started working properly in Windows 2003 system as well.</p>
<p>If you are also facing a similar issue on Windows 2003, then you can try the solution mentioned here. If setting the value of “lmcompatibilitylevel” to 1 makes no difference, then change this value to 0, which is the default value of “lmcompatibilitylevel” in Windows XP.</p>
]]></content:encoded>
			<wfw:commentRss>http://anaykamat.com/2008/10/28/fixing-ntlm-authentication-in-windows-2003/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Be careful while using ‘replaceAll’ and ‘replaceFirst’ methods of String class in Java</title>
		<link>http://anaykamat.com/2008/10/27/be-careful-while-using-%e2%80%98replaceall%e2%80%99-and-%e2%80%98replacefirst%e2%80%99-methods-of-string-class-in-java/</link>
		<comments>http://anaykamat.com/2008/10/27/be-careful-while-using-%e2%80%98replaceall%e2%80%99-and-%e2%80%98replacefirst%e2%80%99-methods-of-string-class-in-java/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 07:55:50 +0000</pubDate>
		<dc:creator>Anay</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[regular expression]]></category>
		<category><![CDATA[replace]]></category>
		<category><![CDATA[replaceAll]]></category>
		<category><![CDATA[replaceFirst]]></category>
		<category><![CDATA[String]]></category>

		<guid isPermaLink="false">http://anaykamat.com/?p=54</guid>
		<description><![CDATA[Most of the time, while trying to replace a substring in a given string, either all its occurrences or just the first one, java programmers tend to use ‘replaceAll’ and ‘replaceFirst’ methods provided by String class in Java. Java programmers like to use these methods to replace substrings as compared to ‘replace’ method of String [...]]]></description>
			<content:encoded><![CDATA[<p>Most of the time, while trying to replace a substring in a given string, either all its occurrences or just the first one, java programmers tend to use ‘replaceAll’ and ‘replaceFirst’ methods provided by String class in Java. Java programmers like to use these methods to replace substrings as compared to ‘replace’ method of String class because of different reasons like:</p>
<ol>
<li>‘replaceAll’ and ‘replaceFirst’ methods use regular expressions instead of character sequence. It is pre-assumed most of the time that using these methods will allow us to replace a given pattern in future, instead of just replacing a substring.</li>
<li>‘replaceAll’ and ‘replaceFirst’ methods are named such that they clarify the intent of their execution.</li>
</ol>
<p>However, while using these methods, we need to be very careful while providing the string value which would replace a given substring or a pattern. Let’s understand why with the following example:</p>
<p>Run the following java code:</p>
<pre class="brush: java;">public class StringReplace {

public static void main(String[] args){
String stringValue = &quot;test1 test2 test1 test3&quot;;
String replaceValue = &quot;test&quot;;
stringValue = stringValue.replaceAll(&quot;test1&quot;, replaceValue);
System.out.print(stringValue);
}

}</pre>
<p>This code works properly. But now try running the same code by changing the value of variable ‘replaceValue’ as:</p>
<pre class="brush: java;">String replaceValue = &quot;$100&quot;;</pre>
<p>This would result in an exception of type ‘IndexOutOfBoundException’. This is because the ‘$’ symbol is used to identify a group from the regular expression which is the first parameter of ‘replaceAll’ or ‘replaceFirst’ method. We can solve this problem by:</p>
<ol>
<li>Using ‘replace’ method: This would be the good choice if you want to replace a string literal and not a pattern.</li>
<li>Escaping ‘$’ symbol: If you need to a use regular expression, and your pattern has no groups identified, then you can escape any group identification symbols from your replace string as shown below:</li>
</ol>
<p style="text-align: center;">
<pre class="brush: java;">String replaceValue = java.util.regex.Matcher.quoteReplacement(&quot;$100&quot;);</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://anaykamat.com/2008/10/27/be-careful-while-using-%e2%80%98replaceall%e2%80%99-and-%e2%80%98replacefirst%e2%80%99-methods-of-string-class-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
