<?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/"
	>

<channel>
	<title>sushain.com &#124; blog</title>
	<atom:link href="http://sushain.com/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://sushain.com/blog</link>
	<description>Common weblog for two parallel threads - Random Segments of Code (http://sushain.blogspot.com) and A Unification Effort on the Random Segments (http://unified-integrated-intelligence.blogspot.com/) - Primarily for archival since mid 2009.</description>
	<pubDate>Fri, 10 Feb 2012 00:46:14 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>An extensible Decision-Tree framework in Java</title>
		<link>http://sushain.com/blog/archives/88</link>
		<comments>http://sushain.com/blog/archives/88#comments</comments>
		<pubDate>Thu, 08 Jan 2009 17:26:50 +0000</pubDate>
		<dc:creator>sushain</dc:creator>
		
		<category><![CDATA[Artificial Intelligence]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[decision tree]]></category>

		<category><![CDATA[framework]]></category>

		<category><![CDATA[Java]]></category>

		<category><![CDATA[linkedin]]></category>

		<guid isPermaLink="false">http://sushain.com/blog/?p=88</guid>
		<description><![CDATA[Problem Description: Decision trees are widely used predictive models in data mining and machine learning domains. This post describes a java-based decision-tree framework that can be worked upon and extended as needed. The implementation is done similar to the C5 library. I would also assume that the user has fundamental knowledge on the classifier and [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem Description: </strong>Decision trees are widely used predictive models in data mining and machine learning domains. This post describes a java-based decision-tree framework that can be worked upon and extended as needed. The implementation is done similar to the <a href="http://www.rulequest.com/see5-info.html" target="_blank">C5</a> library. I would also assume that the user has fundamental knowledge on the classifier and won&#8217;t go into explaining what a decision-tree is. More info can be found <a href="http://en.wikipedia.org/wiki/Decision_tree">here.<br />
</a></p>
<p><strong>Framework Description:</strong> The framework essentially comprises 4 parts.</p>
<p><strong><br />
1.) TreeNode and DataPoint classes to hold hold data and define tree nodes: -<br />
</strong></p>
<p>DataPoint contains an attribute array to hold the values for a particular node and is contained within each TreeNode instance. The structures for these classes are as follows.</p>
<p><em>class TreeNode {</em></p>
<p><em>public double entropy;<br />
public Vector data;<br />
public int decompositionAttribute;<br />
public int decompositionValue;<br />
public TreeNode [] children;<br />
public TreeNode parent;</em></p>
<p><em>public TreeNode () {<br />
data = new Vector ();<br />
}<br />
}<br />
</em></p>
<p><em>class DataPoint {</em></p>
<p><em>public int [] attributes;<br />
public String label;</em></p>
<p><em><br />
public DataPoint (final int numattributes) {<br />
attributes = new int [numattributes];<br />
}<br />
}</em></p>
<p><strong>2.) DecisionTree: -</strong></p>
<p>This is the base class for decision-tree implementation and has a containment relation with the TreeNode class. It encapsulates all the implementation details for decision tree creation and entropy calculation. It uses the max-gain criteria for splitting over nodes. Right now, pruning hasn&#8217;t been implemented.</p>
<p>The field-definitions for decision-tree is as follows.</p>
<p><em>public class DecisionTree {</em></p>
<p><em>private int numAttributes;<br />
private String [] attributeNames;<br />
private Vector [] domains;<br />
private TreeNode trainingRoot;<br />
private TreeNode testingRoot;<br />
private String namesFile;<br />
private String trainingDataFile;<br />
private String testingDataFile;<br />
private int correctCount;<br />
private int inCorrectCount;<br />
private boolean debug;<br />
private int maxDepth;<br />
&#8230;.</em></p>
<p><em>}</em></p>
<p>The decision-tree class invokes the InputProcessor (explained below) , which populates the training and testing Roots with input data. After this, it invokes <em>createDecisionTree </em>and <em>induce </em>modules to the create the actual tree.</p>
<p>The overall structure of <em>induce </em>is as follows.</p>
<p><em>public void induce (final TreeNode node) {</em></p>
<p><em>double bestEntropy = 0;<br />
boolean selected = false;<br />
int selectedAttribute = 0;<br />
int numdata = node.data.size ();<br />
int numinputattributes = numAttributes - 1;<br />
node.entropy = calculateEntropy (node.data);<br />
if (node.entropy == 0) {<br />
return;<br />
}</em></p>
<p><em><br />
for (int i = 0; i &lt; numinputattributes; i++) {<br />
int numvalues = domains[i].size ();<br />
if (alreadyUsedToDecompose (node, i)) {<br />
continue;<br />
}</em></p>
<p><em>double averageentropy = 0;</em></p>
<p><em>for (int j = 0; j &lt; numvalues; j++) {<br />
Vector subset = getSubset (node.data, i, j);<br />
if (subset.size () == 0) {<br />
continue;<br />
}</em></p>
<p><em>double subentropy = calculateEntropy (subset);<br />
averageentropy += subentropy *     subset.size ();<br />
}</em></p>
<p><em>averageentropy = averageentropy / numdata;</em></p>
<p><em><br />
if (selected == false) {<br />
selected = true;<br />
bestEntropy = averageentropy;<br />
selectedAttribute = i;<br />
} else {</em></p>
<p><em>if (averageentropy &lt; bestEntropy) {</em></p>
<p><em>selected = true;<br />
bestEntropy = averageentropy;<br />
selectedAttribute = i;<br />
}<br />
}<br />
}</em></p>
<p><em>if (selected == false) {<br />
return;<br />
}</em></p>
<p><em>int numvalues = domains[selectedAttribute].size ();<br />
node.decompositionAttribute = selectedAttribute;<br />
node.children = new TreeNode [numvalues];<br />
for (int j = 0; j &lt; numvalues; j++) {<br />
node.children[j] = new TreeNode ();<br />
node.children[j].parent = node;<br />
node.children[j].data = getSubset (node.data,<br />
selectedAttribute, j);<br />
node.children[j].decompositionValue = j;<br />
}</em></p>
<p><em>for (int j = 0; j &lt; numvalues; j++) {<br />
induce (node.children[j]);<br />
}<br />
node.data = null;<br />
}</em></p>
<p><em><br />
</em></p>
<p>The most important function call within induce is to calculate the entropy and the structure for that is given below.</p>
<p><em> public double calculateEntropy (final Vector data) {</em></p>
<p><em>int numdata = data.size ();<br />
if (numdata == 0) {<br />
return 0;<br />
}</em></p>
<p><em>int attribute = numAttributes - 1;<br />
int numvalues = domains[attribute].size ();<br />
double sum = 0;</em></p>
<p><em> for (int i = 0; i &lt; numvalues; i++) {<br />
int count = 0;<br />
for (int j = 0; j &lt; numdata; j++) {<br />
DataPoint point = (DataPoint) data.elementAt (j);<br />
if (point.attributes[attribute] == i) {<br />
count++;<br />
}<br />
}</em></p>
<p><em>double probability = ((double) count) / numdata;</em></p>
<p><em>if (count &gt; 0) {<br />
sum += -probability * Math.log (probability);<br />
}<br />
}<br />
return sum;<br />
}</em></p>
<p><strong>3.) InputProcessor: -</strong></p>
<p>This is used for all the input processing and in turn, for node data population and is utilized by DecisionTree to get the populated Node Objects from raw input data. This is a fairly complicated class with different modules to read the attributes and the actual data. Besides, it contains the functionality to do a random split between training and test in case only one data-set is provided &amp; to discretize the linear data into bins.</p>
<p>The key module is <em>readDataSets</em>.</p>
<p><em> public int readDataSets (final String fileName, final TreeNode root, final String toSplit) throws Exception {<br />
</em></p>
<p><em> FileInputStream in = null;<br />
/************************************************<br />
* Reading the Training / Testing data set File    *<br />
************************************************/<br />
try {<br />
File inputFile = new File (fileName);<br />
in = new FileInputStream (inputFile);<br />
} catch (Exception e) {<br />
System.err.println (&#8221;Unable to open file: &#8221; + fileName + &#8220;n&#8221; + e);<br />
return -1;<br />
}</em></p>
<p><em>BufferedReader bin = new BufferedReader (new InputStreamReader (in));<br />
String input;<br />
int index = 1;<br />
while (true) {<br />
input = bin.readLine ();<br />
if (input == null) {<br />
break;<br />
} else if (input.startsWith (&#8221;|&#8221;)) {<br />
continue;<br />
} else if (input.contains (&#8221;|&#8221;)) {<br />
input = input.substring (0, input.indexOf (&#8221;|&#8221;));<br />
}<br />
if (input.equals (&#8221;")) {<br />
continue;<br />
}</em></p>
<p><em>StringTokenizer tokenizer = new StringTokenizer (input, &#8220;,&#8221;);<br />
int numtokens = tokenizer.countTokens ();<br />
if (skipCount &gt; -1) {<br />
if (numtokens != numAttributes + 1) {<br />
return -1;<br />
}<br />
} else if (numtokens != numAttributes) {<br />
return -1;<br />
}</em></p>
<p><em>DataPoint point = new DataPoint (numAttributes);<br />
// if there is no label to skip<br />
if (skipCount == -1) {<br />
point.label = &#8220;Example#&#8221; + index;<br />
for (int i = 0; i &lt; numAttributes; i++) {<br />
point.attributes[i] = getSymbolValue (i, tokenizer.nextToken ());<br />
}<br />
} else if (skipCount &gt; -1) {<br />
int attributeIndex = 0;<br />
for (int panditIndex = 0; panditIndex &lt; numAttributes + 1; panditIndex++) {<br />
// assign label to the data point and skip it as an attribute field<br />
if (panditIndex == skipCount) {<br />
point.label = tokenizer.nextToken ();<br />
continue;<br />
}</em></p>
<p><em>point.attributes[attributeIndex] = getSymbolValue (attributeIndex, tokenizer.nextToken ());<br />
attributeIndex = attributeIndex + 1;<br />
}<br />
}</em></p>
<p><em>/************************************************<br />
* Required 2/3-1/3 random data split follows     *<br />
************************************************/<br />
if (toSplit.equals (&#8221;SPLIT&#8221;)) {<br />
double randomNumber = 3 * Math.random ();<br />
if (randomNumber &gt; 2) {<br />
testingRoot.data.addElement (point);<br />
} else {<br />
root.data.addElement (point);<br />
}<br />
} else {<br />
root.data.addElement (point);<br />
}<br />
index = index + 1;<br />
}<br />
in.close ();<br />
bin.close ();<br />
return 1;<br />
}</em><br />
<strong>4.) DisplayProcessor:-</strong></p>
<p>This class provides the key implementation for handling the display functionality. The output formatting is similar to what you see <a href="http://www.rulequest.com/see5-win.html#TREES">here.</a> The key module is <em>displayTree </em>which displays each node-level recursively.<em><br />
</em></p>
<p><em> public void displayTree (final TreeNode node, final String tab, final int numAttributes, final String [] attributeNames, final Vector [] domains, final int depth) {</em></p>
<p><em>int outputattr = numAttributes - 1;<br />
if (node.children == null) {<br />
int [] values = getAllValues (node.data, outputattr, domains);<br />
if (values.length == 1) {<br />
System.out.print (&#8221; &#8221; + domains[outputattr].elementAt (values[0]));<br />
return;<br />
}</em></p>
<p><em>System.out.print (&#8221; {&#8221;);<br />
for (int i = 0; i &lt; values.length; i++) {<br />
System.out.print (&#8221;"&#8221; + domains[outputattr].elementAt (values[i]) + &#8220;&#8221;");<br />
if (i != values.length - 1) {<br />
System.out.print (&#8221; , &#8220;);<br />
}<br />
}</em></p>
<p><em>System.out.print (&#8221; };&#8221;);<br />
return;<br />
}</em></p>
<p><em>int numvalues = node.children.length;<br />
for (int i = 0; i &lt; numvalues; i++) {<br />
System.out.print (&#8221;n&#8221; + tab + attributeNames[node.decompositionAttribute] + &#8221; = &#8221; + domains[node.decompositionAttribute].elementAt (i) + &#8220;:&#8221;);<br />
if (depth &lt;= this.MAX_DEPTH) {<br />
displayTree (node.children[i], tab + &#8220;:   &#8220;, numAttributes, attributeNames, domains, depth + 1);<br />
} else {<br />
System.out.print (&#8221;&#8230;&#8221;);<br />
}</em></p>
<p><em>if (i != numvalues - 1) {<br />
System.out.print (&#8221;t&#8221;);<br />
} else {<br />
System.out.print (&#8221;");<br />
}<br />
}<br />
}<br />
</em></p>
<p>Again, this can be easily modified or extended as needed since the display functionality is cleanly decoupled from decision-tree creation logic and other parts explained above. Finally, in case you require the complete framework implementation alongwith the data-sets and instructions, please drop me a <a href="mailto:sushain.pandit@gmail.com?subject=Decision Tree Framework Required">note</a> explaining the purpose and need for it and I shall get back to you.</p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=sushain.com%20%7C%20blog&amp;siteurl=http%3A%2F%2Fsushain.com%2Fblog%2F&amp;linkname=An%20extensible%20Decision-Tree%20framework%20in%20Java&amp;linkurl=http%3A%2F%2Fsushain.com%2Fblog%2Farchives%2F88"><img src="http://sushain.com/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://sushain.com/blog/archives/88/feed</wfw:commentRss>
		</item>
		<item>
		<title>Resolving 403 forbidden page error for Wordpress blogs</title>
		<link>http://sushain.com/blog/archives/77</link>
		<comments>http://sushain.com/blog/archives/77#comments</comments>
		<pubDate>Wed, 07 Jan 2009 19:04:57 +0000</pubDate>
		<dc:creator>sushain</dc:creator>
		
		<category><![CDATA[Troubleshooting]]></category>

		<category><![CDATA[403]]></category>

		<category><![CDATA[debugging]]></category>

		<category><![CDATA[error]]></category>

		<category><![CDATA[forbidden]]></category>

		<category><![CDATA[linkedin]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://sushain.com/blog/?p=77</guid>
		<description><![CDATA[Well, yesterday I moved my blog from blogspot to wordpress using Wordpress&#8217;s awesome Importer tool and this tutorial. The action was mainly driven by the desire to host the blog on my own domain since that gives me a lot more flexibility to customize stuff as I want it to be. Luckily for me, my [...]]]></description>
			<content:encoded><![CDATA[<p>Well, yesterday I moved my <em><a href="http://unified-integrated-intelligence.blogspot.com/">blog</a></em> from blogspot to wordpress using Wordpress&#8217;s awesome <em>Importer</em> tool and <a href="http://www.terencechang.com/2007/06/16/import-blog-from-bloggercom-into-wordpress-free-your-blog-with-freedom/">this</a> tutorial. The action was mainly driven by the desire to host the blog on my own domain since that gives me a lot more flexibility to customize stuff as I want it to be. Luckily for me, my hosting provider (A2hosting.com) has a ready installation package for setting up a wordpress blog and so that part went pretty smooth. However, once I tried to open up the landing page of my blog, I got <em>page forbidden (403)</em> error. Incidentally, it was coming for every single page of the blog, including the wp-admin.</p>
<p>After a lot of hassle, I was finally able to resolve it and everything seems to be working alright since then. Nehow, I thought of putting down my observations here for anyone who may face similar issue with their installations or otherwise.</p>
<p>- The obvious things first - I checked the permissions on the installation folder (for me, <em>&lt;root&gt;/blog</em>) and found it to be perfectly ok (<em>755 for read / execute to world</em>).</p>
<p>- Next I checked the <em>.htaccess</em> in the root and so I found the problem. I had an earlier rails (Ruby on Rails) installation and following lines were present in it: -</p>
<p><em>RewriteEngine on</em></p>
<p><em>RewriteCond %{HTTP_HOST} ^sushain.com$ [OR]<br />
RewriteCond %{HTTP_HOST} ^www.sushain.com$<br />
RewriteRule ^contest http://127.0.0.1:12009%{REQUEST_URI} [P,QSA,L]<br />
DirectoryIndex preload.html index.html<br />
# BEGIN WordPress</em></p>
<p><em># END WordPress</em></p>
<p>I immediately knew that the url rewriting module was causing some issue here, but I didn&#8217;t want to tinker with this since I may want my Ruby app (although dormant for now) to come alive again in future. So, what I did instead was that I changed the .htaccess file in the /blog folder from -</p>
<p><em>DirectoryIndex index.php<br />
AuthUserFile &#8220;/home/sushainp/.htpasswds/public_html/blog/passwd&#8221;</em></p>
<p>to -</p>
<p><em>DirectoryIndex index.php<br />
AuthUserFile &#8220;/home/sushainp/.htpasswds/public_html/blog/passwd&#8221;<br />
# BEGIN WordPress<br />
&lt;IfModule mod_rewrite.c&gt;<br />
RewriteEngine On<br />
RewriteBase /blog/<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule . /blog/index.php [L]<br />
&lt;/IfModule&gt;</em></p>
<p><em># END WordPress</em></p>
<p>This overrode the url rewriting mechanism for /blog level addresses and thus, solved the issue.</p>
<p>Btw, for those of you interested in knowing more about url rewriting module, more information is available <a href="http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html">here</a>.</p>
<p>Cheers !</p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=sushain.com%20%7C%20blog&amp;siteurl=http%3A%2F%2Fsushain.com%2Fblog%2F&amp;linkname=Resolving%20403%20forbidden%20page%20error%20for%20Wordpress%20blogs&amp;linkurl=http%3A%2F%2Fsushain.com%2Fblog%2Farchives%2F77"><img src="http://sushain.com/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://sushain.com/blog/archives/77/feed</wfw:commentRss>
		</item>
		<item>
		<title>On creation of zip-files using PHP</title>
		<link>http://sushain.com/blog/archives/21</link>
		<comments>http://sushain.com/blog/archives/21#comments</comments>
		<pubDate>Fri, 02 Jan 2009 11:37:00 +0000</pubDate>
		<dc:creator>sushain</dc:creator>
		
		<category><![CDATA[Comparison]]></category>

		<category><![CDATA[comaprison]]></category>

		<category><![CDATA[library]]></category>

		<category><![CDATA[linkedin]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[zip]]></category>

		<guid isPermaLink="false">http://sushain.com/blog/?p=21</guid>
		<description><![CDATA[Problem: The subject describes the problem and situation quite comprehensively. Just putting down my observations here.
Solution options: Well, I tried out many libraries and finally used none. In any case, here is my experience.
1.) Ziplib  library from phpclasses - Very powerful library, can be used for recursively adding folders to an archive, etc. Just [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem:</strong> The subject describes the problem and situation quite comprehensively. Just putting down my observations here.</p>
<p><strong>Solution options:</strong> Well, I tried out many libraries and finally used none. In any case, here is my experience.</p>
<p><strong>1.)</strong> <a href="http://www.phpclasses.org/browse/download/targz/package/2088/name/ziplib-2005-08-26.tar.gz">Ziplib </a> library from phpclasses - Very powerful library, can be used for recursively adding folders to an archive, etc. Just seemed to be too complicated for my task.</p>
<p><strong>2.)</strong> <a href="http://www.devco.net/code/zipfile.inc.txt">Lib by devco.net</a> - Simple usage and fairly good lib. This is how I tried using it: -</p>
<p><span style="font-style:italic;">require (&#8221;pclzip.lib.php&#8221;);<br />
$exp = &#8220;63&#8243;;<br />
$zipfile = new PclZip(&#8221;$exp&#8221;.&#8221;_pack.zip&#8221;);<br />
error_reporting(E_ALL);<br />
$output = shell_exec( &#8220;cp index.php 63&#8243; );<br />
$v_list = $zipfile-&gt;create(&#8221;$exp&#8221;);<br />
</span><br />
The issue I had with this one was that it didn&#8217;t allow me to add subdirectory structures selectively, or at least I couldn&#8217;t fig it out rightaway.</p>
<p><strong>3.)</strong> Yet another library, this one was by <a href="http://drupal.org/node/83253">Drupal</a> - Seemed similar to 1.) and again, I just realized mid-way that I needn&#8217;t have that much functionality at all and wanted something simpler.</p>
<p><strong>4.)</strong> Another one by <a href="http://www.granthinkson.com/2005/07/01/create-zip-files-dynamically-using-php/">granthinkson</a> - Neat library, esp if you want to get all dirty with the actual file-creation and understanding process. I just wanted my zip :sigh:.</p>
<p><strong>5.)</strong> Yet another by <a href="http://articles.techrepublic.com.com/5100-10878_11-6125204.html">Techrepublic</a> - Again, simple usage and I would&#8217;ve almost gone with this, but for point (6.) below. But, in any case, fairly easy to use this -</p>
<p><span style="font-style:italic;">$obj = new Archive_Zip(&#8217;63.zip&#8217;);<br />
$files = array(&#8217;63.soft&#8217;,'63.chp&#8217;, &#8216;63.cel&#8217;);<br />
$obj-&gt;create($files);<br />
</span></p>
<p><strong>6.)</strong> Well, dunno why, but I had my usual whim and I suddenly decided not to go with any of these and resorted back to plain old &#8216;jar&#8217; util. So, this is what I did finally, esp since our server is configured with a jre anyways.</p>
<p><span style="font-style:italic;">/* Modified: 1-1-09 | code for zip creation - pandit */<br />
&#8230;..<br />
$zipfilename = &#8220;$exp&#8221;.&#8221;_pack.zip&#8221;;<br />
&#8230;&#8230;<br />
if(!file_exists(&#8221;$tmp_dir/$zipfilename&#8221;)) {<br />
$src = &#8220;$root_dir/ftp/pub/$exp/*&#8221;;<br />
$dest = &#8220;$tmp_dir/$exp&#8221;;<br />
exec( &#8220;cp  $src $dest&#8221; );<br />
exec (&#8221;jar cfM $tmp_dir/$zipfilename -C $dest .&#8221;);<br />
}<br />
&#8230;&#8230;<br />
$zip_link = $base_url . &#8220;/$zipfilename&#8221;;</span></p>
<p>But, thats so trivial, said Watson.. Yup, everything becomes trivial after explanation, sighed Holmes.</p>
<p>Anyhow, I implemented it <a href="http://www.anexdb.org/query/experiment.php?ex=111">here</a></p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=sushain.com%20%7C%20blog&amp;siteurl=http%3A%2F%2Fsushain.com%2Fblog%2F&amp;linkname=On%20creation%20of%20zip-files%20using%20PHP&amp;linkurl=http%3A%2F%2Fsushain.com%2Fblog%2Farchives%2F21"><img src="http://sushain.com/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://sushain.com/blog/archives/21/feed</wfw:commentRss>
		</item>
		<item>
		<title>Case analysis - A critique on Turing&#8217;s original refutations</title>
		<link>http://sushain.com/blog/archives/92</link>
		<comments>http://sushain.com/blog/archives/92#comments</comments>
		<pubDate>Tue, 02 Dec 2008 06:03:32 +0000</pubDate>
		<dc:creator>sushain</dc:creator>
		
		<category><![CDATA[Artificial Intelligence]]></category>

		<category><![CDATA[Comparison]]></category>

		<category><![CDATA[games]]></category>

		<category><![CDATA[Imitation]]></category>

		<category><![CDATA[Test]]></category>

		<category><![CDATA[Turing]]></category>

		<guid isPermaLink="false">http://sushain.com/blog/?p=92</guid>
		<description><![CDATA[

In this piece, I try to analyze the refutations (against various arguments) given by Turing in his classic article on the &#8216;Imitation Game&#8217;, and determine what still holds given the present state of AI. The following arguments and analysis are with reference to the original Turing Article located at - http://www.loebner.net/Prizef/TuringArticle.html Towards the end, I [...]]]></description>
			<content:encoded><![CDATA[<p><!-- 		@page { size: 8.5in 11in; margin: 0.79in } 		P { margin-bottom: 0.08in } --></p>
<p style="margin-bottom: 0in;"><!-- 		@page { size: 8.5in 11in; margin: 0.79in } 		P { margin-bottom: 0.08in } --></p>
<p style="margin-bottom: 0in;">In this piece, I try to analyze the refutations (against various arguments) given by Turing in his classic article on the &#8216;Imitation Game&#8217;, and determine what still holds given the present state of AI. The following arguments and analysis are with reference to the original Turing Article located at - <a href="http://www.loebner.net/Prizef/TuringArticle.html"><span style="color: #0000ff;"><span style="text-decoration: underline;">http://www.loebner.net/Prizef/TuringArticle.html</span></span></a> Towards the end, I present my views on the current state of success at passing the Turing Test and what future warrants on the subject.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">1.) <span style="text-decoration: underline;"><strong>Theological objection</strong></span>: - To me it seems that the theological arguments have always banked on <em>faith</em> rather than being based on logic and reason. However, this objection may still carry some weight to those who can define and clarify the idea of a <em>soul</em> and then be able to link this idea to <em>thinking</em> process. Without these definitions, linking the thinking process with <em>man’s immortal soul </em>is a highly generalized assumption based on the notion that an <em>all-powerful</em> <em>God</em> is able to somehow put this into effect. However, this very assumption is contradicted later on by claiming that the same God can’t put those souls somewhere else, in this instance - machines. Overall, this objection seems too pretentious to carry substantial weight now. Moreover, Turing’s refutations in the original paper seemed to be quite rational to put this case to rest.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">2.) <span style="text-decoration: underline;"><strong>The “Heads in the Sand” objection</strong></span>: - This objection in itself (as stated in the original paper) carries no weight now. However, it is somewhat related to the ethical issues that are now often connected with AI, when we pause considering whether we can develop AI, and ask ourselves - Should we create AI and ponder upon the various implications of advanced / strong AI if it were to co-exist with humankind. But, since the current discussion is about ‘<strong>Can</strong> machines think’, we would rest this case here.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">3.) <span style="text-decoration: underline;"><strong>The Mathematical objection</strong></span>: - Actually, this argument doesn’t really seem like a reason to object the test since it tentatively puts machines only at a disadvantage w.r.t humans and thus this test may be a decent criteria to determine the validity of that objection. Anyhow, as far as computing capacities are concerned, we’ve reached very high orders from what was available back in Turing’s time. Thus, ideally, such machines can be build which would decently respond to the objections in this point.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">4.) <span style="text-decoration: underline;"><strong>The argument from consciousness</strong></span>: - In his original paper, Turing has handled this argument from the perspective of <em>feeling as it relates to thinking </em>and he describes this objection as - ‘whether machines can feel that they are thinking‘. Within this context, his refutations seem valid since he links these objections to solipsism (claim that only <em>self</em> can be verified), which he then claims is noone’s win since it makes idea communication difficult.</p>
<p><br/></p>
<p style="margin-bottom: 0in;"><!-- 		@page { size: 8.5in 11in; margin: 0.79in } 		P { margin-bottom: 0.08in } --></p>
<p style="margin-bottom: 0in;">However, there is a broader context to this argument now, especially after thought experiments like <strong>Chinese Room</strong> by Searle - <a href="http://en.wikipedia.org/wiki/Chinese_Room"><span style="color: #0000ff;"><span style="text-decoration: underline;">http://en.wikipedia.org/wiki/Chinese_Room</span></span></a> . These experiments broaden the scope of the argument by relating consciousness to mind,  bringing the notion of intentionality &amp; states, and illustrating that machines can’t have minds irrespective of their intelligent behavior.</p>
<p style="margin-bottom: 0in;">One may argue that Turing would have reasoned that even the neurons within human brains aren’t conscious in the sense of understanding what they are doing, and it somehow appears that the overall system as a whole is behaving intelligently and there is nothing more to it than appearance. However, since these ideas are not the part of his original paper, these objections would still hold.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">5.) <span style="text-decoration: underline;"><strong>Arguments from various disabilities</strong></span>: - This argument is essentially a combination of various objections and expectations each of which are discusses below. For many of these, we would require an exact definition of the word to relate it to AI and for this purpose, we would refer this source - <a href="http://www.answers.com/"><span style="color: #0000ff;"><span style="text-decoration: underline;">http://www.answers.com</span></span></a> : -</p>
<p><br/></p>
<p style="margin-bottom: 0in;">- <span style="text-decoration: underline;">Being kind, friendly, loving</span>: These are abstract words that require contextual definitions. If these are implied by being <em>helpful and useful</em>, then certainly this objection will not hold since there are many machines, softwares etc, that help people automate their work. Applications of AI to advanced robotics has produced many helpful robots - <a href="http://www.helpfulrobots.com/"><span style="color: #0000ff;"><span style="text-decoration: underline;">http://www.helpfulrobots.com/</span></span></a> .</p>
<p style="margin-bottom: 0in;">However, if we think of kindness, friendship and falling in love from a conscious point of view, then it would again require a mind and intention. It would thus fall into the consciousness argument discussed above.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">- <span style="text-decoration: underline;">Being resourceful</span>: As per our source, resourceful means - able to act effectively or imaginatively, especially in difficult situations. Clearly, most of the existing softwares meet the criteria of efficiency. There are various agent programs that deal with different situations intelligently as well - <a href="http://en.wikipedia.org/wiki/Windows_Live_Agents"><span style="color: #0000ff;"><span style="text-decoration: underline;">http://en.wikipedia.org/wiki/Windows_Live_Agents</span></span></a> . Imagination is again dependent on how we define it, but overall this criteria seems to be met now.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">- <span style="text-decoration: underline;">Being beautiful</span>: If this concerns external beauty, there are certainly beautiful machines created by careful manufacturing, etc. Internal beauty is again abstract and would belong to the consciousness argument, as in being aware of an internal state.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">- <span style="text-decoration: underline;">Having initiative</span>:<strong> </strong>Most AI machines or softwares have been created with an ultimate goal to take the initiative from humans and automate processes.</p>
<p><br/></p>
<p style="margin-bottom: 0in;"><strong>- </strong><span style="text-decoration: underline;">Having a sense of humour</span>: There have been some efforts towards artificial comedy - <a href="http://www.clone3d.net/"><span style="color: #0000ff;"><span style="text-decoration: underline;">http://www.clone3d.net/</span></span></a> .</p>
<p><br/></p>
<p style="margin-bottom: 0in;"><!-- 		@page { size: 8.5in 11in; margin: 0.79in } 		P { margin-bottom: 0.08in } --></p>
<p style="margin-bottom: 0in;">- <span style="text-decoration: underline;">Telling right from wrong and learning from experience and doing something really new</span>: Machine learning and causalreasoning are two of the core fields in AI research and have been implemented in many systems. Doing something new can be a direct consequence of machine learning or learning from experience. So, this objection doesn’t hold now.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">- <span style="text-decoration: underline;">Making mistakes</span>: Since AI programs are written by humans, they can be buggy and hence their actual output can deviate from expected. This can be classified as making mistakes.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">- <span style="text-decoration: underline;">Making someone fall in love</span>: This is quite achievable using meticulous and aesthetical design, and giving a pleasing appearance to a useful machine.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">- <span style="text-decoration: underline;">Using words properly</span>: NLP and voice recognition programs are a case in point.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">- <span style="text-decoration: underline;">Having as much diversity of behavior as a man</span>: This objection still holds and would continue to hold until certainmilestones are reached in brain and mind simulation .</p>
<p><br/></p>
<p style="margin-bottom: 0in;">- <span style="text-decoration: underline;">Being the subject of its own thought</span>: Thought requires a clear contextual definition here, but, in general, this could be similar to providing a program source as an input to itself and observe the output. Again, doable and hence the objection doesn’t hold.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">6.) <span style="text-decoration: underline;"><strong>Lady Lovelace&#8217;s Objection</strong></span>: The gist of this objection can be summed up in one sentence - machines can never do anything <em>really </em>new so as to take us (humans) by surprise and Turing gave a classic refutation to this by claiming that this is equivalent to saying that there is nothing new under the sun since every new discovery or invention is linked to some past event or chain of events. So, basically he tried to give a context to what should be considered as <em>really new</em> and within that context, this objection is clearly not true today. There are programs capable of giving surprises as well as creating unique and new scenarios. A case in point is the origin of Butterfly effect - <a href="http://en.wikipedia.org/wiki/Butterfly_effect"><span style="color: #0000ff;"><span style="text-decoration: underline;">http://en.wikipedia.org/wiki/Butterfly_effect</span></span></a> .</p>
<p><br/></p>
<p style="margin-bottom: 0in;">7.) <span style="text-decoration: underline;"><strong>Argument from Continuity in the Nervous System</strong></span>: This argument needed refutation on grounds of fairness in the original paper at the time Turing wrote it. However, now with neuro-computing models in existence, this argument can be made redundant in principle.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">8.) <span style="text-decoration: underline;"><strong>The Argument from Informality of Behavior</strong></span>: The crux of the argument is - If each man had a definite set of rules of conduct by which he regulated his life, he would be no better than a machine. But there are no such rules, so men cannot be machines. Turing refutation on this still holds since we still haven’t found the absolute laws of behavior that regulate life, something similar to the M-theory, or the theory of everything - <a href="http://en.wikipedia.org/wiki/M-theory"><span style="color: #0000ff;"><span style="text-decoration: underline;">http://en.wikipedia.org/wiki/M-theory</span></span></a> .</p>
<p><br/></p>
<p style="margin-bottom: 0in;">9.) <span style="text-decoration: underline;"><strong>The Argument from Extrasensory Perception</strong></span>: The argument itself seems pretty weak and containing very less substantiation. There are varied opinions on phenomena like telepathy, precognition, etc, and like the argument the refutation is also pretty weak <!-- 		@page { size: 8.5in 11in; margin: 0.79in } 		P { margin-bottom: 0.08in } -->(<em>telepathy-proof room</em>). Anyhow, some people may still have this objection, however it remains a very subjective issue.</p>
<p><br/></p>
<p style="margin-bottom: 0in;">
<p style="margin-bottom: 0in;"><span style="text-decoration: underline;"><strong>New Issues</strong></span>: -</p>
<p><br/></p>
<p style="margin-bottom: 0in;"><span style="text-decoration: underline;"><strong>Inherent problems with the Turing Test and Comprehensive Turing Test</strong></span>:</p>
<p><br/></p>
<p style="margin-bottom: 0in;">With the advancement of AI to fields like machine vision and perception, one may demand a more comprehensive test. This is since humans generally don’t use question-answering as a means to find whether someone is able to ‘<em>think‘</em>. We use more simplistic (or elaborate, if we consider machines) methods like sight, sound of voice, etc and our notion of thinking is implied by many other apparent things than just plain response. A case in point are the systems like CAPTCHA - <a href="http://www.captcha.net/"><span style="color: #0000ff;"><span style="text-decoration: underline;">http://www.captcha.net/</span></span></a> . This brings back the old issue on whether the Turing Test is a real test of intelligence at all. It seems that the inherent problem with the test is that a program can fool an interrogator by playing on his psychology. This task is much more easier and doesn’t definitely require intelligence equivalent to the mind, or thought process. A simple re-use of the question-phrases can be used as an effective way of letting an interrogator know that the program is actually a person belonging to a particular genre. A case in point is Eliza - <a href="http://en.wikipedia.org/wiki/ELIZA"><span style="color: #0000ff;"><span style="text-decoration: underline;">http://en.wikipedia.org/wiki/ELIZA</span></span></a> . Of late, there have been similar concerns raised over expertise of judges in the Loebner competition. As far as the current state of success with passing the Turing Test is concerned, it may be noted that Loebner is the only official competition for judging this and most of the effort in AI is actually not focused on passing this test. This current state of AI may not have a one-to-one co-relation with the whether this test has been passed or not. However, current state of AI does give us an idea regarding whether this test <em>can</em> be passed if all effort was directed towards it. The 2007 winner for Loebner award was UltraHal, which is basically a software assistant and was re-programmed to enter the competition so that it could specifically fool the judges (ref the interview here - <a href="http://aidreams.co.uk/forum/index.php?page=67"><span style="color: #0000ff;"><span style="text-decoration: underline;">http://aidreams.co.uk/forum/index.php?page=67</span></span></a> ) . So, again the chance of fooling a judge is subjective and dependent on the skill of judge as described above in the case of Eliza bot. It may be argued that the Turing test has already been passed by some programs since they fooled a set of judges in Loebner, but the credibilty of judges would always be in question and so will be the exact rules and regulations under the competition was held. In all, I would say there’s a chance of about 25% for a machine to pass the test, considering strict Turing guidelines and maybe in next 50 years, we would make substantial advances in allied fields of AI to eventually pass the test satisfactorily, however, this again depends on how much effort is put in  actually solving this problem in specific.</p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=sushain.com%20%7C%20blog&amp;siteurl=http%3A%2F%2Fsushain.com%2Fblog%2F&amp;linkname=Case%20analysis%20-%20A%20critique%20on%20Turing%26%238217%3Bs%20original%20refutations&amp;linkurl=http%3A%2F%2Fsushain.com%2Fblog%2Farchives%2F92"><img src="http://sushain.com/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://sushain.com/blog/archives/92/feed</wfw:commentRss>
		</item>
		<item>
		<title>Case Analysis - Cuil</title>
		<link>http://sushain.com/blog/archives/20</link>
		<comments>http://sushain.com/blog/archives/20#comments</comments>
		<pubDate>Fri, 25 Jul 2008 13:43:00 +0000</pubDate>
		<dc:creator>sushain</dc:creator>
		
		<category><![CDATA[Comparison]]></category>

		<category><![CDATA[cuil]]></category>

		<category><![CDATA[google]]></category>

		<category><![CDATA[linkedin]]></category>

		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://sushain.com/blog/?p=20</guid>
		<description><![CDATA[We&#8217;ve had a new entrant in internet-search spaces, called Cuil, which, as per popular fiction, is supposedly out there to compete with Google. Anyhow, I spend some time playing around and reading accessible literature on it and here are my observations: -
- Indexing: Most hyped is the size of its massive index (~120 billion pages), [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve had a new entrant in internet-search spaces, called Cuil, which, as per popular fiction, is supposedly out there to compete with Google. Anyhow, I spend some time playing around and reading accessible literature on it and here are my observations: -</p>
<p>- <strong>Indexing:</strong> Most hyped is the size of its massive index (~120 billion pages), as also quoted in their <a href="http://www.cuil.com/info/">info page</a> - &#8220;Cuil searches more pages on the Web than anyone else—three times as many as Google and ten times as many as Microsoft&#8221;. However, I didn&#8217;t find any conclusive proof for this in that Google still listed more total hits on most of my test-searches. [Example SearchKey = 'Sushain': Cuil - 662 | Google - 929]</p>
<p>Now, this may still improve with time, so we&#8217;ll let this one pass.</p>
<p>- <strong>Renewal rate:</strong> Now, they might have indexed more pages than Google but their index still doesn&#8217;t contain recent links. Indexing recent content is really critical to search engines and again, they should improve on this front with time.</p>
<p>- <strong>Page ranking:</strong> The <a href="http://www.cuil.com/info/">info page</a> also says - &#8220;Rather than rely on superficial popularity metrics, Cuil searches for and ranks pages based on their content and relevance. When we find a page with your keywords, we stay on that page and analyze the rest of its content, its concepts, their inter-relationships and the page’s coherency.&#8221;</p>
<p>The issue I found was that sometimes the searches listed &#8216;not-so-important&#8217; results before more-relevant ones. For instance, listing the pages linked to someone&#8217;s friend (via a social network) before actually putting the person&#8217;s site-listing etc. In my case, it shows my name being present in my friend&#8217;s HiFi n/w, before pointing anything relevant to me (and I haven&#8217;t put a robots.txt file on my website yet to stop crawlers :-)).</p>
<p>- <strong>Infrastructure:</strong> Many a times, during my experimentation, Cuil would just give a &#8216;We&#8217;ll be back&#8217; message, or wouldn&#8217;t repeat the results that were generated for the same query, some time ago. Again, there&#8217;s room for improvement and they would do well to evolve with time.</p>
<p>- <strong>Layout:</strong> I&#8217;ve personal hots for dark (energy-saving) backgrounds and Cuil scores there. Even otherwise, the results are laid out in a better way and are easy to spot, but again, I think I&#8217;ve seen this before on proprietary search-engines.</p>
<p>- <strong>Privacy:</strong> Cuil does claim to be the good-boy search engine n not track the data et al, but the bottom-line still is how good the search capability is.</p>
<p><strong>Final verdict:</strong> Well, I&#8217;m pretty much in favor of any new-comer into a partially monopolized domain (Though I love Google as much as anyone :-)). The only issue I&#8217;ve is that they really could&#8217;ve done some more ground-work before making this live (Links on Info and Privacy weren&#8217;t working till yesterday) since the first impression really goes a long way. All in all, I think, we need to give more time to Cuil; No enterprise gets build in a day and Cuil should be appreciated to have at least taken an initiative in an otherwise one-firm show.</p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=sushain.com%20%7C%20blog&amp;siteurl=http%3A%2F%2Fsushain.com%2Fblog%2F&amp;linkname=Case%20Analysis%20-%20Cuil&amp;linkurl=http%3A%2F%2Fsushain.com%2Fblog%2Farchives%2F20"><img src="http://sushain.com/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://sushain.com/blog/archives/20/feed</wfw:commentRss>
		</item>
		<item>
		<title>A Javascript Framework for Building Hierarchical Layouts</title>
		<link>http://sushain.com/blog/archives/19</link>
		<comments>http://sushain.com/blog/archives/19#comments</comments>
		<pubDate>Tue, 22 Jul 2008 06:58:00 +0000</pubDate>
		<dc:creator>sushain</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[framework]]></category>

		<category><![CDATA[hierarchical]]></category>

		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[layout]]></category>

		<category><![CDATA[linkedin]]></category>

		<guid isPermaLink="false">http://sushain.com/blog/?p=19</guid>
		<description><![CDATA[Abstract: Layouts play a key role in any UI-based application requiring even marginal display formatting. The idea is to encapsulate the screen-level details into a library and to completely decouple the rendering knowledge from the actual business / enterprise logic details. This would then allow a UI-specialist team to work in tandem with business analysts, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Abstract:</strong> Layouts play a key role in any UI-based application requiring even marginal display formatting. The idea is to encapsulate the screen-level details into a library and to completely decouple the rendering knowledge from the actual business / enterprise logic details. This would then allow a UI-specialist team to work in tandem with business analysts, or core product-development teams without getting too much up-close and personal with the underlying product-level details. Alternatively, a properly designed layout library could be used off-the-shelf by a development team. The framework discussed here relates to either of these scenarios and many more.</p>
<p><strong>Description:</strong> The framework is developed as a javascript service that defines vertical / horizontal hierarchical layout method handlers. There are different handlers  based on whether one wants to organize divisions (div tags), separate nodes, or node hierarchies. Apart from the structuring logic, the file also includes the rendering logic that paints the node(s) and their associated relations to build the actual hierarchy.</p>
<p>Now, the layouts are provided out of the box and all one requires is a nodelist (supporting composite pattern), which will then be consumed to draw the actual hierarchy. Such hierarchies can be utilized for a particular filtered view within a social networking graph.</p>
<p>The node definition(s) should comply to the following generic template to be able to fed and subsequently consumed properly by the framework: -</p>
<p><span style="font-style:italic;">var Node = function(id) {<br />
this.id = id;<br />
this.coords;<br />
this.shape;<br />
this.text;<br />
this.group;<br />
this.childList = new dojox.collections.ArrayList();<br />
}<br />
</span></p>
<p>Illustration: -</p>
<p>- Get a hierarchy object (pass the ultimate parent of the node hierarchy and specify the alignment [horizontal / vertical]: -</p>
<p><span style="font-style:italic;">HierarchyLayout newLayout = new HierarchyLayout (document, ultimateParent, alignment);</span></p>
<p>- Invoke addNodeHierarchy: -</p>
<p><span style="font-style:italic;">newLayout.addNodeHierarchy (ultimateParent, &#8220;&#8221;); // 2nd argument is yet to be utilized</span></p>
<p>This invocation would assign a value to the node coordinates (node.coords.x, node.coords.y) for each node in the hierarchy according to the passed alignment.</p>
<p>- Invoke renderHierarchy on a node: -</p>
<p><span style="font-style:italic;">node.renderHierarchy ();</span></p>
<p>This invocation would render the immediate child nodes considering &#8220;node&#8221; as the parent.</p>
<p>The library can be downloaded from - <a href="http://sushain.com/sonet/resources/Layout.js">Layout Lib</a></p>
<p>You can see a demo-usage @ <a href="http://sushain.com/sonet/index.html">SoNet home</a> under &#8220;Demo&#8221; &#8211;&gt; &#8220;Layout service demo&#8221;.</p>
<p>Please feel free to drop a note in case you&#8217;ve comments / feedback.</p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=sushain.com%20%7C%20blog&amp;siteurl=http%3A%2F%2Fsushain.com%2Fblog%2F&amp;linkname=A%20Javascript%20Framework%20for%20Building%20Hierarchical%20Layouts&amp;linkurl=http%3A%2F%2Fsushain.com%2Fblog%2Farchives%2F19"><img src="http://sushain.com/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://sushain.com/blog/archives/19/feed</wfw:commentRss>
		</item>
		<item>
		<title>A Framework Description for Dynamic Generation of XMLs</title>
		<link>http://sushain.com/blog/archives/14</link>
		<comments>http://sushain.com/blog/archives/14#comments</comments>
		<pubDate>Tue, 15 Jul 2008 10:27:00 +0000</pubDate>
		<dc:creator>sushain</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[dynamic]]></category>

		<category><![CDATA[framework]]></category>

		<category><![CDATA[Java]]></category>

		<category><![CDATA[linkedin]]></category>

		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://sushain.com/blog/?p=14</guid>
		<description><![CDATA[Problem Statement: XML is an oft-used specification in enterprise-level application frameworks for specifying input/output sources. Many a times, there arises a need to extend or adorn the existing access end-points, for instance by placing a wrapper over the original frameworks or middle-ware. Such scenarios should be handled without the loss of generality and the key [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem Statement:</strong> XML is an oft-used specification in enterprise-level application frameworks for specifying input/output sources. Many a times, there arises a need to extend or adorn the existing access end-points, for instance by placing a wrapper over the original frameworks or middle-ware. Such scenarios should be handled without the loss of generality and the key requirement is seamless matching with the input specification (XML) of the existing framework. In such cases, it becomes a tedious task for the writers of the wrapper to statically code the XMLs that are to be fed into the existing framework, while simultaneously conforming to the existing schema definitions (xsds / dtds).</p>
<p>Thus, a generic XML-generation framework is desirable that could return precise XML files by consuming a schema definition(specifying generic XML structure) and an input configuration (containing information specific to a particular XML-generation instance).</p>
<p><strong>Input(s) to the framework:</strong> Schema Definition (xsd), Configuration (.xml), Input Parameters (HashMap ), Resource Specification [Specifies the system-specific entity for which the xml is to be generated].</p>
<p><strong>Solution Design:</strong> The core idea is pretty straight-forward and comprises of the following steps: -</p>
<p>[1]. Create an in-memory parse-tree out of the given .xsd</p>
<p>[2]. Use the resource specification to refer the configuration and find out &#8216;the information&#8217; specific to that particular XML-generation instance</p>
<p>[3]. Use the above &#8216;information&#8217; to find out the scope of the current instance of xml generation from within the entire parse-tree</p>
<p>[4]. Adorn that scope with the input parameters and recursively apply &#8216;the information&#8217; to generate the actual XML file</p>
<p><strong>Description:</strong></p>
<p><strong>[1]</strong>. Create an in-memory parse-tree out of the given .xsd - For this, one can either go with any of the open-source xml-parsers, or write from scratch. Writing from scratch would generally require Element, Node, Attribute and ComplexType  classes along with their respective handlers. Then, you would&#8217;ve a Schema Parser, which would utilize instances of those classes and generate the final tree object.</p>
<p>I won&#8217;t elaborate further on this here; if required, please drop me a note. In essence, the only contract to be followed is that the return object should contain a parse-tree structure.</p>
<p><strong>[2, 3 &amp; 4]</strong>. To understand these, let us delve a bit into the source.</p>
<p>Our generator would generally need to follow something similar to the following contract: -</p>
<p><span style="font-style: italic;">/**<br />
* IXMLGenerator represents the contract that all XML generators must adhere to<br />
* in order to support the default logic of XML genertion. Default XML generation<br />
* contract is based on the consumption of the starting XML <code>element</code><br />
* and the <code>consolidatedMap</code> of input and configuration parameters to<br />
* generate the populated response XML for that particular element.<br />
*<br />
* @author sushain<br />
*<br />
* @version 1.0<br />
*/</span></p>
<p>public interface IXMLGenerator<br />
{ /**<br />
* This method takes a resource name, corresponding method and a<br />
* parameter map and builds a request xml<br />
* which can be consumed by the a request handler.<br />
*<br />
* @param resource<br />
* @param method<br />
* @param paramMap<br />
*<br />
* @return Generated request xml<br />
*/</p>
<p>public static String generateXml(final String resource,<br />
final String method, final HashMap paramMap)<br />
throws SchemaParsingException;<br />
}</p>
<p>Here, generateXml would be the main method, inherently calling the tree-creation module, and effectively completing step (1). This method would utilize the input-parameter map (HashMap containing the name-value pairs for the elements to be populated in the xml), resource (the entity for which the xml is desired) and method (the type of xml desired {system-specific}) by referring the &#8216;Configuration&#8217; in the following manner: -</p>
<p>Now, I&#8217;ve repeatedly referred to a &#8216;Configuration&#8217; above, lets see how that actually looks like: -</p>
<p>&lt;configuration&gt;<br />
&lt;resource name=&#8221;&lt;system-defined name&gt;&#8221;&gt;<br />
&lt;method name=&#8221;&lt;resource access method / CRUD operation&gt;&#8221;&gt;</p>
<p>&lt;param name = &#8220;aaa&#8221; value=&#8221;val1&#8243; /&gt;</p>
<p>&lt;param name = &#8220;bbb&#8221; value=&#8221;val2&#8243; /&gt;</p>
<p>&lt;param name = &#8220;ccc&#8221; value=&#8221;val3&#8243; /&gt;</p>
<p>&lt;!&#8211;param name = &#8220;&lt;complex_aaa&gt;&#8221; value=&#8221;&lt;attr_val1&gt;,&lt;attr_val2&gt;&#8221; /&#8211;&gt;</p>
<p>&lt;!&#8211;param name = &#8220;&lt;complex_bbb&gt;&#8221; value=&#8221;&lt;attr_val3&gt;,&lt;attr_val4&gt;&#8221; /&#8211;&gt;</p>
<p>&lt;/method&gt;</p>
<p>.<br />
.<br />
.</p>
<p>Some key-points about the above conf are: -</p>
<p>- Each resource-name has a list of parameters associated with it that would define what exactly its associated XML would consist of.</p>
<p>- In case of complex-type params, the value consists of a list of comma-separated attributes.</p>
<p>- Such a definition is readable, easily extensible and configurable.</p>
<p>We would also have a corresponding Config class to read the above XML configuration into a Document (org.w3c.dom.Document) and build a hashMap out of it.</p>
<p>The structure of such a class would be similar to: -</p>
<p><span style="font-style:italic;">public class Configuration {</span></p>
<p>private File configFile;</p>
<p>private Document configDoc;</p>
<p>private String resultNodeName;</p>
<p>public Configuration(String configText){</p>
<p>this.configFile = new File (configText);</p>
<p>this.configDoc = getConfigDocument();<br />
}</p>
<p>public Document getConfigDocument() {</p>
<p>Document XMLDoc = XMLutils.getXMLDocument(configFile);</p>
<p>if (XMLDoc == null) {</p>
<p>System.out.println(&#8221;XMLDoc null&#8221;);</p>
<p>System.exit(-1);<br />
}</p>
<p>String query = &#8220;/configuration&#8221;;</p>
<p>NodeList nl = (NodeList) XMLutils.runXPathQuery(XMLDoc, query);</p>
<p>if(nl.getLength() !=1 ) {</p>
<p>return null;<br />
}</p>
<p>Document responseObject = XMLutils.getNodeAsDocumentRoot(nl.item(0));</p>
<p>return (responseObject == null) ? null : responseObject;<br />
}</p>
<p>public String getResultNodeName() {</p>
<p>return resultNodeName;<br />
}</p>
<p>public HashMap getConfigurationMap (final String resourceName, final String methodName) {</p>
<p>HashMap  configObject = new HashMap  ();</p>
<p>Node temp = this.configDoc.getDocumentElement().getFirstChild();</p>
<p>while(temp != null) {</p>
<p>if(temp.getNodeType() == Node.ELEMENT_NODE) {</p>
<p>if (temp.getAttributes().item(0).getNodeValue().trim().equals(resourceName)) {</p>
<p>NodeList methodList = temp.getChildNodes();</p>
<p>int methodListIndex = 0;</p>
<p>while (methodListIndex &lt; methodList.getLength()) {</p>
<p>if (methodList.item (methodListIndex).getAttributes() == null) {</p>
<p>methodListIndex = methodListIndex + 1;</p>
<p>continue;<br />
}</p>
<p>if (methodList.item (methodListIndex).getAttributes().item(0).getNodeValue().trim().equals(methodName)) {</p>
<p>NodeList paramList = methodList.item(methodListIndex).getChildNodes();</p>
<p>int paramListIndex = 0;</p>
<p>while (paramListIndex &lt; paramList.getLength()) {</p>
<p>if (paramList.item(paramListIndex).getAttributes() == null) {</p>
<p>paramListIndex = paramListIndex + 1;</p>
<p>continue;<br />
}</p>
<p>configObject.put(paramList.item(paramListIndex).getAttributes().item(0).getNodeValue().trim(),<br />
paramList.item(paramListIndex).getAttributes().item(1).getNodeValue().trim());</p>
<p>paramListIndex = paramListIndex + 1;<br />
}<br />
}</p>
<p>methodListIndex = methodListIndex + 1;<br />
}<br />
}<br />
}</p>
<p>temp = temp.getNextSibling();<br />
}</p>
<p>return configObject;<br />
}</p>
<p>}</p>
<p>- Once such a setup is in place, the generateXml method would then build a &#8216;Consolidated Map&#8217; by appending ParamMap to HashMap.</p>
<p>- It would then read the xsd definition and get the in-memory parse tree ready using the module discussed in step (1).</p>
<p>- After that the actual xml generation logic would be invoked, passing the above built Consolidated Map and the resource specifiction.</p>
<p>- The generation logic would iterate through the tree, until it locates the resource spec</p>
<p>- It would then start building the XML, simultaneously referring the Consolidated Map and populating elements whenever it finds a corresponding entry in the Map. The population logic would be written in the corresponding handlers for &#8217;simple&#8217; as well as &#8216;complex&#8217; type nodes.</p>
<p>This would be something similar to: -</p>
<p><span style="font-style:italic;">if(attList.size() &gt; 0) {</span></p>
<p>XSDAttribute att = (XSDAttribute)attList.get(0);</p>
<p>if (consolidatedMap.containsKey(getName())) {</p>
<p>attributeString = consolidatedMap.get(getName()).toString();</p>
<p>StringTokenizer stok = new StringTokenizer (attributeString, &#8220;,&#8221;);</p>
<p>while (stok.hasMoreTokens()) {</p>
<p>buffer.append(&#8221;&lt;&#8221;);</p>
<p>buffer.append (getName() + &#8221; &#8220;);</p>
<p>buffer.append (att.getName());</p>
<p>buffer.append(&#8221;=&#8221;);</p>
<p>buffer.append(&#8221;"&#8221; + stok.nextToken() + &#8220;&#8221;");</p>
<p>buffer.append(&#8221;&gt;&#8221;);</p>
<p>if (consolidatedMap.containsKey(att.getName())) {</p>
<p>buffer.append (consolidatedMap.get(att.getName()));<br />
}</p>
<p>buffer.append(&#8221;<!--");</p-->
<p>buffer.append(getName());</p>
<p>buffer.append(&#8221;&gt;&#8221;);<br />
}</p>
<p>}</p>
<p>return buffer;</p>
<p>Finally, this XML would be returned to the caller and subsequently consumed by the original framework. For extension purposes, the only file to be modified later would be the configuration, which could be easily achieved due to the uniformity and structured nature of the definition. Due to a generic contract specification that only mandates an input parameter-map with name-value pairs of population-parameters, such a framework could be utilized in applications with a consuming UI-front as well as headless command-based apps. We thus saw how an effective configuration-design simplifies a seemingly difficult extension &amp; integration problem.</p>
<p>If you have any suggestions, please drop a note / post.</p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=sushain.com%20%7C%20blog&amp;siteurl=http%3A%2F%2Fsushain.com%2Fblog%2F&amp;linkname=A%20Framework%20Description%20for%20Dynamic%20Generation%20of%20XMLs&amp;linkurl=http%3A%2F%2Fsushain.com%2Fblog%2Farchives%2F14"><img src="http://sushain.com/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://sushain.com/blog/archives/14/feed</wfw:commentRss>
		</item>
		<item>
		<title>Aggregation, Mashup Creation and Assembly Services</title>
		<link>http://sushain.com/blog/archives/13</link>
		<comments>http://sushain.com/blog/archives/13#comments</comments>
		<pubDate>Mon, 07 Jul 2008 14:09:00 +0000</pubDate>
		<dc:creator>sushain</dc:creator>
		
		<category><![CDATA[Comparison]]></category>

		<category><![CDATA[alphaworks]]></category>

		<category><![CDATA[ibm]]></category>

		<category><![CDATA[Mashup]]></category>

		<category><![CDATA[services]]></category>

		<guid isPermaLink="false">http://sushain.com/blog/?p=13</guid>
		<description><![CDATA[Another one of those all-exploratory, info-posts. In case you&#8217;re looking for a Mashup service solution for your enterprise, check these out: -
- alphaworks.ibm.com/tech/mashuphub
- services.alphaworks.ibm.com/damia
- services.alphaworks.ibm.com/qedwiki
^ Excellent assembly canvasses and services to create holistic aggregations and their respective interface components, and in turn giving us yet another instance of an effort towards the unification of the [...]]]></description>
			<content:encoded><![CDATA[<p>Another one of those all-exploratory, info-posts. In case you&#8217;re looking for a Mashup service solution for your enterprise, check these out: -</p>
<p>- <a href="http://www.alphaworks.ibm.com/tech/mashuphub">alphaworks.ibm.com/tech/mashuphub</a></p>
<p>- <a href="http://services.alphaworks.ibm.com/damia/">services.alphaworks.ibm.com/damia</a></p>
<p>- <a href="http://services.alphaworks.ibm.com/qedwiki/">services.alphaworks.ibm.com/qedwiki</a></p>
<p>^ Excellent assembly canvasses and services to create holistic aggregations and their respective interface components, and in turn giving us yet another instance of an effort towards the unification of the random segments.</p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=sushain.com%20%7C%20blog&amp;siteurl=http%3A%2F%2Fsushain.com%2Fblog%2F&amp;linkname=Aggregation%2C%20Mashup%20Creation%20and%20Assembly%20Services&amp;linkurl=http%3A%2F%2Fsushain.com%2Fblog%2Farchives%2F13"><img src="http://sushain.com/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://sushain.com/blog/archives/13/feed</wfw:commentRss>
		</item>
		<item>
		<title>Eclipse IDE - How I do my part..</title>
		<link>http://sushain.com/blog/archives/11</link>
		<comments>http://sushain.com/blog/archives/11#comments</comments>
		<pubDate>Wed, 25 Jun 2008 08:03:00 +0000</pubDate>
		<dc:creator>sushain</dc:creator>
		
		<category><![CDATA[Demonstration]]></category>

		<category><![CDATA[eclipse]]></category>

		<category><![CDATA[Java]]></category>

		<category><![CDATA[setup]]></category>

		<category><![CDATA[workspace]]></category>

		<guid isPermaLink="false">http://sushain.com/blog/?p=11</guid>
		<description><![CDATA[I recently read - WS Setup and not to beat about it, or sound harsh et al, I just had that sweet lil&#8217; feeling, which you get when you know that you know. So, why have this post at all then ? Well, I&#8217;m a real skeptical guy, even paranoid at that.. I had that [...]]]></description>
			<content:encoded><![CDATA[<p>I recently read - <a href="http://www.darronschall.com/weblog/archives/000201.cfm">WS Setup</a> and not to beat about it, or sound harsh et al, I just had that sweet lil&#8217; feeling, which you get when you know that you know. So, why have this post at all then ? Well, I&#8217;m a real skeptical guy, even paranoid at that.. I had that feel good feeling for a moment, followed by an immediate moronic realization that thunder may strike and rob me of my lil&#8217; knowledge in the context of the post. So, for the records following is a description that may remind me on how I use the IDE when I get a fresh workspace, just in case.. the thunder strikes :-|</p>
<p><strong>IDE used: -</strong></p>
<p>Rational Software Architect (RSA) and Rational Application Development (RAD) Platform – built on Eclipse 3.0</p>
<p><strong> Plugins: -</strong></p>
<p>- Team – As a repository tool for consistent change management<br />
- JDT Core - Just touched it once to re-install the code assist support<br />
- org.eclipse.ant.core<br />
- org.eclipse.pde.core<br />
- org.eclipse.tomcat<br />
- Most other preinstalled plugins in the .metadata/plugins folder in RSA (/plugins folder in Eclipse)</p>
<p><strong>File-types usually touched: -</strong></p>
<p>.java, .xml, .properties, .jsp, .js, .sh, .bat, etc and some project-specific formats</p>
<p><strong>Process followed when a fresh workspace is given: -</strong></p>
<p>- To start with, shift the dock from the bottom position to leftmost.</p>
<p>- After this, dock all the development-related views like (pakage explorer, navigator, outline, hierarchy et al) onto this.</p>
<p>- Doing this (above explained docking) gives the entire width of screen for code-writing purposes. Also, this enables toggling any other view by single mouse-click.</p>
<p>- Keep server, problems, and console views docked at the bottom, since they&#8217;re needed most of the time.</p>
<p>- After this, open the required perspective – java, j2ee, or debug.</p>
<p>- Un-check the ‘build automatically’ option in the Project-menu because you don’t want the ws to build every-time you change a single line.</p>
<p>- If required, go to Preferences – Java – Code Style and change the formatting to what you usually practice, or to the standard that is followed at the organization / client working for.</p>
<p>- The next activity is creating the required CVS repositories and checking-out the code.</p>
<p>- Follow this by a build check to see if all the required projects are checked-out and resolved all dependencies. A clean build would ensure that.</p>
<p>- Next, do the database setup. Run the associated scripts for schema generation and data population.</p>
<p>- After this comes the server configuration part. Depending on whether the server is Tomcat, Websphere Application Server or JBoss, follow different set of steps.</p>
<p>- In case there is an automation plugin available, last four steps could be made redundant.</p>
<p>- After this, prepare the main Ear or War for deployment, if required, by right-clicking and selecting ‘Prepare for deployment’. This would generate deployment code for all the projects specified within the application.xml / web.xml.</p>
<p>- Following this, do a clean-buildall again and finally publish the .ear onto the server.</p>
<p>- Run the sanity-test bucket to see that the code hasn’t broken any existing stuff.</p>
<p>- Follow this by unit-test creation according to a test-case matrix provided by a business-analyst or yourself, and then running those.</p>
<p>- After this, if lucky, you would do the code sync-merge-checkin, or would’ve to switch to the debug-mode :-)</p>
<p>- After code check-in, ideally, sync the workspace again with Head-stream and do the above steps till sanity-check to ensure everything is working perfectly.</p>
<p>- If any new plugins are installed, start RSA with –clean option to clear the registry et al.</p>
<p>There are many other things to be done and points to follow in order to ensure that the development process is smooth, but the above description shall give a good enough idea to save me.. in case the thunder strikes.</p>
<p>[Disclaimer: If I goofed-up any of the steps, blame me not.. it would simply imply that thunder struck early !</p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=sushain.com%20%7C%20blog&amp;siteurl=http%3A%2F%2Fsushain.com%2Fblog%2F&amp;linkname=Eclipse%20IDE%20-%20How%20I%20do%20my%20part..&amp;linkurl=http%3A%2F%2Fsushain.com%2Fblog%2Farchives%2F11"><img src="http://sushain.com/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://sushain.com/blog/archives/11/feed</wfw:commentRss>
		</item>
		<item>
		<title>An anecdote on Technical Disclosures and Defensive Publications</title>
		<link>http://sushain.com/blog/archives/32</link>
		<comments>http://sushain.com/blog/archives/32#comments</comments>
		<pubDate>Sat, 21 Jun 2008 19:22:00 +0000</pubDate>
		<dc:creator>sushain</dc:creator>
		
		<category><![CDATA[Random Segments]]></category>

		<category><![CDATA[Artificial Intelligence]]></category>

		<category><![CDATA[classification]]></category>

		<category><![CDATA[patent]]></category>

		<guid isPermaLink="false">http://sushain.com/blog/?p=32</guid>
		<description><![CDATA[Recently, one of my disclosures on a classification variant using neural-networks got published on ip.com as a defensive publication. I always thought it to be a really strong candidate for a patent application, and was rather upset when I came to know that it would be published openly. A little research on the topic however [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, one of my disclosures on a classification variant using neural-networks got published on ip.com as a defensive publication. I always thought it to be a really strong candidate for a patent application, and was rather upset when I came to know that it would be published openly. A little research on the topic however changed my impression, and on retrospection I was quite happy with the state of affairs. I thus decided that I would record my observations here for anyone to read and clarify this whole patent-publication terminology as such. But, as always, blessed with whatever, I can&#8217;t just resist that tinge of drama; I would thus tell you an anecdote.</p>
<p>Let us start with an example scenario whence a top-notch scientist working in a world-class firm makes a ground-breaking discovery, leading to an equally precious idea and associated methodology to implement the idea.</p>
<p><a href="http://bp3.blogger.com/_heXLUxxvwKc/SIRPTG7Zr6I/AAAAAAAAAVE/WQ7nnAivhdg/s1600-h/1.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5225388657352486818" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_heXLUxxvwKc/SIRPTG7Zr6I/AAAAAAAAAVE/WQ7nnAivhdg/s200/1.JPG" border="0" alt="" /></a><br />
He knows that ideas are meant to be patented and thus he files a disclosure with his local Invention Development Team (IDT). Now, this IDT consists of equally capable guys, with a decent patent-portfolio and a healthy disdain for jack-in-the-office patent wannabes. They begin to scrutinize the disclosure as usual.</p>
<p><a href="http://bp1.blogger.com/_heXLUxxvwKc/SIRQTz-4hUI/AAAAAAAAAVs/gQG0Sv7LlWs/s1600-h/2.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5225389768958313794" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp1.blogger.com/_heXLUxxvwKc/SIRQTz-4hUI/AAAAAAAAAVs/gQG0Sv7LlWs/s400/2.JPG" border="0" alt="" /></a><br />
They go through the existing and easily-accessible prior-art and find some seemingly similar implementations. Thus, they immediately publish a questionnaire soliciting a response. Now, our dear scientist, being quite busy with putting new ideas and draft disclosure in pipeline, misses the solicitation deadline given, and gets a note with the subject - &#8216;Disclosure Rated Close&#8217; in his mailbox after some days.</p>
<p><a href="http://bp0.blogger.com/_heXLUxxvwKc/SIRPTASusBI/AAAAAAAAAVU/jlb1KSwDU-Q/s1600-h/3.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5225388655571283986" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp0.blogger.com/_heXLUxxvwKc/SIRPTASusBI/AAAAAAAAAVU/jlb1KSwDU-Q/s200/3.JPG" border="0" alt="" /></a><br />
Panic struck, he immediately writes to IDT expressing his distress and feeling of injustice et al. Soon after, he realizes his sloppiness and writes another apologetic note asking for a re-consideration of deadline and disclosure. He spends that night sorting out the core idea and drafting the answers to the questionnaire.. with his mind already messed-up with new ideas. He finally strikes gold and publishes his detailed explanation requesting IDT to revoke the &#8216;close decision&#8217; on the application. After much deliberation, he finally succeeds and the disclosure status again changes to &#8216;under evaluation&#8217;. Rejuvenated with his cock-a-doodle of victory, he starts following-up with IDT at regular intervals, dropping notes and giving an impression as if he is next-in-line after Euler, Newton and Einstein.</p>
<p><a href="http://bp3.blogger.com/_heXLUxxvwKc/SIRQz1Mqn_I/AAAAAAAAAV0/aHhacWyV3KE/s1600-h/6.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5225390319040372722" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_heXLUxxvwKc/SIRQz1Mqn_I/AAAAAAAAAV0/aHhacWyV3KE/s320/6.JPG" border="0" alt="" /></a></p>
<p>Anyhow, the IDT guys, after many more comparisons and explanations aren&#8217;t satisfied with whatever prior-art they evaluated the idea against, and give the decision as &#8216;Search&#8217;. Now, this doesn&#8217;t go down too well with the scientist guy. Afterall, if you ask him, he had manually searched every single entry on Goog, and found nothing even remotely similar.</p>
<p>Anyhow, he starts working with the IDT; IDT guys giving him a new paper every other day to evaluate and he making sure that he points out sufficient differences between that and his own disclosure. This process goes on for sometime, after which, the IDT folks start to give that one-in-a-blue-moon feeling of getting impressed. But now, they face another dilemma. They were pretty convinced that the idea was unique and the implementation novel, unrelated to anything done before, but the patent, if filed, wouldn&#8217;t have business value.</p>
<p>Now, the scientist guy is inconsolable.. &#8220;Business Value ? But this is a beautiful innovation.. Novelty, Uniqueness, Rigor.. everything in perfect proportions.. just patent it, it would create a new business for you.&#8221;</p>
<p><a href="http://bp1.blogger.com/_heXLUxxvwKc/SIRPTeIqqPI/AAAAAAAAAVc/JyLVtSMADG4/s1600-h/4.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5225388663582140658" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp1.blogger.com/_heXLUxxvwKc/SIRPTeIqqPI/AAAAAAAAAVc/JyLVtSMADG4/s200/4.JPG" border="0" alt="" /></a></p>
<p>It would not however benefit the existing business in any way. &#8220;The revenue that the patent, if filed, would generate on an average after &#8216;n&#8217; number of years and after going through &#8216;t&#8217; lawsuits doesn&#8217;t weigh well against the cost of the patent application (cost of filing + cost of effort + cost of time spent) and the cost of those &#8216;t&#8217; lawsuits and the cost of establishing a new business to accommodate your invention.&#8221;</p>
<p><a href="http://bp0.blogger.com/_heXLUxxvwKc/SIRSFfHxLDI/AAAAAAAAAV8/aQW9ly5osbI/s1600-h/7.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5225391721863523378" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp0.blogger.com/_heXLUxxvwKc/SIRSFfHxLDI/AAAAAAAAAV8/aQW9ly5osbI/s400/7.JPG" border="0" alt="" /></a><br />
In the hindsight, these explanations seem pretty rational. But the scientist guy still reasons - &#8220;Okay, so you don&#8217;t want to file an application now, no problem.. I can wait till we get a suitable business, and we&#8217;ll then file an application.&#8221;</p>
<p>&#8220;Ah well, your invention is valuable and has got all the limelight and hype because &#8216;it is unique right now&#8217;. We can wait, but then you&#8217;ll risk someone else making the same discovery and filing a patent application, in which case, your efforts will be rendered useless.&#8221;</p>
<p>The scientist snapped and took a moment to think about 6 billion people, who at that moment, seemed all capable of making the par and taking away his prized possession. &#8220;So, what is the way out ?&#8221;, asked the Scientist guy.</p>
<p><a href="http://bp2.blogger.com/_heXLUxxvwKc/SIRSFlxq0SI/AAAAAAAAAWE/dBAnZt7fu4U/s1600-h/8.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5225391723649880354" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_heXLUxxvwKc/SIRSFlxq0SI/AAAAAAAAAWE/dBAnZt7fu4U/s400/8.JPG" border="0" alt="" /></a><br />
&#8220;Well.. lets publish this defensively, which would mean publishing this in an open database accessible to all patent attorneys. That way, we preserve our right of using this and no one else can patent this in future. So, from then on, this becomes a piece of un-patentable, public knowledge. You will of course retain the major authorship and your organization will become the disclosing entity. The only catch is that since it&#8217;ll be public, we won&#8217;t be able to generate any revenue through lawsuits.&#8221;<br />
<a href="http://bp3.blogger.com/_heXLUxxvwKc/SIRUTgtPKGI/AAAAAAAAAWU/siG6GyKBL_U/s1600-h/10.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5225394161830537314" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_heXLUxxvwKc/SIRUTgtPKGI/AAAAAAAAAWU/siG6GyKBL_U/s400/10.JPG" border="0" alt="" /></a></p>
<p>To the scientist, this is a revelation - Unification of business and technological brilliance. Feeling of maintaining the celibacy of a brain-child forever. An equilibrium. And thus, he decides to rest his case.<br />
<a href="http://bp3.blogger.com/_heXLUxxvwKc/SIRUTl2vp5I/AAAAAAAAAWM/sTUA0jhBZ1c/s1600-h/9.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5225394163212593042" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_heXLUxxvwKc/SIRUTl2vp5I/AAAAAAAAAWM/sTUA0jhBZ1c/s400/9.JPG" border="0" alt="" /></a></p>
<p>[Disclaimer: All the above images are copyright of phdcomics.com and have been referred for non-commercial use]</p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=sushain.com%20%7C%20blog&amp;siteurl=http%3A%2F%2Fsushain.com%2Fblog%2F&amp;linkname=An%20anecdote%20on%20Technical%20Disclosures%20and%20Defensive%20Publications&amp;linkurl=http%3A%2F%2Fsushain.com%2Fblog%2Farchives%2F32"><img src="http://sushain.com/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://sushain.com/blog/archives/32/feed</wfw:commentRss>
		</item>
	</channel>
</rss>

