<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-2589427789736403011</atom:id><lastBuildDate>Sun, 27 Nov 2011 23:41:34 +0000</lastBuildDate><category>linux</category><category>Sun campus ambassador</category><category>pc</category><category>adam</category><category>java</category><category>configuration</category><category>karmic koala</category><category>apple</category><category>tablet</category><category>IRC</category><category>google talk</category><category>comparision</category><category>experience</category><category>program</category><category>pidgin</category><category>gtalk</category><category>iPad</category><category>ubuntu</category><category>hanvon</category><category>ubuntu 9.10</category><category>notion ink</category><category>karmic</category><category>empathy</category><category>gnome</category><title>My World</title><description /><link>http://anuragsharma-sun.blogspot.com/</link><managingEditor>noreply@blogger.com (Anurag)</managingEditor><generator>Blogger</generator><openSearch:totalResults>24</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/AnuragSharmaSunCampusAmbassador" /><feedburner:info uri="anuragsharmasuncampusambassador" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2589427789736403011.post-7236340607924508020</guid><pubDate>Sun, 17 Apr 2011 14:47:00 +0000</pubDate><atom:updated>2011-04-17T08:21:27.943-07:00</atom:updated><title>Finding whether a Binary tree is BST or not</title><description>Hi folks!&lt;br /&gt;It has been quite sometime since I posted on this blog. Anyways, yesterday a friend asked me this question, given a binary tree (not necessarily Binary Search Tree) find whether it is BST(Binary Search Tree) or not.&lt;br /&gt;Well, the question is pretty straight forward. A small thought on the basic definition of BST will lead us to answer this. As we know, BST holds the property that for every node of the tree its left child (if exists) contains value strictly less than the current node and its right child (if exists) contains value strictly greater than the current code.&lt;br /&gt;Now, if we implement the above logic we may end up marking the below tree as bst which is wrong:-&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;        8&lt;br /&gt;  4          10&lt;br /&gt;2   12&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;A little thought on this reveals the problem with above logic is we are not checking the range for every node. So here goes my C++ implementation (but pretty straight forward. Pardon the syntax errors) with range checking:-&lt;br /&gt;Let the structure of every node is:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;struct bst{&lt;br /&gt;  int val;&lt;br /&gt;  bst *left;&lt;br /&gt;  bst *right;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So now our function goes:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;bool isbst(const bst *T,const int &amp;start, const int &amp;end){&lt;br /&gt; if(!T)&lt;br /&gt;  return true; //trivially true for empty tree&lt;br /&gt;&lt;br /&gt; if(start &lt;= T-&gt;val &amp;&amp; T-&gt;val &lt;= end){   //check current node lies within range [start,end]&lt;br /&gt;  bool left = isbst(T-&gt;left, start,T-&gt;val-1); //check left subtree is bst&lt;br /&gt;  bool right = isbst(T-&gt;right, T-&gt;val+1,end); //check right subtree is bst&lt;br /&gt;  if(left &amp;&amp; right)     &lt;br /&gt;   return true;&lt;br /&gt; }else&lt;br /&gt;  return false; //value out of range;&lt;br /&gt;  &lt;br /&gt; return false;  //never reached&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This function is called like : isbst(root_node, INT_MIN, INT_MAX);&lt;br /&gt;INT_MIN here signifies -infinity and INT_MAX as +infinity&lt;br /&gt;Feedback welcome :)&lt;div class="blogger-post-footer"&gt;alternatively catch me at &lt;a href="http://blogs.sun.com/AnuragSharma"&gt; http://blogs.sun.com/AnuragSharma&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2589427789736403011-7236340607924508020?l=anuragsharma-sun.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AnuragSharmaSunCampusAmbassador/~4/_agj3I_XNnw" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AnuragSharmaSunCampusAmbassador/~3/_agj3I_XNnw/finding-whether-binary-tree-is-bst-or.html</link><author>noreply@blogger.com (Anurag)</author><thr:total>1</thr:total><feedburner:origLink>http://anuragsharma-sun.blogspot.com/2011/04/finding-whether-binary-tree-is-bst-or.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2589427789736403011.post-2336414349201597110</guid><pubDate>Thu, 08 Apr 2010 06:48:00 +0000</pubDate><atom:updated>2010-10-28T02:10:46.413-07:00</atom:updated><title>Finding the 'First Common Ancestor' in a Binary Tree</title><description>Just this morning, I received a basic question related to Binary Trees(not necessarily Binary 'Search' Trees) from a fellow at an algorithm forum. So here I am posting my solution to it.&lt;br /&gt;The problem goes like this(pretty simple 1 line problem):- Given a Binary Tree (not necessarily Binary 'Search' Tree), its root and pointers to any 2 nodes of the tree, find out the first common ancestor of the Tree. A Node of the tree contains: &lt;i&gt;data,&lt;/i&gt; &lt;i&gt;left subtree pointer&lt;/i&gt;, &lt;i&gt;right subtree pointer&lt;/i&gt; but no &lt;i&gt;'Parent pointer'.&lt;br /&gt; &lt;/i&gt;&lt;br /&gt;&lt;b&gt;Logic:&lt;/b&gt; Let 'A' and 'B' be the given too node whose common ancestor we have to find. Now perform an inorder traversal of the tree and at every node call the &lt;b&gt;'search(A)'&lt;/b&gt; function on the &lt;i&gt;left subtree &lt;/i&gt;and &lt;b&gt;search(B)&lt;/b&gt; function on the &lt;i&gt;right subtree.&lt;/i&gt; When both the results are true, you can be assured that this current node is only the first common ancestor of A, and B,&lt;br /&gt;&lt;b&gt;Reason: &lt;/b&gt;Let the first common ancestor node be '&lt;b&gt;C&lt;/b&gt;'. Then below C on either of its subtree tree (left and right) one and only one of the nodes amongst A and B will be present and above the hierarchy of node C,  both A and B will exist on just the 1 side.&lt;br /&gt;Heres d pseudo code:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function getFirstCommonAncestor(root, A, B):&lt;br /&gt;    if root == NULL:&lt;br /&gt;        return NULL                // the tree doesnt exists&lt;br /&gt;   &lt;br /&gt;    // if the left subtree contains node A and the right subtree contains node B then we have found the first common ancestor&lt;br /&gt;     if(searchTree(root.left, A) and searchTree(root.right, B)):&lt;br /&gt;        return root&lt;br /&gt;   &lt;br /&gt;    //else recursively find the common ancestor on its left and right subtrees and return if found&lt;br /&gt;    L = getFirstCommonAncestor(root.left, A, B)&lt;br /&gt;     R = getFirstCommonAncestor(root.right, A, B)&lt;br /&gt;   &lt;br /&gt;    if L != None:&lt;br /&gt;        return L&lt;br /&gt;    if R != None:&lt;br /&gt;        return R&lt;br /&gt;   &lt;br /&gt;    return None&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Well, the algorithm is not so efficient but solves our purpose partially. I am yet to further include additional conditional checks and optimize the algorithm, but for most of the cases it works just fine. :)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://crackersonly.googlegroups.com/web/firstCommonAncestor.py?gsc=aa0soQsAAACh167l8RzHseBy-tmnuN9r" &gt;Here&lt;/a&gt; goes the complete implementation in Python.&lt;br /&gt;&lt;br /&gt;Note: Some of the extra checks are missing. You will figure that out yourself.&lt;br /&gt;&lt;br /&gt;Bye for now.&lt;br /&gt;Happy Coding !&lt;div class="blogger-post-footer"&gt;alternatively catch me at &lt;a href="http://blogs.sun.com/AnuragSharma"&gt; http://blogs.sun.com/AnuragSharma&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2589427789736403011-2336414349201597110?l=anuragsharma-sun.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AnuragSharmaSunCampusAmbassador/~4/B3gg3ANrXxs" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AnuragSharmaSunCampusAmbassador/~3/B3gg3ANrXxs/finding-first-common-ancestor-in-binary.html</link><author>noreply@blogger.com (Anurag)</author><thr:total>3</thr:total><feedburner:origLink>http://anuragsharma-sun.blogspot.com/2010/04/finding-first-common-ancestor-in-binary.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2589427789736403011.post-2277959697168405917</guid><pubDate>Wed, 31 Mar 2010 10:55:00 +0000</pubDate><atom:updated>2010-04-01T02:13:22.220-07:00</atom:updated><title>Converting a BST to circular Doubly linked list</title><description>Yesterday, while browsing on internet I landed up on a good, yet very basic DS and algorithm problem. Its not that difficult to solve, but can go a little weird if you miss out or go wrong at 1 or 2 pointer changes. ok, so here goes the problem:&lt;br /&gt;&lt;br /&gt;Given a Binary search Tree ( I assume here, that most of you are aware of it, by now at least. Others, may like to read &lt;a href="http://en.wikipedia.org/wiki/Binary_search_tree"&gt;this&lt;/a&gt; before reading this problem further). You have to create a recursive function, which takes a BST and returns the corresponding Circular Doubly linked list.&lt;br /&gt;&lt;br /&gt;Ok. Lets consider a sample BST (Binary Search Tree)&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    a(5)&lt;br /&gt;   /   \&lt;br /&gt;  b(3)  c(6)&lt;br /&gt; /    \    \&lt;br /&gt;d(2) e(4)   f(7)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;[Note: the letters 'a','b'... are the names given to the nodes and the value in the parenthesis indicates the numeric data of that node]&lt;br /&gt;&lt;br /&gt;Now our objective is to make a recursive function which takes the above tree as input and returns a circular doubly linked list, somewhat like this:-&lt;br /&gt;&lt;br /&gt;d(2)==b(3)==e(4)==a(5)==c(6)==f(7)==d(2) ( its circular)&lt;br /&gt;&lt;br /&gt;here the 'left' and 'right' pointers of the Node of the BST, will be treated analogous to 'previous' and 'next' in the linked list.&lt;br /&gt;&lt;br /&gt;A little thought to the problem, and I came up with following solution. Heres the intended function's pseudo code:-&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;function bstToList(root)&lt;br /&gt;{&lt;br /&gt; //for leaf node return itself ( case 1)&lt;br /&gt; if (root.left == root and root.right == root)&lt;br /&gt;     return root&lt;br /&gt;&lt;br /&gt; //no left subtree exist (case 2)&lt;br /&gt; else if (root.left == root)&lt;br /&gt; {&lt;br /&gt;     head2 = bstToList(root.right) //call recursively&lt;br /&gt;     root.right = head2&lt;br /&gt;     head2.left.right = root       //head2.left refers to the last node in the list&lt;br /&gt;     root.left = head2.left&lt;br /&gt;     head2.left = root&lt;br /&gt;     return root&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; //no right subtree exist (case 3)&lt;br /&gt; else if (root.right == root)&lt;br /&gt; {&lt;br /&gt;     head1 = bstToList(root.left) //call recursively&lt;br /&gt;     root.left = head1.left   //head1.left refers to the last node in the list&lt;br /&gt;     head1.left.right = root&lt;br /&gt;     root.right = head1&lt;br /&gt;     head1.left = root&lt;br /&gt;     return head1&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; //both left and right subtrees exist (case 4)&lt;br /&gt; else&lt;br /&gt; {            &lt;br /&gt;     h1 = bstToList(root.left)  //call recursively  and find the head nodes of both sublists&lt;br /&gt;     h2 = bstToList(root.right)&lt;br /&gt;&lt;br /&gt;     l1 = h1.left               //find last nodes of the sublists&lt;br /&gt;     l2 = h2.left&lt;br /&gt;&lt;br /&gt;     h1.left = l2              //join the ends of both sublists&lt;br /&gt;     l2.right = h1&lt;br /&gt;&lt;br /&gt;     l1.right = root           //insert the root to the end of left sublist&lt;br /&gt;     root.left = l1&lt;br /&gt;&lt;br /&gt;     root.right = h2           //insert the right sublist to the right of root&lt;br /&gt;     h2.left = root&lt;br /&gt;&lt;br /&gt;     return h1                 //return the head node&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;} //function ends&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;As evident, the function considers 4 major cases:-&lt;br /&gt;1. When the current node(root) is a leaf node( a leaf node is one with no children)&lt;br /&gt;2. When there exists no left subtree/child&lt;br /&gt;3. When there exists no right subtree/child&lt;br /&gt;4. When there exists both left and right subtree/child&lt;br /&gt;&lt;br /&gt;In every call the function tries to append the current node to the already formed doubly linked lists at the appropriate position.( it can be easily figured out in the above code in case 4)&lt;br /&gt;&lt;br /&gt;Here goes the complete implementation(its in Python, but can be understood, inspite of my terrible coding style):-&lt;br /&gt;&lt;pre style='code' language='python'&gt;&lt;br /&gt;&lt;br /&gt;class node:&lt;br /&gt; ''' class to represent a node of BST/ linked list'''&lt;br /&gt; def __init__(self, data):&lt;br /&gt;     self.data = data&lt;br /&gt;     self.left = self&lt;br /&gt;     self.right = self&lt;br /&gt;&lt;br /&gt;def printBST(root):&lt;br /&gt; '''prints the BST in an inorder sequence'''&lt;br /&gt; if root.left == root or root.right == root:&lt;br /&gt;     print root.data, " ",&lt;br /&gt; else:&lt;br /&gt;     printBST(root.left)&lt;br /&gt;     print root.data, " ",&lt;br /&gt;     printBST(root.right)&lt;br /&gt;&lt;br /&gt;def printList(head):&lt;br /&gt; '''prints the linked list in both directions&lt;br /&gt;  to test whether both the 'next' and 'previous' pointers are fine'''&lt;br /&gt; #print forward direction&lt;br /&gt; h = head&lt;br /&gt; print '[%d]' % (h.data),&lt;br /&gt; h = h.right&lt;br /&gt; while h != head:&lt;br /&gt;     print '[%d]' % (h.data),&lt;br /&gt;     h = h.right&lt;br /&gt;&lt;br /&gt; print ""&lt;br /&gt; #print in reverse direction&lt;br /&gt; h = head.left&lt;br /&gt; print '[%d]' % (h.data),&lt;br /&gt; h = h.left&lt;br /&gt; while h != head.left:&lt;br /&gt;     print '[%d]' % (h.data),&lt;br /&gt;     h = h.left&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;def bstToList(root):&lt;br /&gt; '''&lt;br /&gt; main function to take the root of the BST and return the head of the&lt;br /&gt; doubly linked list&lt;br /&gt;  '''&lt;br /&gt;&lt;br /&gt; #for leaf node return itself&lt;br /&gt; if root.left == root and root.right == root:&lt;br /&gt;     return root&lt;br /&gt;&lt;br /&gt; elif root.left == root:   #no left subtree exist&lt;br /&gt;     h2 = bstToList(root.right)&lt;br /&gt;     root.right = h2&lt;br /&gt;     h2.left.right = root&lt;br /&gt;     root.left = h2.left&lt;br /&gt;     h2.left = root&lt;br /&gt;     return root&lt;br /&gt;&lt;br /&gt; elif root.right == root:   #no right subtree exist&lt;br /&gt;     h1 = bstToList(root.left)&lt;br /&gt;     root.left = h1.left&lt;br /&gt;     h1.left.right = root&lt;br /&gt;     root.right = h1&lt;br /&gt;     h1.left = root&lt;br /&gt;     return h1&lt;br /&gt;&lt;br /&gt; else:                       #both left and right subtrees exist&lt;br /&gt;     h1 = bstToList(root.left)&lt;br /&gt;     h2 = bstToList(root.right)&lt;br /&gt;&lt;br /&gt;     l1 = h1.left      #find last nodes of the lists&lt;br /&gt;     l2 = h2.left&lt;br /&gt;&lt;br /&gt;     h1.left = l2&lt;br /&gt;     l2.right = h1&lt;br /&gt;&lt;br /&gt;     l1.right = root&lt;br /&gt;     root.left = l1&lt;br /&gt;&lt;br /&gt;     root.right = h2&lt;br /&gt;     h2.left = root&lt;br /&gt;&lt;br /&gt;     return h1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if __name__ == "__main__":&lt;br /&gt;&lt;br /&gt; #create the sample BST&lt;br /&gt; root = a = node(5)&lt;br /&gt; b = node(3)&lt;br /&gt; c = node(6)&lt;br /&gt; d = node(2)&lt;br /&gt; e = node(4)&lt;br /&gt; f = node(7)&lt;br /&gt;&lt;br /&gt; a.left, a.right = b, c&lt;br /&gt; b.left, b.right = d, e&lt;br /&gt; c.right = f&lt;br /&gt;&lt;br /&gt; printBST(root)&lt;br /&gt;&lt;br /&gt; print "\ncreating to double linked list"&lt;br /&gt; head = bstToList(root);&lt;br /&gt;&lt;br /&gt; printList(head)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I am sure this is not the best way to go, but it surely solve the problem in a recursive way. Comments welcome&lt;br /&gt;Happy Coding! :~) @_@&lt;div class="blogger-post-footer"&gt;alternatively catch me at &lt;a href="http://blogs.sun.com/AnuragSharma"&gt; http://blogs.sun.com/AnuragSharma&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2589427789736403011-2277959697168405917?l=anuragsharma-sun.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AnuragSharmaSunCampusAmbassador/~4/7H60aZJcUiw" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AnuragSharmaSunCampusAmbassador/~3/7H60aZJcUiw/converting-bst-to-circular-doubly.html</link><author>noreply@blogger.com (Anurag)</author><thr:total>0</thr:total><feedburner:origLink>http://anuragsharma-sun.blogspot.com/2010/03/converting-bst-to-circular-doubly.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2589427789736403011.post-3986336343385826934</guid><pubDate>Wed, 24 Mar 2010 07:21:00 +0000</pubDate><atom:updated>2010-03-24T00:36:57.703-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">IRC</category><title>IRC</title><description>For many of my friends who are not able to connect to IRC due to blocking of its ports, here is the application, which works on HTTP, you can join the desired Rooms and chat:-&lt;br /&gt;&lt;br /&gt;&lt;iframe src="http://webchat.freenode.net/?channels=gsoc" width="550" height="600"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;(thanks to:http://webchat.freenode.net/)&lt;div class="blogger-post-footer"&gt;alternatively catch me at &lt;a href="http://blogs.sun.com/AnuragSharma"&gt; http://blogs.sun.com/AnuragSharma&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2589427789736403011-3986336343385826934?l=anuragsharma-sun.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AnuragSharmaSunCampusAmbassador/~4/4z2wARzOZ7g" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AnuragSharmaSunCampusAmbassador/~3/4z2wARzOZ7g/irc.html</link><author>noreply@blogger.com (Anurag)</author><thr:total>0</thr:total><feedburner:origLink>http://anuragsharma-sun.blogspot.com/2010/03/irc.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2589427789736403011.post-3023657968413521486</guid><pubDate>Mon, 22 Mar 2010 07:02:00 +0000</pubDate><atom:updated>2010-03-22T00:29:25.553-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">comparision</category><category domain="http://www.blogger.com/atom/ns#">hanvon</category><category domain="http://www.blogger.com/atom/ns#">iPad</category><category domain="http://www.blogger.com/atom/ns#">adam</category><category domain="http://www.blogger.com/atom/ns#">tablet</category><category domain="http://www.blogger.com/atom/ns#">pc</category><category domain="http://www.blogger.com/atom/ns#">notion ink</category><category domain="http://www.blogger.com/atom/ns#">apple</category><title>Tablet War Begins</title><description>&lt;div style="text-align: justify;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_C163I0t-EVM/S6cZLgQYXkI/AAAAAAAAAGQ/ASnhAfLWZ7g/s1600-h/3-14-10-hanvonbc10c6002.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 154px;" src="http://4.bp.blogspot.com/_C163I0t-EVM/S6cZLgQYXkI/AAAAAAAAAGQ/ASnhAfLWZ7g/s320/3-14-10-hanvonbc10c6002.jpg" alt="" id="BLOGGER_PHOTO_ID_5451353559383170626" border="0" /&gt;&lt;/a&gt;    After the launching of a yet another success product from Microsoft, i.e. Windows 7, after Windows XP, which was one of the most successful of the MS products. MS came up with several new innovations in its new OS, including the "Multi Touch interface", although the concept was existing even before the launch of Win7, but it still was lacking a completeness, fully support and a tight integration with an OS. It literally warmed up the technical market. As you all might be aware of, now Ubuntu also comes with support for multi touch screen display. But with the onset of the OS' supporting multi-touch displays, the market seems to be hit by many Tablet PC products, like Apples hits the market by its new I-PAD, soon the race was caught up by NotionInks ADAM, and JKKs Hanvon to make things 'not so simple' to Apple.&lt;br /&gt;&lt;/div&gt;Here I have compiled a list (not exhaustive) of features for these products:-&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_C163I0t-EVM/S6cYuGM9kbI/AAAAAAAAAGI/ndOFG5qZ4Ls/s1600-h/table.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 307px;" src="http://3.bp.blogspot.com/_C163I0t-EVM/S6cYuGM9kbI/AAAAAAAAAGI/ndOFG5qZ4Ls/s400/table.png" alt="" id="BLOGGER_PHOTO_ID_5451353054173303218" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Note that, there are many more to join ( and probably joined already) the crowed of Tablet PC production. But whatever it is, one thing is sure, there is no limit to innovation and there is always infinite scope for doing the new.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Useful links:&lt;br /&gt;&lt;a href="http://www.iphoneinterest.com/adam-vs-ipad.html" target="_blank"&gt;http://www.iphoneinterest.com/adam-vs-ipad.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://jkkmobile.com/" target="_blank"&gt;http://jkkmobile.com&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.youtube.com/watch?v=7_1_ix4qP88&amp;amp;feature=player_embedded" target="_blank"&gt;http://www.youtube.com/watch?v=7_1_ix4qP88&amp;amp;feature=player_embedded&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.notionink.com/" target="_blank"&gt;http://www.notionink.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;Disclaimer&lt;/b&gt;: The views expressed here are entirely my own and bear no intention to offend anyone. I am not against or for any company, organization or individual, but just express what I feel at the time of writing the post. Anyone is free to disagree with me and the ones who don't like my views are free not to read my blog ;)&lt;br /&gt;&lt;br /&gt;Happy computing&lt;br /&gt;&lt;/div&gt;Bye for now&lt;div class="blogger-post-footer"&gt;alternatively catch me at &lt;a href="http://blogs.sun.com/AnuragSharma"&gt; http://blogs.sun.com/AnuragSharma&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2589427789736403011-3023657968413521486?l=anuragsharma-sun.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AnuragSharmaSunCampusAmbassador/~4/K2XIoDbzGKI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AnuragSharmaSunCampusAmbassador/~3/K2XIoDbzGKI/tablet-war-begins.html</link><author>noreply@blogger.com (Anurag)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_C163I0t-EVM/S6cZLgQYXkI/AAAAAAAAAGQ/ASnhAfLWZ7g/s72-c/3-14-10-hanvonbc10c6002.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://anuragsharma-sun.blogspot.com/2010/03/tablet-war-begins.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2589427789736403011.post-8490730533545119878</guid><pubDate>Sat, 20 Mar 2010 14:00:00 +0000</pubDate><atom:updated>2010-03-20T08:26:18.170-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Sun campus ambassador</category><category domain="http://www.blogger.com/atom/ns#">google talk</category><category domain="http://www.blogger.com/atom/ns#">ubuntu 9.10</category><category domain="http://www.blogger.com/atom/ns#">configuration</category><category domain="http://www.blogger.com/atom/ns#">pidgin</category><category domain="http://www.blogger.com/atom/ns#">empathy</category><category domain="http://www.blogger.com/atom/ns#">karmic</category><category domain="http://www.blogger.com/atom/ns#">karmic koala</category><category domain="http://www.blogger.com/atom/ns#">gtalk</category><category domain="http://www.blogger.com/atom/ns#">ubuntu</category><category domain="http://www.blogger.com/atom/ns#">gnome</category><title>Ubuntu9.10 and Empathy</title><description>Alright, its been really a long time, since I posted anything to my blog. Many things happened in the meantime, and my computer was formatted a lot many times, and now I have an entirely different set of OSs. I installed Ubuntu 9.10, Karmic Koala, and to my surprise my beloved Pidgin IM Client was missing in it, which I was accustomed to. I tried to use Empathy but its been not even an hour and I downloaded Pidgin and installed it. But Somehow it seemed to be unstable on my IBM Thinkpad laptop. Unlike the previous times, it crashes frequently and soon I have to run away from it. I had no option but to explore the new Empathy. I soon was able to configure it to my taste. It not only has full support now for voice chat (unlike the previous times) but also comes in handy with the full and stable support for the desktop sharing with anyone over the internet, in just a click of the mouse!&lt;br /&gt;&lt;div style="text-align: justify;"&gt;  Anyways, I know as soon as we install ubuntu or any other linux distro, where the beginners have to struggle a lot to initially hunt for a suitable client where they can talk to their google-talk contacts. So here are the google-talk settings which seem to work for me ( but I shall not be responsible if it doesnt turn out for you &lt;img goomoji="332" style="margin: 0pt 0.2ex; vertical-align: middle;" src="cid:332@goomoji.gmail" /&gt;). Ok, here it goes-&lt;br /&gt; &lt;/div&gt;&lt;ol style="text-align: justify;"&gt;&lt;li&gt;Just Open your Empathy client ( I hope you know it, Applications-&amp;gt; Internet-&amp;gt; Empathy)&lt;/li&gt;&lt;li&gt; Press F4 or Edit-&amp;gt;Accounts and click Add button at the bottom of the left panel&lt;/li&gt;&lt;li&gt; Select "Google Talk" as the account type and press "Create"&lt;/li&gt;    &lt;li&gt;Enter your login name along with the "@&lt;a href="http://gmail.com/" target="_blank"&gt;gmail.com&lt;/a&gt;" extension. Eg. if your login name is ABC then enter "&lt;a href="mailto:ABC@gmail.com" target="_blank"&gt;ABC@gmail.com&lt;/a&gt;"&lt;/li&gt;   &lt;li&gt;Enter your password, in the space provided&lt;/li&gt; &lt;li&gt;Click Advance to expand the options and fill the following details:&lt;/li&gt;&lt;ol&gt;&lt;li&gt;Select the option "&lt;span style="font-weight: bold;"&gt;Encryption required (TLS/SSL)&lt;/span&gt;"&lt;/li&gt;&lt;li&gt;Select the option "&lt;span style="font-weight: bold;"&gt;Ignore Certificate Errors&lt;/span&gt;"&lt;/li&gt;&lt;li&gt;Leave "Resource" and "Priority" blank ( default value)&lt;/li&gt;    &lt;li&gt;Enter the "Server" as "&lt;a href="http://talk.google.com/" target="_blank"&gt;talk.google.com&lt;/a&gt;"&lt;/li&gt;&lt;li&gt;Enter the "Port" as "&lt;span style="font-weight: bold;"&gt;443&lt;/span&gt;"&lt;/li&gt;&lt;li&gt;Select the "&lt;span style="font-weight: bold;"&gt;Use old SSL&lt;/span&gt;" option&lt;/li&gt;   &lt;/ol&gt;&lt;li&gt;Click "Apply" and you are done&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;Empathy offers a lot of features, most of them are pretty much similar to the Pidgin, like (what I can think as of now)-&lt;br /&gt;&lt;/div&gt;&lt;ol&gt;&lt;li&gt;Configuring and Using multiple Chatting accounts like Gtalk, IRC, ICQ, Yahoo, MSN etc. simultaneously&lt;/li&gt;&lt;li&gt;Support for file transfer feature ( although you need to check the file transfer server for the accounts over which the file is meant to be transferred)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Audio Call&lt;/li&gt;&lt;li&gt;Video Call&lt;/li&gt;&lt;li&gt;"Share My Desktop" feature&lt;/li&gt;&lt;li&gt;Join Different Chat rooms&lt;/li&gt;&lt;li&gt;Few Themes also come bundled with the application&lt;/li&gt;&lt;li&gt;Another feature which I liked more than Pidgin was the ease it offers to set the status message for all accounts at once (ya, its true, you have to sacrifice the facility of being able to set different status messages on different accounts)&lt;/li&gt;&lt;/ol&gt;&lt;ul style="text-align: justify;"&gt;            &lt;/ul&gt;&lt;div style="text-align: justify;"&gt;Here is a screenshot of the application, for those who want to know how it looks :)&lt;br /&gt;&lt;br /&gt;&lt;img alt="http://www.desktoplinux.com/files/misc/gnome_empathy.jpg" src="http://www.desktoplinux.com/files/misc/gnome_empathy.jpg" /&gt;&lt;br /&gt;Happy Chatting !&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;alternatively catch me at &lt;a href="http://blogs.sun.com/AnuragSharma"&gt; http://blogs.sun.com/AnuragSharma&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2589427789736403011-8490730533545119878?l=anuragsharma-sun.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AnuragSharmaSunCampusAmbassador/~4/LsWtLY49s4g" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AnuragSharmaSunCampusAmbassador/~3/LsWtLY49s4g/ubuntu910-and-empathy.html</link><author>noreply@blogger.com (Anurag)</author><thr:total>1</thr:total><feedburner:origLink>http://anuragsharma-sun.blogspot.com/2010/03/ubuntu910-and-empathy.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2589427789736403011.post-1481827978803875731</guid><pubDate>Sat, 28 Nov 2009 05:41:00 +0000</pubDate><atom:updated>2010-03-20T07:26:25.121-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Sun campus ambassador</category><title>Using BFS to solve the minimum number moves problems</title><description>Often in various programming contests we find problems related to calculating minimum moves for some toy problems like "8-puzzle problem", where the step cost to move a block from 1 location to other is constant for every move (or analogous). Generally such problems can be tackled by BFS (it means Breadth First Search, for my friends who didn't know earlier) technique. Well, the concept is pretty simple for BFS. it  refers to traversing a tree level wise, i.e. first level 0, then level 1, then 2, 3...&lt;br /&gt;Eg.&lt;br /&gt;     1&lt;br /&gt;   /     \&lt;br /&gt;  2    3&lt;br /&gt; /  \     / \&lt;br /&gt;4  5 6  7&lt;br /&gt;For a tree like the above, a BFS traversal guarantees the traversal order: 1-&gt;2-&gt;3-&gt;4-&gt;5-&gt;6-&gt;7&lt;br /&gt;Though in a linked implementation of a tree, the BFS traversal is a bit trickier but for an array representation this is nothing but a straight traversal of the array sequentially.&lt;br /&gt;Since in most of the programming problems, generally the tree is not known at the beginning, therefore the limit of the total number of nodes is uncertain. But, theres nothing to worry much, for the ArrayList in Java and vector classe in C++ are the way out. Well a generalized BFS traversal may look something like this, when the code to remove the repeated states is added to the main BFS logic:&lt;br /&gt;(Note: its just a pseudo code)&lt;br /&gt;&lt;br /&gt;fringe= a queue&lt;br /&gt;closed= a set containing visited nodes&lt;br /&gt;fringe.push(root_node_of_tree);&lt;br /&gt;while( ! fringe.empty())&lt;br /&gt;{&lt;br /&gt;  node n=fringe.pop();&lt;br /&gt;  if(goalTest(n)){&lt;br /&gt;     return solution(n);&lt;br /&gt;  }&lt;br /&gt;  if(!closed.contains(n)){&lt;br /&gt;      closed.add(n);&lt;br /&gt;      //add all children of n to fringe&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Based on this below is my C++ implementation for finding out the minimum move sequence to solve the 8-puzzle problem. In this problem given a 3*3 matrix with numbers 1..8 filled in random 8 places among 9 in the matrix with 1 block empty. Our goal is to slide a block at a time in the empty place and finally arrange the puzzle back to sorted order, just like this&lt;br /&gt;1 2 3&lt;br /&gt;4 5 6&lt;br /&gt;7 8 0&lt;br /&gt;(Note: 0 indicates the empty block)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blogs.sun.com/AnuragSharma/resource/mycodes/shuffle.cpp"&gt; Here &lt;/a&gt; is my complete C++ implementation&lt;div class="blogger-post-footer"&gt;alternatively catch me at &lt;a href="http://blogs.sun.com/AnuragSharma"&gt; http://blogs.sun.com/AnuragSharma&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2589427789736403011-1481827978803875731?l=anuragsharma-sun.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AnuragSharmaSunCampusAmbassador/~4/hDQzaJbXpiU" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AnuragSharmaSunCampusAmbassador/~3/hDQzaJbXpiU/using-bfs-to-solve-minimum-number-moves.html</link><author>noreply@blogger.com (Anurag)</author><thr:total>0</thr:total><feedburner:origLink>http://anuragsharma-sun.blogspot.com/2009/11/using-bfs-to-solve-minimum-number-moves.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2589427789736403011.post-3600310251749059333</guid><pubDate>Sun, 08 Nov 2009 09:31:00 +0000</pubDate><atom:updated>2010-03-20T07:26:25.121-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Sun campus ambassador</category><title>An Effective way of removing duplicates in a file</title><description>I remember just a few days back I was asked to design a program to remove duplicates from a file. Well the problem seems quite straight forward and simple to approach, but the real hidden question here lies in, how effective can anyone come up with an algorithm to solve this problem. Initially thinking on the tracks of using hashtables, maps, sets etc. I finally landed up designing a custom 'tree' implementation for getting almost the optimal solution which would remove duplicates from a file in a single iteration! (or in O(n) time, for my geek friends! )&lt;br /&gt;&lt;br /&gt;Well while surfing internet, I later found that the tree concept I used to solve this problem is pretty much similar to a standard implementation called 'Suffix tree'. Here I am not going to explain you about suffix trees, you can find plenty of matter on this once you google it, rather, I would be explaining how my solution to this problem worked. Well, I don't claim it to be the most optimal implementation, I am sure, someone out there may come up with a solution better than mine. But this one solves the purpose just fine.&lt;br /&gt;&lt;br /&gt;The logic here is to keep building the custom tree (which now we know is similar to suffix tree) as we go through the text. Here is the basic algorithm:&lt;br /&gt;1) Iterate through the text and do the following steps&lt;br /&gt;1.1) As the beginning of a new word is encountered, start matching it starting from the root node to its children, successively. along with buffering the current word as we proceed.&lt;br /&gt;1.2) If a match is found, try to match the next character in the word with its children&lt;br /&gt;1.3) If a match is not found, add another node representing the current character as a child to the current node.&lt;br /&gt;1.4) When the word ends, and the last character is matched, check its 'final' tag.&lt;br /&gt;1.4.1) if its true, it means the current word is the repeated one, so don't output the current buffer word&lt;br /&gt;1.4.2) if its false, it means the current word is encountered for the first time, so output the current buffer and flush the buffer.&lt;br /&gt;&lt;br /&gt;Eg. let the text be "CAT CAN BAT". The tree for this sentence  will be -&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;   ROOT&lt;br /&gt;    /\   &lt;br /&gt;   C  B&lt;br /&gt;  /    \&lt;br /&gt; A      A&lt;br /&gt;/ \      \&lt;br /&gt;T*  N*     T*&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Note: the (*) mark represents the final state.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blogs.sun.com/AnuragSharma/resource/mycodes/myUniq.cc"&gt;Here&lt;/a&gt; goes my C/C++ implementation&lt;div class="blogger-post-footer"&gt;alternatively catch me at &lt;a href="http://blogs.sun.com/AnuragSharma"&gt; http://blogs.sun.com/AnuragSharma&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2589427789736403011-3600310251749059333?l=anuragsharma-sun.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AnuragSharmaSunCampusAmbassador/~4/Lr5j3irRhjU" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AnuragSharmaSunCampusAmbassador/~3/Lr5j3irRhjU/effective-way-of-removing-duplicates-in.html</link><author>noreply@blogger.com (Anurag)</author><thr:total>0</thr:total><feedburner:origLink>http://anuragsharma-sun.blogspot.com/2009/11/effective-way-of-removing-duplicates-in.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2589427789736403011.post-1422609787265029569</guid><pubDate>Sun, 25 Oct 2009 08:20:00 +0000</pubDate><atom:updated>2009-10-29T02:55:57.822-07:00</atom:updated><title>Donate water</title><description>&lt;div style="width:220px;"&gt;&lt;center&gt;&lt;OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" WIDTH="220" HEIGHT="200" id="fpMovie"&gt;&lt;PARAM NAME="movie" VALUE="http://www.freepoverty.com/swf/banner2.swf?ID=2686439108604391476"&gt;&lt;PARAM NAME="quality" VALUE="high"&gt;&lt;PARAM NAME="bgcolor" VALUE="#ffffff"&gt;&lt;EMBED src="http://www.freepoverty.com/swf/banner2.swf?ID=2686439108604391476" quality="high" bgcolor="#ffffff" WIDTH="220" HEIGHT="200"NAME="fpMovie" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"&gt;&lt;/EMBED&gt;&lt;/OBJECT&gt;&lt;a href="http://www.freepoverty.com" style="text-decoration:none;"&gt;&lt;img src="http://www.freepoverty.com/images/donate_now.png" width="121" height="33" style="border:none;"&gt;&lt;/a&gt;&lt;/center&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;alternatively catch me at &lt;a href="http://blogs.sun.com/AnuragSharma"&gt; http://blogs.sun.com/AnuragSharma&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2589427789736403011-1422609787265029569?l=anuragsharma-sun.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AnuragSharmaSunCampusAmbassador/~4/0joexxslSTg" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AnuragSharmaSunCampusAmbassador/~3/0joexxslSTg/donate-water.html</link><author>noreply@blogger.com (Anurag)</author><thr:total>4</thr:total><feedburner:origLink>http://anuragsharma-sun.blogspot.com/2009/10/donate-water.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2589427789736403011.post-1952800713366506821</guid><pubDate>Sat, 24 Oct 2009 12:00:00 +0000</pubDate><atom:updated>2010-03-20T07:26:25.122-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Sun campus ambassador</category><title>Dealing with a Strange Java Problem</title><description>Here is a strange problem encountered by me while experimenting with Java. Have a look at the following code sample:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;interface test {&lt;br /&gt;&lt;br /&gt;    void fun();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class Test implements test {&lt;br /&gt;&lt;br /&gt;    public void fun() {&lt;br /&gt;        System.out.println("Test.fun() called");&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public static void main(String[] args) {&lt;br /&gt;        new Test().fun();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Can you find any problem with the above code sample? Well there really isn't any problem with the above code. Still when you try to run this on Windows systems the execution fails for Test class ( i.e. &gt;java Test) throwing exceptions like:-&lt;br /&gt;&lt;code&gt;&lt;br /&gt; java.lang.NoClassDefFoundError: test (wrong name: Test)&lt;br /&gt; at java.lang.ClassLoader.defineClass1(Native Method)&lt;br /&gt; at java.security.AccessController.doPrivileged(Native Method)&lt;br /&gt; at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)&lt;br /&gt; at java.lang.ClassLoader.defineClass1(Native Method)&lt;br /&gt; at java.security.AccessController.doPrivileged(Native Method)&lt;br /&gt; at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)&lt;br /&gt; Exception in thread "main" &lt;br /&gt; Exception in thread "main" Java Result: 1&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;And adding to the surprise, this program runs absolutely fine on Linux and other Unix based systems!&lt;br /&gt;&lt;br /&gt;Ok so lets try to dissect the program and figure out what the problem is with this. Here is the possible explaination which I came up with.&lt;br /&gt;Observing it a little carefully you can observe that the name of the interface is 'test' and class is 'Test' this makes them differ only in case. But what difference does it make to us? java is of course case sensitive, so we are free to chose names like that!&lt;br /&gt;Well the answer is that, although java is case sensitive the underlying OS ( Windows) is not. Therefore the compiler (even though it wanted) couldn't create two separate .class files (one for interface, and other for the implementing class), because the other class file over-writes the previous one. In short, this problem arises because after compiling the above code, two class files: test.class and Test.class map only to a single file on windows, not two unlike the unix systems.&lt;br /&gt;So be careful while getting trapped in such of hard-to-find bugs!&lt;div class="blogger-post-footer"&gt;alternatively catch me at &lt;a href="http://blogs.sun.com/AnuragSharma"&gt; http://blogs.sun.com/AnuragSharma&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2589427789736403011-1952800713366506821?l=anuragsharma-sun.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AnuragSharmaSunCampusAmbassador/~4/xAbsojhNY9U" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AnuragSharmaSunCampusAmbassador/~3/xAbsojhNY9U/dealing-with-strange-java-problem.html</link><author>noreply@blogger.com (Anurag)</author><thr:total>0</thr:total><feedburner:origLink>http://anuragsharma-sun.blogspot.com/2009/10/dealing-with-strange-java-problem.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2589427789736403011.post-5750215448668748726</guid><pubDate>Sun, 06 Sep 2009 03:59:00 +0000</pubDate><atom:updated>2010-03-20T07:26:25.123-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Sun campus ambassador</category><category domain="http://www.blogger.com/atom/ns#">linux</category><category domain="http://www.blogger.com/atom/ns#">ubuntu</category><category domain="http://www.blogger.com/atom/ns#">gnome</category><title>Getting started with GNOME  based OS (Linux)</title><description>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_C163I0t-EVM/SqM76aQ87ZI/AAAAAAAAADo/9Bjy6dJwcSc/s1600-h/Screenshot.png"&gt;&lt;img style="cursor: pointer; width: 320px; height: 240px;" src="http://3.bp.blogspot.com/_C163I0t-EVM/SqM76aQ87ZI/AAAAAAAAADo/9Bjy6dJwcSc/s320/Screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5378208254679379346" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;       &lt;br /&gt;&lt;div style="text-align: justify;"&gt;Here is My Linux (&lt;b&gt;Ubuntu9.04&lt;/b&gt;) Desktop's screenshot, to prove that theres nothing now which cannot be achieved in the world of Open-source. Linux now is no more limited to the community of computer geeks, but its increasingly becoming extremely user friendly proving it much suitable for the beginners as well. The time is gone when one needed to type long and cryptic commands in order to do anything they want on Linux &amp;amp; Unix systems. Though the command line alternatives are always there, leaving an entire world for the user to explore and learn! Everything is now offered in much more interactive and highly customizable GUI.&lt;br /&gt;Thats the beauty of open-source- &lt;i&gt;it can give you exactly what you want&lt;/i&gt;. Open-source products including Linux opens itself to change by anyone who uses it thereby giving the freedom and power to users. There are multiple Window Managers available for using with Linux. The most commonly used are -&lt;b&gt;GNOME&lt;/b&gt; and &lt;b&gt;KDE&lt;/b&gt; which generally comes integrated with most of the linux distributions.&lt;br /&gt;&lt;br /&gt;Lets begin with our familiarisation with GNOME, Ubuntu9.04 Desktop ( but this might help you in other distros as well)&lt;br /&gt;It displays a menu bar at the top containing menus for Application, Places and System on the left side of the bar along with the tray icons of the processes and a calendar, sound control and the Username being on the right side of the bar.&lt;br /&gt;And a status bar at the bottom of the screen with the icon to Show the empty desktop minimizing all the currently opened windows, tabs of all the currently opened windows, a Desktop Switcher showing the available desktops and finally a Trash (where the deleted files reside giving option to restore back the accidently deleted files, until manually cleaned).&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul style="text-align: justify;"&gt;&lt;li&gt;&lt;b&gt;Application Menu:&lt;/b&gt; It contains Set of the applications installed and currently configured to be displayed in the menu format in different categories. It comes packed with a range of open-source applications preinstalled, like firefox for web browsing, Evolution as the email client, Pidgin as the chatting messenger, Totem and Rythmboxfor audio/video playing, GIMP ( my favourite!) for Image editing and a set of GNOME games!&lt;/li&gt;&lt;li&gt;&lt;b&gt;Places Menu:&lt;/b&gt; It presents links to some of the predefined locations so as to reach there quickly.&lt;/li&gt;&lt;li&gt;&lt;b&gt;System Menu:&lt;/b&gt; It presents the system specific tasks and configurations&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;Application and System menu can be manually altered by &lt;i&gt;right clicking-&gt; Edit Menu&lt;/i&gt; option.&lt;br /&gt;&lt;br /&gt;Any system related information about the running processes or the present system memory and network usage etc. can be found anytime in &lt;i&gt;System-&gt;Administration-&gt;System Monitor&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;Ubuntu presents with an exhaustive list of open-source software for anyone to download from anywhere in the world from its central repository. This can be done in either of the following ways:&lt;br /&gt;&lt;/div&gt;&lt;ul style="text-align: justify;"&gt;&lt;li&gt;Applications-&gt;Add/Remove&lt;/li&gt;&lt;li&gt;System-&gt;Administration-&gt;Synaptic Package Manager&lt;/li&gt;&lt;li&gt;using command line utilities like apt-get :&lt;/li&gt;&lt;ul&gt;&lt;li&gt;sudo apt-get install &lt;package_to_install&gt;&lt;/package_to_install&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;Some of the other utilities in which you would be interested to install are:&lt;br /&gt;&lt;/div&gt;&lt;ul style="text-align: justify;"&gt;&lt;li&gt;Opera (a web browser)&lt;/li&gt;&lt;li&gt;Netbeans IDE ( for programming in JavaSE, JavaME, JavaEE, C, C++, Javascript etc )&lt;/li&gt;&lt;li&gt;openssh ( for enabling remote login into the machine)&lt;/li&gt;&lt;li&gt;Thunderbird ( another email client like Evolution)&lt;/li&gt;&lt;li&gt;Avant Window Navigator ( enables a cool looking, highly customizable docking feature much like MAC )&lt;/li&gt;&lt;li&gt;GVIM text editor ( a GUI based vim  text editor, for the people who are addicted to the cool and simple, our beloved VIM ! )&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;Happy Linuxing!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;alternatively catch me at &lt;a href="http://blogs.sun.com/AnuragSharma"&gt; http://blogs.sun.com/AnuragSharma&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2589427789736403011-5750215448668748726?l=anuragsharma-sun.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AnuragSharmaSunCampusAmbassador/~4/YLUDaM-ITFs" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AnuragSharmaSunCampusAmbassador/~3/YLUDaM-ITFs/getting-started-with-gnome-based-os.html</link><author>noreply@blogger.com (Anurag)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_C163I0t-EVM/SqM76aQ87ZI/AAAAAAAAADo/9Bjy6dJwcSc/s72-c/Screenshot.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://anuragsharma-sun.blogspot.com/2009/09/getting-started-with-gnome-based-os.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2589427789736403011.post-7126575426913719751</guid><pubDate>Sun, 23 Aug 2009 05:46:00 +0000</pubDate><atom:updated>2010-03-20T07:26:25.123-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Sun campus ambassador</category><title>Mother Nature</title><description>&lt;p style="background-image:url("http://www.psychologytoday.com/files/u40/nature-desktop- wallpaper.jpg")"&gt;&lt;br /&gt;Here are the lines written by a 15 year school girl.  It indeed reminds us of our long forgotten nature and provokes us to again ponder on our actions.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; Mother Nature&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The lap of soothing comforts for all&lt;br /&gt;With selfless care for all&lt;br /&gt;Where all worries vanish, with no blemish,&lt;br /&gt;Where the delicate colours of the rainbow,&lt;br /&gt;Stretch themselves in the sky,&lt;br /&gt;Birds sing, high and higher they fly.&lt;br /&gt;Trees bear sweet fruits of affection,&lt;br /&gt;Rivers linger through cresses with anticipation&lt;br /&gt;This, nature through its humble phase,&lt;br /&gt;confers on man a graceful place.&lt;br /&gt;Man today in his passionate greed,&lt;br /&gt;cutting down trees without need,&lt;br /&gt;The smoke looming high from chimneys,&lt;br /&gt;Toxicants thrown into rivers by industries.&lt;br /&gt;Exploring, exploiting, denuding, eroding...&lt;br /&gt;Man is gradually destroying his own living.&lt;br /&gt;Benumbing, choking the Mother Nature.&lt;br /&gt;Forgetting all her cares and nurture.&lt;br /&gt;Tomorrow someone will surely ask:&lt;br /&gt;Who is Mother Nature?&lt;br /&gt;The barren lands with no life?&lt;br /&gt;Or the carcasses of early extinct animals?&lt;br /&gt;Is it???&lt;br /&gt;So, can't we be kinder to nature,&lt;br /&gt;for all her care and nurture?&lt;br /&gt;can't we strive today,&lt;br /&gt;So that never comes this tomorrow.&lt;br /&gt;So that Mother Nature never cease to grow.&lt;br /&gt;Can't We???&lt;br /&gt;&lt;br /&gt;--Anjali Sharma&lt;br /&gt;  ( fortunately, who is my beloved sis )&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;alternatively catch me at &lt;a href="http://blogs.sun.com/AnuragSharma"&gt; http://blogs.sun.com/AnuragSharma&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2589427789736403011-7126575426913719751?l=anuragsharma-sun.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AnuragSharmaSunCampusAmbassador/~4/DULvDIMqljE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AnuragSharmaSunCampusAmbassador/~3/DULvDIMqljE/mother-nature.html</link><author>noreply@blogger.com (Anurag)</author><thr:total>2</thr:total><feedburner:origLink>http://anuragsharma-sun.blogspot.com/2009/08/mother-nature.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2589427789736403011.post-6014001628803118461</guid><pubDate>Sun, 23 Aug 2009 03:02:00 +0000</pubDate><atom:updated>2010-03-20T07:26:25.123-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Sun campus ambassador</category><title>GIMP (the GNU Image Manipulation Program) my favourite Open-Source Image Editor</title><description>This tutorial is meant to remove fears from the hearts of people who fear working on open-source tools. GIMP is an open-source Image manipulation tool used exhaustively, but not that much common with the students especially here at my college. It has an exhaustive set of tools to match any of your image editing needs, with and extremely  intuitive interface and very easy to learn.&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: justify;"&gt;So lets get started. Here I present my first tutorial for building a cool name template with shiny table effect as shown below, to let them know how easy it is to work with GIMP for common requirements of students.&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_C163I0t-EVM/SpCxtUW8TxI/AAAAAAAAACw/nQJADDBmGSA/s1600-h/6.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 320px; height: 77px;" src="http://4.bp.blogspot.com/_C163I0t-EVM/SpCxtUW8TxI/AAAAAAAAACw/nQJADDBmGSA/s320/6.png" alt="" id="BLOGGER_PHOTO_ID_5372989747570167570" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here are the easy steps to create one-&lt;br /&gt;&lt;br /&gt;1. Install and start GIMP editor in your favourite operating system. This is fairly easy in case of &lt;span style="font-style: italic;"&gt;OpenSolaris&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;Linux&lt;/span&gt; flavours like Ubuntu, Fedora etc.&lt;br /&gt;&lt;br /&gt;2. &lt;span style="font-style: italic;"&gt;File -&gt; New -&gt;&lt;/span&gt; Choose desired size ( default 640*400 works fine for me ), and click OK&lt;br /&gt;Now a white background is visible in the Image window.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_C163I0t-EVM/SpCyLlbFcvI/AAAAAAAAAC4/LYoYjsQfns0/s1600-h/1.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 270px; height: 169px;" src="http://2.bp.blogspot.com/_C163I0t-EVM/SpCyLlbFcvI/AAAAAAAAAC4/LYoYjsQfns0/s320/1.png" alt="" id="BLOGGER_PHOTO_ID_5372990267547022066" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;3. Select &lt;span style="font-style: italic;"&gt;Blend Tool&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;Gradient&lt;/span&gt; as &lt;span style="font-style: italic;"&gt;FG to BG. &lt;/span&gt;Then keeping the CTRL key pressed drag a line from top to bottom on the image and you shall find something like this --&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. Select the &lt;span style="font-style: italic;"&gt;Text tool &lt;/span&gt;from Toolbar or press 'T' key shortcut. and drag a bounding rectangle on the image at the position you want to place the text. This will open a text box popup, type in the de&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_C163I0t-EVM/SpCyibH50KI/AAAAAAAAADA/aqK0-vb78aw/s1600-h/2.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 294px; height: 184px;" src="http://1.bp.blogspot.com/_C163I0t-EVM/SpCyibH50KI/AAAAAAAAADA/aqK0-vb78aw/s320/2.png" alt="" id="BLOGGER_PHOTO_ID_5372990659919204514" border="0" /&gt;&lt;/a&gt;sired text here ( "I LOVE OPEN-SOURCE" in my case ).  Check the "&lt;span style="font-style: italic;"&gt;Use selected Font&lt;/span&gt;" option and select the desired font type ( &lt;span style="font-style: italic;"&gt;Sans Bold &lt;/span&gt;in my case), size( &lt;span style="font-style: italic;"&gt;37 px&lt;/span&gt; in my case) and color ( &lt;span style="font-style: italic;"&gt;Red&lt;/span&gt; in my case) from the drop down menu. This will create a new layer ( say &lt;span style="font-style: italic;"&gt;Layer1&lt;/span&gt; ), which will be listed in the Layers window and It will look like this now--&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5. Right click on the newly created layer with the name same as your text and select &lt;span style="font-style: italic;"&gt;Duplicate Layer&lt;/span&gt; . This creates a duplicated layer ( say &lt;span style="font-style: italic;"&gt;Layer2&lt;/span&gt;).  Now with the original layer, Layer1 selected, go to&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Filters -&gt; Blur -&gt; Gaussian Blur -&gt;&lt;/span&gt; Select &lt;span style="font-style: italic;"&gt;horizontal and vertical blur radius&lt;/span&gt; as anything between 12 px - 20px each. and click OK&lt;br /&gt;&lt;br /&gt;6. Select &lt;span style="font-style: italic;"&gt;Layer2&lt;/span&gt; and choose &lt;span style="font-style: italic;"&gt;Color&lt;/span&gt; as &lt;span style="font-style: italic;"&gt;Green&lt;/span&gt; from the color chooser.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_C163I0t-EVM/SpCzUwSVsSI/AAAAAAAAADI/Jt2atFFMEGA/s1600-h/3.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 270px; height: 169px;" src="http://3.bp.blogspot.com/_C163I0t-EVM/SpCzUwSVsSI/AAAAAAAAADI/Jt2atFFMEGA/s320/3.png" alt="" id="BLOGGER_PHOTO_ID_5372991524593578274" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;7. Select &lt;span style="font-style: italic;"&gt;Filters-&gt; Distorts -&gt; Emboss -&gt; &lt;/span&gt;select&lt;span style="font-style: italic;"&gt; funtion &lt;/span&gt;as&lt;span style="font-style: italic;"&gt; Emboss and Azimuth, Elevation and Depth&lt;/span&gt; to any suitable value ( &lt;span style="font-style: italic;"&gt;30, 45, 20 &lt;/span&gt;respectively in my case)&lt;br /&gt;now this will look something like this-&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;8. Select &lt;span style="font-style: italic;"&gt;Layer2 -&gt; right click on it -&gt; Duplicate Layer&lt;/span&gt;. This creates another duplicate layer of it ( say &lt;span style="font-style: italic;"&gt;Layer3&lt;/span&gt;).&lt;br /&gt;&lt;br /&gt;9. Now Select &lt;span style="font-style: italic;"&gt;Layer3 -&gt; Tools menu -&gt; Transform Tools -&lt;/span&gt;&lt;a style="font-style: italic;" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_C163I0t-EVM/SpCztvRfSWI/AAAAAAAAADQ/MTttGDK4er4/s1600-h/4.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 275px; height: 172px;" src="http://4.bp.blogspot.com/_C163I0t-EVM/SpCztvRfSWI/AAAAAAAAADQ/MTttGDK4er4/s320/4.png" alt="" id="BLOGGER_PHOTO_ID_5372991953818306914" border="0" /&gt;&lt;/a&gt;&lt;span style="font-style: italic;"&gt;&gt; Flip Tool -&gt;&lt;/span&gt; Select &lt;span style="font-style: italic;"&gt;Flip type&lt;/span&gt; as &lt;span style="font-style: italic;"&gt;Vertical&lt;/span&gt; and click on the text. This is invert the image.&lt;br /&gt;Select the &lt;span style="font-style: italic;"&gt;Move tool&lt;/span&gt; from the toolbar and position the vertically flipped text few pixels below the original text. It will look like this now---&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;10. Select &lt;span style="font-style: italic;"&gt;Layer3 -&gt; right click on it -&gt; Add Layer Mask -&gt;&lt;/span&gt; select &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_C163I0t-EVM/SpCzuL6ohII/AAAAAAAAADY/Hv9byNMAymQ/s1600-h/5.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 247px; height: 155px;" src="http://3.bp.blogspot.com/_C163I0t-EVM/SpCzuL6ohII/AAAAAAAAADY/Hv9byNMAymQ/s320/5.png" alt="" id="BLOGGER_PHOTO_ID_5372991961507071106" border="0" /&gt;&lt;/a&gt;&lt;span style="font-style: italic;"&gt;Transfer Layer's Alpha Channel&lt;/span&gt; -&gt; click &lt;span style="font-style: italic;"&gt;Add&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;11. Select &lt;span style="font-style: italic;"&gt;Layer3&lt;/span&gt; and then select &lt;span style="font-style: italic;"&gt;Blend tool &lt;/span&gt;from the tool bar with &lt;span style="font-style: italic;"&gt;Gradient&lt;/span&gt; as &lt;span style="font-style: italic;"&gt;FG to transparent&lt;/span&gt; and using CTRL key draw a straight line from bottom to top anywhere in the image. This is make the reflection text only partially visible, like this-&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;12. Finally right click &lt;span style="font-style: italic;"&gt;Layer3 -&gt; Apply Layer Mask.&lt;/span&gt; This finishes our steps and we finally get the desired text, kept on a shiny table, and glowing in red light. Crop the image to remove unwanted space and thats all!&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_C163I0t-EVM/SpCzuX0St1I/AAAAAAAAADg/kDxZ7ZBbWtE/s1600-h/6.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; cursor: pointer; width: 320px; height: 77px;" src="http://2.bp.blogspot.com/_C163I0t-EVM/SpCzuX0St1I/AAAAAAAAADg/kDxZ7ZBbWtE/s320/6.png" alt="" id="BLOGGER_PHOTO_ID_5372991964701701970" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Hope you enjoyed the tutorial!  Experiment and learn...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;alternatively catch me at &lt;a href="http://blogs.sun.com/AnuragSharma"&gt; http://blogs.sun.com/AnuragSharma&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2589427789736403011-6014001628803118461?l=anuragsharma-sun.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AnuragSharmaSunCampusAmbassador/~4/9jgNtXBT9Bo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AnuragSharmaSunCampusAmbassador/~3/9jgNtXBT9Bo/gimp-gnu-image-manipulation-program-my.html</link><author>noreply@blogger.com (Anurag)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_C163I0t-EVM/SpCxtUW8TxI/AAAAAAAAACw/nQJADDBmGSA/s72-c/6.png" height="72" width="72" /><thr:total>4</thr:total><feedburner:origLink>http://anuragsharma-sun.blogspot.com/2009/08/gimp-gnu-image-manipulation-program-my.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2589427789736403011.post-2637159652255595917</guid><pubDate>Tue, 11 Aug 2009 15:18:00 +0000</pubDate><atom:updated>2010-03-20T07:26:25.124-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Sun campus ambassador</category><title>Yet another tremor shook the souls at Bhubaneswar.</title><description>Well it was around 2 o' clock night with most of the people deep in their sleep at KP3 hostel, when we were hit by yet another earth quake. Though it was mild here, but strong enough to shake awake few of my sleeping friends. I noticed about this major piece of action going on here, when two of my friends shook me with their full strength ( I guess it was no less than 10-12 on Richter scale ;) , which struck me when I was peacefully asleep ) , still not strong enough to make my nerves active. It took me another 10 minutes to realise what had happened. I could hear students shouting and yelling ( But this is not new to our hostel. We have full freedom of expression here :) ). But as the case with me, majority of us got to know about the event from the fellow mates, only after it was gone ( just like Indian Police! ). But whatever the case may be, this event triggered many hot talks and fuming discussions here among boys. I could listen to few words which popped up every now and then like -'earth-quake','tsunami' ( what ? TSUNAMI !!! I really am scared of it.. Can I make a boat out of my study table? or using bed would be better idea? :) )&lt;br /&gt;These increasing terrorist activities, bomb blasts every now and then, and now earth-quakes, tsunami, drastic weather changes, global warming, pollution, Swine Flu! are they not signals by mother nature indicating something? It sounds like a threat to me. We all shall be wiped off from the crust if we continued our greedy actions..&lt;br /&gt;But at such hard times, one deeply feels the need of the loved ones to stay next to us. It makes one realise the true worth of relationships.&lt;div class="blogger-post-footer"&gt;alternatively catch me at &lt;a href="http://blogs.sun.com/AnuragSharma"&gt; http://blogs.sun.com/AnuragSharma&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2589427789736403011-2637159652255595917?l=anuragsharma-sun.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AnuragSharmaSunCampusAmbassador/~4/nhtPjoyFmBI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AnuragSharmaSunCampusAmbassador/~3/nhtPjoyFmBI/yet-another-tremor-shook-souls-at.html</link><author>noreply@blogger.com (Anurag)</author><thr:total>3</thr:total><feedburner:origLink>http://anuragsharma-sun.blogspot.com/2009/08/yet-another-tremor-shook-souls-at.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2589427789736403011.post-8643566151601695654</guid><pubDate>Sat, 08 Aug 2009 11:56:00 +0000</pubDate><atom:updated>2010-03-20T07:26:25.124-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Sun campus ambassador</category><title>A Leap towards Open Source... We too are in the race !</title><description>Here is some good news for the open-source supporters.. KIIT-U finally started its endeavours towards going completely open-source. This year the new-comers would be introduced to work on open-source platforms and softwares. The initiation has been done by the Technical Leads of our college along with a set of 4th year guys including me :P ,  by setting up the new user group for the upcoming new open-source enthusiasts in our college, where they can find the answers to all their queries related to open-source softwares and Unix-based systems. Lets look forward  with a hope that the freshers joining the insti would make use of this opportunity to the fullest. They would not only be provided with Unix based OS pre-installed on their systems, which they shall shortly be getting, but they will also enjoy the full support for the Open Source softwares on the local repository of our college. All the laboratories would adapt to the open-source alternatives thereby promoting the zeal of open-source among the freshies.&lt;br /&gt;I really appreciate this campaign and am happy to be a part of this :) . I hope, soon I would be accompanied by all my fellow mates in this effort.&lt;div class="blogger-post-footer"&gt;alternatively catch me at &lt;a href="http://blogs.sun.com/AnuragSharma"&gt; http://blogs.sun.com/AnuragSharma&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2589427789736403011-8643566151601695654?l=anuragsharma-sun.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AnuragSharmaSunCampusAmbassador/~4/wQZY0VIqt5w" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AnuragSharmaSunCampusAmbassador/~3/wQZY0VIqt5w/leap-towards-open-source-we-too-are-in.html</link><author>noreply@blogger.com (Anurag)</author><thr:total>0</thr:total><feedburner:origLink>http://anuragsharma-sun.blogspot.com/2009/08/leap-towards-open-source-we-too-are-in.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2589427789736403011.post-5374677995096011557</guid><pubDate>Mon, 03 Aug 2009 09:12:00 +0000</pubDate><atom:updated>2010-03-20T07:26:25.125-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Sun campus ambassador</category><category domain="http://www.blogger.com/atom/ns#">program</category><category domain="http://www.blogger.com/atom/ns#">java</category><category domain="http://www.blogger.com/atom/ns#">experience</category><title>My Experiments with Java..</title><description>I am a guy who had Computer Science as his main subject in 12th standard and I still remember its since that time I developed a passion for  programming languages. I remember the time we were taught Basic programming in school, there was nothing more boring than programming for me at that time. As the classes went by there haven't been any improvement in me, until I was introduced with C++ in 11th standard. I dont know what compelled me through it. May be the excellent teaching style of Hasan Sir, our beloved computer teacher :)  We never realized that among so much fun and enjoyment in our Computer classes  we were actually making our way through programming fundamentals and later on most of us would land up in there lives at places which would inextricably attached with programming. Well that was the beginning of programming for me, I would rather say.&lt;br /&gt;&lt;br /&gt;Java... I remember I heard it for the first time in class 7th from my computer teacher. I didnt know anything more than just its name. At that time computers meant no more than a dull boring Black screens placed in our school labs, which knows some DOS commands, for me. Java seemed interesting.. :) or rather 'sounded' interesting! I decided to learn it sooner or later. But then we make so many plans in our lives when we are young. And as it happens with me always, I forgot even that. It wasnt until my B-Tech 1st year, that again the term 'Java' got refreshed in my mind. Actually it was an informal geeky (rather we all were trying to sound as geeky as possible!) conversations among friends at college hostel. There one of my dear friend put up this term &amp; again I was reminded of my plans of childhood :) (sounds comical)&lt;br /&gt;&lt;br /&gt;Well then it was the summer holidays of 2nd year and then I decided to try my hands out on something new. And what else can be it other than Java at that time. I just dived my college library and came out satisfied with a thich 1000 pages book on Advanced Java in hands. I happily took it home and then spent 2-3 days just to understand its starting 2-3 pages. :) It began with Multi-threading !!! that was the first topic I started with!&lt;br /&gt;anyways.. it happens.. I kept on trying and consistently practicing all the programs and soon I had a large collection of my Java programs and gradually the 4 letters of 'Java' started getting clearer in my mind. And just few months more and I was the champ in Java among our friends !! ( i know I boast sometimes ) Another friend Raju, who started with C# at nearly the same time when I picked up Java, too started making cool applications in it. We used to spend hours together competing with each other, challenging each other on programming problems. He used to do it in C# and by now you all very well know what language I used:) ... This is called a healthy beginning. Later I self-studied JavaME an JavaEE, created applications ranging from stupid games to challenging problems. Here are few of my startup programs in Java. freely available and distributable, thats what open-source is all about! -&lt;br /&gt;&lt;ul type=disc&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://groups.google.co.in/group/crackersonly/web/TTTGame.java"&gt;My Tic Tac Toe game&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://groups.google.co.in/group/crackersonly/web/Queen.java"&gt;8 Queen Problem&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;alternatively catch me at &lt;a href="http://blogs.sun.com/AnuragSharma"&gt; http://blogs.sun.com/AnuragSharma&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2589427789736403011-5374677995096011557?l=anuragsharma-sun.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AnuragSharmaSunCampusAmbassador/~4/3YM7QGnY5GY" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AnuragSharmaSunCampusAmbassador/~3/3YM7QGnY5GY/my-experiments-with-java.html</link><author>noreply@blogger.com (Anurag)</author><thr:total>0</thr:total><feedburner:origLink>http://anuragsharma-sun.blogspot.com/2009/08/my-experiments-with-java.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2589427789736403011.post-5659907334601155255</guid><pubDate>Sat, 01 Aug 2009 08:58:00 +0000</pubDate><atom:updated>2010-03-20T07:26:25.125-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Sun campus ambassador</category><title>Another KIIT-Sun Club get-together</title><description>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_C163I0t-EVM/SnQDE1GpUzI/AAAAAAAAACo/xK2JKUy4fNU/s1600-h/DSC00466.JPG"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://3.bp.blogspot.com/_C163I0t-EVM/SnQDE1GpUzI/AAAAAAAAACo/xK2JKUy4fNU/s320/DSC00466.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5364916437614416690" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_C163I0t-EVM/SnQDEZNb93I/AAAAAAAAACg/8pERVGmyLvk/s1600-h/DSC00463.JPG"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://3.bp.blogspot.com/_C163I0t-EVM/SnQDEZNb93I/AAAAAAAAACg/8pERVGmyLvk/s320/DSC00463.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5364916430126708594" /&gt;&lt;/a&gt;&lt;br /&gt;It was only this Saturday ie 21st March'09 and the KIIT- Sun Club was all set to organize a Technical demo on OpenSolaris2008.11.&lt;br /&gt;It was primarily focused for the 1st and 2nd year students who do not know the intricacies of the operating systems and the specialities of OpenSolaris, in order to equip them with the basic knowledge of OpenSolaris Operating System, but was equally open for interested students of all the years and branches. And to my surprize I got the students for the 3rd years also joining me in the talk and few were found much interested to know the correlation between modern Linux and opensolaris as they look alike to them.&lt;br /&gt;I started with the history of opensolaris project and later on introduced them with the tools to be used late in that session i.e. Virtual Box. Smart IT students didn't take it any longer to understand the underlying basics and working of Virtual Box as most of them have already seen some kind of Virtualization agents earlier. Few seemed to be already using Virtual Box, but still they liked to listen to the basics of the concept of Virtualization. Testing entirely different and new operating systems on their Windows preloded systems provided by the college, have never been so easy and risk free for them. Watching the Guest operating system run inside the host machine was though some kind of a magic to few but nonetheless all were keen to know the steps to do it. After covering the basics I demonstrated the steps for building Virtual Machines inside Virtual Box and how can the guest OS be installed in it safely.&lt;br /&gt;I later showed them Opensolaris working perfectly fine in the Virtual Box ( preinstalled on my computer). Then after giving them a brief overview of the opensolaris I talked about the exciting features and opensolaris like DTrace and promised them to carry on this topic in future sessions.&lt;div class="blogger-post-footer"&gt;alternatively catch me at &lt;a href="http://blogs.sun.com/AnuragSharma"&gt; http://blogs.sun.com/AnuragSharma&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2589427789736403011-5659907334601155255?l=anuragsharma-sun.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AnuragSharmaSunCampusAmbassador/~4/j4CMEJhKQuk" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AnuragSharmaSunCampusAmbassador/~3/j4CMEJhKQuk/another-kiit-sun-club-get-together.html</link><author>noreply@blogger.com (Anurag)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_C163I0t-EVM/SnQDE1GpUzI/AAAAAAAAACo/xK2JKUy4fNU/s72-c/DSC00466.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://anuragsharma-sun.blogspot.com/2009/08/another-kiit-sun-club-get-together.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2589427789736403011.post-7940232032730232073</guid><pubDate>Fri, 01 May 2009 14:37:00 +0000</pubDate><atom:updated>2009-05-01T07:46:28.761-07:00</atom:updated><title>Its hot !</title><description>ufff.. hot summers..  its chilling out here&lt;br /&gt;and I am feeling this place.. more like a cage..&lt;br /&gt;this place will always be, the 1 which anyone would like to flee&lt;br /&gt;But this hostel life has not really been totally wasteful&lt;br /&gt;now look here we are taught so many good lessons-&lt;br /&gt;&lt;br /&gt;&gt; The calm and cool Birthday celebrations ( i hope u get it.) taught us the lesson of non-violence and brotherhood as never before.. The way we guys congratulate and greet others on their B'days ( well its the time which is much more awaited by all other than only d b'day boy ) .. m talkin abt  d birthday bumps yar.. its way of living in a society. It shows the existence of immense intimacy between guys of King's Palace-3 . yeah  thats what true friendship seems to me!&lt;br /&gt;&gt; The delicious food ( Oh Paneer!!! yummy. look I started developing a taste for it ). It teaches us to respect the food and be thankful to hostels mess authorities for the little we are getting in our hostels ( mind the word 'little') :)&lt;br /&gt;as such paneer is the only source of energy here for vegetarians like me&lt;br /&gt;&gt; Watching movies even a day before exams doesnt really teach us anything but its just to tell that we are sharp enough to vomit in few tragic hours of exams all what in entire semester's class we never thought of giving an ear to. &lt;br /&gt;Anyways its true that theres a beautiful dawn awaiting after a gloomy night.&lt;br /&gt;&gt; Games !!! oh yes. playing it whole night really helps a lot in building ones concentration and keeping ones mind from silly thoughts and earthly tensions. its a divine thing to do. and yes ofcourse it keeps your laptops from rusting.&lt;br /&gt;&lt;br /&gt;I really feel everyone should atleast ones experience this hostel life, full of fun . among all this you really do discover some true friends with whom you would like to hang out ( else they are always ready to Hang you out and then get themselves hung too). u rarely find such idiots!&lt;div class="blogger-post-footer"&gt;alternatively catch me at &lt;a href="http://blogs.sun.com/AnuragSharma"&gt; http://blogs.sun.com/AnuragSharma&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2589427789736403011-7940232032730232073?l=anuragsharma-sun.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AnuragSharmaSunCampusAmbassador/~4/oOefu3hWDB0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AnuragSharmaSunCampusAmbassador/~3/oOefu3hWDB0/its-hot.html</link><author>noreply@blogger.com (Anurag)</author><thr:total>0</thr:total><feedburner:origLink>http://anuragsharma-sun.blogspot.com/2009/05/its-hot.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2589427789736403011.post-7656086815731369345</guid><pubDate>Sat, 07 Mar 2009 02:58:00 +0000</pubDate><atom:updated>2010-03-20T07:26:25.126-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Sun campus ambassador</category><title>Netbeans Technical session</title><description>I organized an OSUM meeting in my campus on February 28 in which I discussed about various programmes by SUN Microsystems for the benefit of students and teachers like OSUM, SAI and gave a technical demonstration on project development using Netbeans6.5 which was the most interesting part of the session.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_C163I0t-EVM/SbHmIMo1JwI/AAAAAAAAACQ/hq7cHLIQtjs/s1600-h/ABCD0006.JPG"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://1.bp.blogspot.com/_C163I0t-EVM/SbHmIMo1JwI/AAAAAAAAACQ/hq7cHLIQtjs/s320/ABCD0006.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5310278464152348418" /&gt;&lt;/a&gt;&lt;br /&gt;Since the audience I targeted were mostly second year students well trained in their curriculum subjects like C++ and Operating Systems but having little or no background knowledge of Java, but were much enthusiastic to learn it. So, I planned to show them how easily and quickly can the projects be developed using Netbeans without the need of having a strong command on the language.&lt;br /&gt;&lt;br /&gt;I began by telling them how easy and fun would C++ programming be in Netbeans, and hence can be used for their daily assignments. I introduced Netbeans as the IDE which they shall be using exhaustively in most of their future projects. Bundled with JavaSE,JavaEE, JavaME, JavaScript, Ruby, application and database servers and much more, Netbeans offers support for just anything one can think of!&lt;br /&gt;I developed a sample project each in JavaSE, JavaEE and JavaME by typing down minimum number of Java Code lines by just using other features of Netbeans like drag and drop etc. trying to keep the complexity of the project minimum, so that it can be easily understood by the audience.&lt;br /&gt;Students were really fascinated to see ease of development it offers in Mobile application in  JavaME, after watching the development of a 'Login and Welcome' application in which I just typed in a single line of Java Code!&lt;br /&gt;Everyone was willing to adapt Netbeans as their IDE at the end of the session.&lt;br /&gt;At the end their was a usual quiz session with exciting goodies to be won. Netbeans DVDs were distributed among the Club members so than they can experiment, play and learn.&lt;br /&gt;&lt;br /&gt;Think anything Code anything&lt;div class="blogger-post-footer"&gt;alternatively catch me at &lt;a href="http://blogs.sun.com/AnuragSharma"&gt; http://blogs.sun.com/AnuragSharma&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2589427789736403011-7656086815731369345?l=anuragsharma-sun.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AnuragSharmaSunCampusAmbassador/~4/Vmwg0AIJMbc" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AnuragSharmaSunCampusAmbassador/~3/Vmwg0AIJMbc/netbeans-technical-session.html</link><author>noreply@blogger.com (Anurag)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_C163I0t-EVM/SbHmIMo1JwI/AAAAAAAAACQ/hq7cHLIQtjs/s72-c/ABCD0006.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://anuragsharma-sun.blogspot.com/2009/03/netbeans-technical-session.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2589427789736403011.post-1349353666398227434</guid><pubDate>Wed, 25 Feb 2009 13:47:00 +0000</pubDate><atom:updated>2010-03-20T07:25:29.115-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Sun campus ambassador</category><title>My first ever Session...</title><description>Here is something to share.&lt;br /&gt;Last Sunday I conducted a little casual type of OSUM meeting just to brief up the interested students (especially of 2nd years) about SUN, its technologies, OSUM, SAI and the benefits its going 2 share with us. I got a mass of interested students (more than 50) attending the session (45 mins approximately) willingly!&lt;br /&gt;&lt;br /&gt;I got amazed to know that though majority of them were not knowing of Java Programming &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_C163I0t-EVM/SaVOUf2nf6I/AAAAAAAAACA/CBc8Z5fjIsI/s1600-h/22022009_005.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://4.bp.blogspot.com/_C163I0t-EVM/SaVOUf2nf6I/AAAAAAAAACA/CBc8Z5fjIsI/s320/22022009_005.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5306733849980927906" /&gt;&lt;/a&gt;&lt;br /&gt;(since it was not in their course till now) but they had much enthusiasm to learn it and go for the Certifications as well!!!&lt;br /&gt;&lt;br /&gt;Opposite to what I expected and adding to my astonishment, there were 5-6 people who came forward showing their extreme interest in going for SUN Certification in near future and are eager to derive benefits out of SAI ! &lt;br /&gt;Many were curious to know about various SUN Technologies which I assured them to be discussed in future OSUM meetings .&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_C163I0t-EVM/SaVOrfsvoqI/AAAAAAAAACI/QA9aWrwUeow/s1600-h/22022009_006.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://4.bp.blogspot.com/_C163I0t-EVM/SaVOrfsvoqI/AAAAAAAAACI/QA9aWrwUeow/s320/22022009_006.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5306734245076509346" /&gt;&lt;/a&gt;&lt;br /&gt; &lt;br /&gt;At the end I had a brief quiz. I asked few questions to them and the ones who came up with correct answer got SUN goodies ( Open Solaris Student pack, Netbeans DVD, SUN pen, SUN keyrings etc.)&lt;br /&gt;&lt;br /&gt;Since it was my first demo I ever conducted. I was a bit nervous about it and a bit uncertain about the response. But it all went so well. Thus making me to think an urgent need of other such demos. I think I would be conducting another session very soon. &lt;br /&gt;It boosted my confidence a lot... A nice and exciting experience altogether..&lt;div class="blogger-post-footer"&gt;alternatively catch me at &lt;a href="http://blogs.sun.com/AnuragSharma"&gt; http://blogs.sun.com/AnuragSharma&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2589427789736403011-1349353666398227434?l=anuragsharma-sun.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AnuragSharmaSunCampusAmbassador/~4/QxIZY_wN6qU" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AnuragSharmaSunCampusAmbassador/~3/QxIZY_wN6qU/my-first-ever-session.html</link><author>noreply@blogger.com (Anurag)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_C163I0t-EVM/SaVOUf2nf6I/AAAAAAAAACA/CBc8Z5fjIsI/s72-c/22022009_005.jpg" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://anuragsharma-sun.blogspot.com/2009/02/my-first-ever-session.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2589427789736403011.post-1964208207976995371</guid><pubDate>Sun, 25 Jan 2009 02:49:00 +0000</pubDate><atom:updated>2009-01-24T19:05:31.771-08:00</atom:updated><title>truly OSUM (awesome) !!!</title><description>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_C163I0t-EVM/SXvWYJLFvEI/AAAAAAAAAAM/diqla4Et504/s1600-h/osum.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 113px;" src="http://3.bp.blogspot.com/_C163I0t-EVM/SXvWYJLFvEI/AAAAAAAAAAM/diqla4Et504/s320/osum.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5295061497171786818" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span"   style="border-collapse: collapse; color: rgb(34, 34, 34);   font-family:arial;font-size:13px;"&gt;&lt;span style="font-family: arial, helvetica, sans-serif; font-size:85%;"&gt;Here is a community in which you might be interested. &lt;b&gt;OSUM&lt;/b&gt; (pronounced "awesome") is a global community of students that are passionate about &lt;b&gt;Free and Open Source Software (FOSS) &lt;/b&gt;and how it is Changing (Y)Our World.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: arial, helvetica, sans-serif; font-size:85%;"&gt;OSUMs provide students with training in cutting edge technologies in demand by the IT industry, access to resources to advance their careers and the opportunity to make friends through engaging and fun technology-based activities.&lt;/span&gt;&lt;span style="font-family: arial, helvetica, sans-serif; font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-family: arial, helvetica, sans-serif; font-size:85%;"&gt;Students will reap substantial benefits which include&lt;/span&gt;&lt;span style="font-family: arial, helvetica, sans-serif; font-size:85%;"&gt;-&lt;br /&gt;&lt;/span&gt;&lt;ul style="font-family: arial, helvetica, sans-serif; "&gt;&lt;li style="margin-left: 15px; "&gt;&lt;span style="font-size:85%;"&gt;Support for FOSS ( Free and Open Source Softwares)&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-left: 15px; "&gt;&lt;span style="font-size:85%;"&gt;Hands- on training via Tech Demos and Student Projects to learn technologies that can lead to promising careers in the IT industry&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-left: 15px; "&gt;&lt;span style="font-size:85%;"&gt;Tools, ideas and opportunity for student projects, contests and more&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-left: 15px; "&gt;&lt;span style="font-size:85%;"&gt;Ready access to free and low-cost student resources, such as the &lt;b&gt;SAI &lt;/b&gt;(free trainng and discounted certification)&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;ul&gt;&lt;li style="margin-left: 15px; "&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;SAI &lt;/b&gt;offers loads of tutorials on all the SUN technologys&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-left: 15px; "&gt;&lt;span style="font-size:85%;"&gt;A &lt;b&gt;HUGE &lt;/b&gt;discount !!! on SUN Certification exams ( $40 instead of $200)&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-left: 15px; "&gt;&lt;span style="font-size:85%;"&gt;free ePractice exams for Sun Certification preparation and  much more&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li style="margin-left: 15px; "&gt;&lt;span style="font-size:85%;"&gt;Communities create opportunity for collaboration&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-left: 15px; "&gt;&lt;span style="font-size:85%;"&gt;Make lots of like-minded (technical) friends &lt;/span&gt;&lt;span style="font-size:85%;"&gt;through the Sun OSUM global community&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-left: 15px; "&gt;&lt;span style="font-size:85%;"&gt;Have access to a variety of OSUM events such as Software Freedom Day, University Day, etc.&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-left: 15px; "&gt;&lt;span style="font-size:85%;"&gt;Media kits &amp;amp; Give-aways&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;So, join &lt;a href="http://osum.sun.com/" target="_blank" style="color: rgb(53, 66, 88); "&gt;this group&lt;/a&gt; and be a part of our Open Source family and enjoy the benefits. :)&lt;br /&gt;you can find me &lt;a href="http://osum.sun.com/profile/AnuragSharma" target="_blank" style="color: rgb(53, 66, 88); "&gt;here&lt;/a&gt;.&lt;br /&gt;be a part of KIIT-U SUN club &lt;a href="http://osum.sun.com/group/kiitsunclub" target="_blank" style="color: rgb(53, 66, 88); "&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Feel free to tell about this wonderful club to all your friends.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;alternatively catch me at &lt;a href="http://blogs.sun.com/AnuragSharma"&gt; http://blogs.sun.com/AnuragSharma&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2589427789736403011-1964208207976995371?l=anuragsharma-sun.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AnuragSharmaSunCampusAmbassador/~4/WCq4eBU5d2U" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AnuragSharmaSunCampusAmbassador/~3/WCq4eBU5d2U/truly-osum-awesome.html</link><author>noreply@blogger.com (Anurag)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_C163I0t-EVM/SXvWYJLFvEI/AAAAAAAAAAM/diqla4Et504/s72-c/osum.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://anuragsharma-sun.blogspot.com/2009/01/truly-osum-awesome.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2589427789736403011.post-2299997050325510109</guid><pubDate>Sun, 25 Jan 2009 01:11:00 +0000</pubDate><atom:updated>2009-01-24T17:14:44.133-08:00</atom:updated><title>Participate in Project NPTEL</title><description>&lt;span style="font-size:85%;"&gt;Here is an interesting project and a great opportunity to participate in India's largest open courseware initiative &lt;b&gt;Project NPTEL&lt;/b&gt; by &lt;b&gt;IIT-M&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;In the true spirit of being 'open' , volunteers are solicited to help to transcribe the video lectures into text.&lt;br /&gt; Of course, due recognition will be awarded.&lt;br /&gt;&lt;br /&gt;IIT Madras' NPTEL project is rated 4th among the world's e-learning&lt;br /&gt;intiatives &amp;amp; this is a great way to contribute and make it even better.&lt;br /&gt;&lt;br /&gt;The IIT Madras has made video lectures of all IITs &amp;amp; IISc professors' lectures on various subjects, for details &lt;a href="http://nptel.iitm.ac.in/" target="_blank"&gt;http://nptel.iitm.ac.in/&lt;/a&gt; or &lt;a href="http://in.youtube.com/user/nptelhrd" target="_blank"&gt;http://in.youtube.com/user/&lt;wbr&gt;nptelhrd&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Now they want to transcribe them into written format. So, our task will be, to listen the video lectures &amp;amp; write down whatever the professor says.&lt;br /&gt;&lt;br /&gt;This is beneficial for you anyway, as you'll be getting the material from top professors of IIT &amp;amp; IISc. Computer Science, EC, ME, IT, EE etc all branch's various subjects are covered in this. Getting IIT's quality education is dream of every student, isn't it :-)&lt;br /&gt;&lt;br /&gt;Therefore, any branch student who is interested in this, please give their names &amp;amp; email id.So Hurry up friends..&lt;br /&gt;&lt;br /&gt;1. Name :&lt;br /&gt;2. Email  :&lt;br /&gt;&lt;br /&gt;Looking forward to your confirmations to contribute.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;&lt;/span&gt;      &lt;span style="font-size:85%;color:#888888;"&gt;&lt;br /&gt;--&lt;br /&gt;Anurag Sharma&lt;br /&gt;SUN CA, KIIT&lt;br /&gt;(A.Sharma@sun.com)&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;alternatively catch me at &lt;a href="http://blogs.sun.com/AnuragSharma"&gt; http://blogs.sun.com/AnuragSharma&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2589427789736403011-2299997050325510109?l=anuragsharma-sun.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AnuragSharmaSunCampusAmbassador/~4/p0h-5-3xLS0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AnuragSharmaSunCampusAmbassador/~3/p0h-5-3xLS0/participate-in-project-nptel.html</link><author>noreply@blogger.com (Anurag)</author><thr:total>1</thr:total><feedburner:origLink>http://anuragsharma-sun.blogspot.com/2009/01/participate-in-project-nptel.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2589427789736403011.post-2697865469152707112</guid><pubDate>Wed, 21 Jan 2009 14:23:00 +0000</pubDate><atom:updated>2010-03-20T07:26:25.126-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Sun campus ambassador</category><title>Top Ten Errors Java Programmers Make</title><description>&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;Top Ten Errors Java Programmers Make&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;(How to spot them. How to fix/prevent them.)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;-By David Reilly&lt;br /&gt;&lt;br /&gt;Whether you program regularly in Java, and know it like the back of your hand, or whether you're new to the language or a casual programmer, you'll make mistakes. It's natural, it's human, and guess what? You'll more than likely make the same mistakes that others do, over and over again. Here's my top ten list of errors that we all seem to make at one time or another,  how to spot them, and how to fix them.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;10. Accessing non-static member variables from static methods (such as main)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Many programmers, particularly when first introduced to Java, have problems with accessing member variables from their main method. The method signature for main is marked static - meaning that we don't need to create an instance of the class to invoke the main method. For example, a Java Virtual Machine (JVM) could call the class MyApplication like this :-&lt;br /&gt;&lt;br /&gt;   MyApplication.main ( command_line_args );&lt;br /&gt;&lt;br /&gt;This means, however, that there isn't an instance of MyApplication - it doesn't have any member variables to access! Take for example the following application, which will generate a compiler error message.&lt;br /&gt;&lt;br /&gt;public class StaticDemo&lt;br /&gt;{&lt;br /&gt;       public String my_member_variable = "somedata";&lt;br /&gt;&lt;br /&gt;       public static void main (String args[])&lt;br /&gt;       {&lt;br /&gt;  // Access a non-static member from static method&lt;br /&gt;               System.out.println ("This generates a compiler error" +&lt;br /&gt;   my_member_variable );&lt;br /&gt;       }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;If you want to access its member variables from a non-static method (like main), you must create an instance of the object. Here's a simple example of how to correctly write code to access non-static member variables, by first creating an instance of the object.&lt;br /&gt;&lt;br /&gt;public class NonStaticDemo&lt;br /&gt;{&lt;br /&gt;       public String my_member_variable = "somedata";&lt;br /&gt;&lt;br /&gt;       public static void main (String args[])&lt;br /&gt;       {&lt;br /&gt;               NonStaticDemo demo = new NonStaticDemo();&lt;br /&gt;&lt;br /&gt;  // Access member variable of demo&lt;br /&gt;               System.out.println ("This WON'T generate an error" +&lt;br /&gt;                       demo.my_member_variable );&lt;br /&gt;       }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;9. Mistyping the name of a method when overriding&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Overriding allows programmers to replace a method's implementation with new code. Overriding is a handy feature, and most OO programmers make heavy use of it. If you use the AWT 1.1 event handling model, you'll often override listener implementations to provide custom functionality. One easy trap to fall into with overriding, is to mistype the method name. If you mistype the name, you're no longer overriding a method - you're creating an entirely new method, but with the same parameter and return type.&lt;br /&gt;&lt;br /&gt;public class MyWindowListener extends WindowAdapter {&lt;br /&gt; // This should be WindowClosed&lt;br /&gt; public void WindowClose(WindowEvent e) {&lt;br /&gt;  // Exit when user closes window&lt;br /&gt;  System.exit(0);&lt;br /&gt; }&lt;br /&gt;});&lt;br /&gt;&lt;br /&gt;Compilers won't pick up on this one, and the problem can be quite frustrating to detect. In the past, I've looked at a method, believed that it was being called, and taken ages to spot the problem. The symptom of this error will be that your code isn't being called, or you think the method has skipped over its code. The only way to ever be certain is to add a println statement, to record a message in a log file, or to use good trace debugger (like Visual J++ or Borland JBuilder) and step through line by line. If your method still isn't being called, then it's likely you've mistyped the name.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;8. Comparison assignment (  = rather than == )&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is an easy error to make. If you're used other languages before, such as Pascal, you'll realize just how poor a choice this was by the language's designers. In Pascal, for example, we use the := operator for assignment, and leave = for comparison. This looks like a throwback to C/C++, from which Java draws its roots.&lt;br /&gt;&lt;br /&gt;Fortunately, even if you don't spot this one by looking at code on the screen, your compiler will. Most commonly, it will report an error message like this : "Can't convert xxx to boolean", where xxx is a Java type that you're assigning instead of comparing.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;7. Comparing two objects ( == instead of .equals)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When we use the == operator, we are actually comparing two object references, to see if they point to the same object. We cannot compare, for example, two strings for equality, using the == operator. We must instead use the .equals method, which is a method inherited by all classes from java.lang.Object.&lt;br /&gt;&lt;br /&gt;Here's the correct way to compare two strings.&lt;br /&gt;&lt;br /&gt;String abc = "abc"; String def = "def";&lt;br /&gt;&lt;br /&gt;// Bad way&lt;br /&gt;if ( (abc + def) == "abcdef" )&lt;br /&gt;{&lt;br /&gt;   ......&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Good way&lt;br /&gt;if ( (abc + def).equals("abcdef") )&lt;br /&gt;{&lt;br /&gt;  .....&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;6. Confusion over passing by value, and passing by reference&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This can be a frustrating problem to diagnose, because when you look at the code, you might be sure that its passing by reference, but find that its actually being passed by value. Java uses both, so you need to understand when you're passing by value, and when you're passing by reference.&lt;br /&gt;&lt;br /&gt;When you pass a primitive data type, such as a char, int, float, or double, to a function then you are passing by value. That means that a copy of the data type is duplicated, and passed to the function. If the function chooses to modify that value, it will be modifying the copy only. Once the function finishes, and control is returned to the returning function, the "real" variable will be untouched, and no changes will have been saved. If you need to modify a primitive data type, make it a return value for a function, or wrap it inside an object.&lt;br /&gt;&lt;br /&gt;When you pass a Java object, such as an array, a vector, or a string, to a function then you are passing by reference. Yes - a String is actually an object, not a primitive data type.  So that means that if you pass an object to a function, you are passing a reference to it, not a duplicate. Any changes you make to the object's member variables will be permanent - which can be either good or bad, depending on whether this was what you intended.&lt;br /&gt;&lt;br /&gt;On a side note, since String contains no methods to modify its contents, you might as well be passing by value.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;5. Writing blank exception handlers&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I know it's very tempting to write blank exception handlers, and to just ignore errors. But if you run into problems, and haven't written any error messages, it becomes almost impossible to find out the cause of the error. Even the simplest exception handler can be of benefit. For example, put a try { .. } catch Exception around your code, to catch ANY type of exception, and print out the message. You don't need to write a custom handler for every exception (though this is still good programming practice). Don't ever leave it blank, or you won't know what's happening.&lt;br /&gt;&lt;br /&gt;For example&lt;br /&gt;&lt;br /&gt;public static void main(String args[])&lt;br /&gt;{&lt;br /&gt;   try {&lt;br /&gt; // Your code goes here..&lt;br /&gt;   }&lt;br /&gt;   catch (Exception e)&lt;br /&gt;   {&lt;br /&gt; System.out.println ("Err - " + e );&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;4. Forgetting that Java is zero-indexed&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you've come from a C/C++ background, you may not find this quite as much a problem as those who have used other languages. In Java, arrays are zero-indexed, meaning that the first element's index is actually 0. Confused? Let's look at a quick example.&lt;br /&gt;&lt;br /&gt;// Create an array of three strings&lt;br /&gt;String[] strArray = new String[3];&lt;br /&gt;&lt;br /&gt;// First element's index is actually 0&lt;br /&gt;strArray[0] = "First string";&lt;br /&gt;&lt;br /&gt;// Second element's index is actually 1&lt;br /&gt;strArray[1] = "Second string";&lt;br /&gt;&lt;br /&gt;// Final element's index is actually 2&lt;br /&gt;strArray[2] = "Third and final string";&lt;br /&gt;&lt;br /&gt;In this example, we have an array of three strings, but to access elements of the array we actually subtract one. Now, if we were to try and access strArray[3], we'd be accessing the fourth element. This will case an ArrayOutOfBoundsException to be thrown - the most obvious sign of forgetting the zero-indexing rule.&lt;br /&gt;&lt;br /&gt;Other areas where zero-indexing can get you into trouble is with strings. Suppose you wanted to get a character at a particular offset within a string. Using the String.charAt(int) function you can look this information up - but under Java, the String class is also zero-indexed. That means than the first character is at offset 0, and second at offset 1. You can run into some very frustrating problems unless you are aware of this - particularly if you write applications with heavy string processing. You can be working on the wrong character, and also throw exceptions at run-time. Just like the ArrayOutOfBoundsException, there is a string equivalent. Accessing beyond the bounds of a String will cause a StringIndexOutOfBoundsException to be thrown, as demonstrated by this example.&lt;br /&gt;&lt;br /&gt;public class StrDemo&lt;br /&gt;{&lt;br /&gt;public static void main (String args[])&lt;br /&gt;{&lt;br /&gt;       String abc = "abc";&lt;br /&gt;&lt;br /&gt;       System.out.println ("Char at offset 0 : " + abc.charAt(0) );&lt;br /&gt;       System.out.println ("Char at offset 1 : " + abc.charAt(1) );&lt;br /&gt;       System.out.println ("Char at offset 2 : " + abc.charAt(2) );&lt;br /&gt;&lt;br /&gt; // This line should throw a StringIndexOutOfBoundsException&lt;br /&gt;       System.out.println ("Char at offset 3 : " + abc.charAt(3) );&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Note too, that zero-indexing doesn't just apply to arrays, or to Strings. Other parts of Java are also indexed, but not always consistently. The java.util.Date, and java.util.Calendar classes start their months with 0, but days start normally with 1. This problem is demonstrated by the following application.&lt;br /&gt;&lt;br /&gt;import java.util.Date;&lt;br /&gt;import java.util.Calendar;&lt;br /&gt;&lt;br /&gt;public class ZeroIndexedDate&lt;br /&gt;{&lt;br /&gt;       public static void main (String args[])&lt;br /&gt;       {&lt;br /&gt;               // Get today's date&lt;br /&gt;               Date today = new Date();&lt;br /&gt;&lt;br /&gt;  // Print return value of getMonth&lt;br /&gt;  System.out.println ("Date.getMonth() returns : " +&lt;br /&gt;    today.getMonth());&lt;br /&gt;&lt;br /&gt;  // Get today's date using a Calendar&lt;br /&gt;  Calendar rightNow = Calendar.getInstance();&lt;br /&gt;&lt;br /&gt;  // Print return value of get ( Calendar.MONTH )&lt;br /&gt;  System.out.println ("Calendar.get (month) returns : " +&lt;br /&gt;   rightNow.get ( Calendar.MONTH ));&lt;br /&gt;&lt;br /&gt;       }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Zero-indexing is only a problem if you don't realize that its occurring. If you think you're running into a problem, always consult your API documentation.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3. Preventing concurrent access to shared variables by threads&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When writing multi-threaded applications, many programmers (myself included) often cut corners, and leave their applications and applets vulnerable to thread conflicts. When two or more threads access the same data concurrently, there exists the possibility (and Murphy's law holding, the probability) that two threads will access or modify the same data at the same time. Don't be fooled into thinking that such problems won't occur on single-threaded processors. While accessing some data (performing a read), your thread may be suspended, and another thread scheduled. It writes its data, which is then overwritten when the first thread makes its changes.&lt;br /&gt;&lt;br /&gt;Such problems are not just limited to multi-threaded applications or applets. If you write Java APIs, or JavaBeans, then your code may not be thread-safe. Even if you never write a single application that uses threads, people that use your code WILL. For the sanity of others, if not yourself, you should always take precautions to prevent concurrent access to shared data.&lt;br /&gt;&lt;br /&gt;How can this problem be solved? The simplest method is to make your variables private (but you do that already,  right?) and to use synchronized accessor methods. Accessor methods allow access to private member variables, but in a controlled manner. Take the following accessor methods, which provide a safe way to change the value of a counter.&lt;br /&gt;&lt;br /&gt;public class MyCounter&lt;br /&gt;{&lt;br /&gt; private int count = 0; // count starts at zero&lt;br /&gt;&lt;br /&gt; public synchronized void setCount(int amount)&lt;br /&gt; {&lt;br /&gt;  count = amount;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public synchronized int getCount()&lt;br /&gt; {&lt;br /&gt;  return count;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2. Capitalization errors&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is one of the most frequent errors that we all make. It's so simple to do, and sometimes one can look at an uncapitalized variable or method and still not spot the problem. I myself have often been puzzled by these errors, because I recognize that the method or variable does exist, but don't spot the lack of capitalization.&lt;br /&gt;&lt;br /&gt;While there's no silver bullet for detecting this error, you can easily train yourself to make less of them. There's a very simple trick you can learn :-&lt;br /&gt;&lt;br /&gt;   * all methods and member variables in the Java API begin with lowercase letters&lt;br /&gt;   * all methods and member variables use capitalization where a new word begins e.g - getDoubleValue()&lt;br /&gt;&lt;br /&gt;If you use this pattern for all of your member variables and classes, and then make a conscious effort to get it right, you can gradually reduce the number of mistakes you'll make. It may take a while, but it can save some serious head scratching in the future.&lt;br /&gt;(drum roll)&lt;br /&gt;And the number one error that Java programmers make !!!!!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1. Null pointers!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Null pointers are one of the most common errors that Java programmers make. Compilers can't check this one for you - it will only surface at runtime, and if you don't discover it, your users certainly will.&lt;br /&gt;&lt;br /&gt;When an attempt to access an object is made, and the reference to that object is null, a NullPointerException will be thrown. The cause of null pointers can be varied, but generally it means that either you haven't initialized an object, or you haven't checked the return value of a function.&lt;br /&gt;&lt;br /&gt;Many functions return null to indicate an error condition - but unless you check your return values, you'll never know what's happening. Since the cause is an error condition, normal testing may not pick it up - which means that your users will end up discovering the problem for you. If the API function indicates that null may be returned, be sure to check this before using the object reference!&lt;br /&gt;&lt;br /&gt;Another cause is where your initialization has been sloppy, or where it is conditional. For example, examine the following code, and see if you can spot the problem.&lt;br /&gt;&lt;br /&gt;public static void main(String args[])&lt;br /&gt;{&lt;br /&gt; // Accept up to 3 parameters&lt;br /&gt; String[] list = new String[3];&lt;br /&gt;&lt;br /&gt; int index = 0;&lt;br /&gt;&lt;br /&gt; while ( (index &lt; args.length) &amp;amp;&amp;amp; ( index &lt; 3 ) )&lt;br /&gt; {&lt;br /&gt;  list[index++] = args[index];&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; // Check all the parameters&lt;br /&gt; for (int i = 0; i &lt; list.length; i++)&lt;br /&gt; {&lt;br /&gt;  if (list[i].equals "-help")&lt;br /&gt;  {&lt;br /&gt;   // .........&lt;br /&gt;  }&lt;br /&gt;  else&lt;br /&gt;  if (list[i].equals "-cp")&lt;br /&gt;  {&lt;br /&gt;   // .........&lt;br /&gt;  }&lt;br /&gt;  // else .....&lt;br /&gt; } &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This code (while a contrived example), shows a common mistake. Under some circumstances, where the user enters three or more parameters, the code will run fine. If no parameters are entered, you'll get a NullPointerException at runtime. Sometimes your variables (the array of strings) will be initialized, and other times they won't. One easy solution is to check BEFORE you attempt to access a variable in an array that it is not equal to null.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;alternatively catch me at &lt;a href="http://blogs.sun.com/AnuragSharma"&gt; http://blogs.sun.com/AnuragSharma&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2589427789736403011-2697865469152707112?l=anuragsharma-sun.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AnuragSharmaSunCampusAmbassador/~4/aIcX5vHDPQY" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AnuragSharmaSunCampusAmbassador/~3/aIcX5vHDPQY/top-ten-errors-java-programmers-make.html</link><author>noreply@blogger.com (Anurag)</author><thr:total>0</thr:total><feedburner:origLink>http://anuragsharma-sun.blogspot.com/2009/01/top-ten-errors-java-programmers-make.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2589427789736403011.post-5711601552173005863</guid><pubDate>Sun, 18 Jan 2009 08:52:00 +0000</pubDate><atom:updated>2009-01-18T00:53:25.457-08:00</atom:updated><title>Dreams come true!!!</title><description>&lt;span class="Apple-style-span" style="color: rgb(34, 34, 34); font-family: 'Helvetica Neue'; font-size: 13px; line-height: 19px; "&gt;Hi,&lt;br /&gt;I have been recently hired as the &lt;b&gt;Sun Campus Ambassador&lt;/b&gt; of &lt;b&gt;KIIT-U, Bhubaneswar, India&lt;/b&gt;. Since the time I wrote my first Java program I was deeply affected by the simplicity of java yet its enormous potential, which slowly aroused my interest in knowing other Technology solutions from SUN.This growing interest led me to study &lt;b&gt;javaSE, javaEE, javaME&lt;/b&gt; etc. and successful completion of several projects based on these technologies.&lt;br /&gt;I felt overjoyed when I learnt that I have been selected as the next Campus Ambassador for my college, as now I can see a whole lot of opportunities to shape up my dreams about knowing the technology closely, have interaction with experts from round the globe, make friends world-wide who share common interest, same passion and zeal within like mine, opportunity to get certified directly by SUN, and of course a closer outlook of the working of a technology giant firm in corporate sector.&lt;br /&gt;Well appreciated and supported by friends and mates, I am making my way through materializing various activities for the betterment of students of our college by letting them know about the current cutting-edge technology and many other interesting activities.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;alternatively catch me at &lt;a href="http://blogs.sun.com/AnuragSharma"&gt; http://blogs.sun.com/AnuragSharma&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2589427789736403011-5711601552173005863?l=anuragsharma-sun.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AnuragSharmaSunCampusAmbassador/~4/bPF8nRPJTZg" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AnuragSharmaSunCampusAmbassador/~3/bPF8nRPJTZg/dreams-come-true.html</link><author>noreply@blogger.com (Anurag)</author><thr:total>0</thr:total><feedburner:origLink>http://anuragsharma-sun.blogspot.com/2009/01/dreams-come-true.html</feedburner:origLink></item></channel></rss>

