<?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>Ankit Jain &#187; code</title>
	<atom:link href="http://ankitjain.info/ankit/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://ankitjain.info/ankit</link>
	<description>» It’s all about Ankit and Web! «</description>
	<lastBuildDate>Thu, 02 Jun 2011 16:54:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Split Pascalcase String</title>
		<link>http://ankitjain.info/ankit/2009/09/11/spliting-camelcase-string/</link>
		<comments>http://ankitjain.info/ankit/2009/09/11/spliting-camelcase-string/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 18:32:12 +0000</pubDate>
		<dc:creator>Ankit</dc:creator>
				<category><![CDATA[Programming/Code]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[regexp]]></category>

		<guid isPermaLink="false">http://ankitjain.info/ankit/?p=344</guid>
		<description><![CDATA[Do you ever need to split a camel case or pascal case string to a set of words? This can be achieved simply by regular expressions in Java as well as C#. The following code is for Java: String camelCase = "StructuralDesignPattern"; StringBuffer label = new StringBuffer(camelCase + 10); java.util.regex.Pattern p = java.util.regex.Pattern.compile("[A-Z][a-z]+"); java.util.regex.Matcher m [...]]]></description>
			<content:encoded><![CDATA[<p>Do you ever need to split a camel case or pascal case string to a set of words? This can be achieved simply by regular expressions in Java as well as C#. The following code is for Java:<br />
<code><br />
		    String camelCase = "StructuralDesignPattern";<br />
		    StringBuffer label = new StringBuffer(camelCase + 10);<br />
		    java.util.regex.Pattern p = java.util.regex.Pattern.compile("[A-Z][a-z]+");<br />
		    java.util.regex.Matcher m = p.matcher(camelCase);<br />
		    while ( m.find() )<br />
		    {<br />
			label.append( m.group() + " ");<br />
		    }<br />
		    System.out.println(camelCase + " >> " + label.toString());<br />
</code></p>
<p>[ Note: this does not work for all test cases. You may also want to try regexp as <em>"[A-Z][a-z]+&#8221;</em>, for matching any continues uppercase letters too (e.g. AnkitJainFROMIndia >> Ankit Jain FROMIndia) ]</p>
<p>Jon Galloway <a target="_blank" href="http://weblogs.asp.net/jgalloway/archive/2005/09/27/426087.aspx">points out a tricky method</a> for C#.</p>
]]></content:encoded>
			<wfw:commentRss>http://ankitjain.info/ankit/2009/09/11/spliting-camelcase-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Handicapped Software</title>
		<link>http://ankitjain.info/ankit/2009/07/25/software-disability-user-expectation/</link>
		<comments>http://ankitjain.info/ankit/2009/07/25/software-disability-user-expectation/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 08:44:37 +0000</pubDate>
		<dc:creator>Ankit</dc:creator>
				<category><![CDATA[Coding Guidelines]]></category>
		<category><![CDATA[Programming/Code]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://ankitjain.info/ankit/?p=334</guid>
		<description><![CDATA[[ This post is about software's disability to meet users' expectations. I know you have developed lots of software/applications over your career! Have you ever evaluated them on disability index? No, then read on. "You" = refers to our typical "software engineer" ] Ever heard someone saying &#8220;this software sucks&#8221;&#8230; I love such moments. It [...]]]></description>
			<content:encoded><![CDATA[<p><small>[ This post is about software's disability to meet users' expectations. I know you have developed lots of software/applications over your career! Have you ever evaluated them on disability index? No, then read on. "You" = refers to our typical "software engineer" ]</small></p>
<p>Ever heard someone saying &#8220;this software sucks&#8221;&#8230; I love such moments. It makes me laugh, not for the user,  but for the poor developer! Users are innocent, they are not concerned about technical details. A software is there to make life simpler and hide complications of a task. It&#8217;s your responsibility to make it intuitive and meet users expectation on first impression, rather showing unnecessary (modal) alert boxes or irrelevant (technical) details. You don&#8217;t need to be a Usability Engineer. Just, </p>
<ul>
<li> stand on users&#8217; shoe and think what is annoying</li>
<li> don&#8217;t take negative feedback as an attack on you and your beliefs.<br />
Rather it&#8217;s a feedback on your understanding about <em>how much you understand your users</em>. In short never reject/resist on feedback. </li>
</ul>
<p><a href="http://www.codinghorror.com/blog/archives/001289.html" target="_blank" >Nobody hates software more than software developers</a> and nobody distrust software more than software developers. Scott Berkun has written a good post about <a target="_blank" href="http://www.scottberkun.com/essays/46-why-software-sucks/">why software sucks</a>. ( I have heard software engineers saying that they don&#8217;t trust online money transactions.  Heck !! Do you need President to meet you and ensure? ) </p>
<p>Here is what I think you should target as first step:</p>
<ul>
<li>Any tasks that you think user should perform by reading Help/Documentation, MUST be automated.</li>
<li>Even an single unnecessary alert box annoys. Features should be available with less no of clicks. Still this is very subjective matter to discuss. A simple guidelines is &#8211; only system errors or exceptions should raise alert-box, tiny information should be modal-less dialogs (or like balloon pop-up).</li>
<li>users never read entire screen. Default values chosen or default selection of check-boxes makes big difference in a long run.<br />
E.g. while filling an online form a default selection of check-box &#8220;subscribe me for spam mails&#8221;. Who does read entire form before clicking submit? None. But it affects your reputation in long run.</li>
<li>Never hesitate in picking a useful (cool, awesome, sexy, astonishing, amazing! ) feature from competitive software. Ask a simple question &#8211; Does it add value to your product? You won&#8217;t like this argument, but this is truth. The success of Web is a tiny &#8216;view source&#8217; feature. Well, this is a fast moving industry where we learn from other, we improve over time. You never blame the world for borrowing <a href="http://en.wikipedia.org/wiki/Tabbed_browsing">tabbed browsing</a> from Opera (originally by NetCaptor). It&#8217;s a matter of accessibility, and understanding what your users like and what they dislike is a key to success.</li>
<li>Don&#8217;t recruit incompetent programmers, because a <a href="http://www.sigsoft.org/SEN/parnas.html" target="_blank">incompetent programmer creates two new jobs a year</a>.  If you have a few already, either trains them or fire them. (Sorry pals)</li>
</ul>
<p>- ankit<br />
( and finally, this is a 100th post on this blog. Happy Blogging! )</p>
]]></content:encoded>
			<wfw:commentRss>http://ankitjain.info/ankit/2009/07/25/software-disability-user-expectation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unreachable code Error or Warning?</title>
		<link>http://ankitjain.info/ankit/2009/07/08/java-unreachable-error-why/</link>
		<comments>http://ankitjain.info/ankit/2009/07/08/java-unreachable-error-why/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 04:14:13 +0000</pubDate>
		<dc:creator>Ankit</dc:creator>
				<category><![CDATA[Coding Guidelines]]></category>
		<category><![CDATA[Programming/Code]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://ankitjain.info/ankit/?p=330</guid>
		<description><![CDATA[In Java, unreachable code is treated as compilation error. What do you think? Isn&#8217;t making it warning would have made developers&#8217; life simpler? Of course you can write &#8211; if( true ) &#160;&#160;&#160;return; What if you could simply write return. This helps in testing a function quickly. As a good programming practice we always remove [...]]]></description>
			<content:encoded><![CDATA[<p>In Java, unreachable code is treated as compilation error. What do you think? Isn&#8217;t making it warning would have made developers&#8217; life simpler?</p>
<p>Of course you can write &#8211; </p>
<blockquote><p><code>if( true )<br />
&nbsp;&nbsp;&nbsp;return;<br />
</code> </p></blockquote>
<p>What if you could simply write return. This helps in testing a function quickly. As a good programming practice we always remove all warnings from code, and such unconditional return statements can be rectified later.</p>
]]></content:encoded>
			<wfw:commentRss>http://ankitjain.info/ankit/2009/07/08/java-unreachable-error-why/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting up SDB for MySQL</title>
		<link>http://ankitjain.info/ankit/2009/06/21/configure-jena-sdb-mysql-ubuntu/</link>
		<comments>http://ankitjain.info/ankit/2009/06/21/configure-jena-sdb-mysql-ubuntu/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 15:33:05 +0000</pubDate>
		<dc:creator>Ankit</dc:creator>
				<category><![CDATA[Programming/Code]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://ankitjain.info/ankit/?p=327</guid>
		<description><![CDATA[Jena is a semantic web framework implemented in Java. It allows you to store/query/inference RDF/RDSF/OWL triples. In Jena a set of triples (in RDF) are called Model or stored within Model object. By default Jena creates in-memory models, but this is not suitable if you have pretty large set of triples to process. Here comes [...]]]></description>
			<content:encoded><![CDATA[<p>Jena is a semantic web framework implemented in Java. It allows you to store/query/inference RDF/RDSF/OWL triples. In Jena a set of triples (in RDF) are called Model or stored within Model object. By default Jena creates in-memory models, but this is not suitable if you have pretty large set of triples to process. Here comes SDB to rescue you. It&#8217;s a component of Jena that allows you to store these models in relational databases like MySQL, MSSQL, PostgreSQL, Oracle, etc; This post describes my experience while setting up SDB on Ubuntu.</p>
<ol>
<li><a href="http://jena.hpl.hp.com/wiki/SDB" target="_blank">Download SDB</a>. Extract it into some folder.</li>
<li>SDB works with SUN Java only. Ubuntu has GNU Java installed by default. You need to install SUN Java and <a href="http://ankitjain.info/ankit/2009/06/21/set-default-jvm-linux-sun-update/">set it as default</a>.<br />
<em>[Note: you know why this point is important? I wasted 1 hr when I did same setup second time. Later I realized I was using GNU libgcj (gij/gcj). For god's sake, someone please kill gcj... </em></li>
<li>Create a database for SDB in MySQL. I did using phpMyAdmin. Let&#8217;s call this database <em>SDB2</em>.</li>
<li>Prepare a store description file. It serves as config for SDB and contains information like where to connect. You will find one such example file in the SDB directory. Here is an example for the description file I have used:<br />
<code>@prefix sdb:     &lt;http://jena.hpl.hp.com/2007/sdb#&gt; .<br />
@prefix rdfs:	 &lt;http://www.w3.org/2000/01/rdf-schema#&gt; .<br />
@prefix rdf:     &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt; .<br />
@prefix ja:      &lt;http://jena.hpl.hp.com/2005/11/Assembler#&gt; .<br />
# MySQL - InnoDB<br />
&lt;#store&gt; rdf:type sdb:Store ;<br />
    sdb:layout     "layout2" ;<br />
    sdb:connection &lt;#conn&gt; ;<br />
    sdb:engine     "InnoDB" ;      # MySQL specific<br />
.<br />
&lt;#conn&gt; rdf:type sdb:SDBConnection ;<br />
    sdb:sdbType       "MySQL" ;     # Needed for JDBC URL<br />
    sdb:sdbHost       "localhost" ; #  or the IP address of the database server<br />
    sdb:sdbName       "SDB2" ;    # MySQL database name<br />
    sdb:sdbUser       "username";<br />
    sdb:sdbPassword   "password";<br />
    sdb:driver        "com.mysql.jdbc.Driver" ;<br />
    .<br />
</code>
</li>
<li>Set environment variables:
<p>SDB installation directory &#8211;<br />
<code>export SDBROOT="/home/ankit/tmp/SDB"</code></p>
<p>Path to MySQL JDBC commector jar which contains <code>com.mysql.jdbc.Driver</code> class.<br />
<code>export SDB_JDBC="/home/ankit/tmp/SDB/mysql-connector-java-5.1.7-bin.jar"</code></li>
<li>Required tables must be created in database before we can use it. Run following to initialize <code>SDB2</code> database. This creates 4 tables inside <code>SDB2</code>.<br />
<code> bin/sdbconfig --sdb=sdb.ttl --create</code><br />
If this fails, somthing went wrong with settings. Check them again.</li>
<li>Next you can run test suit to ensure everything is working fine.<br />
<code>bin/sdbtest --sdb=sdb.ttl testing/manifest-sdb.ttl</code></p>
<p>In my case one testcase failed stating -</p>
<blockquote><p><code>Failure:  Unicode-5(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB): Results sets not the same</code></p></blockquote>
</li>
</ol>
<p>I decided to write this as the SDB wiki does now contains clear steps to follow. Hope your semantic (web) application ROCKS !</p>
<p>- ankit</p>
]]></content:encoded>
			<wfw:commentRss>http://ankitjain.info/ankit/2009/06/21/configure-jena-sdb-mysql-ubuntu/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting Default JVM on Ubuntu</title>
		<link>http://ankitjain.info/ankit/2009/06/21/set-default-jvm-linux-sun-update/</link>
		<comments>http://ankitjain.info/ankit/2009/06/21/set-default-jvm-linux-sun-update/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 19:46:02 +0000</pubDate>
		<dc:creator>Ankit</dc:creator>
				<category><![CDATA[Quick Tricks]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://ankitjain.info/ankit/?p=324</guid>
		<description><![CDATA[Heard of &#8216;update-alternatives&#8217; on Linux? It&#8217;s a smart utility to find various versions of one software and set default. For example, you may have GNU Java as well as Sun Java. (frankly saying, I hate GNU Java, aka gcj) sudo update-alternatives --config java [ Where can I see all installed JVM? On Ubuntu, Java Virtual [...]]]></description>
			<content:encoded><![CDATA[<p>Heard of &#8216;update-alternatives&#8217; on Linux? It&#8217;s a smart utility to find various versions of one software and set default.</p>
<p>For example, you may have GNU Java as well as Sun Java. (frankly saying,  <a target="_blank" href="http://www.google.com/search?q=gcj+(UTF-8+or+mysql)+encoding+issues">I hate GNU Java, aka gcj</a>)</p>
<blockquote><p>
<code>sudo update-alternatives --config java</code></p></blockquote>
<p>[ <strong>Where can I see all installed JVM?</strong><br />
On Ubuntu, Java Virtual Machines are installed in <code>/usr/lib/jvm</code>. You can see <em>java-gcj</em> here which comes by default with Ubuntu.<br />
]<br />
- ankit</p>
]]></content:encoded>
			<wfw:commentRss>http://ankitjain.info/ankit/2009/06/21/set-default-jvm-linux-sun-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lucene StopWords</title>
		<link>http://ankitjain.info/ankit/2009/05/27/lucene-search-ignore-word-list/</link>
		<comments>http://ankitjain.info/ankit/2009/05/27/lucene-search-ignore-word-list/#comments</comments>
		<pubDate>Tue, 26 May 2009 20:17:10 +0000</pubDate>
		<dc:creator>Ankit</dc:creator>
				<category><![CDATA[Programming/Code]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[lucene]]></category>
		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://ankitjain.info/ankit/?p=314</guid>
		<description><![CDATA[Lucene is a open-source high performance full-text search engine and has libraries for almost all well known languages (Java, C#, PHP, Python, C). This post is about describing StopWords for a full-text search engine (Lucene). ( Lucene can also be used to index database table rows. The advantage for having Lucene search instead of (database [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://lucene.apache.org/" target="_blank">Lucene</a> is a open-source high performance full-text search engine and has libraries for almost all well known languages (Java, C#, PHP, Python, C). This post is about describing StopWords for a full-text search engine (Lucene).</p>
<p>( Lucene can also be used to index database table rows. The advantage for having Lucene search instead of (database software&#8217;s) in-build full-text search engine is Lucene ranks search results based on their relevancy. For example assume you have a product table with &lt;title , description&gt; fields and you want to give higher rank to &#8216;title&#8217; over &#8216;description&#8217;. )</p>
<p>A <strong>stopword</strong> is a language-word that has no significance meaning in a keyword based search system (e.g. Google). Lucene also has a set of such words for English language and these are simply ignored while analyzing/tokenizing text. You can find them inside <code>org/apache/lucene/analysis/StopAnalyzer.java</code> file declared as <code>StopAnalyzer.ENGLISH_STOP_WORDS</code> constant.</p>
<blockquote><p><code>public static final String[] ENGLISH_STOP_WORDS = {<br />
    "a", "an", "and", "are", "as", "at", "be", "but", "by",<br />
    "for", "if", "in", "into", "is", "it",<br />
    "no", "not", "of", "on", "or", "such",<br />
    "that", "the", "their", "then", "there", "these",<br />
    "they", "this", "to", "was", "will", "with"<br />
  };</code></p></blockquote>
<p>You can also specify your own <strong>stopwords</strong> while indexing text. Use <a href="http://lucene.apache.org/java/2_4_0/api/org/apache/lucene/analysis/standard/StandardAnalyzer.html#StandardAnalyzer(java.util.Set)"  target="_blank">StandardAnalyzer&#8217;s constructor</a> and pass a set of words as agrument. These will be ignored while indexing.</p>
<p>- ankit</p>
]]></content:encoded>
			<wfw:commentRss>http://ankitjain.info/ankit/2009/05/27/lucene-search-ignore-word-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Proposal for WordPress Summer of Code</title>
		<link>http://ankitjain.info/ankit/2009/04/02/google-summer-of-code-event-management/</link>
		<comments>http://ankitjain.info/ankit/2009/04/02/google-summer-of-code-event-management/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 18:17:35 +0000</pubDate>
		<dc:creator>Ankit</dc:creator>
				<category><![CDATA[Programming/Code]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://ankitjain.info/ankit/?p=299</guid>
		<description><![CDATA[Requirements: Create a suite of plug-ins for event planning, tie it into WordPress MU/BuddyPress/bbPress, and create a community organizing platform for open source release. Using WordCamp.org as the test case, the resulting site would include functionality for registration, calendaring, additional roles/permissions, extended profiles, directories (vendors, participants, etc), discussion and messaging, coordination around things like carpooling [...]]]></description>
			<content:encoded><![CDATA[<p><strong><span>Requirements</span></strong><span>: Create a suite of plug-ins for event planning, tie it into WordPress MU/BuddyPress/bbPress, and create a community organizing platform for open source release. Using WordCamp.org as the test case, the resulting site would include functionality for registration, calendaring, additional roles/permissions, extended profiles, directories (vendors, participants, etc), discussion and messaging, coordination around things like carpooling and planning meetings, event media, etc. Source <a href="http://codex.wordpress.org/GSoC2009">WordPress GSoC2009</a>. This proposal generalizes it further.</span></p>
<h2><span><span style="font-size: 10pt;">Project Proposal </span></span></h2>
<p><span>Social networks are a medium of easier communication, bounding and bringing people together. Any effort made to achieve this is highly appreciated by the community (of users).  Event management is a recently discovered feature in social networks. Implementing this in WordPress will surly bring WordPress to a new height allowing users to create/share/participate/notify events. This feature has already been a part of LinkedIn and Facebook.</span></p>
<p><span>Following are few possibilities that can be included in WordPress MU/BuddyPress. Looking forward for feedback and prioritizing:</span></p>
<ol>
<li>Event Organizer: allowing users to create, edit, delete events. In addition, time zone coordination and showing time in user’s local time zone, geo-location, etc.</li>
<li><span>Attendance: users can mark for their attendance. (e.g.  interested, may attend, attending, not attending)</span></li>
<li><span>Search for upcoming events. This can be extended as event directory allowing location specific search, tag cloud / browse by category.</span></li>
<li><span>Roles: users can indicate their role for events. E.g. organizer, participant, volunteer, promoter/sponsor, etc;</span></li>
<li><span>Revision History: this becomes important component when we want multiple users (in addition to event creator) to modify/propose event details.</span></li>
<li><span>Discussion: each event will have a forum for users’ views. For simplicity this should be a flat blog-post comment like listing (or like Twitter’s update listing).</span></li>
<li><span>Tagging: free tagging. Or categorization of event (e.g. educational, cultural, get-together/party, conference, show, outing, etc <img src='http://ankitjain.info/ankit/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . Categorization sometimes known as controlled tagging.</span></li>
<li><span>Group integration: if implemented in Buddypress, an event can be restricted to one (or possibly more) group.</span></li>
<li><span>Blog-post integration: while writing a blog-post, users can indicate associate events. And now, these posts appear on event’s detail page as ‘blogs that talk about this event’.</span></li>
<li><span>Notifications/Reminders: sending reminder emails to all interested. This includes users who have indicated as interested, attending, may attend.</span></li>
<li><span>RDF support: This is an effort to produce semantic data <img src='http://ankitjain.info/ankit/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  as machine interpretable. Event details should be encoded as RDFa (RDF/XML) using <a href="http://www.w3.org/TR/rdfcal/">http://www.w3.org/TR/rdfcal/</a> ontology. </span></li>
<li><span>Admin page: settings like to enable/disable discussions, notifications, revisions, etc;</span></li>
</ol>
<p><span> </span></p>
</p>
<h2><span><span style="font-size: 10pt;">Schedule of Deliverables / Milestones </span></span></h2>
<p><strong>1<sup>st</sup> May to 31<sup>st</sup> May</strong>:  Design and Basic framework:</p>
<p><span>Before any code deliverable, it is necessary that we lay down a good foundation.</span></p>
<ol>
<li>Brainstorming, discussion threads, design and then wireframes are required to set the project in motion and prevent unnecessary rewriting/modifications to the code. (as what I have observed on WordPress Dev Blog).
	</li>
</ol>
<p><span>The first code-deliverable will consist of (in addition to the database backend) – </span></p>
<ol>
<li><span>Event creation and edit page. (assuming an event is public and available to all)</span></li>
<li><span>Basic Upcoming events box (as widget/sidebar)</span></li>
<li><span>Event details page</span></li>
<li><span>(Optional) Event discussion: any user can post simple comments on the event page.</span></li>
<li><span>Installer script – included with the plug-in itself.</span></li>
</ol>
<p><strong><span>1st June to 30th June: </span></strong><span>Advanced features</span></p>
<p><span>I’m not finalizing what features shall be there in next milestones. It’s a community project and community’s feedback and rating priority to each feature plays an important role for deciding deliverables. In my opinion the next milestone should have –</span></p>
<ol>
<li>Attendance (e.g.  interested, may attend, attending, not attending)</li>
<li>User roles ( e.g. organizer, participant, volunteer, promoter/sponsor, etc)</li>
<li>Search and Tagging</li>
<li>Revision History</li>
<li>Blog post integration</li>
<li>RDF/XML integration</li>
</ol>
<p><span>This is merely my opinion. Community’s comments and suggestions are welcomed. We (with mentor) should plan for systematic pre-releases. This will helps us in getting early feedback from WordPress community for features and code-reviews.</span></p>
<p><span>I do not have any commitments during this period. I have 3 months of free time starting from 1st of May.</span></p>
<h2><span><span style="font-size: 10pt;">Open Source Development Experience</span></span></h2>
<p><span>I have not been a part of any open source project officially. I am willing to be a part of WP community.</span></p>
<h2><span><span style="font-size: 10pt; ">Work/Internship Experience </span></span></h2>
<p><span>I have 3 years of work experience in Web development (ASP.Net, PHP, WordPress and Drupal). In addition, I do freelancing work time to time to fund my studies. This includes PHP scripts and Drupal development. I have experience with version control systems too.</span></p>
<h2><span><span style="font-size: 10pt;">Academic Experience </span></span></h2>
<p><span>I am currently doing M.Tech (2nd year) from IIT Kanpur. I am studying Comp Sci. and Engineering. </span><span>My Research Interests includes:  <em>Software Design &amp; Architecture</em>, <em>Knowledge engineering</em>, <em>Social Networks</em>.</span></p>
<h2><span><span style="font-size: 10pt; ">Why WordPress </span></span></h2>
<p>WordPress is a state of art for software for blogging. Other open source CMS offers just basic blogging features. I am associated with WordPress for the last 4 years and passionate about it. My WP blog is hosted at <a href="http://ankitjain.info/ankit/">http://ankitjain.info/ankit</a> running v2.6.</p>
<p><span>Summer of Code is an exciting opportunity for me. For my WP blog I have done basic customizations. This includes post specific advertisements, customizations of theme file, etc. This opportunity gives me an official chance to contribute to my favorite Web application. Such open source development experience and time to time guidance from mentor will surly help me to understand and boost passion, binding with community and coding standards. </span></p>
<p>
Thanks,<br />
- ankit</p>
]]></content:encoded>
			<wfw:commentRss>http://ankitjain.info/ankit/2009/04/02/google-summer-of-code-event-management/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Windows CardSpace: FAQ for ASP.NET Developers</title>
		<link>http://ankitjain.info/ankit/2007/06/19/windows-infocard-faq-developers/</link>
		<comments>http://ankitjain.info/ankit/2007/06/19/windows-infocard-faq-developers/#comments</comments>
		<pubDate>Tue, 19 Jun 2007 18:27:39 +0000</pubDate>
		<dc:creator>Ankit</dc:creator>
				<category><![CDATA[.net 3.0]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Programming/Code]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://ankitjain.info/ankit/2007/06/19/windows-infocard-faq-developers</guid>
		<description><![CDATA[Few frequently asked question for ASP.NET developers: The Identity Selector dialog box is displayed only for SSL protected pages. Therefore you are required to deploy your application on a Web server and install a SSL Certificate. Windows CardSpace does not work with Self Signed Certificates and will die horribly. These certificates do not have CRL [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal">Few frequently asked question for ASP.NET developers:</p>
<ol type="1" style="margin-top: 0in" start="1">
<li class="MsoNormal">The Identity Selector dialog      box is displayed only for SSL protected pages. Therefore you are required      to deploy your application on a Web server and <a target="_blank" href="http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/iis/56bdf977-14f8-4867-9c51-34c346d48b04.mspx">install a SSL Certificate</a>.</li>
<li class="MsoNormal">Windows CardSpace does not      work with Self Signed Certificates and <span lang="EN">will die horribly</span>. These certificates <a target="_blank" href="http://idunno.org/archive/2007/04/06/Self-signed-Certificates-and-CardSpace.aspx">do not have CRL field</a>. It contains a <span lang="EN">URL that CardSpace will check for the      revocation list</span>.</li>
<li class="MsoNormal">For ASP.NET developers      there is Toolbox control written by <a target="_blank" href="http://www.codecomplete.de/blogs/digitalidentity/archive/2007/03/18/visual-studio-2005-toolbox-for-windows-cardspace.aspx">Christian Arnold</a>. Add this to your Toolbox and you won&#8217;t need to write a single line of code. <a target="_blank" href="http://www.codecomplete.de/blogs/digitalidentity/archive/2007/04/11/demo-video-use-windows-cardspace-and-the-visual-studio-toolbox-for-windows-cardspace.aspx">Watch demo</a>.</li>
<li class="MsoNormal">When you use CardSpaceLogin controls you must run application over SSL. The application pool also need to be run under <strong>Local System</strong>s identify;      otherwise <em>w3wp.exe</em> process will not be able to retrieve server&#8217;s private key. In such case you may end up with error stating <em>Keyset does not exist</em>. <span style="color: red">Note: This is not advisory if the application pool is shared with other Web applications. </span> [ Edited: Refer Barry Dorrans comment for more <a target="_blank" href="http://idunno.org/archive/2007/07/01/giving-your-web-site-process-access-to-your-ssl-certificate.aspx">details</a>.]</li>
<li class="MsoNormal">When using Information cards there is nothing like <em>passwords</em>.</li>
<li class="MsoNormal">CardSpaceLogin controls are integrated with your identify providers such as Forms Authentication. For example: If you use Information Card to register a user, his details are reflected in the identify source.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://ankitjain.info/ankit/2007/06/19/windows-infocard-faq-developers/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>TFS &#8211; Free Text search in History Objects</title>
		<link>http://ankitjain.info/ankit/2007/05/29/tfs-free-text-search-in-history-objects/</link>
		<comments>http://ankitjain.info/ankit/2007/05/29/tfs-free-text-search-in-history-objects/#comments</comments>
		<pubDate>Tue, 29 May 2007 07:52:33 +0000</pubDate>
		<dc:creator>Ankit</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Programming/Code]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[tfs]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://ankitjain.info/ankit/2007/05/29/tfs-%e2%80%93-free-text-search-in-history-objects</guid>
		<description><![CDATA[It&#8217;s a best practice to add comment when you do check-in to the source control. A text comment is associated with the change you made to the item. Some of the times you need to find a particular comment, but the View History tool available with Visual Studio/TFS is limited that you can&#8217;t make a [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s a best practice to add comment when you do check-in to the source control. A text comment is associated with the change you made to the item. Some of the times you need to find a particular comment, but the <em>View History</em> tool available with Visual Studio/TFS is limited that you can&#8217;t make a search in the history results. Say you want to find all check-ins by a particular user <img src='http://ankitjain.info/ankit/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p><img alt="History Tool in Visual Studio 2005" src="http://ankitjain.info/ankit/wp-content/052907_0752_TFSFreeText12.png" /></p>
<p>Here comes the purpose of this small add-in. It provides search within history comments and find a particular change-set instead of traversing the whole list. The plug-in goes one step forward and facilitates free text search in change-set fields. For example you can use change-set id, username or even date-time as search keywords!!!</p>
<p>The major steps involved in developing this add-in are:</p>
<ol>
<li>Writing an add-in for Visual Studio 2005,</li>
<li>Getting file history from Team Foundation Server (TFS),</li>
<li>Look for the selected item in the Visual Studio IDE,</li>
<li>Free text search along with the tools to compare two files.</li>
</ol>
<p><span id="more-97"></span></p>
<p>Visual Studio 2005 provides templates to build add-ins in few minutes. Refer <a target="_blank" href="http://www.devx.com/vstudioextensibility/Article/31354">www.devx.com</a> for step-by-step guide for building Visual Studio app-ins. Additionally, you can download <a target="_blank" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=79c7e038-8768-4e1e-87ae-5bbbe3886de8&#038;displaylang=en">Visual Studio 2005 Automation Samples</a> for detailed code illustrations with documentation.</p>
<p>Once you have completed the <em>Visual Studio Add-in wizard</em> the IDE generates <span style="font-family: Courier New; font-size: 10pt">Connect.cs</span> file and dumps some code for basic functionality. The next step is to retrieve history from the TFS for selected file. Refer my previous post, <a href="http://ankitjain.info/ankit/2006/12/13/tfs-version-control-build-history">Fetching file history from TFS</a> to find out how to fetch file history objects from Version Control Server.</p>
<p>Moving forward we need to find out the currently selected item in the Visual Studio IDE. Visual Studio exposes various properties/objects allowing you to query almost any UI controls and get their status.  The following code first finds the active window. If it is Source Control Explorer and then looks for the selected item within the same.</p>
<p><!--<br />
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red0\green0\blue0;\red43\green145\blue175;\red0\green128\blue0;\red163\green21\blue21;}??\fs20 \cf1 public\cf0  \cf1 static\cf0  \cf1 void\cf0  GetServerUriAndItemPath(\cf4 DTE2\cf0  appObj, \cf1 ref\cf0  \cf1 string\cf0  serverUri, \cf1 ref\cf0  \cf1 string\cf0  itemPath, \cf1 ref\cf0  \cf1 bool\cf0  isFolder)\par ??\{\par ??    isFolder = \cf1 false\cf0 ;\par ??\par ??    \cf5 // Get local workspace info\par ??\cf0     \cf4 WorkspaceInfo\cf0 [] wsInfo = \cf4 Workstation\cf0 .Current.GetAllLocalWorkspaceInfo();\par ??    \cf1 if\cf0  (wsInfo.Length == 0)\par ??        \cf1 throw\cf0  \cf1 new\cf0  \cf4 TFSHistorySearchException\cf0 (\cf6 "No workspace found."\cf0 );\par ??\par ??    \cf5 // Get server Uri\par ??\cf0     serverUri = wsInfo[0].ServerUri.AbsoluteUri;\par ??\par ??    \cf5 //\'a0Get\'a0a\'a0reference\'a0to the\'a0Team\'a0Foundation\'a0Server. \par ??\cf0     \cf4 TeamFoundationServer\cf0  tfs = \cf1 new\cf0  \cf4 TeamFoundationServer\cf0 (serverUri);\par ??    \cf4 VersionControlServer\cf0  vcs = tfs.GetService(\cf1 typeof\cf0 (\cf4 VersionControlServer\cf0 )) \cf1 as\cf0  \cf4 VersionControlServer\cf0 ;\par ??\par ??    \cf5 //if Active Window is Source Control Explorer\par ??\cf0     \cf1 if\cf0  (appObj.ActiveWindow.Caption.StartsWith(\cf6 "Source Control Explorer"\cf0 ))\par ??    \{\par ??        \cf4 VersionControlExt\cf0  vce;\par ??        \cf5 // The top level class used to access all other Team Foundation Version Control Extensiblity classes\par ??\cf0         vce = appObj.GetObject(\cf6 "Microsoft.VisualStudio.TeamFoundation.VersionControl.VersionControlExt"\cf0 ) \cf1 as\cf0  \cf4 VersionControlExt\cf0 ;\par ??\par ??        \cf1 if\cf0  (!vce.Explorer.Connected)\par ??        \{\par ??            \cf1 throw\cf0  \cf1 new\cf0  \cf4 TFSHistorySearchException\cf0 (\cf6 "Source control explorer is not connected to a Team Foundation Server"\cf0 );\par ??        \}\par ??\par ??        \cf5 // Get all selected items\par ??\cf0         \cf4 VersionControlExplorerItem\cf0  []selectedItems = vce.Explorer.SelectedItems;\par ??\par ??        \cf1 if\cf0  (selectedItems.Length == 0)\par ??            \cf1 throw\cf0  \cf1 new\cf0  \cf4 TFSHistorySearchException\cf0 (\cf6 "You must select one item."\cf0 );\par ??\par ??        \cf1 if\cf0  (selectedItems.Length &amp;amp;gt; 1)\par ??            \cf1 throw\cf0  \cf1 new\cf0  \cf4 TFSHistorySearchException\cf0 (\cf6 "Multiple items selected."\cf0 );\par ??\par ??        \cf1 if\cf0  (selectedItems[0].SourceServerPath.Equals(\cf6 "$/"\cf0 ))\par ??            \cf1 throw\cf0  \cf1 new\cf0  \cf4 TFSHistorySearchException\cf0 (\cf6 "Operation is not supported for the selected item."\cf0 );\par ??        \cf5 //Take the 1st item\par ??\cf0         itemPath = selectedItems[0].SourceServerPath;\par ??        isFolder = selectedItems[0].IsFolder;\par ??    \}\par ??    \cf5 //if Active Window is Solution Explorer\par ??\cf0     \cf1 else\cf0  \cf1 if\cf0  (appObj.ActiveWindow.Caption.StartsWith(\cf6 "Solution Explorer"\cf0 ))\par ??    \{\par ??        isFolder = \cf1 false\cf0 ;\par ??        \cf1 if\cf0  (appObj.SelectedItems.MultiSelect == \cf1 true\cf0 )\par ??            \cf1 throw\cf0  \cf1 new\cf0  \cf4 TFSHistorySearchException\cf0 (\cf6 "Multiple items selected."\cf0 );\par ??\par ??        \cf4 SelectedItem\cf0  selectedItem = appObj.SelectedItems.Item(1);\par ??\par ??        \cf4 SourceControl2\cf0  sc = (\cf4 SourceControl2\cf0 )appObj.SourceControl;\par ??\par ??        \cf1 string\cf0  fileName = \cf4 String\cf0 .Empty;\par ??        \cf1 if\cf0  (selectedItem.ProjectItem != \cf1 null\cf0 )\par ??        \{\par ??            \cf5 //Its a project file\par ??\cf0             fileName = selectedItem.ProjectItem.Properties.Item(\cf6 "URL"\cf0 ).Value.ToString();\par ??            fileName = \cf4 Regex\cf0 .Replace(fileName, \cf6 "file:///"\cf0 , \cf4 String\cf0 .Empty, \cf4 RegexOptions\cf0 .IgnoreCase);\par ??            \cf1 if\cf0  (fileName.EndsWith(\cf6 "\\\\"\cf0 ))\par ??            \{\par ??                fileName = fileName.Substring(0, fileName.LastIndexOf(\cf6 '\\\\'\cf0 ));\par ??                isFolder = \cf1 true\cf0 ;\par ??            \}\par ??            \cf1 try\par ??\cf0             \{\par ??                \cf4 Item\cf0  item = vcs.GetItem(fileName);\par ??                itemPath = item.ServerItem;\par ??            \}\par ??            \cf1 catch\cf0  (Microsoft.TeamFoundation.VersionControl.Client.\cf4 VersionControlException\cf0  ex)\par ??            \{\par ??                \cf1 throw\cf0  \cf1 new\cf0  \cf4 TFSHistorySearchException\cf0 (\cf6 "Item not under source control."\cf0 , ex);\par ??            \}\par ??        \}\par ??        \cf1 else\cf0  \cf1 if\cf0  (selectedItem.Project != \cf1 null\cf0 )\par ??        \{\par ??            \cf5 //Its a project\par ??\cf0             fileName = selectedItem.Project.FileName;\par ??            \cf1 try\par ??\cf0             \{\par ??                \cf4 Item\cf0  item = vcs.GetItem(fileName);\par ??                itemPath = item.ServerItem;\par ??            \}\par ??            \cf1 catch\cf0  (Microsoft.TeamFoundation.VersionControl.Client.\cf4 VersionControlException\cf0  ex)\par ??            \{\par ??                \cf1 throw\cf0  \cf1 new\cf0  \cf4 TFSHistorySearchException\cf0 (\cf6 "Item not under source control."\cf0 , ex);\par ??            \}\par ??        \}\par ??        \cf1 else\par ??\cf0         \{\par ??            \cf1 throw\cf0  \cf1 new\cf0  \cf4 TFSHistorySearchException\cf0 (\cf6 "Operation is not supported for the selected item."\cf0 );\par ??        \}\par ??    \}\par ??    \cf1 else\par ??\cf0     \{\par ??        \cf1 throw\cf0  \cf1 new\cf0  \cf4 TFSHistorySearchException\cf0 (\cf6 "Operation is not supported for the selected item."\cf0 );\par ??    \}\par ??\}\par ??}<br />
--></p>
<div style="background: white none repeat scroll 0% 50%; font-family: Courier New; font-size: 10pt; color: black; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial">
<p style="margin: 0px"><span style="color: blue">public</span> <span style="color: blue">static</span> <span style="color: blue">void</span> GetServerUriAndItemPath(<span style="color: #2b91af">DTE2</span> appObj, <span style="color: blue">ref</span> <span style="color: blue">string</span> serverUri, <span style="color: blue">ref</span> <span style="color: blue">string</span> itemPath, <span style="color: blue">ref</span> <span style="color: blue">bool</span> isFolder)</p>
<p style="margin: 0px">{</p>
<p style="margin: 0px">isFolder = <span style="color: blue">false</span>;</p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: green">// Get local workspace info</span></p>
<p style="margin: 0px"><span style="color: #2b91af">WorkspaceInfo</span>[] wsInfo = <span style="color: #2b91af">Workstation</span>.Current.GetAllLocalWorkspaceInfo();</p>
<p style="margin: 0px"><span style="color: blue">if</span> (wsInfo.Length == 0)</p>
<p style="margin: 0px"><span style="color: blue">throw</span> <span style="color: blue">new</span> <span style="color: #2b91af">TFSHistorySearchException</span>(<span style="color: #a31515">&#8220;No workspace found.&#8221;</span>);</p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: green">// Get server Uri</span></p>
<p style="margin: 0px">serverUri = wsInfo[0].ServerUri.AbsoluteUri;</p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: green">// Get a reference to the Team Foundation Server. </span></p>
<p style="margin: 0px"><span style="color: #2b91af">TeamFoundationServer</span> tfs = <span style="color: blue">new</span> <span style="color: #2b91af">TeamFoundationServer</span>(serverUri);</p>
<p style="margin: 0px"><span style="color: #2b91af">VersionControlServer</span> vcs = tfs.GetService(<span style="color: blue">typeof</span>(<span style="color: #2b91af">VersionControlServer</span>)) <span style="color: blue">as</span> <span style="color: #2b91af">VersionControlServer</span>;</p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: green">//if Active Window is Source Control Explorer</span></p>
<p style="margin: 0px"><span style="color: blue">if</span> (appObj.ActiveWindow.Caption.StartsWith(<span style="color: #a31515">&#8220;Source Control Explorer&#8221;</span>))</p>
<p style="margin: 0px">{</p>
<p style="margin: 0px"><span style="color: #2b91af">VersionControlExt</span> vce;</p>
<p style="margin: 0px"><span style="color: green">// The top level class used to access all other Team Foundation Version Control Extensiblity classes</span></p>
<p style="margin: 0px">vce = appObj.GetObject(<span style="color: #a31515">&#8220;Microsoft.VisualStudio.TeamFoundation.VersionControl.VersionControlExt&#8221;</span>) <span style="color: blue">as</span> <span style="color: #2b91af">VersionControlExt</span>;</p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: blue">if</span> (!vce.Explorer.Connected)</p>
<p style="margin: 0px">{</p>
<p style="margin: 0px"><span style="color: blue">throw</span> <span style="color: blue">new</span> <span style="color: #2b91af">TFSHistorySearchException</span>(<span style="color: #a31515">&#8220;Source control explorer is not connected to a Team Foundation Server&#8221;</span>);</p>
<p style="margin: 0px">}</p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: green">// Get all selected items</span></p>
<p style="margin: 0px"><span style="color: #2b91af">VersionControlExplorerItem</span> []selectedItems = vce.Explorer.SelectedItems;</p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: blue">if</span> (selectedItems.Length == 0)</p>
<p style="margin: 0px"><span style="color: blue">throw</span> <span style="color: blue">new</span> <span style="color: #2b91af">TFSHistorySearchException</span>(<span style="color: #a31515">&#8220;You must select one item.&#8221;</span>);</p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: blue">if</span> (selectedItems.Length &gt; 1)</p>
<p style="margin: 0px"><span style="color: blue">throw</span> <span style="color: blue">new</span> <span style="color: #2b91af">TFSHistorySearchException</span>(<span style="color: #a31515">&#8220;Multiple items selected.&#8221;</span>);</p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: blue">if</span> (selectedItems[0].SourceServerPath.Equals(<span style="color: #a31515">&#8220;$/&#8221;</span>))</p>
<p style="margin: 0px"><span style="color: blue">throw</span> <span style="color: blue">new</span> <span style="color: #2b91af">TFSHistorySearchException</span>(<span style="color: #a31515">&#8220;Operation is not supported for the selected item.&#8221;</span>);</p>
<p style="margin: 0px"><span style="color: green">//Take the 1st item</span></p>
<p style="margin: 0px">itemPath = selectedItems[0].SourceServerPath;</p>
<p style="margin: 0px">isFolder = selectedItems[0].IsFolder;</p>
<p style="margin: 0px">}</p>
<p style="margin: 0px"><span style="color: green">//if Active Window is Solution Explorer</span></p>
<p style="margin: 0px"><span style="color: blue">else</span> <span style="color: blue">if</span> (appObj.ActiveWindow.Caption.StartsWith(<span style="color: #a31515">&#8220;Solution Explorer&#8221;</span>))</p>
<p style="margin: 0px">{</p>
<p style="margin: 0px">isFolder = <span style="color: blue">false</span>;</p>
<p style="margin: 0px"><span style="color: blue">if</span> (appObj.SelectedItems.MultiSelect == <span style="color: blue">true</span>)</p>
<p style="margin: 0px"><span style="color: blue">throw</span> <span style="color: blue">new</span> <span style="color: #2b91af">TFSHistorySearchException</span>(<span style="color: #a31515">&#8220;Multiple items selected.&#8221;</span>);</p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: #2b91af">SelectedItem</span> selectedItem = appObj.SelectedItems.Item(1);</p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: #2b91af">SourceControl2</span> sc = (<span style="color: #2b91af">SourceControl2</span>)appObj.SourceControl;</p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: blue">string</span> fileName = <span style="color: #2b91af">String</span>.Empty;</p>
<p style="margin: 0px"><span style="color: blue">if</span> (selectedItem.ProjectItem != <span style="color: blue">null</span>)</p>
<p style="margin: 0px">{</p>
<p style="margin: 0px"><span style="color: green">//Its a project file</span></p>
<p style="margin: 0px">fileName = selectedItem.ProjectItem.Properties.Item(<span style="color: #a31515">&#8220;URL&#8221;</span>).Value.ToString();</p>
<p style="margin: 0px">fileName = <span style="color: #2b91af">Regex</span>.Replace(fileName, <span style="color: #a31515">&#8220;file:///&#8221;</span>, <span style="color: #2b91af">String</span>.Empty, <span style="color: #2b91af">RegexOptions</span>.IgnoreCase);</p>
<p style="margin: 0px"><span style="color: blue">if</span> (fileName.EndsWith(<span style="color: #a31515">&#8220;\\&#8221;</span>))</p>
<p style="margin: 0px">{</p>
<p style="margin: 0px">fileName = fileName.Substring(0, fileName.LastIndexOf(<span style="color: #a31515">&#8216;\\&#8217;</span>));</p>
<p style="margin: 0px">isFolder = <span style="color: blue">true</span>;</p>
<p style="margin: 0px">}</p>
<p style="margin: 0px"><span style="color: blue">try</span></p>
<p style="margin: 0px">{</p>
<p style="margin: 0px"><span style="color: #2b91af">Item</span> item = vcs.GetItem(fileName);</p>
<p style="margin: 0px">itemPath = item.ServerItem;</p>
<p style="margin: 0px">}</p>
<p style="margin: 0px"><span style="color: blue">catch</span> (Microsoft.TeamFoundation.VersionControl.Client.<span style="color: #2b91af">VersionControlException</span> ex)</p>
<p style="margin: 0px">{</p>
<p style="margin: 0px"><span style="color: blue">throw</span> <span style="color: blue">new</span> <span style="color: #2b91af">TFSHistorySearchException</span>(<span style="color: #a31515">&#8220;Item not under source control.&#8221;</span>, ex);</p>
<p style="margin: 0px">}</p>
<p style="margin: 0px">}</p>
<p style="margin: 0px"><span style="color: blue">else</span> <span style="color: blue">if</span> (selectedItem.Project != <span style="color: blue">null</span>)</p>
<p style="margin: 0px">{</p>
<p style="margin: 0px"><span style="color: green">//Its a project</span></p>
<p style="margin: 0px">fileName = selectedItem.Project.FileName;</p>
<p style="margin: 0px"><span style="color: blue">try</span></p>
<p style="margin: 0px">{</p>
<p style="margin: 0px"><span style="color: #2b91af">Item</span> item = vcs.GetItem(fileName);</p>
<p style="margin: 0px">itemPath = item.ServerItem;</p>
<p style="margin: 0px">}</p>
<p style="margin: 0px"><span style="color: blue">catch</span> (Microsoft.TeamFoundation.VersionControl.Client.<span style="color: #2b91af">VersionControlException</span> ex)</p>
<p style="margin: 0px">{</p>
<p style="margin: 0px"><span style="color: blue">throw</span> <span style="color: blue">new</span> <span style="color: #2b91af">TFSHistorySearchException</span>(<span style="color: #a31515">&#8220;Item not under source control.&#8221;</span>, ex);</p>
<p style="margin: 0px">}</p>
<p style="margin: 0px">}</p>
<p style="margin: 0px"><span style="color: blue">else</span></p>
<p style="margin: 0px">{</p>
<p style="margin: 0px"><span style="color: blue">throw</span> <span style="color: blue">new</span> <span style="color: #2b91af">TFSHistorySearchException</span>(<span style="color: #a31515">&#8220;Operation is not supported for the selected item.&#8221;</span>);</p>
<p style="margin: 0px">}</p>
<p style="margin: 0px">}</p>
<p style="margin: 0px"><span style="color: blue">else</span></p>
<p style="margin: 0px">{</p>
<p style="margin: 0px"><span style="color: blue">throw</span> <span style="color: blue">new</span> <span style="color: #2b91af">TFSHistorySearchException</span>(<span style="color: #a31515">&#8220;Operation is not supported for the selected item.&#8221;</span>);</p>
<p style="margin: 0px">}</p>
<p style="margin: 0px">}</p>
</div>
<p>The following code is to compare two source code files and show visual difference. There is an API provided for the same.</p>
<p><!--<br />
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red0\green0\blue0;\red43\green145\blue175;}??\fs20 \cf1 public\cf0  \cf1 static\cf0  \cf1 void\cf0  CompareLocal(\cf1 string\cf0  localPath, \cf1 string\cf0  sourceChangesetId, \cf1 string\cf0  serverUri, \cf1 string\cf0  srcPath)\par ??\{\par ??    \cf4 TeamFoundationServer\cf0  tfs = \cf4 TeamFoundationServerFactory\cf0 .GetServer(serverUri);\par ??    \cf4 VersionControlServer\cf0  vcs = tfs.GetService(\cf1 typeof\cf0 (\cf4 VersionControlServer\cf0 )) \cf1 as\cf0  \cf4 VersionControlServer\cf0 ;\par ??\par ??    \cf4 VersionSpec\cf0  sourceVersion = \cf4 VersionSpec\cf0 .ParseSingleSpec(sourceChangesetId, vcs.TeamFoundationServer.AuthenticatedUserName);\par ??\par ??    \cf4 Difference\cf0 .VisualDiffItems(vcs, \cf4 Difference\cf0 .CreateTargetDiffItem(vcs, srcPath, sourceVersion, 0, sourceVersion), \cf4 Difference\cf0 .CreateTargetDiffItem(vcs, localPath, \cf1 null\cf0 , 0, \cf1 null\cf0 ));\par ??\}\par ??}<br />
--></p>
<div style="background: white none repeat scroll 0% 50%; font-family: Courier New; font-size: 10pt; color: black; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial">
<p style="margin: 0px"><span style="color: blue">public</span> <span style="color: blue">static</span> <span style="color: blue">void</span> CompareLocal(<span style="color: blue">string</span> localPath, <span style="color: blue">string</span> sourceChangesetId, <span style="color: blue">string</span> serverUri, <span style="color: blue">string</span> srcPath)</p>
<p style="margin: 0px">{</p>
<p style="margin: 0px"><span style="color: #2b91af">TeamFoundationServer</span> tfs = <span style="color: #2b91af">TeamFoundationServerFactory</span>.GetServer(serverUri);</p>
<p style="margin: 0px"><span style="color: #2b91af">VersionControlServer</span> vcs = tfs.GetService(<span style="color: blue">typeof</span>(<span style="color: #2b91af">VersionControlServer</span>)) <span style="color: blue">as</span> <span style="color: #2b91af">VersionControlServer</span>;</p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: #2b91af">VersionSpec</span> sourceVersion = <span style="color: #2b91af">VersionSpec</span>.ParseSingleSpec(sourceChangesetId, vcs.TeamFoundationServer.AuthenticatedUserName);</p>
<p style="margin: 0px">
<p style="margin: 0px"><span style="color: #2b91af">Difference</span>.VisualDiffItems(vcs, <span style="color: #2b91af">Difference</span>.CreateTargetDiffItem(vcs, srcPath, sourceVersion, 0, sourceVersion), <span style="color: #2b91af">Difference</span>.CreateTargetDiffItem(vcs, localPath, <span style="color: blue">null</span>, 0, <span style="color: blue">null</span>));</p>
<p style="margin: 0px">}</p>
</div>
<p>Once the add-in is installed, it appears in the Tools menu within Visual Studio 2005. Open <em>Source Control Explorer</em> and select an item. Launch the add-in from Tools menu.</p>
<p><img src="http://ankitjain.info/ankit/wp-content/052907_0752_TFSFreeText22.png" /></p>
<p>When you search for the history of a File, you can also compare it with the local version or the latest version in the source control. These option are avaiable as context menu.</p>
<p><img src="http://ankitjain.info/ankit/wp-content/052907_0752_TFSFreeText32.png" /></p>
<p><img alt="Compare options for search results (only for file types)" src="http://ankitjain.info/ankit/wp-content/TFS-History-Compare.PNG" /></p>
<p>Following steps are required only if you download the code and try to deploy the solution to have hands on with the code.</p>
<ol>
<li>Copy the <span style="font-family: Courier New; font-size: 10pt">TFSHistorySearch.AddIn</span> file to <span style="font-family: Courier New; font-size: 10pt">%userprofile%\My Documents\Visual Studio 2005\Addins\</span> directory.</li>
<li>Update the full path of the assembly <span style="font-family: Courier New; font-size: 10pt">TFSHistorySearch.dll </span>under <span style="font-family: Courier New; font-size: 10pt">Extensibility/Addin/Assembly</span> x-path.</li>
<li>Add reference of <span style="font-family: Courier New; font-size: 10pt">TFSHistorySearch.AddIn</span> as link to the project.</li>
</ol>
<p>Download Source code &#038; Installer: <a href="http://ankitjain.info/ankit/wp-content/TFSHistorySearch.zip">TFSHistorySearch.zip</a> ~700 KB<br />
Download Installer only: <a href="http://ankitjain.info/ankit/wp-content/TFSHistorySearch-Setup.zip">TFSHistorySearch-Setup.zip</a> ~400 KB</p>
<p>Implemented by:  <a target="_blank" href="http://www.topcoder.com/tc?module=MemberProfile&#038;cr=15892009&#038;tab=long">Jagdish.Vasani</a> [at] Gmail [dot] com</p>
<p>- Ankit</p>
]]></content:encoded>
			<wfw:commentRss>http://ankitjain.info/ankit/2007/05/29/tfs-free-text-search-in-history-objects/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Preview: LINQ</title>
		<link>http://ankitjain.info/ankit/2007/02/14/linq-preview/</link>
		<comments>http://ankitjain.info/ankit/2007/02/14/linq-preview/#comments</comments>
		<pubDate>Wed, 14 Feb 2007 17:47:57 +0000</pubDate>
		<dc:creator>Ankit</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Programming/Code]]></category>
		<category><![CDATA[Technology Trends]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[review]]></category>

		<guid isPermaLink="false">http://ankitjain.info/ankit/2007/02/14/linq-preview</guid>
		<description><![CDATA[Hmmm&#8230; a new tool in my hands &#8230; and following equation makes me crazy about it! C# 2.0 + ADO.NET = LINQ = C# 3.0 In simple words Language Integrated Query (LINQ) exposes the power of SQL queries within C# syntax. This technology along with its tools allows you to connect to SQL database, extract [...]]]></description>
			<content:encoded><![CDATA[<p>Hmmm&#8230; a new tool in my hands<br />
&#8230; and following equation makes me crazy about it!</p>
<p>C# 2.0 + ADO.NET = LINQ = C# 3.0</p>
<p>In simple words Language Integrated Query (<a target="_blank" title="LINQ on Wikipedia" href="http://en.wikipedia.org/wiki/Language_Integrated_Query">LINQ</a>) exposes the power of SQL queries within C# syntax. This technology along with its tools allows you to connect to SQL database, extract metadata, build typed datasets/classes (using <a target="_blank" href="http://msdn2.microsoft.com/en-us/library/512aeb7t%28vs.80%29.aspx">C# Generics</a>) and make you use them along with C# syntax using just two lines of code. And not necessarily SQL databases, it can execute on any collection type.</p>
<blockquote><p class=MsoNormal><span style='font-size:10.0pt;color:blue'>int</span><span style='font-size:10.0pt'>[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };<br />
var lowNums =<br />
</span><span style='color:blue'>&nbsp; &nbsp;&nbsp; from</span> n <span style='color:blue'>in</span> numbers<br />
<span style='font-size:10.0pt;color:blue'>&nbsp; &nbsp;&nbsp; where</span><span style='font-size:10.0pt'> n &lt; 5</span><br />
<span style='font-size:10.0pt;color:blue'>&nbsp; &nbsp;&nbsp; select</span><span style='font-size:10.0pt'> n;</span> Console.WriteLine(&quot;<span style='color:maroon'>Numbers &lt; 5:</span>&quot;);<br />
<span style='color:blue'>foreach</span> (var x <span style='color:blue'>in</span><br />
lowNums)<br />
<span style='font-size:10.0pt'>{<br />
&nbsp; &nbsp; Console.WriteLine(x);<br />
}</span></p>
</blockquote>
<p>Have a look at <a target="_blank" href="http://msdn2.microsoft.com/en-us/vcsharp/aa336745.aspx">Linq Project</a> @ MSDN and <a target="_blank" href="http://msdn2.microsoft.com/en-us/vcsharp/aa336746.aspx">101 Samples</a> all to sense this. Here in this short -n-simple post Iâ€™m just showing how to do things for databases stored as <span style="font-style: italic">*.mdf</span> files and generate wrapper classes.The LINQ preview includes SqlMetal.exe, a utility to auto-generate a strongly-typed C# DataContext class file from an SQL Server 2000 or 2005 database&#8217;s metadata with this execution syntax:</p>
<blockquote>
<p class="MsoNormal">$>sqlmetal.exe /namespace:NWind /language:csharp /code:Northwind.cs c:\ Northwind.mdf</p>
</blockquote>
<p>- Ankit</p>
]]></content:encoded>
			<wfw:commentRss>http://ankitjain.info/ankit/2007/02/14/linq-preview/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

