<?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-5634405680765167374</id><updated>2011-12-31T02:08:12.004-08:00</updated><category term='Hashtable'/><category term='computer science'/><category term='Algorithm'/><category term='my intro'/><category term='interview'/><category term='pointer to function'/><category term='Daemon'/><category term='C'/><category term='programming'/><category term='coding'/><title type='text'>while(1);</title><subtitle type='html'>Learning is an endless loop</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://shubham-theway.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5634405680765167374/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://shubham-theway.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Eps!lon</name><uri>http://www.blogger.com/profile/03422560839616223592</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-KfHzNTLMxqw/TfUD0-NeiUI/AAAAAAAAACI/EnPzlVsLews/s220/IMG_2268.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5634405680765167374.post-642030071578180559</id><published>2011-12-31T02:04:00.001-08:00</published><updated>2011-12-31T02:08:12.025-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='Algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='Hashtable'/><category scheme='http://www.blogger.com/atom/ns#' term='Daemon'/><category scheme='http://www.blogger.com/atom/ns#' term='coding'/><title type='text'>In Memory Hashtable</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;In web applications you mostly get into this kind of situations where you need a code or API which acts as Hashtable and since you want it lightning fast, it must be in the memory instead of disk storage. So how would you create an In Memory Hashtable for Strings for a large set.&lt;br /&gt;&lt;br /&gt;I had enough experience with hashtable to understand that the whole bottleneck is going to be the hash function which maps Strings to LongInts. After some brainstorming I got the solution. So here we go:&lt;br /&gt;1. Create a Trie and provide to methods to set and retrieve the values. Something like this:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;bool insert(String s)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;long retrieve(String s)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;bool exist(String s)&lt;br /&gt;&lt;br /&gt;2. Create a list of String to be inserted in the beginning and use a file to perform the operation.&lt;br /&gt;&lt;br /&gt;3. Once you are done with the initial setup now you can put your Hashtable live to answer your queries.&lt;br /&gt;&lt;br /&gt;4. Create a daemon and put the above code into it.&lt;br /&gt;&lt;br /&gt;5. Whenever you want to shoot a query invoke the daemon and call the retrieve function.&lt;br /&gt;&lt;br /&gt;I hope the main problem would be figuring out the appropriate solution and writing a code for daemon and hashtable won't be a problem.&lt;br /&gt;&lt;br /&gt;This can be implemented in many ways and on any architecture. But since mostly the servers are located on Linux machines, mostly it'll be useful on Linux environment with C being the underlying language. However I admit that if you use Java or Python it will be much easier to code. I used unix message passing mechanism to handle IPC.&lt;br /&gt;&lt;br /&gt;Anybody wants the working code then write to me &lt;a href="mailto:dave.shubham@gmail.com"&gt;here&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5634405680765167374-642030071578180559?l=shubham-theway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shubham-theway.blogspot.com/feeds/642030071578180559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5634405680765167374&amp;postID=642030071578180559' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5634405680765167374/posts/default/642030071578180559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5634405680765167374/posts/default/642030071578180559'/><link rel='alternate' type='text/html' href='http://shubham-theway.blogspot.com/2011/12/in-memory-hashtable.html' title='In Memory Hashtable'/><author><name>Eps!lon</name><uri>http://www.blogger.com/profile/03422560839616223592</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-KfHzNTLMxqw/TfUD0-NeiUI/AAAAAAAAACI/EnPzlVsLews/s220/IMG_2268.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5634405680765167374.post-5020199695081376649</id><published>2011-06-23T13:06:00.000-07:00</published><updated>2011-06-23T13:07:28.037-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='computer science'/><title type='text'>Science of Computer Science</title><content type='html'>With increasing number of students getting out of college with the same Bachelor degree of Computer Science, its important to focus of some key area of Computer Science to get an edge over others. I created a list (or a wish list in some sense) of topics that I promised myself to learn. However the list itself was volatile and this excuse was sufficient enough to not abide to the promise :D. Finally it is now in stable state. So here we go...&lt;br /&gt;&lt;br /&gt;&gt; Good command over a couple of Programming Languages ( C/C++ and/or Java would do)&lt;br /&gt;&gt; One Scripting Language. (Python (preferred), Java Script, Bash anyone)&lt;br /&gt;&gt; Good understanding of OS (Life is as simple as Unix)&lt;br /&gt;&gt; Database handling (need not be an expert but capable of understanding/performing normalizations and basic queries)&lt;br /&gt;&gt; Basic Networking concepts (If time permits and unless your only goal is to get into Cisco :) )&lt;br /&gt;&gt; Finally Data Structures and Algorithms with Coding (No limits)&lt;br /&gt;&lt;br /&gt;With these Arms and Ammo in your disposal, you are ready to face any challenge. But war does not always win by the tangible things.&lt;br /&gt;You can apply in Google/ Facebook/ Twitter/ Microsoft/ Adobe etc or better go for research in any of the topic you liked.&lt;br /&gt;&lt;br /&gt;Disclaimer: This list is prepared by me, being an average student throughout. It includes only my thoughts &amp; is not targeted towards outstanding and brilliant students. :P&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5634405680765167374-5020199695081376649?l=shubham-theway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shubham-theway.blogspot.com/feeds/5020199695081376649/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5634405680765167374&amp;postID=5020199695081376649' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5634405680765167374/posts/default/5020199695081376649'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5634405680765167374/posts/default/5020199695081376649'/><link rel='alternate' type='text/html' href='http://shubham-theway.blogspot.com/2011/06/science-of-computer-science.html' title='Science of Computer Science'/><author><name>Eps!lon</name><uri>http://www.blogger.com/profile/03422560839616223592</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-KfHzNTLMxqw/TfUD0-NeiUI/AAAAAAAAACI/EnPzlVsLews/s220/IMG_2268.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5634405680765167374.post-5003669431425835315</id><published>2011-06-18T13:31:00.000-07:00</published><updated>2011-07-11T04:32:00.931-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='coding'/><title type='text'>code for fun</title><content type='html'>Program to Add/Subtract/Multiply 2 numbers..&lt;br /&gt;Sounds pretty easy, so is the code for it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#define s(c)    if(scanf("%c",&amp;c)){}&lt;br /&gt;#define p(b)    if(b+=(c-'0')){} if(b*=10){}&lt;br /&gt;#define w(a,b)  while(a&gt;b){&lt;br /&gt;#define i(a,b)  if(a=b){}&lt;br /&gt;main(int a,int b,int n,char c,char o)&lt;br /&gt;{&lt;br /&gt;if(scanf("%d",&amp;n)){}&lt;br /&gt;s(c)&lt;br /&gt;w(n--,0)&lt;br /&gt;i(a,0)&lt;br /&gt;i(b,0)&lt;br /&gt;s(c)&lt;br /&gt;w(c,47)&lt;br /&gt;p(a)&lt;br /&gt;s(c)&lt;br /&gt;}&lt;br /&gt;if(a/=10){}&lt;br /&gt;i(o,c)&lt;br /&gt;s(c)&lt;br /&gt;w(c,47) &lt;br /&gt;p(b)&lt;br /&gt;s(c)&lt;br /&gt;}&lt;br /&gt;if(b/=10){}&lt;br /&gt;if(o=='+')&lt;br /&gt;if(a=a+b){}&lt;br /&gt;if(o=='-')&lt;br /&gt;if(a=a-b){}&lt;br /&gt;if(o=='*')&lt;br /&gt;if(a=a*b){}&lt;br /&gt;if(printf("%d\n",a)){}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;However if you have noticed it correctly you would have found it unusual in the sense that it does not have any single semicolon. The unnecessary directives are to make the code shorter but it made the code ugly nevertheless.&lt;br /&gt;I am still trying to make it smaller. If any one has better idea regarding it then comments are welcome.&lt;br /&gt;You can compile the code successfully on any GCC compiler and run it as described below:&lt;br /&gt;3 (3 test cases)&lt;br /&gt;123+456&lt;br /&gt;output: 579&lt;br /&gt;456-123&lt;br /&gt;output:333&lt;br /&gt;123*45&lt;br /&gt;output: 5535&lt;br /&gt;&lt;br /&gt;happy coding!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5634405680765167374-5003669431425835315?l=shubham-theway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shubham-theway.blogspot.com/feeds/5003669431425835315/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5634405680765167374&amp;postID=5003669431425835315' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5634405680765167374/posts/default/5003669431425835315'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5634405680765167374/posts/default/5003669431425835315'/><link rel='alternate' type='text/html' href='http://shubham-theway.blogspot.com/2011/06/code-for-fun.html' title='code for fun'/><author><name>Eps!lon</name><uri>http://www.blogger.com/profile/03422560839616223592</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-KfHzNTLMxqw/TfUD0-NeiUI/AAAAAAAAACI/EnPzlVsLews/s220/IMG_2268.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5634405680765167374.post-1209192268100875548</id><published>2011-06-09T10:46:00.000-07:00</published><updated>2011-06-12T21:32:08.345-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='pointer to function'/><category scheme='http://www.blogger.com/atom/ns#' term='coding'/><title type='text'>When pointer to functions fascinated me...</title><content type='html'>Some time back I was fascinated by pointer to function concept. Not only it gives the flexibility of CallBack, its more faster nevertheless. But instead of writing plain code I thought to write a code that looks different. Here it is...&lt;br /&gt;&lt;br /&gt;void _(int *_o,int o_){o_&lt;7?printf("%c",o_[_o]),o_++,_(_o,o_):printf("\n");}&lt;br /&gt;void o_o(void (*_)(int*,int),int *_0,int __){_(_0,__);}&lt;br /&gt;main(){int _O_[]={83,104,117,98,104,97,0x6d},_i_=0;&lt;br /&gt;void (*_o_)(int*,int)=&amp;_;&lt;br /&gt;void (*_0_)(void(*__)(int*,int),int*,int)=&amp;o_o;&lt;br /&gt;_0_(_o_,_O_,_i_);}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;All it does is print my name.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5634405680765167374-1209192268100875548?l=shubham-theway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shubham-theway.blogspot.com/feeds/1209192268100875548/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5634405680765167374&amp;postID=1209192268100875548' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5634405680765167374/posts/default/1209192268100875548'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5634405680765167374/posts/default/1209192268100875548'/><link rel='alternate' type='text/html' href='http://shubham-theway.blogspot.com/2011/06/when-pointer-to-functions-fascinated-me.html' title='When pointer to functions fascinated me...'/><author><name>Eps!lon</name><uri>http://www.blogger.com/profile/03422560839616223592</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-KfHzNTLMxqw/TfUD0-NeiUI/AAAAAAAAACI/EnPzlVsLews/s220/IMG_2268.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5634405680765167374.post-3921560770632167097</id><published>2010-08-13T08:00:00.000-07:00</published><updated>2011-07-21T20:11:28.868-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='interview'/><title type='text'>interview(s), job(s) and offer(s)</title><content type='html'>I had been rigorously interviewed by some of the most high profile software developing firms in India including GE India, Slide Share, Oracle and Amazon. &lt;br /&gt;Here are the stats&lt;br /&gt;Slide share : interviewed by tech expert, tech lead India, India Head, CTO. Finally Not selected!!&lt;br /&gt;Amazon.com : cleared 3 rounds. Finally Not selected!!&lt;br /&gt;GE India : cleared all 5 rounds. Finally In.&lt;br /&gt;Oracle India : cleared all 6 rounds. HR asked to wait for final approval, which is happened to be in US. Finally got the offer letter.&lt;br /&gt;Had I not been selected by two companies, I would have appeared for SlideShare with much more sincerity and would have cracked it too.. probably :)&lt;br /&gt;All in all I didn't let down myself. I'm kinda happy with the result. I was able to clear all the coding and aptitude rounds and was able to convince almost all of my interviewers. Details about the interviews and questions they asked will be covered in subsequent posts :)&lt;br /&gt;Ok finally I settled down in GE India, which has great work culture, people and also the work. I like it more because I have bad experience from my old employer.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5634405680765167374-3921560770632167097?l=shubham-theway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shubham-theway.blogspot.com/feeds/3921560770632167097/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5634405680765167374&amp;postID=3921560770632167097' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5634405680765167374/posts/default/3921560770632167097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5634405680765167374/posts/default/3921560770632167097'/><link rel='alternate' type='text/html' href='http://shubham-theway.blogspot.com/2010/08/interviews-jobs-and-offers.html' title='interview(s), job(s) and offer(s)'/><author><name>Eps!lon</name><uri>http://www.blogger.com/profile/03422560839616223592</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-KfHzNTLMxqw/TfUD0-NeiUI/AAAAAAAAACI/EnPzlVsLews/s220/IMG_2268.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5634405680765167374.post-8026683829914066053</id><published>2010-05-23T12:56:00.000-07:00</published><updated>2010-05-23T13:41:23.622-07:00</updated><title type='text'>Linux Experience</title><content type='html'>Hi, I am writing after a long time and of course my life has changed big time. During the last post I was in college and now it's been around 7 months or so since I have been working in an IT company, however the main thing that I am gonna discuss here, is the change of the machine I posses. I had AMD Athlon and now its Dell i5. I wanted it to be Open Source so I installed Fedora. I started with Fedora 8 then 9 and 11 until I had settled with 12.&lt;br /&gt;&lt;iframe src="http://rcm.amazon.com/e/cm?t=algrhy-20&amp;o=1&amp;p=8&amp;l=bpl&amp;asins=B002FCDZCQ&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="align:left;padding-top:5px;width:131px;height:245px;padding-right:10px;"align="left" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt;&lt;br /&gt;Previous versions were not compatible with the machine given the latest hardware I had. The distro seemed nice and complete but I was unable to listen to music since media players do not have codecs sufficient enough to play media. Finally I found mplayer that was perfect and since then I had been using it without a problem. It's been playing all the extensions and all the types of media. However it was a command line player and didn't come up with a GUI. Ultimately I got smplayer which was a wrapper over the mplayer. It was just a GUI and used mplayer to play the media behind the scene.&lt;br /&gt;I did many experiments with it but thats for subsequent posts.&lt;br /&gt;Happy Gnuing&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5634405680765167374-8026683829914066053?l=shubham-theway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shubham-theway.blogspot.com/feeds/8026683829914066053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5634405680765167374&amp;postID=8026683829914066053' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5634405680765167374/posts/default/8026683829914066053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5634405680765167374/posts/default/8026683829914066053'/><link rel='alternate' type='text/html' href='http://shubham-theway.blogspot.com/2010/05/linux-experience.html' title='Linux Experience'/><author><name>Eps!lon</name><uri>http://www.blogger.com/profile/03422560839616223592</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-KfHzNTLMxqw/TfUD0-NeiUI/AAAAAAAAACI/EnPzlVsLews/s220/IMG_2268.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5634405680765167374.post-7209131847725972972</id><published>2009-01-15T05:18:00.000-08:00</published><updated>2009-01-15T22:33:00.830-08:00</updated><title type='text'>Repeated Squaring: You will love it</title><content type='html'>This time I want to write something about the calculation of large powers of any number. For example say we want to calculate 13 to the power 1000. This is indeed a huge number and there is no data type in C/C++ or even in java that can hold such a huge number. So this is a problem unless you are a python user. Well I am not interested in talking about BigInt class but how to perform such calculation efficiently. In a scenario like when you need to find the last digit of the above mentioned number (13^1000) you can use it since you have to save only one digit throughout the calculation ( of the last digit).&lt;br /&gt;More precisely let l(n)=last digit of n&lt;br /&gt;13^1=13 l=3&lt;br /&gt;13^2=13*13=169   l(13*13)=l(3*13)&lt;br /&gt;13^3=169*13=2197     l(169*13)=l(9*13)&lt;br /&gt;13^4=2197*13=28561      l(2197*13)=l(7*13)&lt;br /&gt;means you need not save all the intermediate huge numbers along the way but just their last digit&lt;br /&gt;&lt;br /&gt;Now come back to our business of calculation of 13^1000.&lt;br /&gt;There are 2 approaches&lt;br /&gt;1. Naive method&lt;br /&gt;2. Repeated Squaring&lt;br /&gt;&lt;br /&gt;1&lt;span style="font-style: italic;"&gt;. Naive method&lt;/span&gt; is to calculate straight forward 13*13*13.... (1000 timess)13&lt;br /&gt;something like this&lt;br /&gt;a=1;&lt;br /&gt;for(i=0;i&lt;1000;i++) &lt;br /&gt;{&lt;br /&gt;  a=a*13;&lt;br /&gt;  a=a%10;&lt;br /&gt;}&lt;br /&gt;it requires &lt;span style="font-weight:bold;"&gt;1000&lt;/span&gt; multiplications!!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;2. Repeated squaring&lt;/span&gt;&lt;br /&gt;we will calculate 13 to the power multiples of two...&lt;br /&gt;here we go&lt;br /&gt;a=13*13&lt;br /&gt;b=a*a=(13*13)*(13*13)=13^4&lt;br /&gt;c=b*b=(13*13)*(13*13)*(13*13)*(13*13)=13^8&lt;br /&gt;using a loop we can proceed&lt;br /&gt;13^16, 13^32, 13^64, 13^128, 13^256, 13^512&lt;br /&gt;now just multiply (13^512)*(13^256)*(13^128)*(13^64)*(13^32)*(13^8)=13^1000&lt;br /&gt;512+256+128+64+32+8=1000&lt;br /&gt;so totally &lt;span style="font-weight:bold;"&gt;14&lt;/span&gt; multiplications!!!!&lt;br /&gt;So you can check by yourself how beautiful this method is :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5634405680765167374-7209131847725972972?l=shubham-theway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shubham-theway.blogspot.com/feeds/7209131847725972972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5634405680765167374&amp;postID=7209131847725972972' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5634405680765167374/posts/default/7209131847725972972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5634405680765167374/posts/default/7209131847725972972'/><link rel='alternate' type='text/html' href='http://shubham-theway.blogspot.com/2009/01/repeated-squaring-you-will-love-it.html' title='Repeated Squaring: You will love it'/><author><name>Eps!lon</name><uri>http://www.blogger.com/profile/03422560839616223592</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-KfHzNTLMxqw/TfUD0-NeiUI/AAAAAAAAACI/EnPzlVsLews/s220/IMG_2268.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5634405680765167374.post-4627272586463692419</id><published>2008-12-01T20:13:00.000-08:00</published><updated>2011-06-24T08:56:16.133-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>fastest i/o methods</title><content type='html'>Almost all the problems involve some kind of input and output processing. Unless your code is of O(n^2) or above, more than 70% of the running time goes for IO processing. So it is important to perfrom these operation efficiently in order to make the entire program efficient. here are some tips regarding input and output...&lt;br /&gt;1. More overloaded a function the more time it takes&lt;br /&gt;It means if you use overloaded function or stream opreator then it will take more time than an ordinary function, in short cin is slower than scanf() which in turn is slower than gets()&lt;br /&gt;2. Input and output usually involves peripheral hardwares which make them slow.&lt;br /&gt;If you are taking input from file then its ok otherwise you have to use keyboard which can slow down the speed not because you cant type fast(even thats also true) but because it has to check the buffer of keyboard and same in case output.&lt;br /&gt;3. String and character arrays are easy to handle in case of input and output because the compiler just has to use them exactly as they are. Int, Long and Floats have to be transformed before printing or before storing.&lt;br /&gt;&lt;br /&gt;Here is a hierarchy of the methods to take the input:&lt;br /&gt;&gt; fread() or read() system call&lt;br /&gt;&gt; gets() or getchar()&lt;br /&gt;&gt; scanf()&lt;br /&gt;&gt; cin&gt;&gt;&lt;br /&gt;these are the methods in the increasing order of processing time with fread() is the fastest and cin being the slowest.&lt;br /&gt;&lt;br /&gt;similarly you can figure out for the output:&lt;br /&gt;&gt; fwrite() or write()&lt;br /&gt;&gt; puts()&lt;br /&gt;&gt; printf()&lt;br /&gt;&gt; cout&lt;&lt;&lt;br /&gt;&lt;br /&gt;now choose any one option according to the situation. Choose from the bottom if you want good looking but relatively slower code and choose from the top if you want complex but faster code... as always choice is yours :)&lt;br /&gt;happy coding&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5634405680765167374-4627272586463692419?l=shubham-theway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shubham-theway.blogspot.com/feeds/4627272586463692419/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5634405680765167374&amp;postID=4627272586463692419' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5634405680765167374/posts/default/4627272586463692419'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5634405680765167374/posts/default/4627272586463692419'/><link rel='alternate' type='text/html' href='http://shubham-theway.blogspot.com/2008/12/fastest-io-methods.html' title='fastest i/o methods'/><author><name>Eps!lon</name><uri>http://www.blogger.com/profile/03422560839616223592</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-KfHzNTLMxqw/TfUD0-NeiUI/AAAAAAAAACI/EnPzlVsLews/s220/IMG_2268.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5634405680765167374.post-2535279584344378333</id><published>2008-09-14T13:56:00.000-07:00</published><updated>2008-12-01T14:45:16.297-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>get the input from a file</title><content type='html'>there are lots of problems on SPOJ that require input must be taken from an input file. Those types of problems require that you get input till the end of input file and you cant use simple while or for loop to get input say 'n' no of times or until a particular number is entered. i tried so many things like finding EOF or checking for (!scanf()) but none of them worked and finally i had to keep my working codes for those problems aside since if i cant take inputs as described i will either get Time limit exceeded or runtime error. &lt;br /&gt;after a long searching of such code i finally got perhaps the easiest way to get around that problem of getting input. it is damn simple. all you need to do is to make an object(e.g. string s;) of string type in CPP of course and then simply initialize a loop as &lt;br /&gt;string s;&lt;br /&gt;while(getline(cin,s))&lt;br /&gt;{&lt;br /&gt;use s as you wish&lt;br /&gt;print result&lt;br /&gt;}&lt;br /&gt;that was a normal code but if you dont know this in prior then you cant do anything since it is not very common code. few examples of those problems which require this type of implementation are &lt;a href="http://www.spoj.pl/problems/ENCONDING/"&gt;encondin&lt;/a&gt;, &lt;a href="http://www.spoj.pl/problems/JAVAC/"&gt;javac&lt;/a&gt;, &lt;a href="http://www.spoj.pl/problems/BISHOPS/"&gt;bishops&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5634405680765167374-2535279584344378333?l=shubham-theway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shubham-theway.blogspot.com/feeds/2535279584344378333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5634405680765167374&amp;postID=2535279584344378333' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5634405680765167374/posts/default/2535279584344378333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5634405680765167374/posts/default/2535279584344378333'/><link rel='alternate' type='text/html' href='http://shubham-theway.blogspot.com/2008/09/programming.html' title='get the input from a file'/><author><name>Eps!lon</name><uri>http://www.blogger.com/profile/03422560839616223592</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-KfHzNTLMxqw/TfUD0-NeiUI/AAAAAAAAACI/EnPzlVsLews/s220/IMG_2268.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5634405680765167374.post-3391500490924025348</id><published>2008-09-12T14:25:00.001-07:00</published><updated>2009-05-05T13:59:23.121-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>it was sensational :)</title><content type='html'>when on sep 03 i got my code for generation of &lt;a href="http://www.spoj.pl/users/getshubham"&gt;prime number&lt;/a&gt; accepted on SPOJ i felt like i have achieved something very special. its not that very few people have solved it or it was a great problem but its in that sense that i made more than 20 unsuccessful attempts before finally cracked it. i was simply jumped from my chair when i saw the time taken by my code it was showing 0.21 secs when the time limit is 6 secs. indeed it was great feeling because i could not able to do it even for 6 secs few days before now fucked it up for 0.21 secs :)&lt;br /&gt;there was nothing special in that code i just implemented Sieve's algorithm for generation of prime number but improved it a little bit.&lt;br /&gt;what i done is not at all significant but still i explain it here. here we go...&lt;br /&gt;i created an array of 32000 and applied sieve on it to get a list of all the primes from 1 to 32000 now processed the input. if the larger number is less than 32000 then simply printout what we already have in our pocket.&lt;br /&gt;else created another array of size that is the difference between the larger(h) and smaller(l) input. now besides small manipulations, i found the square root of larger number then from 2 to that square root took each number(lets say 'd') and for each such number i took another number(lets say 'n') in the given range(l to h) but instead of dividing it for modulus(as per Sieves algorithm) i used a trick here.&lt;br /&gt;i found a number that is nearest to the first number of the input(smallest int greater than l) which is a multiple of 'd' and then simply added d till it was less than h to find all its multiple and then simply applied remaining sieves algorithm.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font: 10pt Courier New;"&gt;&lt;span class="cpp1-comment"&gt;// AC&lt;br /&gt;&lt;/span&gt;&lt;span class="cpp1-preprocessor"&gt;#include&amp;lt;iostream&amp;gt;&lt;br /&gt;&lt;br /&gt;#include&amp;lt;math.h&amp;gt;&lt;br /&gt;#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;using&lt;/span&gt;&lt;span class="cpp1-space"&gt; &lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;namespace&lt;/span&gt;&lt;span class="cpp1-space"&gt; std;&lt;br /&gt;&lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;int&lt;/span&gt;&lt;span class="cpp1-space"&gt; main()&lt;br /&gt;{&lt;br /&gt;    &lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;bool&lt;/span&gt;&lt;span class="cpp1-space"&gt; a[&lt;/span&gt;&lt;span class="cpp1-number"&gt;32010&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;]={&lt;/span&gt;&lt;span class="cpp1-number"&gt;0&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;},*p;&lt;br /&gt;    &lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;int&lt;/span&gt;&lt;span class="cpp1-space"&gt; i,j,s,k,t=&lt;/span&gt;&lt;span class="cpp1-number"&gt;0&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;,rem,rem1;&lt;br /&gt;    cin&amp;gt;&amp;gt;t;    &lt;br /&gt;    &lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;long&lt;/span&gt;&lt;span class="cpp1-space"&gt; &lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;long&lt;/span&gt;&lt;span class="cpp1-space"&gt; n1[t],n2[t],m;&lt;br /&gt;    &lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;long&lt;/span&gt;&lt;span class="cpp1-space"&gt; d;&lt;br /&gt;    &lt;/span&gt;&lt;span class="cpp1-comment"&gt;//int z=0;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="cpp1-space"&gt;    &lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;double&lt;/span&gt;&lt;span class="cpp1-space"&gt; x;&lt;br /&gt;    &lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;for&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;(i=&lt;/span&gt;&lt;span class="cpp1-number"&gt;2&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;;i&amp;lt;&lt;/span&gt;&lt;span class="cpp1-number"&gt;32002&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;;i++)&lt;br /&gt;    {&lt;br /&gt;          &lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;if&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;(a[i]==&lt;/span&gt;&lt;span class="cpp1-number"&gt;0&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;)&lt;br /&gt;          {&lt;br /&gt;               &lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;for&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;(j=i+i;j&amp;lt;&lt;/span&gt;&lt;span class="cpp1-number"&gt;32002&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;;j+=i)&lt;br /&gt;               a[j]=&lt;/span&gt;&lt;span class="cpp1-number"&gt;1&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;;&lt;br /&gt;          }&lt;br /&gt;    }&lt;br /&gt;    &lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;for&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;(i=&lt;/span&gt;&lt;span class="cpp1-number"&gt;0&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;;i&amp;lt;t;i++)&lt;br /&gt;    {&lt;br /&gt;        cin&amp;gt;&amp;gt;n1[i]&amp;gt;&amp;gt;n2[i];&lt;br /&gt;        &lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;if&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;(n2[i]&amp;lt;=&lt;/span&gt;&lt;span class="cpp1-number"&gt;32000&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;)&lt;br /&gt;        {&lt;br /&gt;            &lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;for&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;(j=n1[i];j&amp;lt;=n2[i];j++)&lt;br /&gt;            &lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;if&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;(a[j]==&lt;/span&gt;&lt;span class="cpp1-number"&gt;0&lt;/span&gt;&lt;span class="cpp1-space"&gt; &amp;amp;&amp;amp; j&amp;gt;&lt;/span&gt;&lt;span class="cpp1-number"&gt;1&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;)&lt;br /&gt;            cout&amp;lt;&amp;lt;j&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="cpp1-comment"&gt;/*&amp;quot;   &amp;quot;&amp;lt;&amp;lt;++z&amp;lt;&amp;lt;*/&lt;/span&gt;&lt;span class="cpp1-identifier"&gt;endl;&lt;br /&gt;            &lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;goto&lt;/span&gt;&lt;span class="cpp1-space"&gt; done;&lt;br /&gt;        }&lt;br /&gt;        &lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;if&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;(n1[i]==&lt;/span&gt;&lt;span class="cpp1-number"&gt;1&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;)&lt;br /&gt;        n1[i]=&lt;/span&gt;&lt;span class="cpp1-number"&gt;2&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;;&lt;br /&gt;        n2[i]+=&lt;/span&gt;&lt;span class="cpp1-number"&gt;2&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;;&lt;br /&gt;        d=sqrt(&lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;double&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;(n2[i]))+&lt;/span&gt;&lt;span class="cpp1-number"&gt;1&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;;&lt;br /&gt;        p=&lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;new&lt;/span&gt;&lt;span class="cpp1-space"&gt; &lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;bool&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;[n2[i]-n1[i]+&lt;/span&gt;&lt;span class="cpp1-number"&gt;1&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;];&lt;br /&gt;        &lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;for&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;(j=&lt;/span&gt;&lt;span class="cpp1-number"&gt;0&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;;j&amp;lt;n2[i]-n1[i]+&lt;/span&gt;&lt;span class="cpp1-number"&gt;1&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;;j++)&lt;br /&gt;        p[j]=&lt;/span&gt;&lt;span class="cpp1-number"&gt;0&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;;&lt;br /&gt;        &lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;for&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;(j=&lt;/span&gt;&lt;span class="cpp1-number"&gt;2&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;;j&amp;lt;d;j++)&lt;br /&gt;        {&lt;br /&gt;         &lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;if&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;(a[j]==&lt;/span&gt;&lt;span class="cpp1-number"&gt;0&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;)&lt;br /&gt;            {&lt;br /&gt;                rem=n1[i]%j;&lt;br /&gt;                &lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;if&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;(rem==&lt;/span&gt;&lt;span class="cpp1-number"&gt;0&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;)&lt;br /&gt;                rem=j;&lt;br /&gt;                k=n1[i]+j-rem;&lt;br /&gt;                &lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;while&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;(k&amp;lt;=n2[i])&lt;br /&gt;                {&lt;br /&gt;                    p[k-n1[i]]=&lt;/span&gt;&lt;span class="cpp1-number"&gt;1&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;;&lt;br /&gt;                    k+=j;&lt;br /&gt;                }&lt;br /&gt;                &lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;if&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;(j==n1[i]+j-rem)&lt;br /&gt;                p[j-n1[i]]=&lt;/span&gt;&lt;span class="cpp1-number"&gt;0&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        s=n2[i]-n1[i];&lt;/span&gt;&lt;span class="cpp1-comment"&gt;//getchar();&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="cpp1-space"&gt;        &lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;for&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;(j=&lt;/span&gt;&lt;span class="cpp1-number"&gt;0&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;;j&amp;lt;s;j++)&lt;br /&gt;        {&lt;br /&gt;            &lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;if&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;(p[j]==&lt;/span&gt;&lt;span class="cpp1-number"&gt;0&lt;/span&gt;&lt;span class="cpp1-space"&gt; &amp;amp;&amp;amp; j+n1[i]&amp;lt;n2[i]-&lt;/span&gt;&lt;span class="cpp1-number"&gt;1&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;)&lt;br /&gt;            cout&amp;lt;&amp;lt;j+n1[i]&lt;/span&gt;&lt;span class="cpp1-comment"&gt;/*&amp;lt;&amp;lt;&amp;quot;   &amp;quot;&amp;lt;&amp;lt;++z*/&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;&amp;lt;&amp;lt;endl;&lt;br /&gt;        }&lt;br /&gt;      done: cout&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="cpp1-string"&gt;&amp;quot;\n&amp;quot;&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;;&lt;br /&gt;    }&lt;br /&gt;    &lt;/span&gt;&lt;span class="cpp1-reservedword"&gt;return&lt;/span&gt;&lt;span class="cpp1-space"&gt; &lt;/span&gt;&lt;span class="cpp1-number"&gt;0&lt;/span&gt;&lt;span class="cpp1-symbol"&gt;;&lt;br /&gt;}                 &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;besides this i have come across few other cool programming problems and concepts but thats not for now....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5634405680765167374-3391500490924025348?l=shubham-theway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shubham-theway.blogspot.com/feeds/3391500490924025348/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5634405680765167374&amp;postID=3391500490924025348' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5634405680765167374/posts/default/3391500490924025348'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5634405680765167374/posts/default/3391500490924025348'/><link rel='alternate' type='text/html' href='http://shubham-theway.blogspot.com/2008/09/when-on-sep-03-i-got-my-code-for.html' title='it was sensational :)'/><author><name>Eps!lon</name><uri>http://www.blogger.com/profile/03422560839616223592</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-KfHzNTLMxqw/TfUD0-NeiUI/AAAAAAAAACI/EnPzlVsLews/s220/IMG_2268.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5634405680765167374.post-7776577142564023014</id><published>2008-08-06T05:12:00.000-07:00</published><updated>2008-12-01T14:47:10.001-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>tips 4 neophytes like me</title><content type='html'>programming is the only thing that i do in my college with (extreme) regularity. i think i need not mention that i m a registered user at &lt;a href="http://www.spoj.pl/"&gt;SPOJ&lt;/a&gt;. i've solved a handful of problems there. &lt;a href="http://www.spoj.pl/users/getshubham"&gt;here&lt;/a&gt; is my profile at spoj. it was not so long when i was happy with my Turbo-C compiler... i was asked by my senior to switch to GCC and i m very grateful to him [:)].&lt;br /&gt;things you need to keep in mind while solving problems.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;they check your efficiency not your language knowlegde.&lt;/li&gt;&lt;li&gt;they run your programs at extreme cases.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;finally you need a gud algorithm and proper implimentation.&lt;/li&gt;&lt;/ol&gt;thats it and you will make it Ac ( @ spoj, Ac means your solution to a particular problem has got accepted by online judges).&lt;br /&gt;mostly problems are based on number theory, string matching, sorting, graph and others but the input range and time limit makes it harder to solve.&lt;br /&gt;if you want to start with some easier ones then go to my profile. i usually solve easier first [:)].&lt;br /&gt;thats enuf for today next time i will tell you explanation to few problems so you can solve them quite easily.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5634405680765167374-7776577142564023014?l=shubham-theway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shubham-theway.blogspot.com/feeds/7776577142564023014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5634405680765167374&amp;postID=7776577142564023014' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5634405680765167374/posts/default/7776577142564023014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5634405680765167374/posts/default/7776577142564023014'/><link rel='alternate' type='text/html' href='http://shubham-theway.blogspot.com/2008/08/programming.html' title='tips 4 neophytes like me'/><author><name>Eps!lon</name><uri>http://www.blogger.com/profile/03422560839616223592</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-KfHzNTLMxqw/TfUD0-NeiUI/AAAAAAAAACI/EnPzlVsLews/s220/IMG_2268.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5634405680765167374.post-3910614006852110470</id><published>2008-07-27T13:48:00.000-07:00</published><updated>2008-07-27T13:49:46.334-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='my intro'/><title type='text'>Introduction</title><content type='html'>hi all. this is me out here with a brand new blog. before i come to my business, let me introduce myself. This is Shubham Dave pursuing my btech with CS stream n currently studying in final year. my subjects of interest are data structures and algorithms and i just love writing programs in c/c++, java and python...&lt;br /&gt;ps: as midsem tests are scheduled from tomoro onwards i cant continue right now [;)]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5634405680765167374-3910614006852110470?l=shubham-theway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shubham-theway.blogspot.com/feeds/3910614006852110470/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5634405680765167374&amp;postID=3910614006852110470' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5634405680765167374/posts/default/3910614006852110470'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5634405680765167374/posts/default/3910614006852110470'/><link rel='alternate' type='text/html' href='http://shubham-theway.blogspot.com/2008/07/introduction.html' title='Introduction'/><author><name>Eps!lon</name><uri>http://www.blogger.com/profile/03422560839616223592</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/-KfHzNTLMxqw/TfUD0-NeiUI/AAAAAAAAACI/EnPzlVsLews/s220/IMG_2268.JPG'/></author><thr:total>0</thr:total></entry></feed>
