<?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: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-7790123389411327331</id><updated>2012-02-16T08:54:23.512-08:00</updated><category term='search engine'/><category term='inspire'/><category term='yahoo'/><category term='Math'/><category term='courses'/><category term='cloud'/><category term='java'/><category term='Algorithms'/><category term='contests'/><category term='singleton'/><title type='text'>Just another Programmer</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>38</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-417659761422973910</id><published>2011-04-25T01:49:00.000-07:00</published><updated>2011-04-25T01:51:53.749-07:00</updated><title type='text'>0.999..... equals 1</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/-mWCkjXGfSlA/TbU2EGgD2II/AAAAAAAABt8/QIoWCHIuUpg/s1600/47e0d646891053c1f3b41fa8c81b6ebb.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 177px; height: 112px;" src="http://3.bp.blogspot.com/-mWCkjXGfSlA/TbU2EGgD2II/AAAAAAAABt8/QIoWCHIuUpg/s320/47e0d646891053c1f3b41fa8c81b6ebb.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5599441155797538946" /&gt;&lt;/a&gt;&lt;br /&gt;see - &lt;a href="http://en.wikipedia.org/wiki/0.999.."&gt;http://en.wikipedia.org/wiki/0.999..&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-417659761422973910?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/417659761422973910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2011/04/0999-equals-1.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/417659761422973910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/417659761422973910'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2011/04/0999-equals-1.html' title='0.999..... equals 1'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-mWCkjXGfSlA/TbU2EGgD2II/AAAAAAAABt8/QIoWCHIuUpg/s72-c/47e0d646891053c1f3b41fa8c81b6ebb.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-2191880466577028131</id><published>2010-09-14T10:45:00.000-07:00</published><updated>2010-09-14T10:48:36.831-07:00</updated><title type='text'>Visual Studio shortcuts</title><content type='html'>Some of the shortcuts which are extremely necessary !&lt;br /&gt;&lt;br /&gt;Ctrl + ] - for matching brackets&lt;br /&gt;Shift + alt + enter for maximizing the code window to fullscreen.&lt;br /&gt;Ctrl + tab to shift across code files&lt;br /&gt;Ctrl+f3 - go to definition ( class or method)&lt;br /&gt;Also Ctrl-K + Ctrl-C or Ctrl-K + Ctrl-U to comment and uncomment code is a great one.&lt;br /&gt;Ctrl k + ctrl F for auto indenting code&lt;br /&gt;&lt;br /&gt;Download the poster available in this msdn link which has a poster containing all essential shortcuts. This will be handy for any visual studio developer.&lt;br /&gt;&lt;a href=" http://www.microsoft.com/downloads/en/details.aspx?familyid=255b8cf1-f6bd-4b55-bb42-dd1a69315833&amp;displaylang=en"&gt;download link&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;cheers!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-2191880466577028131?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/2191880466577028131/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2010/09/visual-studio-shortcuts.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/2191880466577028131'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/2191880466577028131'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2010/09/visual-studio-shortcuts.html' title='Visual Studio shortcuts'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-3727057864247913800</id><published>2010-08-28T15:07:00.000-07:00</published><updated>2010-08-28T15:16:25.161-07:00</updated><title type='text'>When things go completely right - there is something wrong somewhere</title><content type='html'>Things never go the way you want. This hypothesis is  nearly always true. But to me - "when things go more than what you want there is some problem somewhere".&lt;br /&gt;&lt;br /&gt;I have changed my job and joined THE big software firm. As always , the problem with the big firm is 'process'. Everything has its own process and so every thing , be it an request or suggestion, the turn around time is usually large. Adding to this, the release cycle is in its near end , and I am left with no work. Idle for more than a month , I decided to go ahead with implementing some challenging stuff. &lt;br /&gt;&lt;br /&gt;As my interest in machine learning and information retrieval is growing like an exponential upward curve , I decided to do "text classification".  The algorithm classifies the given text into some category. Given a web page / document it classifies them automatically into some topics , say news , sports , religion or celebrities or anything.   &lt;br /&gt;&lt;br /&gt;Its basically a machine learning algorithm. It creates or generates a learning function from the training data. Using this learning function , we classify the test data into one of the categories.  I went ahead implementing the naïve bayes classification algorithm as prescribed in Information Retrieval text book. My aim is to build the prototype first and then do extensive tuning and find some important information which improved the classifier accuracy. When am building the prototype , I started reading papers online to see how we can tune this algorithm. My major interest is in finding some better tuning algorithm. But what happened is a miracle. ..&lt;br /&gt;&lt;br /&gt;As always , I don’t normally make programming errors  and the code is running the first time. Guess what , I felt the fundamental model very simple ,and have implemented the tuning stuff also.  After the program ran ,results were weird . The accuracy rate is below 40%. I couldn’t spot the error. After struggling considerable amount of time , I decided , ok this is not going to work and just for the sake of it I removed the extra tuning algorithm and ran the simple one. And there it is 100% accurate classification.  I wasn’t happy. I didn’t jump in the air because its 100%. I am quite sure , classification algorithms cant predict them accurately that too 100%. This is one of the moments where scoring an 100 is not good. If you score an hundred ,it could be almost sure that this is due to some programming bug. Adding to my woes, I have removed my so called tuning algorithm. It has defeated my very purpose of doing this project which is to find some heuristics on top of the existing one. disappointed. I realized - " not always scoring an 100 is good" . All the effort , its gives 100% accuracy after having implemented the simple model. Now how do I get the enthusiasm to work and learn complex algorithms. Simple one did everything it has to do. Dejected. Felt something wrong , something fundamentally wrong. &lt;br /&gt;&lt;br /&gt;Then started thinking why its 100%. How come it could predict so accurately.  The problem is , I have to test with large number of test cases. All my carefully selected test-cases did the trick somehow. Finally I tested the whole program with more number of test cases, and I got the accuracy down to 92%. Happy ! Delighted. Because I believe this is the right number and also because it makes me work on advanced heuristics algorithm to increase the classifier accuracy. &lt;br /&gt;&lt;br /&gt;One moment where it exceeded my expectations , still I wasn’t happy with what I got ! Expectations - achieve more or less - there is some problem somewhere ! Now that its 92% , it gives me the greatest opportunity to explore advanced methods and heuristics to go towards 100% ! I never want to reach the ultimate 100 , as it will cease my opportunities to learn more. There should always be another mile stone !&lt;br /&gt;&lt;br /&gt;note:&lt;br /&gt;&lt;br /&gt;information retrieval book is avaialble here &lt;a href="http://nlp.stanford.edu/IR-book/pdf/irbookonlinereading.pdf"&gt;link&lt;/a&gt;&lt;br /&gt;this is actually done , by taking details from the assignment given at stanford for IR course - &lt;a href="http://www.stanford.edu/class/cs276/handouts/pe2-2009.pdf"&gt;link&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-3727057864247913800?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/3727057864247913800/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2010/08/when-things-go-completely-right-there.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/3727057864247913800'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/3727057864247913800'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2010/08/when-things-go-completely-right-there.html' title='When things go completely right - there is something wrong somewhere'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-4016002275925880705</id><published>2010-08-20T05:47:00.000-07:00</published><updated>2010-09-19T12:31:54.394-07:00</updated><title type='text'>Interests: You got to find what you really want to do!</title><content type='html'>I have spent number of days deciding what I truly want to do. I have decided my domain of work will be search , search advertising which involves information retrieval , machine learning and statistical models. so here it is...&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Information retrieval&lt;br /&gt;&lt;br /&gt; Index construction and compression&lt;br /&gt; Boolean and probabilistic retrieval models - BPT&lt;br /&gt; Vector space model - Linear algebra&lt;br /&gt; Scoring and ranking in search system&lt;br /&gt; Evaluation and feedback systems&lt;br /&gt; Text classification and categorization&lt;br /&gt; Web search additional challenges&lt;br /&gt;&lt;br /&gt;Machine learning (Tom Mitchell)&lt;br /&gt;&lt;br /&gt; Decision Tree Learning &lt;br /&gt; Artificial Neural Networks &lt;br /&gt; Bayesian Learning &lt;br /&gt; Instance-Based Learning &lt;br /&gt; Genetic Algorithms &lt;br /&gt; Learning Sets of Rules &lt;br /&gt; Analytical Learning &lt;br /&gt; Reinforcement Learning &lt;br /&gt;&lt;br /&gt;Graph theory&lt;br /&gt;&lt;br /&gt; Enumeration&lt;br /&gt; Path problems &lt;br /&gt; Coloring , covering and partitioning&lt;br /&gt; Network flow&lt;br /&gt; Properties and different graphs &lt;br /&gt;&lt;br /&gt;Game theory&lt;br /&gt;Optimization&lt;br /&gt;Natural language processing&lt;br /&gt;Data mining&lt;br /&gt;&lt;br /&gt;Mathematics&lt;br /&gt;&lt;br /&gt; Probability and statistics&lt;br /&gt; Discrete mathematics&lt;br /&gt; Linear algebra&lt;br /&gt; calculus&lt;br /&gt;&lt;br /&gt;Algorithms and Data structures&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I feel lucky to have identified my areas of interest. Currently I am reading IR and going to follow up with machine learning and statistics.&lt;br /&gt;&lt;br /&gt;Have some good knowledege in algorithms and graph theory.&lt;br /&gt;These are more related to web , search and information retrieval and audience intelligence algorithms. &lt;br /&gt;&lt;br /&gt;I wish I keep getting opportunities to work on these areas all through my career and I want to touch every topic in this in the near future! Right now , am doing Vector space models and text classification algorithms in IR&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-4016002275925880705?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/4016002275925880705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2010/08/interests-you-got-to-find-what-you.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/4016002275925880705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/4016002275925880705'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2010/08/interests-you-got-to-find-what-you.html' title='Interests: You got to find what you really want to do!'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-1640925584618909069</id><published>2010-08-19T13:47:00.000-07:00</published><updated>2010-08-19T13:49:16.200-07:00</updated><title type='text'>distance formula : a picture is worth thousand words.</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_HPHOFFg9BEQ/TG2YsXdy9-I/AAAAAAAABfw/pcQtU1Jmvh8/s1600/distance_formula_pythagoras.gif"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 94px;" src="http://3.bp.blogspot.com/_HPHOFFg9BEQ/TG2YsXdy9-I/AAAAAAAABfw/pcQtU1Jmvh8/s320/distance_formula_pythagoras.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5507225807324641250" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;There are no dumb questions&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-1640925584618909069?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/1640925584618909069/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2010/08/distance-formula-picture-is-worth.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/1640925584618909069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/1640925584618909069'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2010/08/distance-formula-picture-is-worth.html' title='distance formula : a picture is worth thousand words.'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_HPHOFFg9BEQ/TG2YsXdy9-I/AAAAAAAABfw/pcQtU1Jmvh8/s72-c/distance_formula_pythagoras.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-3222407403778795605</id><published>2010-07-22T02:31:00.000-07:00</published><updated>2010-07-22T02:35:29.883-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Math'/><title type='text'>Primer : Probability</title><content type='html'>This blog is very basic and Yes everybody in the world know this.&lt;br /&gt;&lt;br /&gt;P(A) = n(A)/n(S)&lt;br /&gt;P(A u B)  = P(A)+P(B)-P(A n B) &lt;br /&gt;&lt;br /&gt;Probability - how likely the event will occur. If we toss a coin , it is likely that the head will occur once in two tosses. But this may not be true. Two consecutive tosses may yield both tails. So how 1/2. If this experiment is repeated a huge number of times , it is observed that the odds with which the head will fall is 1/2. obvious the coin is unbiased.&lt;br /&gt;&lt;br /&gt;Two events , are said to be independent if the outcome of one event doesn’t impact the outcome of the other. Those events are called as independent events. Lets say there are two coins and I toss them simultaneously , the outcome of one coin has no effect on the other coin and hence they are independent.&lt;br /&gt;&lt;br /&gt;Now whats the probability of getting both heads when two coins are tossed simultaneously. Its 1/4&lt;br /&gt;&lt;br /&gt;P(A n B) - getting both heads . P(A).P(B)&lt;br /&gt;&lt;br /&gt;Two events are said to be mutually exclusive if the occurrence of one event , results in the absence of another event. If event A occurs event B doesn’t occur and vice versa. Here P(A n B) = 0 - mutually exclusive.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Conditional Probability&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Defn : If A and B are not independent , given that the event B has occurred what is the probability of event A to occur. &lt;br /&gt;&lt;br /&gt;Lets take one example. Rolling a die.&lt;br /&gt;A : number 5&lt;br /&gt;B : odd number&lt;br /&gt;&lt;br /&gt;Lets say ,its given that B has occurred in an experiment. Now what is the probability of A. its 1/3. How did we get. The sample space is now 3 since the event B has occurred and the odds that it will be number 5 is one amongst three.&lt;br /&gt;&lt;br /&gt;P(A | B) { A given B} = P(A n B)/P(B)&lt;br /&gt;&lt;br /&gt;If two events are independent then&lt;br /&gt;P(A|B)=P(A).(P(B)/P(B) which gives P(A). Which says the occurrence of B does not change the odds of A, its still P(A) regardless.&lt;br /&gt;&lt;br /&gt;If two events are mutually exclusive , then the probability of event A given event B has occurred is P(A|B) = 0. If B has occurred then A will not occur that’s mutually exclusive.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Bayes theorem &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;In simple terms, it is the relation between the conditional probability and its inverse.&lt;br /&gt;&lt;br /&gt;P(A|B)=(P(B|A)*P(A))/P(B)&lt;br /&gt;&lt;br /&gt;Just brushing the basics again and one final time !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-3222407403778795605?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/3222407403778795605/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2010/07/primer-probability.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/3222407403778795605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/3222407403778795605'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2010/07/primer-probability.html' title='Primer : Probability'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-2891694320191390360</id><published>2010-07-13T12:01:00.000-07:00</published><updated>2010-07-22T02:34:47.356-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='inspire'/><title type='text'>Classical todo list</title><content type='html'>ABSTRACTION&lt;br /&gt;&lt;br /&gt;we are right now working in the top most layer say .net framework , java or something. we dont need to worry how actually the code is executed by the machine , how the code loads in memory or how our thread gets scheduled or when vitual memory swapping happens or anything. its all abstraction. You dont need to know whats happening at our processor level. We just know it happens. But Its always essential to understand some inner details to have the complete picture. This is highly essential to become a complete software engineer and its a pre-req for any architect. I have been in many discussion where some guy starts talking about the internals and I have no clue at that level and so the other guy kind of gets the upper hand. and so....&lt;br /&gt;&lt;br /&gt;here is my list of todo's &lt;a href="http://untiluknow.blogspot.com/p/classical-todos.html"&gt;click this link&lt;/a&gt;.&lt;br&gt; Currently am focussed in understanding some architecture and operating systems concepts.&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-2891694320191390360?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/2891694320191390360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2010/07/classical-todo-list.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/2891694320191390360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/2891694320191390360'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2010/07/classical-todo-list.html' title='Classical todo list'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-6517824648132598328</id><published>2010-05-24T03:01:00.000-07:00</published><updated>2010-05-24T04:07:30.493-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Math'/><title type='text'>A Mathematician's lament</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_HPHOFFg9BEQ/S_pOz25ePsI/AAAAAAAABMU/hSizESc6Zz4/s1600/aplusbwholesquare.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 298px;" src="http://2.bp.blogspot.com/_HPHOFFg9BEQ/S_pOz25ePsI/AAAAAAAABMU/hSizESc6Zz4/s320/aplusbwholesquare.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5474774949839126210" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I never knew this before. Now I can derive all formula's by drawing diagrams.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Sum of N natural numbers = (n(n+1))/2&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;n and n+1 are the sides of the rectangle , which gives n(n+1) as its area&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_HPHOFFg9BEQ/S_pUUzrJKXI/AAAAAAAABMc/N4Vy2ixbOTk/s1600/sum5.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 247px; height: 278px;" src="http://1.bp.blogspot.com/_HPHOFFg9BEQ/S_pUUzrJKXI/AAAAAAAABMc/N4Vy2ixbOTk/s320/sum5.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5474781013467539826" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Sum of Squares of N natural numbers proof.&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.macalester.edu/~bressoud/pub/CBN2.pdf"&gt;http://www.macalester.edu/~bressoud/pub/CBN2.pdf&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Binomial Theorem and its the beautiful theory behind the formula (a+b)^n&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.youtube.com/watch?v=Cv4YhIMfbeM"&gt;http://www.youtube.com/watch?v=Cv4YhIMfbeM&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Please watch all the three parts in youtube to understand fully. I hate my math teacher !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-6517824648132598328?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/6517824648132598328/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2010/05/mathematicians-lament.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/6517824648132598328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/6517824648132598328'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2010/05/mathematicians-lament.html' title='A Mathematician&apos;s lament'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_HPHOFFg9BEQ/S_pOz25ePsI/AAAAAAAABMU/hSizESc6Zz4/s72-c/aplusbwholesquare.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-9066425109713188356</id><published>2010-05-14T15:30:00.001-07:00</published><updated>2010-05-24T02:30:12.360-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='contests'/><title type='text'>Into the Top10 All India</title><content type='html'>I have been participating codechef monthly algorithm contests for a while now. Java is my language of choice. Participated in this month algorithm contest. &lt;br /&gt;Problem page : &lt;a href="http://www.codechef.com/MAY10/"&gt;http://www.codechef.com/MAY10/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I was able to solve three problems which were fairly simple. All three problems just require strong logical skills alone. Once the logic is right , implementation has to be fairly efficient as time constraints are too strict. The program has to be optimized at arithmetic level.I ended 7th in India and by far this is my best performance so far in programming contests.&lt;br /&gt;&lt;br /&gt;Find my name at &lt;a href="http://blog.codechef.com/2010/05/12/may-2010-contest-results/"&gt;http://blog.codechef.com/2010/05/12/may-2010-contest-results/&lt;/a&gt; and here is my not-so-great handle &lt;a href="http://www.codechef.com/users/sppraveen"&gt;http://www.codechef.com/users/sppraveen&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;My previous best contest rankings were 9th and 11th. &lt;a href="http://blog.codechef.com/2010/02/11/february-contest-results/"&gt;http://blog.codechef.com/2010/02/11/february-contest-results/&lt;/a&gt;&lt;br /&gt;Expecting top 5 in coming months :)&lt;br /&gt;&lt;br /&gt;(You need to participate. Just register and give a try next month. Be sure you make yourself familiar by putting some practice problems. visit &lt;a href="http://www.codechef.com"&gt;www.codechef.com&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-9066425109713188356?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/9066425109713188356/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2010/05/into-top10-all-india.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/9066425109713188356'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/9066425109713188356'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2010/05/into-top10-all-india.html' title='Into the Top10 All India'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-2184893788526928516</id><published>2010-05-14T14:49:00.000-07:00</published><updated>2010-05-24T02:30:25.129-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Math'/><title type='text'>Basic Math : Area of Circle</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_HPHOFFg9BEQ/S-3IC3TkYiI/AAAAAAAABMM/KQd5vLG1ANU/s1600/circlelabelled.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 285px; height: 99px;" src="http://3.bp.blogspot.com/_HPHOFFg9BEQ/S-3IC3TkYiI/AAAAAAAABMM/KQd5vLG1ANU/s320/circlelabelled.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5471249073856340514" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;No work , bored of algorithms . Its in this state when I thought how (pi)r^2 became the area of circle. &lt;br /&gt;&lt;br /&gt;First what is (pi) . Its the ratio of the circumference of the circle and the diameter. See this wiki animation to understand this&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Pi"&gt;http://en.wikipedia.org/wiki/Pi&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;(pi) is the distance traveled by a circle to complete one full rotation which has 1 unit diameter. This value is found to be 3.141.... based on various methods. &lt;br /&gt;(pi) is 3.14 when diameter (2*r) is 1. &lt;br /&gt;(pi)= Circumference / diameter &lt;br /&gt;(pi) = Circumference / 2 * radius&lt;br /&gt;&lt;br /&gt;which gives &lt;br /&gt;&lt;br /&gt;Circumference = 2 * (pi) * radius&lt;br /&gt;&lt;br /&gt;So far so good. Having read this basics , please go to this link which explains how area of circle became (pi) * r * r. &lt;a href="http://www.worsleyschool.net/science/files/circle/area.html"&gt;http://www.worsleyschool.net/science/files/circle/area.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Its Vow after reading the above link as it marks the great day when I understood the theory behind the formula for area of circle.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-2184893788526928516?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/2184893788526928516/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2010/05/basic-math-area-of-circle.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/2184893788526928516'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/2184893788526928516'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2010/05/basic-math-area-of-circle.html' title='Basic Math : Area of Circle'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_HPHOFFg9BEQ/S-3IC3TkYiI/AAAAAAAABMM/KQd5vLG1ANU/s72-c/circlelabelled.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-6957466130889201999</id><published>2010-04-30T01:13:00.000-07:00</published><updated>2010-04-30T06:07:57.914-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='search engine'/><category scheme='http://www.blogger.com/atom/ns#' term='Algorithms'/><title type='text'>Inverted Index - Data Structures(Under Construction)</title><content type='html'>First see - &lt;a href="http://untiluknow.blogspot.com/2010/04/building-search-engine-inverted-index.html"&gt;part1&lt;/a&gt;,&lt;a href="http://untiluknow.blogspot.com/2010/04/desktop-search-engine-basics-writing.html"&gt;part2&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Hash table&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Hashtable Structure - &lt;word,documentlist&gt;&lt;br /&gt;It will have 10^5 buckets. Each bucket is a word which has a pointer to the document list. &lt;br /&gt;insert - O(1)&lt;br /&gt;search - O(1)&lt;br /&gt;&lt;br /&gt;There are no perfect hash functions available for string. Hence hashing will have collisions. For resolving collisions , we need to use Chaining. Its not guaranteed to be constant time, but since we have 10 ^ 5 buckets and 10 ^ 5 words we could assume that it will fairly perform very well.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Cons :&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1. It doesnt support prefix match. Say am searching ebook and I have types "ebo". It will not show the ebook entry. No prefix match. It supports only exact match.&lt;br /&gt;&lt;br /&gt;2. If the size of our distinct word increases , we should increase the number of buckets also. Something like double hashing. This generally does not scale well and will result in more collisions.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Search Trees :&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Binary Search Tree :&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;insert : O(h)&lt;br /&gt;search : O(h) =&gt; h!= log n - Since its not balanced&lt;br /&gt;&lt;br /&gt;pros : supports prefix match. If we have typed "ebo" we could search for ebo and return all nodes below that.&lt;br /&gt;&lt;br /&gt;cons : Not balanced which does not guarantee log n time complexity&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Red Black Tree , AVL Tree&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;insert : O(log n)&lt;br /&gt;search : O(log n)&lt;br /&gt;&lt;br /&gt;pros : height balanced. Guaranteed logarithmic search and insertion time. Prefix match.&lt;br /&gt;&lt;br /&gt;cons : little complex to implement.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;B Tree&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I think this is the data structure. Let me experiment and come back to this.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Prefix Tree / Trie&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;insert : O(length of the word)&lt;br /&gt;search : O(length of the word)&lt;br /&gt;&lt;br /&gt;cons : Too big memory requirements. Not suitable for big indexes. For small index , this is the best data structure. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Out of the race&lt;/span&gt;&lt;br /&gt;Hashing&lt;br /&gt;Prefix Tree/Trie&lt;br /&gt;BST&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;still in race&lt;/span&gt;&lt;br /&gt;self-balancing binary search tree&lt;br /&gt;B Tree&lt;br /&gt;&lt;br /&gt;B-Tree is leading , since this is the data structure used in database indexing. Lets decide on a simple and efficient one.&lt;br /&gt;&lt;br /&gt;Note : I feel am just repeating the age old data structures.Sorry! Next post, I will try to get into more interesting stuff on dictionaries. I am reading the book "Introduction to Information Retrieval" By Prabhakar Raghavan and Christoper Manning.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-6957466130889201999?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/6957466130889201999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2010/04/inverted-index-data-structures.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/6957466130889201999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/6957466130889201999'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2010/04/inverted-index-data-structures.html' title='Inverted Index - Data Structures(Under Construction)'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-3800782658890391955</id><published>2010-04-27T00:47:00.000-07:00</published><updated>2010-04-30T06:00:27.061-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='search engine'/><title type='text'>Building a Desktop Search Engine - Inverted Index</title><content type='html'>Lets take a look at the Inverted index and try estimating the approximate size of the index.(fits in memory?)&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Indexing&lt;/span&gt; : Indexing is the process of creating an advanced data structure while crawling the documents , for fastest search retrieval.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;What do we index :&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Index all files and folders and also the contents of the file if that is readable. This helps us search some text which occurs in the file also. For file type *.txt , *.doc - index the file contents also. For *.mp3 , *.vlc and so on , index only the file name.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Inverted Index :&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_HPHOFFg9BEQ/S9lIvJw9_LI/AAAAAAAABME/ppwC3qpfzj4/inverted_index.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 520px; height: 394px;" src="http://1.bp.blogspot.com/_HPHOFFg9BEQ/S9lIvJw9_LI/AAAAAAAABME/ppwC3qpfzj4/inverted_index.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5465479597703167154" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Document is a collection of words. The index should finally help in finding all the documents which has certain word. The collection of complete set of words in all documents is the dictionary. For each word in the dictionary - we need to store the documents which has this word. Now while searching a word , get the document list for that word and return the results. &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Operations on Inverted Index&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The following operations are performed frequently on the index.&lt;br /&gt;1. Inserting a new word in the index &lt;br /&gt;2. updating the existing word's document list&lt;br /&gt;3. looking up for a word in the index to get list of documents&lt;br /&gt;&lt;br /&gt;Steps 3 and 2 are just  look-up. So insert and search are the operations performed on the index. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Fits In-memory or not - Biggest question to solve&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;How big the index will be. What will be the size of the complete inverted index. &lt;br /&gt;Total No of Distinct words : 10^5(average)&lt;br /&gt;Average number of text documents : 100 - 10000&lt;br /&gt;Average size of document list for each word : 30 - 50&lt;br /&gt;Average word length : 7 characters&lt;br /&gt;&lt;br /&gt;We dont need to index stop word which appear in every document. See this - &lt;a href="http://nlp.stanford.edu/IR-book/html/htmledition/dropping-common-terms-stop-words-1.html"&gt;link&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;10 ^ 5 words take = 10 ^5 * 7 characters = 7 * 10 ^5 characters = 7 * 10 ^ 5 bytes = 0.7 MB&lt;br /&gt;30 documents = Each document could be represented by a unique integer which takes 4 bytes memory . Hence 30 * 4 = 120 bytes&lt;br /&gt;&lt;br /&gt;Index size = Total word size * Average size of document list&lt;br /&gt;           = 0.7MB * 120 = 84 MB&lt;br /&gt;&lt;br /&gt;If the no of distinct words is of order 10 ^ 6 , then 840 MB would have been the size of index.&lt;br /&gt;&lt;br /&gt;Lets assume , the total size will be around 84 MB and discuss about the data structure which could hold the complete index in-memory. This makes it simple and some research online clearly shows , the index size clearly fits in memory. If it doesnt fit , we should use index compression algorithms or store the index in the hard-disk and do one in-memory + one disk-read model(search engine model).&lt;br /&gt;&lt;br /&gt;Lets go ahead and discuss various data structures including pros and cons&lt;br /&gt;&lt;br /&gt;Note : This calculation is simply my assumption. We will implement in-memory data structure first then we will discuss memory+disk related data-structures.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-3800782658890391955?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/3800782658890391955/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2010/04/building-search-engine-inverted-index.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/3800782658890391955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/3800782658890391955'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2010/04/building-search-engine-inverted-index.html' title='Building a Desktop Search Engine - Inverted Index'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_HPHOFFg9BEQ/S9lIvJw9_LI/AAAAAAAABME/ppwC3qpfzj4/s72-c/inverted_index.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-3655532067411903894</id><published>2010-04-26T23:07:00.000-07:00</published><updated>2010-04-30T06:00:27.062-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='search engine'/><title type='text'>Building a Desktop Search Engine : Writing a crawler</title><content type='html'>We will build a complete end-to-end desktop search engine. &lt;br /&gt;&lt;br /&gt;Objective : A Product similar to google desktop. This is purely for learning and experimentation purpose&lt;br /&gt;&lt;br /&gt;What it does : A search engine for your PC. You could use it as a quick application launch tool.&lt;br /&gt;&lt;br /&gt;To start with , lets write a single threaded crawler which recursively crawls the entire documents in your local system. lets name it - SimpleCrawler&lt;br /&gt;&lt;br /&gt;Language : Java &lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="Java"&gt; &lt;br /&gt;import java.io.*;&lt;br /&gt;public class SimpleCrawler&lt;br /&gt;{&lt;br /&gt; public static void main(String args[])&lt;br /&gt; {&lt;br /&gt;  String rootDirectory="C:\\Documents and Settings\\sppravin\\My Documents";&lt;br /&gt;  crawl(new File(rootDirectory));&lt;br /&gt; }&lt;br /&gt; public static void crawl(File file)&lt;br /&gt; {&lt;br /&gt;  if(!file.isDirectory())&lt;br /&gt;   return;&lt;br /&gt;  String files[]=file.list();&lt;br /&gt;  for(String f:files)&lt;br /&gt;  {&lt;br /&gt;   File newFile=new File(file.getAbsolutePath()+"\\"+f);&lt;br /&gt;   if(newFile.isDirectory())&lt;br /&gt;    crawl(newFile);&lt;br /&gt;   System.out.println(f);&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;All crawlers start crawling from a set of seeded listings. In our case, My Documents folder is the root and we will crawl it fully.&lt;br /&gt;&lt;br /&gt;crawl method takes the root file , checks if this is a directory and then lists() all files under the directory. It may have sub-directories also. For sub-directories we recursively call crawl(subDirectory). We are doing a DepthFirstSearch here. Whenever it gets a file, it prints the name of the file to the console.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;My Documents -&gt; My Pictures -&gt;mine.jpg&lt;br /&gt;             -&gt; resume.txt&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;It will start from the root My Documents. lists all files immediately below this. Finds My Pictures and makes a recursive call crawl(My Pictures). This crawl will print mine.jpg and returns back. It will print My Pictures followed by resume.txt&lt;br /&gt;&lt;br /&gt;output :&lt;br /&gt;mine.jpg&lt;br /&gt;My Pictures&lt;br /&gt;resume.txt&lt;br /&gt;&lt;br /&gt;We can give any number of root nodes to start crawlilng or simply c:\\ to crawl the entire C drive. It does nothing but crawling and print names of all files and folders.&lt;br /&gt;&lt;br /&gt;We are done with our SimpleCrawler. &lt;br /&gt;&lt;br /&gt;Next step - lets build the search index out while crawling and store the index as a file in the hard disk.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-3655532067411903894?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/3655532067411903894/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2010/04/desktop-search-engine-basics-writing.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/3655532067411903894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/3655532067411903894'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2010/04/desktop-search-engine-basics-writing.html' title='Building a Desktop Search Engine : Writing a crawler'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-2491265111499492549</id><published>2010-04-24T07:16:00.000-07:00</published><updated>2010-04-30T05:57:54.083-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cloud'/><title type='text'>Cloud computing</title><content type='html'>Cloud computing - The most talked about buzz word in recent times. It deserves some understanding now.(this is certainly the future) here are my attempts to understand this buzz.&lt;br /&gt;&lt;br /&gt;So whats a cloud - A cloud refers to a cluster of computers(usually in the range of 1000 servers). Cloud computing is simply doing some computation - say an application running on these cluster. Whats new now. All large scale enterprise applications now run using 1000's of nodes.  so whats cloud.&lt;br /&gt;&lt;br /&gt;Lets take a simple example - newsfeed application - similar to the facebook one.  A machine could normally serve certain amount of requests - has a max bound. Initially if there are few users in the our sample application, one server might be enough to do the whole processing. Now , users increase hence traffic increases , which means more requests to the server and now our single machine could not handle so many real time requests. What is the solution now. Have many servers and load balance the traffic. This is normally what scaling mean. Adding more computing power. Now , lets say our peak traffic is some $x requests/sec. To handle this $x req/sec we need $y number of machines. This is termed as availability. A highly available system should be able to process real time request without any delay irrespective of the incoming traffic. We shall now add $y servers, now we made our application highly available.&lt;br /&gt;&lt;br /&gt;On a normal day , we might not get peak $x req/sec . traffic will be $x/2 only. Now we can handle this traffic using y/2 servers. So we are not using the remaining y/2 servers computing power. all the remaining servers are ready to serve requests because application has to have high availability. Now on this normal day, we are wasting y/2 servers computing power, space and the actual power. Now the next day we get $x*2 requests - our new traffic peak. We have not predicted this high traffic and the system is going to come down. Got the problem? This is the problem which could be solved using cloud. Its automatically scalable. If the application starts getting more requests, ask for new instances in the cloud, install OS, deploy app and start serving the traffic. Traffic is less. Release some of the servers. Vow super - computing power as and when required. we can do this on-demand adding or removing servers without cloud also. But the advantage of using cloud is that , we will end up paying for what we use. This is the advantage. You pay for what you use. &lt;br /&gt;&lt;br /&gt;It doesnt end here. lets say we need some big enterprise proprietary application. say our newsfeed application runs on a software stack which is very expensive. In cloud, we dont need to purchase these softwares also. Cloud providers generally provide these softwares also and you will be renting these softwares as long as you use them alone. Vow its cheap. No need to buy them , just rent them as long as you use it. One thing - everything happens via network - internet. &lt;br /&gt;&lt;br /&gt;For a small company , say start-up , buying servers is very expensive. Instead now they could buy computing power from some cloud service. Use their storage which is reliable.(GB's to TB's) Data is stored in a distributed environment and hence even if the hard disk crashed, the data could be retrieved because data is stored in a redundant manner in many servers. All this overhead is automatically handled. We could bring the application up , in just couple of days buying computing power in the cloud. (Ever thought how difficult to buy servers, internet, storage, fail over systems, maintenance - all these is easy now )&lt;br /&gt;&lt;br /&gt;For large companies, they build their own cloud platform so that all their applications run on cloud which is like a shared data center. gmail runs on cloud. they automatically scale - perhaps sometimes not(we will get back to this). Microsoft, yahoo , google , amazon is all building their own cloud infrastructure to win in the future. As mobiles get more powerful , all applications running in mobile will be hosted in the cloud which makes it more compelling.&lt;br /&gt;&lt;br /&gt;Putting all together, &lt;br /&gt;wiki says - "Cloud computing is Internet-based computing, whereby shared resources, software and information are provided to computers and other devices on-demand, like a public utility."&lt;br /&gt;&lt;br /&gt;Another interesting definition -&lt;br /&gt;Cloud computing is "A form of standardized IT capability such as internet based services , software and infrastructure - offered by a service provider that is accessible via internet protocols from any computer , is always available and scales automatically to adjust to demand ,either pay-per-use or advertising based has programmatic-based control interfaces , and enables full customer service."&lt;br /&gt;&lt;br /&gt;the definition means ....&lt;br /&gt;&lt;br /&gt;amazon - the service provider - they offer cloud services&lt;br /&gt;You can control the cloud through internet and deploy your applications.&lt;br /&gt;always available - they guarantee the server availability - on demand&lt;br /&gt;scales - scale server computing , space either up or down&lt;br /&gt;pay-per-use - Works like a prepaid cell phone&lt;br /&gt;programmatic based control interfaces - cloud service provider exposes these interfaces to control the cloud and your applications&lt;br /&gt;enables full customer service - they take care maintaining servers and other IT maintenance related work.&lt;br /&gt;&lt;br /&gt;This new paradigm will pose enough challenges in the near future and it will change the way we look at software today!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-2491265111499492549?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/2491265111499492549/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2010/04/cloud-computing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/2491265111499492549'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/2491265111499492549'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2010/04/cloud-computing.html' title='Cloud computing'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-5853236881243170445</id><published>2010-04-18T04:33:00.000-07:00</published><updated>2010-05-24T01:19:12.569-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='inspire'/><title type='text'>Best inspirational scenes</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Pursuit of Happyness&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Christopher Gardner: Hey. Don't ever let somebody tell you... You can't do something. Not even me. All right?&lt;br /&gt;Christopher: All right.&lt;br /&gt;Christopher Gardner: You got a dream... You gotta protect it. People can't do somethin' themselves, they wanna tell you you can't do it. If you want somethin', go get it. Period. &lt;br /&gt;&lt;br /&gt;Watch : &lt;a href="http://www.youtube.com/watch?v=GQlzz6jGCfI"&gt;http://www.youtube.com/watch?v=GQlzz6jGCfI&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;The Shawshank Redemption&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Andy Dufresne: [in letter to Red] Remember Red, hope is a good thing, maybe the best of things, and no good thing ever dies. &lt;br /&gt;&lt;br /&gt;Watch : &lt;a href="http://www.youtube.com/watch?v=9K30e9O3Nng"&gt;http://www.youtube.com/watch?v=9K30e9O3Nng&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Batman Begins&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Alfred Pennyworth: Why do we fall, sir? So that we might learn to pick ourselves up. &lt;br /&gt;&lt;br /&gt;The Dawn is near when the night is Darkest&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Troy&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Achilles: [to his men] Myrmidons! My brothers of the sword! I would rather fight beside you than any army of thousands! Let no man forget how menacing we are, we are lions! Do you know what's waiting beyond that beach? Immortality! Take it! It's yours! &lt;br /&gt;&lt;br /&gt;Watch : &lt;a href="http://www.youtube.com/watch?v=d_O68HUcHos"&gt;http://www.youtube.com/watch?v=d_O68HUcHos&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Russel Crowe - oscar speech&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;"If you grow up in the suburbs of anywhere, a dream like this seems kind of vaguely ludicrous and completely unattainable. [But] this moment is directly connected to those imaginings. And for anybody who's on the downside of advantage, and relying purely on courage, it's possible."  (Russell Crowe, his Oscar speech) &lt;br /&gt;&lt;br /&gt;Watch : &lt;a href="http://www.youtube.com/watch?v=pJNmKn8f15E"&gt;http://www.youtube.com/watch?v=pJNmKn8f15E&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Steve Jobs&lt;/span&gt; - stanford speech&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.youtube.com/watch?v=UF8uR6Z6KLc"&gt;http://www.youtube.com/watch?v=UF8uR6Z6KLc&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Sachin Tendulkar&lt;/span&gt; - &lt;a href="http://www.youtube.com/watch?v=ukQBb-Ik4PE"&gt;http://www.youtube.com/watch?v=ukQBb-Ik4PE&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Guru interval scene&lt;/span&gt; - &lt;a href="http://www.youtube.com/watch?v=T_R36SQZq-w"&gt;http://www.youtube.com/watch?v=T_R36SQZq-w&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-5853236881243170445?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/5853236881243170445/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2010/04/best-inspirational-scenes.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/5853236881243170445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/5853236881243170445'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2010/04/best-inspirational-scenes.html' title='Best inspirational scenes'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-4307943052602071783</id><published>2010-04-11T07:58:00.000-07:00</published><updated>2010-04-30T06:04:17.782-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='courses'/><title type='text'>Missing you all</title><content type='html'>I am a computer science student and I am passionate for computer science. Till my college end , I donno where all these passion went. I was not at all passionate to learn things at college. Now I realize , even worry when I think I did not read those subjects(not for CGPA - for pure learning).&lt;br /&gt;first one&lt;br /&gt;Operations research and optimization - I really felt bad for missing this two. I remember the way we had this course, a ppt the day before exam which briefly describe the steps to solve. I will read and try to understand these steps without understanding the problem itself. Apply the steps get marks. what the hell?. I remember one word now - simplex and duality. I wondered why is this course required for a c6 ite . Now I could sense how important these two courses , what optimization means what kind of interesting problems and algorithms were discussed. I missed them.&lt;br /&gt;&lt;br /&gt;I can add probability and stats to this. But i feel am not too bad at it.&lt;br /&gt;&lt;br /&gt;Next one,&lt;br /&gt;DS - I dont know. While writing my resume now , I feel this is what all I have now. I am very strong in Algorithms and data structures. When I was in college I got E grade. Just because i was doing animation I could not read this well. Probably I dint like because I dint know to write a simple recursive code or I am not good enough to appreciate the beauty of this. Now, everyday I love reading algorithms and solving puzzles.I feel I missed this.&lt;br /&gt;&lt;br /&gt;Electives - &lt;br /&gt;&lt;br /&gt;Networking&lt;br /&gt;I dont know what a router is. I feel bad to say am a computer science student. Really even now I dont know simple because I did not do anything in networking. Although this is not my interest , I feel this course should have been in the compulsory list for every computer science student.&lt;br /&gt;&lt;br /&gt;Data mining - I did this course. I am atleast in a state where I know what data mining could do and what it means. I should have done a project in this. What a course it is.&lt;br /&gt;&lt;br /&gt;Artificial Intelligence - Given the professor was such a crap guy I dont feel for this course.&lt;br /&gt;&lt;br /&gt;Information Retrieval - I wonder why we did not have this course in our academic list. The dark age of personal computers has come to an end. Its all internet , ubiquitous and data is information.&lt;br /&gt;&lt;br /&gt;Grid/Cloud computing - Again . I thing we had grid computing (elective). The world is moving towards cloud and grid computing. This is the future and am completely fascinated. I felt I missed this.&lt;br /&gt;&lt;br /&gt;Graph theory - I love this subject. The fact that it helps me visualize the answers rather proofs makes it superb. I did read well , though I did not make any attempt to understand it. This is by far the most beautiful course ever and I have bought our text book now to read this. I miss GAN.&lt;br /&gt;&lt;br /&gt;Mathematics - naaaaaa never. Am personally looking for topics in maths which is must for a computer science student. I wanted only those topics which will be useful.some topics like prob stat , number theory , permutation and combination , basic algebra and few more topics. I am not a research guy!!!&lt;br /&gt;&lt;br /&gt;And Some course I hate&lt;br /&gt;&lt;br /&gt;Dynamics of Social Change - funny one and a crap book&lt;br /&gt;Linear algebra - Why?&lt;br /&gt;Electrical pracs - I dont remember course name also.&lt;br /&gt;and one more circuit related junk.&lt;br /&gt;&lt;br /&gt;I dint feel for these courses though they are too good&lt;br /&gt;multimedia computing - donno what to write here&lt;br /&gt;image processing - base for some specific fields&lt;br /&gt;computer graphics - more and faster computing power is compelling reason&lt;br /&gt;machine learning - the classic&lt;br /&gt;mobile computing - future&lt;br /&gt;data storage technologies - with cloud , this is the most challenging task ahead&lt;br /&gt;&lt;br /&gt;So many courses I missed my chance. But still I have time. I feel I wanted to do a Masters which has these courses alone in its structure.But I dont think there is any like this. Looking forward to grab back all these missed chances if I get time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-4307943052602071783?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/4307943052602071783/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2010/04/i-am-computer-science-student-and-i-am.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/4307943052602071783'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/4307943052602071783'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2010/04/i-am-computer-science-student-and-i-am.html' title='Missing you all'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-5990336502202242928</id><published>2010-03-24T13:04:00.000-07:00</published><updated>2010-07-24T13:43:27.293-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='inspire'/><title type='text'>Starting SPOJ</title><content type='html'>I have been into programming contests for four months and I find it very tough. I am inspired by the format of contests held by codechef. Every month they have a contest with 10 days duration to solve six difficult algorithm problems. Good thing is , unlike topcoder , its an offline competition which gives a newbie enough time to think about the problem and code. Another good thing is , they give prizes , in fact lot of prizes and I won 1500 coming 11th. I felt great , but the next month I ended solving just one problem out of six. &lt;br /&gt;&lt;br /&gt;I have been reading algorithms in CLRS book but I did not improve. All great coders say "practice is the key". To practice , the best available site is SPOJ and UVA. As many prefer , I have joined SPOJ and started solving problems. They have the biggest collection of algorithmic problems. I am thrilled seeing such a big collection. I also noted that most of the guys who finish top 10 in codechef have great records in spoj. http://www.spoj.pl/ranks/users/IN/ . They have been practicing these problems , hundreds of algorithms , thousands of problems , for more than two years. Thats awesome. &lt;br /&gt;&lt;br /&gt;Its not inspiring to see these guys have solved 400 problems there. It makes me feel , when will I solve so many problems , learn and win these guys. I know that its not going to happen anytime soon. I should learn and thats the reason why am participating. Now , I have decided to take SPOJ fulltime. It gives me great pleasure in solving these problems. Its simply amazing to read some algorithms and I find it fascinating. I am pretty sure that many would disagree with this thought.&lt;br /&gt;&lt;br /&gt;link - http://www.spoj.pl&lt;br /&gt;So its time to start thinking and coding and thinking and coding. Will update the blog if I come across some tricky problems and perhaps if I manage to solve that tricky problem!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-5990336502202242928?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/5990336502202242928/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2010/03/starting-spoj.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/5990336502202242928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/5990336502202242928'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2010/03/starting-spoj.html' title='Starting SPOJ'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-5552879477854025072</id><published>2010-03-18T03:23:00.001-07:00</published><updated>2010-04-30T06:03:24.557-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Algorithms'/><title type='text'>Generate all permutations for a given set of nos</title><content type='html'>Below is the recursive code which generates all permutations for a given set of numbers.&lt;br /&gt;&lt;pre name="code" class="Java"&gt; &lt;br /&gt;public class Permute&lt;br /&gt;{&lt;br /&gt; static boolean visited[]=null;&lt;br /&gt; static int a[]=null;&lt;br /&gt; public static void main(String args[]) throws Exception&lt;br /&gt; {&lt;br /&gt;  a=new int[]{1,2,3,4};&lt;br /&gt;  for(int i=0;i &lt; a.length;i++)&lt;br /&gt;  {&lt;br /&gt;   visited=new boolean[a.length];&lt;br /&gt;   permute("",i,a.length);&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt; public static void permute(String out,int j,int length)&lt;br /&gt; {&lt;br /&gt;  visited[j]=true;&lt;br /&gt;  out=out+a[j];&lt;br /&gt;  if(out.length()==length)&lt;br /&gt;  {&lt;br /&gt;   System.out.println(out);&lt;br /&gt;   return;&lt;br /&gt;  }&lt;br /&gt;  for(int i=0;i &lt; a.length;i++)&lt;br /&gt;  {&lt;br /&gt;   if(visited[i]==false)&lt;br /&gt;   {&lt;br /&gt;    permute(out,i,length);&lt;br /&gt;    visited[i]=false;&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Its equivalent to recursing all possible paths in a complete graph of N vertices.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-5552879477854025072?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/5552879477854025072/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2010/03/generate-permutation-of-given-nos.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/5552879477854025072'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/5552879477854025072'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2010/03/generate-permutation-of-given-nos.html' title='Generate all permutations for a given set of nos'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-1100870345179091582</id><published>2010-02-26T13:11:00.000-08:00</published><updated>2010-04-30T06:02:30.412-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='yahoo'/><title type='text'>Life at Yahoo Bangalore</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_HPHOFFg9BEQ/S4g5VAxbyRI/AAAAAAAABKo/SjABp-3Re-U/s1600-h/yahoo.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://2.bp.blogspot.com/_HPHOFFg9BEQ/S4g5VAxbyRI/AAAAAAAABKo/SjABp-3Re-U/s320/yahoo.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5442663182824622354" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I have nearly completed my 2 years (this may) at yahoo Bangalore. I have been working in Sponsored search (panama) .One of the most hyped projects when I joined this place. As my blog title suggest – am just another programmer here but still proud that every line of code I have written have been used by millions of people. Having enjoyed every moment here its time to say what I really like at yahoo.&lt;br /&gt;&lt;br /&gt;My first year was most productive period in my career. I learned the most important thing in my life - THINK. TamilNadu board and the school have taught me ways how not to think. That’s the motto in TN. If you think, understand and write answer, most probably end up getting less marks as that’s not exactly the text book says :). So did not get a chance to think as am not supposed to think at all. BITS-Pilani later made me lazy giving the complete freedom that I don’t need to attend classes ...even tests. To add, am a c6 ite(Bitsians know how good c6 is) So here I am at Yahoo after 21 years and still don’t know what thinking mean. This is when I realized seeing my architect, that thinking is the essential part. From then, every problem I face, I think about it strongly to understand it. This has changed me a lot and I have started participating in Programming competitions and have been performing pretty well for a newbie. This is the biggest thing I have learnt from the people I work with. THINK&lt;br /&gt;(Please note – I did not know to think, still I got BITS. I did not attend tests or read – still I got Yahoo – This is my fate. The reality is that I know how to get things done )&lt;br /&gt;&lt;br /&gt;Apart from learning the most important thing, it’s the freedom that I enjoy here gives me the opportunity to explore various fields. &lt;br /&gt;&lt;br /&gt;Gaming – Fun is essential. Foosball tables all around to insist that fun is an essential part of work. I play table tennis in my breakout area. Many enthusiasts join every evening and play for atleast an hour.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_HPHOFFg9BEQ/S4hC_SeRr8I/AAAAAAAABLA/HTlBowoi_aM/s1600-h/3706939126_07fc25bccd.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://1.bp.blogspot.com/_HPHOFFg9BEQ/S4hC_SeRr8I/AAAAAAAABLA/HTlBowoi_aM/s320/3706939126_07fc25bccd.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5442673804735262658" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Coffee – free of cost. What matters is, its not coffee vending machines, the cafeteria has a special coffee shop and I have the choice – bru coffee, tea, tikashan coffee , badam milk. Have gone to office in Sunday also, just because I get good coffee.(Also because I can make unlimited STD calls to someone special)&lt;br /&gt;&lt;br /&gt;No timings – Most IT Company don’t have restriction, but I have crossed limits. Starting after 12 30 daily is weird. I love to be there till 10 playing , eating and ofcourse last and also the least – Coding. &lt;br /&gt;&lt;br /&gt;I determine what I work on, when I would get it done and when to set the deadline. Once set, I have total control and I can play table tennis fully and end up doing the whole thing last day. No one cares as long as you get the work done. No timing cards, no review meetings about my daily work gives me complete freedom to do what I want.&lt;br /&gt;&lt;br /&gt;Food – this one is impressive. Breakfast, lunch, dinner – free of cost and for a change it’s tasty. Monthly beer bash for re-energizing. Pastries, juice counters and Barista too.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_HPHOFFg9BEQ/S4g6GRCT8MI/AAAAAAAABKw/iAKwuWo7I5M/s1600-h/IMG_5424.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://3.bp.blogspot.com/_HPHOFFg9BEQ/S4g6GRCT8MI/AAAAAAAABKw/iAKwuWo7I5M/s320/IMG_5424.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5442664029003968706" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Source code and open source – I have access to the source code of many yahoo properties and I get to see how the big internet company works. Have not spent enough time to learn about scale they handle. Everything, most of the technology is open source and the linux Desktop rocks – feel this is the best coding environment for a developer.&lt;br /&gt;&lt;br /&gt;And finally PRESSURE. Working in Sponsored search is great but the work demand high availability. A P0 , production ticket mean, no matter what that has to be fixed. Yahoo is losing millions every minute and a fix would help them stop losing. Hence pressure is always there, you know only when you face a priority zero issue. So many people around asking questions , suggesting work around, getting the patch ready – that’s one tiresome thing here. Fortunately as am a fresher am not supposed to look at priority zero tickets. When I finally got the word from my manager -“you can start looking into P0 and you are the primary poc for all production incidents” – the product became so stable that I have hardly got this once. Its so surprising how am lucky always. May be my code made it stable and bug free :)&lt;br /&gt;&lt;br /&gt;What more to add – I have a chance to attend some of the finest tech talks ever.&lt;a href="http://bangalore.yahoo.com/bigthinkers/"&gt;link&lt;/a&gt; Also many founders are here and I have met them. Have got a chance to be with the most talented, experienced, smart, and friendly people. It has all stuff for a nice and happy life and I am enjoying every bit of it. Perhaps now you know why yahoo is not doing that good &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-1100870345179091582?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/1100870345179091582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2010/02/life-at-yahoo-bangalore.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/1100870345179091582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/1100870345179091582'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2010/02/life-at-yahoo-bangalore.html' title='Life at Yahoo Bangalore'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_HPHOFFg9BEQ/S4g5VAxbyRI/AAAAAAAABKo/SjABp-3Re-U/s72-c/yahoo.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-8907711682231337622</id><published>2010-01-19T13:38:00.000-08:00</published><updated>2010-04-30T06:03:24.557-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Algorithms'/><title type='text'>DP - When will I master you!</title><content type='html'>I have started participating programming competitions recently. I know whats DP but never really know how to put that to use in solving complex problems.&lt;br /&gt;&lt;br /&gt;Here is an extract from topcoder - jbernadas - Programmer of the month June 2008 in TC&lt;br /&gt;&lt;br /&gt;------------------------------------------------------------------------&lt;br /&gt;SuperRaskao: Do you know Dynamic Programming?&lt;br /&gt;&lt;br /&gt;jbernadas, zyx3d: Yes, of course, we know Longest Increasing Subsequence, Longest Common Subsequence, Matrix Chain Multiplication, ...&lt;br /&gt;&lt;br /&gt;SuperRaskao: Then, given a matrix A of NxN elements, with N &lt;= 16, how would you find a permutation P such that sum{i=0..N-1} A[i][P[i]] is minimized?&lt;br /&gt;&lt;br /&gt;zyx3d: **thinking**&lt;br /&gt;&lt;br /&gt;jbernadas: Just try each possible permutation and keep the one that returns the minimum answer.&lt;br /&gt;&lt;br /&gt;SuperRaskao: That gives TLE, you have to use DP.&lt;br /&gt;&lt;br /&gt;jbernadas: How?&lt;br /&gt;&lt;br /&gt;SuperRaskao: Use a bitmask to memorize the previously calculated values.&lt;br /&gt;&lt;br /&gt;jbernadas: Wow.&lt;br /&gt;&lt;br /&gt;zyx3d: Makes sense.&lt;br /&gt;&lt;br /&gt;SuperRaskao: Go to TopCoder, and you will learn real DP.&lt;br /&gt;------------------------------------------------------------------------&lt;br /&gt;The above is a chat history of jbernadas when he first got motivated to participate in TC competitions. It makes so much sense. You want to know real DP, you need to solve complex problems. Reading DP in CLRS will only make you understand the topic but you will never master unless you practice them.Its tricky!&lt;br /&gt;&lt;br /&gt;I hope I would master DP soon like these guys did! DP concept is simple and but to put it to use, it takes so much practice.&lt;br /&gt;&lt;br /&gt;If you feel the same, here is a link to get started &lt;br /&gt;http://www.topcoder.com/tc?module=Static&amp;d1=tutorials&amp;d2=dynProg - this link has a DP tutorial with some great DP problems to practice.&lt;br /&gt;&lt;br /&gt;For practicing more problems , use this spoj link.  http://pt1989.22web.net/c0ding/spoj.php?search=dp - This classifies the problem difficulty also.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-8907711682231337622?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/8907711682231337622/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2010/01/dp-when-will-i-master-you.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/8907711682231337622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/8907711682231337622'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2010/01/dp-when-will-i-master-you.html' title='DP - When will I master you!'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-7328901956592363324</id><published>2009-12-23T02:05:00.000-08:00</published><updated>2010-04-30T06:03:24.558-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Algorithms'/><title type='text'>Complexity theory</title><content type='html'>Any person interested in algorithms would have heard the terms NP hard , NP complete and so on. I have hardly taken any effort to understand this.&lt;br /&gt;I dont know what we gain understanding if the problems is NP hard easy or complete whatever. But once you enter the field of algorithms it became essential to know and understand these terms. &lt;br /&gt;&lt;br /&gt;First reason which I felt why should I know this theory - For some algorithm questions , if you can find that this is related to some already known algorithm , then we would immediately try to understand how to solve that already know algorithm. But some of the already known algorithms does not have an efficient polynomial time solution to it. May be I can find one. But these problems have been under math and computer science research and they could not come up with efficient algorithms, and hence its highly unlikely that I would come up with one. Hence instead of trying to come up with an algorithm , I will just do some brute force and some approximate algorithms.&lt;br /&gt;Hence if we know this problem is related to some common problem and that problem is not yet solved , then instead of trying to come up with an algorithm , just find the brute force and get it done.&lt;br /&gt;&lt;br /&gt;This is the reason why I felt its essential to understand these terms.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So now whats P and NP&lt;br /&gt;&lt;br /&gt;P - Any problem that could be solved in  polynomial time in a deterministic machine&lt;br /&gt;NP - Any problem that could be solved in  polynomial time in a non-deterministic machine&lt;br /&gt;&lt;br /&gt;So whats a polynomial time here. Any problem which takes n to the power K steps is considered polynomial, where k is a constant. &lt;br /&gt;And whats a deterministic machine - I really dont know but I believe its a machine which given an algorithm and input , it can give the answer in deterministic time.&lt;br /&gt;Now I got puzzled whats a non deterministic machine. I think whats not deterministic is not deterministic. No matter what the definition is , one thing is clear. &lt;br /&gt;&lt;br /&gt;Edit - A non-deterministic machine can be considered like a fastest computer with unlimited parallelism. The parallelism of the machine guarantees that it would be able to search all brute force paths/decisions in polynomial time.Hence a NP problem can complete in polynomial time in Non-deterministic machine.&lt;br /&gt;&lt;br /&gt;NP represents a class of problems which could not be solved in polynomial time in a deterministic machine. The solution could be verified in polynomial time. &lt;br /&gt;&lt;br /&gt;Lets say we have n numbers and we need to find the sum of n nos, we could do this in o(n) time which is linear . Hence this problem is in complexity class P.&lt;br /&gt;&lt;br /&gt;Lets say we have n nos +ve and -ve. Now we need to find a subset whose sum equals x. Once we have got a solution to this problem, we can verify the solution is right in linear time. Thats is , just be adding the subset we could find if that equals x.&lt;br /&gt;&lt;br /&gt;The above argument suggests, the problem could be verified in poly time(in fact it was linear) , but the solution may not be that straight forward to find. &lt;br /&gt;&lt;br /&gt;This problem is belived to be NP complete. So far felt comfortable understanding whats P and NP. Now whats NP complete. Its believed that there exists some problems for which no poly time exists. These problems are set to be in NP complete.&lt;br /&gt;&lt;br /&gt;Hence problems in NP and not in NP complete are those which may have a poly time solution and thats not yet found. &lt;br /&gt;&lt;br /&gt;Now,&lt;br /&gt;1. Subset sum problem could not be solved in poly time&lt;br /&gt;2. In fact , an already available problem in NP complete could be reduced to this.&lt;br /&gt;&lt;br /&gt;So given a problem  C in NP, if we can quickly reduce a known NP complete problem to C, then C is in NP complete.&lt;br /&gt;&lt;br /&gt;3CNF SAT - some problem is in NP complete. That is this problem is believed not to have any poly time algos. Now this problem can quickly be reduced to subset sum. Hence subset sum is also in NP complete.&lt;br /&gt;&lt;br /&gt;NP complete - Problems believed not to have any poly solution.&lt;br /&gt;&lt;br /&gt;P is infact a subset of NP. A problem in complexity space P could also be solved in polnomial time by a non-deterministic machine.&lt;br /&gt;&lt;br /&gt;There is one more important complexity theory namely NP hard. Come on, I am giving up. Wiki says NP hard problem is something which is atleast as hard as NP complete problems.&lt;br /&gt;&lt;br /&gt;If an optimization problem H has an NP-complete decision version L, then H is NP-hard. Hamiltonian circuit problem is finding a path in the graph, such that it touches each vertex exactly once. Once we have a solution , that is , a hamiltonian circuit we can easily verify that it touches all vertex exactly once in polynomial time. But coming up with a hamiltonian circuit is not that straight forward and it happens to be NP complete which means there are no poly time algorithm known to solve this. &lt;br /&gt;&lt;br /&gt;Now , TSP is optimization version if hamiltonian circuit. Traveling salesman problem is exactly the same as hamiltonian circuit with one additional constraint which is to minimize the total distance. We have to select a hamiltonian circuit whose total distance is minimal. This problem is atleast as hard as the Hamiltonian ciruit problem. This optimization version problem is NP hard.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I still did not understand these stuff completely. But I believe what I have found till now is right. Let me read some more theory and get back to this post. Until then, let someone throw some light......&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;There are some arguments going on.does P = NP . Even if one problem which is in NP , if it is proved to have a polynomial time algorithm , then every other problem in NP is also in P which is called as P = NP. But researches believe P != NP , since many of the NP problems have been under research for years and still no poly algorithm is known. To confuse things more, P = NP is NP hard problem.&lt;br /&gt;&lt;br /&gt;This whole complexity theory made my life hard , and so I conclude "Life is NP Hard".&lt;br /&gt;&lt;br /&gt;Under constructive construction&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-7328901956592363324?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/7328901956592363324/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2009/12/complexity-theory.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/7328901956592363324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/7328901956592363324'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2009/12/complexity-theory.html' title='Complexity theory'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-8889283880817891468</id><published>2009-11-19T08:01:00.000-08:00</published><updated>2010-04-30T06:03:24.561-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Algorithms'/><title type='text'>DS and Algorithms base</title><content type='html'>Its a compilation on what all do we need to know. I will keep adding some of the best materials , pdf's, papers , links whatsoever which would keep us thinking and learning.&lt;br /&gt;&lt;br /&gt;Design&lt;br /&gt;------&lt;br /&gt;&lt;br /&gt;http://www.youtube.com/watch?v=aAb7hSCtvGw - How to design a good api and why it matters - joshua&lt;br /&gt;&lt;br /&gt;DS and algos&lt;br /&gt;------------&lt;br /&gt;&lt;br /&gt;tries - http://www.cs.bu.edu/teaching/c/tree/trie/ , suffix tree and suffix array for various string based linear time searching algorithms&lt;br /&gt;suffix array o(n) - http://felix-halim.net/pg/suffix-array/index.php&lt;br /&gt;suffix tree - ukkonen on-line algorithm - linear time&lt;br /&gt;btree and b+ tree and relation to databases. how database does indexing. what ds it uses for fast lookup - !!!Some great links Required!!!&lt;br /&gt;Dynamic programming problem - Most programming competition questions based on this. &lt;a href="http://www.topcoder.com/tc?module=Static&amp;d1=tutorials&amp;d2=dynProg"&gt;link&lt;/a&gt;&lt;br /&gt;self balancing binary tree - red black tree and avl tree &lt;br /&gt;Sorting algos, Sorting in linear time, QuickSort and BST relation&lt;br /&gt;string searching algorithms - min (KMP and boyer moore)&lt;br /&gt;graph - properties and algorithms. Dijkstra floyd warshall must. Flow and graph properties&lt;br /&gt;Range Minimum query and LCA&lt;br /&gt;linesweep algorithms. convex hull 2d,3d and rotating calipers.&lt;br /&gt;binary index trees&lt;br /&gt;&lt;br /&gt;best materials&lt;br /&gt;--------------&lt;br /&gt;Diagrams for all algos (No theory ) - &lt;a href="http://www.cse.ohio-state.edu/~gurari/course/cis680/cis6802.html#QQ2-53-141"&gt;Easily the best quick reference&lt;/a&gt;&lt;br /&gt;dp - &lt;a href="http://people.csail.mit.edu/bdean/6.046/dp/"&gt;one dp problem - just one page&lt;/a&gt;&lt;br /&gt;tutorials from the best programming competition website- &lt;a href="http://www.topcoder.com/tc?module=Static&amp;d1=tutorials&amp;d2=alg_index"&gt;topcoder&lt;/a&gt;&lt;br /&gt;puzzles - &lt;a href="http://www.ocf.berkeley.edu/~wwu/riddles/hard.shtml"&gt;hard&lt;/a&gt; + &lt;a href="http://gurmeetsingh.wordpress.com/puzzles/"&gt;gurmeet singh manku&lt;/a&gt; + &lt;a href="http://www.folj.com/puzzles/easy.htm"&gt;Easy logic puzzles&lt;/a&gt;&lt;br /&gt;MIT algos ds - &lt;a href="http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-046JFall-2005/VideoLectures/"&gt;mit video lectures&lt;/a&gt;&lt;br /&gt;algo geeks - &lt;a href="http://groups.google.com/group/algogeeks/topics?start="&gt;Link&lt;/a&gt; (brilliant  discussion on tech questions)&lt;br /&gt;cormen sols - &lt;a href="http://algogeeks.googlegroups.com/web/solution+to+cormen.pdf?gda=HXp7skgAAADe1AejI-zVVHIGiQr0fwtwYUa0SY2UQz4Db6fV7p4dNuVxA6Q5B_F7A0r1vnS1_LGmwwmmjY8lLEkm5GsdcWpfGjVgdwNi-BwrUzBGT2hOzg"&gt;Link&lt;/a&gt;&lt;br /&gt;combinatorial game theory - &lt;a href="http://sps.nus.edu.sg/~limchuwe/cgt/"&gt;Link&lt;/a&gt;&lt;br /&gt;Course on Programming contests- &lt;a href="http://www.cs.sunysb.edu/~skiena/392/"&gt;Programming Challenges&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Topic worth looking at&lt;br /&gt;----------------------&lt;br /&gt;&lt;br /&gt;Perfect and imperfect hashing&lt;br /&gt;catalan number - very interesting property&lt;br /&gt;huffman coding&lt;br /&gt;levenshtein distance&lt;br /&gt;linear programming,task scheduling,minimax algorithm,activity selection - greedy most of them&lt;br /&gt;Nim game and its variants - http://en.wikipedia.org/wiki/Nim&lt;br /&gt;Exact cover and dancing links algorithm - For solving sudoku in 0.01 sec &lt;a href="http://arxiv.org/PS_cache/cs/pdf/0011/0011047v1.pdf"&gt;Knuth paper&lt;/a&gt;&lt;br /&gt;graph of NP complete problems - http://page.mi.fu-berlin.de/aneumann/npc.html&lt;br /&gt;&lt;br /&gt;java&lt;br /&gt;----&lt;br /&gt;a java web crawler - &lt;a href="http://java.sun.com/developer/technicalArticles/ThirdParty/WebCrawler/"&gt;link&lt;/a&gt;&lt;br /&gt;Java IO for programming competitions - &lt;a href="http://java.sun.com/developer/technicalArticles/Programming/PerfTuning/"&gt;IO performance&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.coderanch.com/t/459684/Web-Services-Certification-SCDJWS/certification/SCDJWS-Cleared"&gt;SCDJWS&lt;/a&gt;&lt;br /&gt;SCJP - SCJP book Bert bates and Kathy sierra&lt;br /&gt;&lt;br /&gt;what i would ask in an interview?&lt;br /&gt;---------------------------------&lt;br /&gt;&lt;br /&gt;1. Explain how duckhunt video game works? &lt;a href="http://www.howstuffworks.com/question273.htm"&gt;Answer&lt;/a&gt;&lt;br /&gt;2. java - implement hashmap - what hashing used. types. extendability. collision resolution and so on&lt;br /&gt;3. autocomplete algorithm - edit distance , trie prefix match. how all language words. size of dictionary is huge. relevancy at that time(hot autocomplete should come). how stored. how retrieved.so on&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-8889283880817891468?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/8889283880817891468/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2009/11/ds-and-algorithms-base.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/8889283880817891468'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/8889283880817891468'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2009/11/ds-and-algorithms-base.html' title='DS and Algorithms base'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-4177128209289296487</id><published>2009-11-09T22:07:00.000-08:00</published><updated>2010-04-30T06:01:49.139-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>Version of the compiled class</title><content type='html'>To find the version of the compiled java class,&lt;br /&gt;use javap -verbose &lt;ClassName&gt;&lt;br /&gt;&lt;br /&gt;If the fully qualified name is com.xxx.yy.Class&lt;br /&gt;use javap -verbose com/xxx/yy/Class | grep version&lt;br /&gt;in the directory where com exist.&lt;br /&gt;&lt;br /&gt;Then grep for version&lt;br /&gt;&lt;br /&gt;minor version: 0&lt;br /&gt;major version: 50&lt;br /&gt;&lt;br /&gt;you could see the major and minor version. From the table below find the version information.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# major  minor Java platform version   &lt;br /&gt;# 45       3           1.0  &lt;br /&gt;# 45       3           1.1  &lt;br /&gt;# 46       0           1.2  &lt;br /&gt;# 47       0           1.3  &lt;br /&gt;# 48       0           1.4  &lt;br /&gt;# 49       0           1.5  &lt;br /&gt;# 50       0           1.6  &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Please note that if you are using JVM 1.5 to run your application and some of your dependent jars in the classpath have the compiled class version as 1.6, your application would fail.&lt;br /&gt;&lt;br /&gt;Either the dependent jars has to be in 1.5 or you should upgrade to 1.6 jvm.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-4177128209289296487?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/4177128209289296487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2009/11/version-of-compiled-class.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/4177128209289296487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/4177128209289296487'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2009/11/version-of-compiled-class.html' title='Version of the compiled class'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-3344508403313015465</id><published>2009-08-28T03:35:00.000-07:00</published><updated>2010-04-30T06:01:49.139-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>Inside JVM - "Where does everything live" - Part A</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Interesting problems which this series of post will address: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1. assertTrue(heapSize &gt; physical memory size) - Lets get into some OS(memory management-virtual memory)&lt;br /&gt;2. sizeof(permgen) &lt;&lt; sizeof(heap) ; assert if there is a performance impact&lt;br /&gt;3. GC and its issues(not tuning)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;We will focus mainly on how jvm manages memory specifically "what lives where"&lt;/span&gt;&lt;br /&gt;To start with , this post has info only about stack&lt;br /&gt;&lt;br /&gt;Java program has number of classes, each class may have variables, instances , statics, arrays, string constants and so on. &lt;br /&gt;I wonder where all these stuff live? If its C, I would simply know where it lives by doing printf("%d",&amp;i);&lt;br /&gt;But java does not have all those pointer stuff(Thank god). It provides a layer of abstraction. You never know where everything lives in memory but the only fact is, it lives in an area called as heap.&lt;br /&gt;&lt;br /&gt;Each program has a main thread which starts the proceedings. JVM would create some background daemon threads to do its VM activities.Generally, when you just have one class with main method, it would create some 12 threads. (1 main thread and 11 background threads) . Background daemon thread - GC is one example.&lt;br /&gt;&lt;br /&gt;Each thread has its own thread stack or simply 'stack'. This is where all local variables live. Every method call is pushed into a stack frame. A stack frame has method local variables and pointer to the objects which live in heap. Conider the following code.&lt;br /&gt;&lt;pre name="code" class="Java"&gt;&lt;br /&gt;public static void main(String args[])&lt;br /&gt;{&lt;br /&gt;int i=0;&lt;br /&gt;int j=5;&lt;br /&gt;process(i,j);&lt;br /&gt;}&lt;br /&gt;static void process(int i,int j)&lt;br /&gt;{&lt;br /&gt;long k=254L;&lt;br /&gt;gone();&lt;br /&gt;}&lt;br /&gt;static void gone()&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;stack would look like this&lt;br /&gt;--------------------------------&lt;br /&gt;gone()&lt;br /&gt;process() k=254&lt;br /&gt;main() i=0;j=5&lt;br /&gt;--------------------------------&lt;br /&gt;&lt;br /&gt;after completing the method execution of gone(), it will pop that out&lt;br /&gt;&lt;br /&gt;--------------------------------&lt;br /&gt;process() k=254&lt;br /&gt;main() i=0;j=5&lt;br /&gt;--------------------------------&lt;br /&gt;&lt;br /&gt;So far so good. Till now we considered only local variables and they live in stack.&lt;br /&gt;Note : Each thread has its own stack. Each thread will have its own copy of method local variables .&lt;br /&gt;&lt;br /&gt;Java supports recursion. Stack is used for recursion internally.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="Java"&gt;&lt;br /&gt;public class a&lt;br /&gt;{&lt;br /&gt; public static void main(String args[]) throws Exception&lt;br /&gt; {&lt;br /&gt;  while(true)&lt;br /&gt;  {&lt;br /&gt;   main(new String[]{"hi"});&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The above piece of code, will keep pushing main method into the stack and ultimately results in &lt;br /&gt;StackOverflowError&lt;br /&gt;Exception in thread "main" java.lang.StackOverflowError&lt;br /&gt;&lt;br /&gt;Now not-stop-recursion will eventually result in Error. What if we have many threads and the total size of all stacks becomes higher?&lt;br /&gt;&lt;br /&gt;Each thread has its own stack. Hence creating many threads in an application can also cause OutOfMemory error. Normally, stack size in unix is 256K.  when you have 256 threads each with 256K stacksize then your system must be capable of allocating 256 X 256 K = 64 MB of native memory, failing to do which it will throw. Now , How to overcome?&lt;br /&gt;&lt;br /&gt;One way is to tweak the stack size in the java options. - java -Xss512k or reduce the number of threads. ( Configure each threads stack size during thread object instantiation)&lt;br /&gt;This stack size will restrict the number of threads that could be created. &lt;br /&gt;&lt;br /&gt;Since the stack can contain only primitive data types or references to objects, it is very unlikely to happen.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;To be Continued... This post will be a Mega serial&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-3344508403313015465?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/3344508403313015465/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2009/08/this-post-is-under-construction.html#comment-form' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/3344508403313015465'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/3344508403313015465'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2009/08/this-post-is-under-construction.html' title='Inside JVM - &quot;Where does everything live&quot; - Part A'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-3146199964464280737</id><published>2009-08-19T13:09:00.000-07:00</published><updated>2010-07-24T13:42:33.659-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Math'/><title type='text'>Interesting probability problems</title><content type='html'>Below are two puzzles related to probability,which I found fascinating. The puzzles look simple, but most of the people get it wrong. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;First puzzle :&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Boy/Girl probability paradox?&lt;br /&gt;At the mall you run into a high school classmate whom you haven't seen in years. While catching up on each others lives, she mentions she has two children. &lt;br /&gt;&lt;br /&gt;A. Assume that you already know your classmate has a son. What is the probability that both her children are boys? &lt;br /&gt;&lt;br /&gt;A moment later, a boy comes running up to her and says, "Hi, Mom." Your classmate then says, "This is my youngest child." &lt;br /&gt;&lt;br /&gt;B. Now, what is the probability that both her children are boys?&lt;br /&gt;&lt;br /&gt;Are the probabilities of A. and B. the same or different? If different, explain why.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Second puzzle :&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Suppose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what's behind the doors, opens another door, say No. 3, which has a goat. He then says to you, "Do you want to pick door No. 2?" Is it to your advantage to switch your choice? &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Solutions :&lt;br /&gt;&lt;br /&gt;I am not going to write solutions here. Try out once and then compare with the answers. &lt;br /&gt;First one  : google "girl boy paradox"&lt;br /&gt;Second one : google "monty hall problem"&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Note : Please dont click comments as it has some solutions also&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-3146199964464280737?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/3146199964464280737/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2009/08/interesting-probability-problems.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/3146199964464280737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/3146199964464280737'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2009/08/interesting-probability-problems.html' title='Interesting probability problems'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-3135002762304518222</id><published>2009-08-05T14:09:00.000-07:00</published><updated>2010-04-30T06:04:43.842-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Algorithms'/><title type='text'>scratch pad : knapsack problem</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_HPHOFFg9BEQ/Snn1VoP2bTI/AAAAAAAABDY/8ctC7NBfP64/s1600/knapsack.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 640px; height: 930px;" src="http://4.bp.blogspot.com/_HPHOFFg9BEQ/Snn1VoP2bTI/AAAAAAAABDY/8ctC7NBfP64/s1600/knapsack.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5366590182918614322" /&gt;&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Key :&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;V - Value of each item &lt;/div&gt;&lt;div&gt;n - no of items&lt;/div&gt;&lt;div&gt;W - weight of knapsack (max weight)&lt;/div&gt;&lt;div&gt;wi - weight of item i &lt;/div&gt;&lt;div&gt;v[i,w] - best/optimized value of first i items having a total weight of w where w less than W&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Problem  : maximize value of items , given that maximum weight W - see knapsack in wiki&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-3135002762304518222?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/3135002762304518222/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2009/08/scratch-pad-knapsack-problem.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/3135002762304518222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/3135002762304518222'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2009/08/scratch-pad-knapsack-problem.html' title='scratch pad : knapsack problem'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_HPHOFFg9BEQ/Snn1VoP2bTI/AAAAAAAABDY/8ctC7NBfP64/s72-c/knapsack.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-5457645245950567956</id><published>2009-06-27T22:03:00.000-07:00</published><updated>2009-06-30T06:12:39.402-07:00</updated><title type='text'>Unix Scripting Essentials</title><content type='html'>I will start this post , with some basic scripts which I used moving to more complex ones. Most of the tasks were simple,&lt;br /&gt;1. Find total no of lines in your source code&lt;br /&gt;2. Search a class in jar repository&lt;br /&gt;and so on. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;"Many unix programs do quite trivial tasks in isolation, but , combined with other programs, become general and useful tools" &lt;/span&gt;- Kernighan&lt;br /&gt;&lt;br /&gt;Mostly it requires understanding these basic tools. find, xargs, jar .&lt;br /&gt;Pipes in unix helps us in taking the output of one program and give it as an input to another program. So here is the "search a class in jar repository one liner"&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="Java"&gt;&lt;br /&gt;$ find . -name "*.jar" -print0 | xargs -0 -i jar tvf {} | grep "someclass.class"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;find gives us a list of jar files. xargs takes these set of jar file names, and then calls jar tvf  &lt;jarfilename&gt; for each jar file . Then we finally grep for our class file. &lt;br /&gt;We can find if the class file is there in classpath or not.&lt;br /&gt;&lt;br /&gt;This script will just give, if the class is available or not but doesnt tell the important fact, which jar the class file exist if found.&lt;br /&gt;&lt;br /&gt;It doesnt solve the purpose. Lets tweak this, and write a shell script which does the same stuff , but prints the jar names, each time as it looks into it.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="Java"&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;classfile="myclassfile.class"&lt;br /&gt;for i in `find . -name "*jar"`&lt;br /&gt;do &lt;br /&gt; echo "processing $i "&lt;br /&gt; jar tvf $i | grep $classfile &gt; /dev/null&lt;br /&gt; if [ $? == 0 ]  then    echo "==&gt; found \"$classfile\" in $i"  &lt;br /&gt;fi&lt;br /&gt;done&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This script is self explanatory. $? - success/failure of the last command.&lt;br /&gt;&lt;br /&gt;find , xargs , grep together does lot of scripting tasks done easily. Let me post some other commands which I use frequently&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Change  some text in all files&lt;/span&gt;&lt;br /&gt;&lt;pre name="code" class="Java"&gt;&lt;br /&gt;find . -name "*.java" -print0 | xargs -0 -i sed 's/from/to/' {}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;show list of directories alone &lt;/span&gt;&lt;br /&gt;&lt;pre name="code" class="Java"&gt;&lt;br /&gt;ls -al | awk '/^d/{print $0}'&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Comment out lines from 20 to end&lt;/span&gt;&lt;br /&gt;&lt;pre name="code" class="Java"&gt;&lt;br /&gt;awk '{if(NR&gt;20){print "//",$0} else print}' "sourcefile"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Find source files which has a static method call&lt;/span&gt;&lt;br /&gt;&lt;pre name="code" class="Java"&gt;&lt;br /&gt;find . -name "*.java" -print0 | xargs -0 -i grep -H "Person.getName()"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Add line nos to a file&lt;/span&gt;&lt;br /&gt;&lt;pre name="code" class="Java"&gt;&lt;br /&gt;awk '{print NR,$0}' filename&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Important rule&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Both awk and sed does not modify the source file directly. The output of the awk/sed program is written to standard output. If you need the output in a file, use redirection like this below&lt;br /&gt;&lt;pre name="code" class="Java"&gt;&lt;br /&gt;awk '{print NR,$0}' filename &gt; targetfilename&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;targetfilename file will have the output now.&lt;br /&gt;&lt;br /&gt;awk, sed could be used with find and xargs, and these when combined together help you in realizing the power of unix platform and the speed at which you can get things done.&lt;br /&gt;&lt;br /&gt;If you are a windows user, install cygwin and you can run all these commands in windows also.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;"One will appreciate the beauty only if he understands it fully."&lt;/span&gt; Experiment these tools and you will start loving&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-5457645245950567956?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/5457645245950567956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2009/06/one-liners.html#comment-form' title='14 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/5457645245950567956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/5457645245950567956'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2009/06/one-liners.html' title='Unix Scripting Essentials'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-6868673237180204102</id><published>2009-06-20T08:52:00.000-07:00</published><updated>2009-06-20T08:56:19.462-07:00</updated><title type='text'>Necessity for Scripting</title><content type='html'>Being a Programmer, it is extremely essential to know as much tools as possible. Scripting is one such tool which makes life easier. I love to code, but I have never read any scripting language. You may think why. The easy answer is ‘ I have never worked in unix/linux’. It leads to the biggest question , WTH/WTF you code but not using unix. I am not going to discuss about that now.&lt;br /&gt;&lt;br /&gt;Every day when I work, I always require some small tasks to be done. One instance is , I need to &lt;span style="font-weight:bold;"&gt;find the no of lines in my total source code&lt;/span&gt;. I struggled to find the easiest way to find this. There is a top level directory which has many directories in it.There are many source files anywhere in this directory hierarchy. We need to find the total no of lines.&lt;br /&gt;&lt;br /&gt;When I was struggling to get this done, my colleague appeared and he wrote one complex line , and there …. Was the output on terminal. It made me think, I should use right tools to get things done faster. Perhaps its easy to write a java program which does this.&lt;br /&gt;&lt;br /&gt;It recursively traverses the directories, open each source file, find no of lines the close the file and do all these stuff. Java code would have been some 20 lines, but definitely it would have taken some time. But the same thing could be done in a single line in just a minute. So it is very essential to know the right tool to use for the right purpose.&lt;br /&gt;&lt;br /&gt;So I decided I am going to learn scripting tools. I found that there are n scripting languages , and each language does one stuff great. I found perl as the one , which is complete and with which we can get these stuff done easily. I came across awk , sed whose sole purpose of existence is to get things done in a single line. These are languages which operate on each line and could be used for editing, finding , pattern matching large amount of files. &lt;br /&gt;&lt;br /&gt;I started learning these small tools , which will make my life comfortable in near future. If you are not satisfied with scripting , go ahead using your c++/java code to do all these stuff. It requires you to do file i/o which is unnecessary. These tools do all these file i/o and other stuff in the background and makes our life easier. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;use right tools and get things faster&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-6868673237180204102?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/6868673237180204102/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2009/06/necessity-for-scripting.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/6868673237180204102'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/6868673237180204102'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2009/06/necessity-for-scripting.html' title='Necessity for Scripting'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-3011972864368922919</id><published>2008-12-04T07:21:00.000-08:00</published><updated>2010-04-30T06:02:50.743-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='singleton'/><title type='text'>Are you game -singleton pattern</title><content type='html'>If you are a java expert and feel u know much about singletons including my previous two posts on singleton, go through this article.&lt;br /&gt;&lt;a href="http://java.sun.com/developer/technicalArticles/Programming/singletons/"&gt;http://java.sun.com/developer/technicalArticles/Programming/singletons/&lt;/a&gt;&lt;br /&gt;Am I becoming a singleton freak, posting this again n again .'No' I feel  i know only this well !!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-3011972864368922919?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/3011972864368922919/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2008/12/are-you-game-singleton-pattern.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/3011972864368922919'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/3011972864368922919'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2008/12/are-you-game-singleton-pattern.html' title='Are you game -singleton pattern'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-9046960384358370941</id><published>2008-12-03T19:29:00.000-08:00</published><updated>2008-12-03T19:39:23.291-08:00</updated><title type='text'>oops....my password!</title><content type='html'>Google being the most popular intenet brand,all of us have a gmail id and use it for all purposes.Hence securing your password is a must.Now what if you have a slight doubt that your friend/colleague knows your password and they might peek into your personal stuff.To overcome this, there is an option in gmail.&lt;br /&gt;look at last few lines at the bottom of your gmail&lt;br /&gt;you will find,&lt;br /&gt;Last account activity: 11 hours ago on this computer.   &lt;span id=":am" class="l73JSe" tabindex="0" role="link"&gt;Details&lt;br /&gt;click details.This will show you the ip's from which you logged in for the previous five times.If someone has logged  into your account,you catch them here.I dont need to say how!. And from your side you can sign them out by clicking 'sign out all other sessions'.Perhaps the easiest way is to change the mail password . This is just to ensure that your heroics are not revealed to others.(chatting,kadalai with girls!!!)&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-9046960384358370941?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/9046960384358370941/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2008/12/oopssomeone-know-my-password.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/9046960384358370941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/9046960384358370941'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2008/12/oopssomeone-know-my-password.html' title='oops....my password!'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-9085882122384207360</id><published>2008-11-17T03:39:00.000-08:00</published><updated>2010-04-30T06:05:56.546-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='singleton'/><title type='text'>singleton pattern hack</title><content type='html'>The previous post was about making sure only one instance is created for a particular class.&lt;br /&gt;We all know that a class is always referred by its fully qualified name.But still each class is initially loaded by a classLoader.&lt;br /&gt;Hence we can create another classloader for this singleton class and get another instance.Thats the hack for getting two instances from a singleton class.&lt;br /&gt;Extract :&lt;br /&gt;Java doesn't provide the formal notion of class version. So how is it possible to implement a class loading domain? The runtime identity of a class in Java 2 is defined by the &lt;em&gt;fully qualified class name&lt;/em&gt; and its &lt;em&gt;defining class loader&lt;/em&gt;. This means that the same class, loaded by two different class loaders, is seen by the Virtual Machine as two completely different types.&lt;br /&gt;&lt;br /&gt;Thanks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-9085882122384207360?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/9085882122384207360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2008/11/singleton-pattern-hack.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/9085882122384207360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/9085882122384207360'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2008/11/singleton-pattern-hack.html' title='singleton pattern hack'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-5895586952267630299</id><published>2008-10-04T09:00:00.000-07:00</published><updated>2010-04-30T06:05:56.546-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='singleton'/><title type='text'>Make Singleton pattern thread-safe</title><content type='html'>Hi all&lt;br /&gt;&lt;br /&gt;Any Object oriented programmer,one day or other will need to restrict creation of multiple instances.Yes the easiest but the most used,singleton pattern.&lt;br /&gt;Singleton pattern&lt;br /&gt;&lt;pre name="code" class="Java"&gt;  &lt;br /&gt;class singleton&lt;br /&gt;{&lt;br /&gt;private static Singleton newInstance=null;&lt;br /&gt;private singleton()&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;public static Singleton getInstance()&lt;br /&gt;{&lt;br /&gt;1.if(newInstance==null)&lt;br /&gt;2.newInstance=new Singleton();&lt;br /&gt;return newInstance;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This is the classic implementation of the singleton pattern.It provides a static getInstance method to get the singleton instance.&lt;br /&gt;Since it has private constructor we cannot instantiate using new operator outside.&lt;br /&gt;&lt;br /&gt;We can get the instance by calling the static method Singleton.getInstance()&lt;br /&gt;&lt;br /&gt;But this classic implementation is not thread safe.&lt;br /&gt;As two threads calling getInstance at the same time can get two different instances as the method is not synchronized.&lt;br /&gt;Say threadA is on line marked 1&lt;br /&gt;ThreadB has just finished line 1&lt;br /&gt;Now threadA checks whether newInstance is null and it finds it null as ThreadB has not executed line 2.&lt;br /&gt;So in this case actually two instances are created as the method is not thread safe.&lt;br /&gt;&lt;br /&gt;By making the following change the whole pattern works fine.&lt;br /&gt;Add synchronized keyword.&lt;br /&gt;public static synchronized Singleton getInstance()&lt;br /&gt;&lt;br /&gt;Note: Singleton pattern helps us to restrict the no of instance for a class and it doesnt say explicitly that it allows only one instance.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-5895586952267630299?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/5895586952267630299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2008/10/closer-look-on-singleton-pattern.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/5895586952267630299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/5895586952267630299'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2008/10/closer-look-on-singleton-pattern.html' title='Make Singleton pattern thread-safe'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-4898297206513687798</id><published>2008-09-02T04:09:00.000-07:00</published><updated>2008-09-02T04:12:56.780-07:00</updated><title type='text'>Coolest hack for RHEL</title><content type='html'>Hi all&lt;br /&gt;&lt;br /&gt;Playigng mp3 in linux,especially in RHEL is a tough job for linux newbies.&lt;br /&gt;The easiest way to go about this is to install the yum&lt;br /&gt;Now use yum to install vlc.This works and u have vlc which can play any format.&lt;br /&gt;But still this is linux, whenever u play some mp3 u might end up getting this&lt;br /&gt;&lt;br /&gt;[00000353] alsa audio output error: write failed (Broken pipe)&lt;br /&gt;&lt;br /&gt;The coolest way to overcome this is to change the audio channels in the vlc player.&lt;br /&gt;Now open the mp3 again.It works!!!&lt;br /&gt;Note : Even if this did not work.Close all applications which produces sound.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-4898297206513687798?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/4898297206513687798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2008/09/coolest-hack-for-rhel.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/4898297206513687798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/4898297206513687798'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2008/09/coolest-hack-for-rhel.html' title='Coolest hack for RHEL'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-2749847020736083351</id><published>2008-08-25T20:39:00.000-07:00</published><updated>2008-08-25T20:46:23.283-07:00</updated><title type='text'>Cookies should be cleared for privacy.</title><content type='html'>Hi all&lt;br /&gt;Whenever we login to some site, our login information is stored as cookies in the browser.&lt;br /&gt;Say we sign into gmail.com&lt;br /&gt;The first time after you sign in,a cookie for gmail will be set in the browser.&lt;br /&gt;For all subsequent request you make like Inbox or Sent mail ... these cookies will be sent for authentication.&lt;br /&gt;This cookies will get deleted only when you sign out.&lt;br /&gt;So do not close you mail account and leave the browser open.&lt;br /&gt;If you just close your mail account rather signing out ,open a new tab ,type gmail.com it will directly go to your mail box.&lt;br /&gt;In mozilla the cookies get cleared by default when the browser exits.So make sure even if you dont sign out close the browser so that the cookies get cleared.&lt;br /&gt;Or manually clear the cookies by changing the browser preferences&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-2749847020736083351?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/2749847020736083351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2008/08/cookies-should-be-cleared-for-privacy.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/2749847020736083351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/2749847020736083351'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2008/08/cookies-should-be-cleared-for-privacy.html' title='Cookies should be cleared for privacy.'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-5829447864008644845</id><published>2008-08-18T21:01:00.000-07:00</published><updated>2008-08-18T21:04:54.791-07:00</updated><title type='text'>wanna know when and whether your mail was read!!!</title><content type='html'>This can be very very useful if you really want to know whether your mail is opened.&lt;br /&gt;Send mail to any person and as soon as he opens the mail , u will get an alert saying "Ur mail opened and read".Cool nice tip&lt;br /&gt;To know how to do this,&lt;br /&gt;Check spypig.com which helps in this spying process.It works!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-5829447864008644845?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/5829447864008644845/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2008/08/wanna-know-when-and-whether-your-mail.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/5829447864008644845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/5829447864008644845'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2008/08/wanna-know-when-and-whether-your-mail.html' title='wanna know when and whether your mail was read!!!'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-330495811925311641</id><published>2008-08-10T23:36:00.000-07:00</published><updated>2008-08-10T23:41:43.210-07:00</updated><title type='text'>reverse i search for linux users</title><content type='html'>This post is for Linux newbie.&lt;br /&gt;To easily access the recently executed commands.Use reverse index search which searches your command history and give you the command.&lt;br /&gt;&lt;br /&gt;For instance you executed this command earlier&lt;br /&gt;#sudo mvn compile somefilename&lt;br /&gt;&lt;br /&gt;Now press ctrl+r and start typing the command&lt;br /&gt;#sudo&lt;br /&gt;it will search your command hostory and automatically fill with the whole command.&lt;br /&gt;If you want to go to some other command press ctrl+r again to move backwards&lt;br /&gt;This will speed up your whole process.&lt;br /&gt;&lt;br /&gt;Note : #history | grep sudo could also be used incase you forget the whole command&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-330495811925311641?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/330495811925311641/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2008/08/reverse-i-search-for-linux-users.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/330495811925311641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/330495811925311641'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2008/08/reverse-i-search-for-linux-users.html' title='reverse i search for linux users'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-260974085120697249</id><published>2008-08-04T20:55:00.000-07:00</published><updated>2008-08-04T20:59:03.160-07:00</updated><title type='text'>Make your bookmarks social</title><content type='html'>&lt;h3&gt;What is Social Bookmarking?: &lt;/h3&gt;&lt;p&gt;Have you ever e-mailed a friend or family member and sent them a link to a website you thought they might find interesting? If so, you have participated in social bookmarking.&lt;/p&gt;  &lt;p&gt;&lt;i&gt;What is social bookmarking&lt;/i&gt;?  It is &lt;a href="http://webtrends.about.com/od/glossary/g/tag_def.htm"&gt;tagging&lt;/a&gt; a website and saving it for later. Instead of saving them to your web browser, you are saving them to the web. And, because your bookmarks are online, you can easily share them with friends.&lt;/p&gt;Some site for social bookmarking&lt;br /&gt;del.icio.us  - a yahoo based one&lt;br /&gt;diggit&lt;br /&gt;slashdot&lt;br /&gt;&lt;br /&gt;Adavantages&lt;br /&gt;&lt;br /&gt;Share your bookmarks easily with other people&lt;br /&gt;Tag them so that its easy to search back&lt;br /&gt;Access your bookmarks from anywhere if online&lt;br /&gt;&lt;br /&gt;Daily, you might come across some very good site and if you do social bookmarking ,you will never lose them.Create an account start bookmarking and sene me the link&lt;br /&gt;Here is mine&lt;br /&gt;del.icio.us/sppraveen&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-260974085120697249?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/260974085120697249/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2008/08/make-your-bookmarks-social.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/260974085120697249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/260974085120697249'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2008/08/make-your-bookmarks-social.html' title='Make your bookmarks social'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7790123389411327331.post-8804640360726857171</id><published>2008-08-04T03:52:00.000-07:00</published><updated>2008-08-04T03:57:21.841-07:00</updated><title type='text'>Invisible in gtalk?</title><content type='html'>I really dont know if this should be my first post of this random collection.&lt;br /&gt;But still the most simple and the straight forward one.&lt;br /&gt;&lt;br /&gt;What if you want to be invisible in gtalk(A feature in Yahoo messenger which is missing in gtalk)&lt;br /&gt;One way is to sign in through gmail and use the browser based chat facility.&lt;br /&gt;This has a status bar where the invisible mode could be set.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7790123389411327331-8804640360726857171?l=untiluknow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://untiluknow.blogspot.com/feeds/8804640360726857171/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://untiluknow.blogspot.com/2008/08/invisible-in-gtalk.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/8804640360726857171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7790123389411327331/posts/default/8804640360726857171'/><link rel='alternate' type='text/html' href='http://untiluknow.blogspot.com/2008/08/invisible-in-gtalk.html' title='Invisible in gtalk?'/><author><name>S P Praveen</name><uri>http://www.blogger.com/profile/00574437530409840970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
