<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5857777128974553872</id><updated>2024-09-01T06:36:47.621-07:00</updated><title type='text'>Lets Have Fun</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sudiptalahapost.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5857777128974553872/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://sudiptalahapost.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Sudipta Kumar Laha</name><uri>http://www.blogger.com/profile/13441403410625666166</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrATPJUl0SncsXhbHeYR5g-Le2cXGBVTj6wyuC95xwwNXcj-64VOYrhYnTI_liHrH6zJDPn-7_ByvpNzYopxVyMdXbwPhI_C-8cDB9YqK0dgpbhPx1xYbgIfZ-3LDPVIU/s220/IMG_1058.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5857777128974553872.post-3910886489545765990</id><published>2016-12-07T08:09:00.000-08:00</published><updated>2016-12-07T08:09:50.310-08:00</updated><title type='text'>Reboot to windows form linux-Only for once</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Follow the below steps to boot to windows when you are in Linux.&lt;br /&gt;
&lt;br /&gt;
1. check the entries in grub.cfg&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: &amp;quot;andale mono&amp;quot;, &amp;quot;lucida console&amp;quot;, monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; text-align: left; width: 100%;&quot;&gt;&lt;code&gt;[sudiptakumar_laha@symc Desktop]$ sudo grep &#39;^menuentry&#39; /boot/grub2/grub.cfg
menuentry &#39;CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)&#39; --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option &#39;gnulinux-3.10.0-327.el7.x86_64-advanced-e138508e-48ed-4b19-9bcc-446bbfa2da86&#39; {
menuentry &#39;CentOS Linux (0-rescue-a962980d35964ca6aa2a4d23e8f02266) 7 (Core)&#39; --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option &#39;gnulinux-0-rescue-a962980d35964ca6aa2a4d23e8f02266-advanced-e138508e-48ed-4b19-9bcc-446bbfa2da86&#39; {
menuentry &quot;Windows 7&quot; {
&lt;/code&gt;
&lt;/pre&gt;
&lt;br /&gt;
2. Here we see windows 7 is the 3nd meny entry and the index is 2 starting from 0. Hence sent grup-reboot 2&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: &amp;quot;andale mono&amp;quot;, &amp;quot;lucida console&amp;quot;, monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; text-align: left; width: 100%;&quot;&gt;&lt;code&gt;
[sudiptakumar_laha@symc Desktop]$ sudo grub2-reboot 2
&lt;/code&gt;
&lt;/pre&gt;
&lt;br /&gt;
3. Now reboot your computer.&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: &amp;quot;andale mono&amp;quot;, &amp;quot;lucida console&amp;quot;, monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; text-align: left; width: 100%;&quot;&gt;&lt;code&gt;
[sudiptakumar_laha@symc Desktop]$ sudo reboot
&lt;/code&gt;
&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://sudiptalahapost.blogspot.com/feeds/3910886489545765990/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudiptalahapost.blogspot.com/2016/12/reboot-to-windows-form-linux-only-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5857777128974553872/posts/default/3910886489545765990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5857777128974553872/posts/default/3910886489545765990'/><link rel='alternate' type='text/html' href='http://sudiptalahapost.blogspot.com/2016/12/reboot-to-windows-form-linux-only-for.html' title='Reboot to windows form linux-Only for once'/><author><name>Sudipta Kumar Laha</name><uri>http://www.blogger.com/profile/13441403410625666166</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrATPJUl0SncsXhbHeYR5g-Le2cXGBVTj6wyuC95xwwNXcj-64VOYrhYnTI_liHrH6zJDPn-7_ByvpNzYopxVyMdXbwPhI_C-8cDB9YqK0dgpbhPx1xYbgIfZ-3LDPVIU/s220/IMG_1058.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5857777128974553872.post-8324818742342924575</id><published>2016-07-17T00:49:00.001-07:00</published><updated>2016-07-17T00:49:13.651-07:00</updated><title type='text'>Elasticsearch -Part 1</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Brief of elasticsearch&lt;/h3&gt;
Elastic search organizes your data &amp;nbsp;a makes it available for online searching.&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Similar products:&lt;/h3&gt;
&lt;div&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Apache Lucene&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Installation prerequisites:&lt;/h3&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;A virtual machine with Linux installed. &amp;nbsp;One of the option may be to use oracle virtual box(&lt;a href=&quot;https://www.virtualbox.org/wiki/Downloads&quot;&gt;https://www.virtualbox.org/wiki/Downloads&lt;/a&gt;) and &amp;nbsp;and Ubuntu 16(&lt;a href=&quot;http://www.ubuntu.com/download/desktop&quot;&gt;http://www.ubuntu.com/download/desktop&lt;/a&gt;) installed. All are available for free.&lt;/li&gt;
&lt;li&gt;Download elaticsearch tar from the url &lt;a href=&quot;https://www.elastic.co/downloads/elasticsearch&quot;&gt;https://www.elastic.co/downloads/elasticsearch&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Installation instructions:&lt;/h3&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Create a directory /elaticsearch &amp;nbsp;and copy&amp;nbsp;elasticsearch-2.3.4.tar.gz &amp;nbsp;inside the directory.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cd /elasticsearch&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Extract the elasticserach contents &lt;code&gt;tar -xvf&amp;nbsp;elasticsearch-2.3.4.tar.gz&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
Starting elastic search&lt;/h2&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Go to the bin directory of the elaticsearch folderextracted folder &amp;nbsp;and execute the below command.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/elasticsearch&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
Verify elastic search install&lt;/h2&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Open your preferred browser&lt;/li&gt;
&lt;li&gt;Go to url &quot;&lt;a href=&quot;http://localhost:9200/?pretty&quot;&gt;http://localhost:9200/?pretty&lt;/a&gt;&quot; . If you see a proper response then elastic search is installed properly&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://sudiptalahapost.blogspot.com/feeds/8324818742342924575/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudiptalahapost.blogspot.com/2016/07/elasticsearch-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5857777128974553872/posts/default/8324818742342924575'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5857777128974553872/posts/default/8324818742342924575'/><link rel='alternate' type='text/html' href='http://sudiptalahapost.blogspot.com/2016/07/elasticsearch-part-1.html' title='Elasticsearch -Part 1'/><author><name>Sudipta Kumar Laha</name><uri>http://www.blogger.com/profile/13441403410625666166</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrATPJUl0SncsXhbHeYR5g-Le2cXGBVTj6wyuC95xwwNXcj-64VOYrhYnTI_liHrH6zJDPn-7_ByvpNzYopxVyMdXbwPhI_C-8cDB9YqK0dgpbhPx1xYbgIfZ-3LDPVIU/s220/IMG_1058.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5857777128974553872.post-1071479984249900180</id><published>2014-09-28T09:25:00.001-07:00</published><updated>2016-07-17T00:26:17.573-07:00</updated><title type='text'>Coding and Chatting- How they affect each other.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Today I choose to write this article based on my experience in past few years. Social networking sites are popular and people like to spend most of their time meeting new people and talking to them. One of the main thing people like to do is chatting, one of the easiest way to communicate with new and old friends. But the thing I am interested is how it affects the software professionals who write code.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;b style=&quot;color: #545454; line-height: 18.2000007629395px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;b style=&quot;color: #545454; line-height: 18.2000007629395px;&quot;&gt;Chatting&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;color: #545454;&quot;&gt;&lt;span style=&quot;line-height: 18.2000007629395px;&quot;&gt;may refer to any kind of communication over the Internet that offers a real-time transmission of text messages from sender to receiver. Its a&amp;nbsp;wonderful&amp;nbsp;technology to communicate with people. Most of us use a lot of&amp;nbsp;jargon&amp;nbsp;and short form of words to make it happen. There is nothing wrong in it, but we&amp;nbsp;generally&amp;nbsp;get&amp;nbsp;habituated&amp;nbsp;with this&amp;nbsp;short form of worlds (like Please -Pls etc). &amp;nbsp;This short form of words become&amp;nbsp;annoying&amp;nbsp;for a&amp;nbsp;software&amp;nbsp;professional when they write such words in software code. I personally have done the same mistake while&amp;nbsp;writing&amp;nbsp;log messages in professional code. As we are habituated with such words, they get a place in our logs messages/documentations. Also being&amp;nbsp;familiar&amp;nbsp;with such words, it become difficult to&amp;nbsp;review such code errors.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #545454; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 18.2000007629395px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #545454; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 18.2000007629395px;&quot;&gt;The conclusion is we stop using social networks. I am j&lt;b&gt;oking- &lt;/b&gt;That cant be true. But we need to be extra&amp;nbsp;careful&amp;nbsp;while&amp;nbsp;writing&amp;nbsp;code and should omit those newly created words. Being a software professional we may avoid using short forms of words while chatting and make our mind familiar with the correct words.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #545454; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 18.2000007629395px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #545454; font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 18.2000007629395px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #545454; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #545454; font-family: arial, helvetica, sans-serif; line-height: 18.2px;&quot;&gt;&lt;div data-class=&quot;affiliateAdsByFlipkart&quot; data-responsive=&quot;yes&quot; data-widgettype=&quot;featuredDeals&quot; data-wrid=&quot;WRID-146853153009848587&quot; height=&quot;250&quot; width=&quot;300&quot;&gt;
&lt;/div&gt;
&lt;script async=&quot;&quot; src=&quot;//affiliate.flipkart.com/affiliate/widgets/FKAffiliateWidgets.js&quot;&gt;&lt;/script&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://sudiptalahapost.blogspot.com/feeds/1071479984249900180/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudiptalahapost.blogspot.com/2014/09/coding-and-chatting-how-they-affect.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5857777128974553872/posts/default/1071479984249900180'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5857777128974553872/posts/default/1071479984249900180'/><link rel='alternate' type='text/html' href='http://sudiptalahapost.blogspot.com/2014/09/coding-and-chatting-how-they-affect.html' title='Coding and Chatting- How they affect each other.'/><author><name>Sudipta Kumar Laha</name><uri>http://www.blogger.com/profile/13441403410625666166</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrATPJUl0SncsXhbHeYR5g-Le2cXGBVTj6wyuC95xwwNXcj-64VOYrhYnTI_liHrH6zJDPn-7_ByvpNzYopxVyMdXbwPhI_C-8cDB9YqK0dgpbhPx1xYbgIfZ-3LDPVIU/s220/IMG_1058.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5857777128974553872.post-6467268453223361708</id><published>2011-07-03T00:30:00.000-07:00</published><updated>2011-07-03T01:30:26.191-07:00</updated><title type='text'>Win Vista PE+usb not recognized+ VMWARE</title><content type='html'>Hi,&lt;br /&gt;&lt;br /&gt;This is a solution i tried to make ghost copies with winPE in VMWare.&lt;br /&gt;Problem- &lt;br /&gt;It recognizes on the hard drive and not the USB devices. So I was unable to make the save the image from the ghost copy.&lt;br /&gt;&lt;br /&gt;Solution-&lt;br /&gt;   Make a copy of the  vmdk file  in the wmware folder and name it as xxxx_1.vmdk. In the vmware setting add a new Hard Drive with the new vmdk file(xxxx_1.vmdk). Boot the image with windows PE. Now it will show up 2 hard drives. So the image of the one hard drive can be saved to the other one. Once done shutdown the VM. Rename the two vmdk files. Boot the operating system with the new vmdk. Then the image can be transfered using FTP(or copying).&lt;br /&gt;&lt;br /&gt;Hope this may be helpful.&lt;br /&gt;&lt;br /&gt;&lt;iframe src=&quot;http://www.facebook.com/widgets/like.php?href=http://sudiptalahapost.blogspot.com/2010/06/java-program-to-list.html&quot;&lt;br /&gt; scrolling=&quot;no&quot; frameborder=&quot;0&quot;&lt;br /&gt;style=&quot;border:none;&quot; width=&quot;90px&quot; height=&quot;20px&quot;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudiptalahapost.blogspot.com/feeds/6467268453223361708/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudiptalahapost.blogspot.com/2011/07/win-vista-peusb-not-recognized-vmware.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5857777128974553872/posts/default/6467268453223361708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5857777128974553872/posts/default/6467268453223361708'/><link rel='alternate' type='text/html' href='http://sudiptalahapost.blogspot.com/2011/07/win-vista-peusb-not-recognized-vmware.html' title='Win Vista PE+usb not recognized+ VMWARE'/><author><name>Sudipta Kumar Laha</name><uri>http://www.blogger.com/profile/13441403410625666166</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrATPJUl0SncsXhbHeYR5g-Le2cXGBVTj6wyuC95xwwNXcj-64VOYrhYnTI_liHrH6zJDPn-7_ByvpNzYopxVyMdXbwPhI_C-8cDB9YqK0dgpbhPx1xYbgIfZ-3LDPVIU/s220/IMG_1058.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5857777128974553872.post-2429885438707209325</id><published>2011-06-25T01:18:00.001-07:00</published><updated>2011-06-25T01:19:57.273-07:00</updated><title type='text'>Updating/Refreshing a dojo Tree</title><content type='html'>A dojo tree can be reloaded or refreshed with the below code.&lt;br /&gt;&lt;pre style=&quot;font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%&quot;&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt; &lt;br /&gt; &amp;lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;dojo-release-1.6.0/dojo/resources/dojo.css&quot; /&amp;gt;&lt;br /&gt; &amp;lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;dojo-release-1.6.0/dijit/themes/tundra/tundra.css&quot; /&amp;gt;&lt;br /&gt; &amp;lt;script src=&quot;dojo-release-1.6.0/dojo/dojo.js&quot; language=&quot;javascript&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt; &amp;lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&amp;gt;  &lt;br /&gt;  dojo.require(&quot;dojo.parser&quot;);&lt;br /&gt;  dojo.require(&quot;dijit.form.Button&quot;);&lt;br /&gt;  dojo.require(&quot;dijit.Tree&quot;);&lt;br /&gt;  dojo.require(&quot;dijit.tree.ForestStoreModel&quot;);&lt;br /&gt;  dojo.require(&quot;dojo.data.ItemFileWriteStore&quot;);&lt;br /&gt;        var treeModel;&lt;br /&gt; &amp;lt;/script&amp;gt;&lt;br /&gt; &amp;lt;script&amp;gt;&lt;br /&gt;  function reload(){&lt;br /&gt;   if(dijit.byId(&quot;treeOne&quot;)){&lt;br /&gt;    // Destroy the widget&lt;br /&gt;    dijit.byId(&quot;treeOne&quot;).destroyRecursive();&lt;br /&gt;   }&lt;br /&gt;   var store = new dojo.data.ItemFileWriteStore({&lt;br /&gt;      url: &quot;./json/files.json&quot;&lt;br /&gt;     });&lt;br /&gt;     &lt;br /&gt;   treeModel = new dijit.tree.ForestStoreModel({&lt;br /&gt;    store: store,&lt;br /&gt;    query: {&lt;br /&gt;     &quot;type&quot;: &quot;Folder&quot;&lt;br /&gt;    },&lt;br /&gt;    rootId: &quot;server&quot;,&lt;br /&gt;    rootLabel: &quot;ROOT&quot;,&lt;br /&gt;    childrenAttrs: [&quot;children&quot;],&lt;br /&gt;   });&lt;br /&gt;   document.getElementById(&quot;treespan&quot;).innerHTML=&quot;&amp;lt;div id=&#39;treeOne&#39;&amp;gt;&amp;lt;/div&amp;gt;&quot;&lt;br /&gt;   new dijit.Tree({&lt;br /&gt;    model: treeModel,&lt;br /&gt;   },&lt;br /&gt;   &quot;treeOne&quot;);&lt;br /&gt;  }&lt;br /&gt; &amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body class=&quot;tundra&quot;&amp;gt;&lt;br /&gt; &amp;lt;button dojoType=&quot;dijit.form.Button&quot; type=&quot;button&quot; onClick=&quot;reload()&quot; &amp;gt;Load Tree&amp;lt;/button&amp;gt;&lt;br /&gt; &amp;lt;span id=&quot;treespan&quot;&amp;gt;&amp;lt;/span&amp;gt; &lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe src=&quot;http://www.facebook.com/widgets/like.php?href=http://sudiptalahapost.blogspot.com/2010/06/java-program-to-list.html&quot;&lt;br /&gt; scrolling=&quot;no&quot; frameborder=&quot;0&quot;&lt;br /&gt;style=&quot;border:none;&quot; width=&quot;90px&quot; height=&quot;20px&quot;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudiptalahapost.blogspot.com/feeds/2429885438707209325/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudiptalahapost.blogspot.com/2011/06/updatingrefreshing-dojo-tree.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5857777128974553872/posts/default/2429885438707209325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5857777128974553872/posts/default/2429885438707209325'/><link rel='alternate' type='text/html' href='http://sudiptalahapost.blogspot.com/2011/06/updatingrefreshing-dojo-tree.html' title='Updating/Refreshing a dojo Tree'/><author><name>Sudipta Kumar Laha</name><uri>http://www.blogger.com/profile/13441403410625666166</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrATPJUl0SncsXhbHeYR5g-Le2cXGBVTj6wyuC95xwwNXcj-64VOYrhYnTI_liHrH6zJDPn-7_ByvpNzYopxVyMdXbwPhI_C-8cDB9YqK0dgpbhPx1xYbgIfZ-3LDPVIU/s220/IMG_1058.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5857777128974553872.post-7094220099992615042</id><published>2011-06-25T00:47:00.001-07:00</published><updated>2011-06-25T02:07:15.542-07:00</updated><title type='text'>Back Track a dojo Tree</title><content type='html'>If we have a tree node of dojo tree we can back track the tree using the below code.&lt;br /&gt;&lt;br /&gt;Once we get a tree node of the dojo tree(for Right click/click), we can find out the root node of the tree .&lt;br /&gt;We get the values of the nodes from the datastore that was used to create the tree.&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%&quot;&gt;&lt;code&gt;&lt;br /&gt; var tn =dijit.getEnclosingWidget(e.target);&lt;br /&gt;   &lt;br /&gt; while(parent.indent &gt;0){&lt;br /&gt;  // get the value from the nodes from the data store&lt;br /&gt;  console.debug(store.getValue(parent.item, &#39;name&#39;));&lt;br /&gt;  parent=parent.getParent();&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe src=&quot;http://www.facebook.com/widgets/like.php?href=http://sudiptalahapost.blogspot.com/2010/06/java-program-to-list.html&quot;&lt;br /&gt; scrolling=&quot;no&quot; frameborder=&quot;0&quot;&lt;br /&gt;style=&quot;border:none;&quot; width=&quot;90px&quot; height=&quot;20px&quot;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudiptalahapost.blogspot.com/feeds/7094220099992615042/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudiptalahapost.blogspot.com/2011/06/back-track-dojo-tree.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5857777128974553872/posts/default/7094220099992615042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5857777128974553872/posts/default/7094220099992615042'/><link rel='alternate' type='text/html' href='http://sudiptalahapost.blogspot.com/2011/06/back-track-dojo-tree.html' title='Back Track a dojo Tree'/><author><name>Sudipta Kumar Laha</name><uri>http://www.blogger.com/profile/13441403410625666166</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrATPJUl0SncsXhbHeYR5g-Le2cXGBVTj6wyuC95xwwNXcj-64VOYrhYnTI_liHrH6zJDPn-7_ByvpNzYopxVyMdXbwPhI_C-8cDB9YqK0dgpbhPx1xYbgIfZ-3LDPVIU/s220/IMG_1058.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5857777128974553872.post-7349929464029936891</id><published>2010-09-14T09:00:00.000-07:00</published><updated>2010-09-14T09:18:09.215-07:00</updated><title type='text'>Running JBOSS Programmatically from java</title><content type='html'>Please find below code to run JBOSS Programmatically from JAVA. Please include jboss jars in your classpath.&lt;br /&gt;&lt;br /&gt;I tested the following code for JBOSS-6.0.0.M2&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%&quot;&gt;&lt;code&gt;&lt;br /&gt;package com.sudipta.jboss.conf;&lt;br /&gt;&lt;br /&gt;import org.jboss.Main;&lt;br /&gt;&lt;br /&gt;public class JbossOperation {&lt;br /&gt;    public static Main ob;&lt;br /&gt;    static Class jbossMain;&lt;br /&gt;    static{&lt;br /&gt;        try {&lt;br /&gt;            jbossMain=Class.forName(&amp;quot;org.jboss.Main&amp;quot;);&lt;br /&gt;            ob = (Main)jbossMain.newInstance();&lt;br /&gt;        } catch (ClassNotFoundException e) {&lt;br /&gt;            e.printStackTrace();&lt;br /&gt;        } catch (InstantiationException e) {&lt;br /&gt;            e.printStackTrace();&lt;br /&gt;        } catch (IllegalAccessException e) {&lt;br /&gt;            e.printStackTrace();&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    /**&lt;br /&gt;     * START JBOSS SERVER&lt;br /&gt;     * @return true if started successfully&lt;br /&gt;     */&lt;br /&gt;    public static boolean startServer(){&lt;br /&gt;        boolean status=true;&lt;br /&gt;        &lt;br /&gt;        String str[]={&amp;quot;-c&amp;quot;,&amp;quot;default&amp;quot;};            &lt;br /&gt;        try {&lt;br /&gt;            ob.boot(str);&lt;br /&gt;            &lt;br /&gt;        } catch (Exception e) {            &lt;br /&gt;            e.printStackTrace();&lt;br /&gt;            return false;&lt;br /&gt;        }        &lt;br /&gt;        return status;&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    /**&lt;br /&gt;     * STOP JBOSS SERVER&lt;br /&gt;     * @return true if started successfully&lt;br /&gt;     */&lt;br /&gt;    public static boolean stopServer(){&lt;br /&gt;        boolean status=true;        &lt;br /&gt;        try {&lt;br /&gt;            ob.shutdown();            &lt;br /&gt;        } catch (Throwable e) {            &lt;br /&gt;            e.printStackTrace();&lt;br /&gt;        }                &lt;br /&gt;        &lt;br /&gt;        return status;&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    /**&lt;br /&gt;     * Main method&lt;br /&gt;     * @param args&lt;br /&gt;     */&lt;br /&gt;    public static void main(String args[]){&lt;br /&gt;        System.out.println(&amp;quot;---------------------Strating the server------------------&amp;quot;);&lt;br /&gt;        startServer();&lt;br /&gt;        System.out.println(&amp;quot;---------------------Stoping the server------------------&amp;quot;);&lt;br /&gt;        stopServer();&lt;br /&gt;        System.out.println(&amp;quot;---------------------SERVER STOPPED------------------&amp;quot;);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe src=&quot;http://www.facebook.com/widgets/like.php?href=http://sudiptalahapost.blogspot.com/2010/06/java-program-to-list.html&quot;&lt;br /&gt; scrolling=&quot;no&quot; frameborder=&quot;0&quot;&lt;br /&gt;style=&quot;border:none;&quot; width=&quot;90px&quot; height=&quot;20px&quot;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudiptalahapost.blogspot.com/feeds/7349929464029936891/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudiptalahapost.blogspot.com/2010/09/running-jboss-programatically-from-java.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5857777128974553872/posts/default/7349929464029936891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5857777128974553872/posts/default/7349929464029936891'/><link rel='alternate' type='text/html' href='http://sudiptalahapost.blogspot.com/2010/09/running-jboss-programatically-from-java.html' title='Running JBOSS Programmatically from java'/><author><name>Sudipta Kumar Laha</name><uri>http://www.blogger.com/profile/13441403410625666166</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrATPJUl0SncsXhbHeYR5g-Le2cXGBVTj6wyuC95xwwNXcj-64VOYrhYnTI_liHrH6zJDPn-7_ByvpNzYopxVyMdXbwPhI_C-8cDB9YqK0dgpbhPx1xYbgIfZ-3LDPVIU/s220/IMG_1058.JPG'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5857777128974553872.post-4239750994200890890</id><published>2010-06-08T11:02:00.001-07:00</published><updated>2010-09-09T13:37:01.758-07:00</updated><title type='text'>Java Program to List the Directories,SubDirectories and Files in them</title><content type='html'>&lt;pre style=&quot;font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%&quot;&gt;&lt;code&gt;import java.io.File;&lt;br /&gt;&lt;br /&gt;import java.io.FileWriter;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;import java.util.Arrays;&lt;br /&gt;import java.util.Comparator;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * List the Directories, SubDirection and Files in them&lt;br /&gt; * @author Sudipta Kumar Laha&lt;br /&gt; *&lt;br /&gt; */&lt;br /&gt;public class FileStructure {&lt;br /&gt;    /**&lt;br /&gt;     * Print Directories, SubDirection and Files in them&lt;br /&gt;     * @param str&lt;br /&gt;     * &lt;br /&gt;     */&lt;br /&gt;    public void getFiles(String str){&lt;br /&gt;        System.out.println(&amp;quot;[D]\t&amp;quot;+str);&lt;br /&gt;        File f=new File(str);&lt;br /&gt;        File ss[]=f.listFiles();&lt;br /&gt;        &lt;br /&gt;&lt;br /&gt;        if(ss!=null){&lt;br /&gt;            Arrays.sort(ss, new sortStructure());&lt;br /&gt;            for(int i=0;i&amp;lt;ss.length;i++){&lt;br /&gt;                if(ss[i].isDirectory()){    &lt;br /&gt;                    String currDir=ss[i].getAbsolutePath();&lt;br /&gt;                    System.out.println(&amp;quot;Total File &amp;amp; Directory &amp;quot;+ss.length);&lt;br /&gt;                    this.getFiles(currDir);&lt;br /&gt;                }else{                    &lt;br /&gt;                    System.out.println(&amp;quot;[F]\t&amp;quot;&lt;br /&gt;                            +getPermissions(ss[i].canRead(),ss[i].canWrite(),ss[i].canExecute())+&lt;br /&gt;                            &amp;quot;\t&amp;quot;+                            &lt;br /&gt;                            ss[i].getName());&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }else{            &lt;br /&gt;            System.out.println(&amp;quot;Unable to read&amp;quot;);&lt;br /&gt;        }&lt;br /&gt;    &lt;br /&gt;    }&lt;br /&gt;    /**&lt;br /&gt;     * Checks for the access in files&lt;br /&gt;     * @param canRead&lt;br /&gt;     * @param canWrite&lt;br /&gt;     * @param canExecute&lt;br /&gt;     * @return &lt;br /&gt;     */&lt;br /&gt;    private String getPermissions(boolean canRead, boolean canWrite,&lt;br /&gt;            boolean canExecute) {&lt;br /&gt;        StringBuffer buff=new StringBuffer();&lt;br /&gt;        if(canRead)&lt;br /&gt;            buff.append(&amp;quot;r&amp;quot;);&lt;br /&gt;        else&lt;br /&gt;            buff.append(&amp;quot;-&amp;quot;);&lt;br /&gt;        if(canWrite)&lt;br /&gt;            buff.append(&amp;quot;w&amp;quot;);&lt;br /&gt;        else&lt;br /&gt;            buff.append(&amp;quot;-&amp;quot;);&lt;br /&gt;        if(canExecute)&lt;br /&gt;            buff.append(&amp;quot;e&amp;quot;);&lt;br /&gt;        else&lt;br /&gt;            buff.append(&amp;quot;-&amp;quot;);&lt;br /&gt;        return buff.toString();&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    /**&lt;br /&gt;     * Start of Program&lt;br /&gt;     * @param args&lt;br /&gt;     */&lt;br /&gt;    public static void main(String args[]){&lt;br /&gt;        FileStructure obj=new FileStructure();&lt;br /&gt;        obj.getFiles(args[0]);&lt;br /&gt;        &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * Class extends comparator to sort files and directories&lt;br /&gt; * @author Sudipta Kumar Laha&lt;br /&gt; *&lt;br /&gt; */&lt;br /&gt;class sortStructure implements Comparator&amp;lt;File&amp;gt;{&lt;br /&gt;    @Override&lt;br /&gt;    public int compare(File o1, File o2) {&lt;br /&gt;        // TODO Auto-generated method stub&lt;br /&gt;        if(o1.isDirectory() &amp;amp;&amp;amp; o2.isDirectory()){&lt;br /&gt;            return o1.getName().compareTo(o1.getName());&lt;br /&gt;        }else if(o1.isFile() &amp;amp;&amp;amp; o2.isFile())&lt;br /&gt;            return o1.getName().compareTo(o1.getName());&lt;br /&gt;        else if(o1.isDirectory())&lt;br /&gt;            return 1;&lt;br /&gt;        else&lt;br /&gt;            return 0;&lt;br /&gt;    }    &lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe src=&quot;http://www.facebook.com/widgets/like.php?href=http://sudiptalahapost.blogspot.com/2010/06/java-program-to-list.html&quot;&lt;br /&gt; scrolling=&quot;no&quot; frameborder=&quot;0&quot;&lt;br /&gt;style=&quot;border:none;&quot; width=&quot;90px&quot; height=&quot;20px&quot;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudiptalahapost.blogspot.com/feeds/4239750994200890890/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudiptalahapost.blogspot.com/2010/06/java-program-to-list.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5857777128974553872/posts/default/4239750994200890890'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5857777128974553872/posts/default/4239750994200890890'/><link rel='alternate' type='text/html' href='http://sudiptalahapost.blogspot.com/2010/06/java-program-to-list.html' title='Java Program to List the Directories,SubDirectories and Files in them'/><author><name>Sudipta Kumar Laha</name><uri>http://www.blogger.com/profile/13441403410625666166</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrATPJUl0SncsXhbHeYR5g-Le2cXGBVTj6wyuC95xwwNXcj-64VOYrhYnTI_liHrH6zJDPn-7_ByvpNzYopxVyMdXbwPhI_C-8cDB9YqK0dgpbhPx1xYbgIfZ-3LDPVIU/s220/IMG_1058.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5857777128974553872.post-7781197163130893425</id><published>2010-05-08T02:44:00.001-07:00</published><updated>2010-09-09T13:22:21.895-07:00</updated><title type='text'>Seraching in Arrays in JAVA</title><content type='html'>&lt;div&gt;We can search in a array for a value using the method binarySearch of Arrays class.&lt;/div&gt;&lt;div&gt;The search result will give correct output if the array is sorted.&lt;/div&gt;&lt;div&gt;If the array is not sorted the result is unpredictable.&lt;/div&gt;&lt;div&gt;Note: For predictable result array must be sorted before searching an element.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The following code explains this behavior:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%&quot;&gt;&lt;code&gt;Integer[] intArr={2,5,3,4,1};&lt;br /&gt; for(Integer s: intArr)&lt;br /&gt;   System.out.print(s+&amp;quot;,&amp;quot;);&lt;br /&gt;&lt;br /&gt; System.out.print(System.lineSeparator());&lt;br /&gt; System.out.print(&amp;quot;Searching 5:&amp;quot;+Arrays.binarySearch(intArr,5));    // Will return -6 which is incorrect&lt;br /&gt; System.out.print(System.lineSeparator());&lt;br /&gt; System.out.print(&amp;quot;Searching 2:&amp;quot;+Arrays.binarySearch(intArr,2));    // will return correct result 0, but not for every search&lt;br /&gt;&lt;br /&gt; Arrays.sort(intArr);         //Sorting the Array&lt;br /&gt; System.out.print(System.lineSeparator());&lt;br /&gt; for(Integer s: intArr)&lt;br /&gt;   System.out.print(s+&amp;quot;,&amp;quot;);&lt;br /&gt; System.out.println(System.lineSeparator()+Arrays.binarySearch(intArr,2));  // Always gives the correct result&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe src=&quot;http://www.facebook.com/widgets/like.php?href=http://sudiptalahapost.blogspot.com/2010/05/seraching-in-arrays.html&quot;&lt;br /&gt; scrolling=&quot;no&quot; frameborder=&quot;0&quot;&lt;br /&gt;style=&quot;border:none;&quot; width=&quot;90px&quot; height=&quot;20px&quot;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudiptalahapost.blogspot.com/feeds/7781197163130893425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudiptalahapost.blogspot.com/2010/05/seraching-in-arrays.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5857777128974553872/posts/default/7781197163130893425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5857777128974553872/posts/default/7781197163130893425'/><link rel='alternate' type='text/html' href='http://sudiptalahapost.blogspot.com/2010/05/seraching-in-arrays.html' title='Seraching in Arrays in JAVA'/><author><name>Sudipta Kumar Laha</name><uri>http://www.blogger.com/profile/13441403410625666166</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrATPJUl0SncsXhbHeYR5g-Le2cXGBVTj6wyuC95xwwNXcj-64VOYrhYnTI_liHrH6zJDPn-7_ByvpNzYopxVyMdXbwPhI_C-8cDB9YqK0dgpbhPx1xYbgIfZ-3LDPVIU/s220/IMG_1058.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5857777128974553872.post-4721020720456652943</id><published>2010-05-08T02:43:00.001-07:00</published><updated>2010-09-09T13:23:41.772-07:00</updated><title type='text'>equals method in JAVA</title><content type='html'>&lt;div&gt;equals method of Object class and String class&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Consider the below code&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;pre style=&quot;font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%&quot;&gt;&lt;code&gt;myClass obj1=new myClass();&lt;br /&gt;myClass obj2=new myClass();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;String str1=new String(&amp;quot;AAAA&amp;quot;);&lt;br /&gt;String str2=new String(&amp;quot;AAAA&amp;quot;);&lt;br /&gt;&lt;br /&gt;System.out.println(obj1.equals(obj2));&lt;br /&gt;System.out.println(str1.equals(str2));&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;OUTPUT:&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size:x-small;&quot;&gt;false&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size:x-small;&quot;&gt;true&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In both the cases two objects were created but for Strings the result is true and for myClass object the result is false.&lt;/div&gt;&lt;div&gt;The reason for this is&lt;/div&gt;&lt;div&gt;In object class the equals method compares the references and returns true if the references are point to the same object.&lt;/div&gt;&lt;div&gt;But in String class the equals method is overridden to check the values of the string object so it returns true.&lt;/div&gt;&lt;br /&gt;&lt;iframe src=&quot;http://www.facebook.com/widgets/like.php?href=http://sudiptalahapost.blogspot.com/2010/05/equal-method.html&amp;amp;layout=button_count&quot;&lt;br /&gt; scrolling=&quot;no&quot; frameborder=&quot;0&quot;&lt;br /&gt;style=&quot;border:none;&quot; width=&quot;50px&quot; height=&quot;25px&quot;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://sudiptalahapost.blogspot.com/feeds/4721020720456652943/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sudiptalahapost.blogspot.com/2010/05/equal-method.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5857777128974553872/posts/default/4721020720456652943'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5857777128974553872/posts/default/4721020720456652943'/><link rel='alternate' type='text/html' href='http://sudiptalahapost.blogspot.com/2010/05/equal-method.html' title='equals method in JAVA'/><author><name>Sudipta Kumar Laha</name><uri>http://www.blogger.com/profile/13441403410625666166</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrATPJUl0SncsXhbHeYR5g-Le2cXGBVTj6wyuC95xwwNXcj-64VOYrhYnTI_liHrH6zJDPn-7_ByvpNzYopxVyMdXbwPhI_C-8cDB9YqK0dgpbhPx1xYbgIfZ-3LDPVIU/s220/IMG_1058.JPG'/></author><thr:total>2</thr:total></entry></feed>