<?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-6907420233574449401</id><updated>2012-01-28T11:27:51.309+05:30</updated><category term='C++'/><category term='technology'/><category term='Complexity'/><category term='logical'/><category term='finance'/><category term='Personalization'/><category term='Linux'/><category term='C'/><category term='maths'/><category term='Tips n Tricks'/><category term='perl'/><category term='Algos'/><category term='puzzles'/><category term='LWP. HTTPS'/><category term='Web 2.0'/><category term='Utilities'/><title type='text'>i-Nnovate</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>AJ</name><uri>http://www.blogger.com/profile/02632968667981078045</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://3.bp.blogspot.com/_9Q_jSZXB__E/SXG6__IMGiI/AAAAAAAAB6M/c8sZUItHuKc/s1600-R/9.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>39</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-4092164276654887068</id><published>2007-10-21T04:26:00.000+05:30</published><updated>2007-10-21T04:35:08.949+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='LWP. HTTPS'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>Downloading Pages via SSL and proxy using LWP Perl</title><content type='html'>If you use LWP modules in perl then you can download pages via HTTP easily using a proxy. However if you wanna download pages with HTTPS through a proxy then it becomes a problem.&lt;br /&gt;This is because both proxy and HTTPS are not implemented simultaneously in LWP modules although individually they work quite well.&lt;br /&gt;But there is a way around. To download paged via HTTPS you have to give LWP the impression that you are not using any proxy. Thus you set the environment variable HTTPS_PROXY as a valid proxy and dont set anything as the proxy in the request object for https. This would make it work like a charm. :)&lt;br /&gt;&lt;a href="http://community.activestate.com/forum-topic/lwp-https-requests-proxy"&gt;Link to above Funda.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6907420233574449401-4092164276654887068?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/4092164276654887068/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=4092164276654887068' title='109 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/4092164276654887068'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/4092164276654887068'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2007/10/downloading-pages-via-ssl-and-proxy.html' title='Downloading Pages via SSL and proxy using LWP Perl'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>109</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-8262975413126337032</id><published>2007-06-28T20:34:00.000+05:30</published><updated>2007-06-29T15:13:04.736+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips n Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Recovering deleted files in an ext3 File System</title><content type='html'>I was working on my Debian machine few days ago when accidentally I pressed &lt;span style="font-weight: bold;"&gt;"rm -rf *"&lt;/span&gt;&lt;span&gt; in a wrong directory(my main working directory). Well, I lost all the data. And after hunting net for hours, find out that there is no traditional method available for  recovering files in ext3 file system.&lt;br /&gt;&lt;/span&gt;In Ext2 file system, OS  marks the blocks, inode and directory entry associated with the deleted file as unused. It did not use to delete the links, so that other files could still use them. And because of this, recovery of lost files were possible using certain tools like &lt;a href="http://www.die.net/doc/linux/man/man8/debugfs.8.html"&gt;debufs&lt;/a&gt;, &lt;a href="http://e2undel.sourceforge.net/"&gt;e2undel&lt;/a&gt;, &lt;a href="http://recover.sourceforge.net/linux/recover/"&gt;recover&lt;/a&gt;, &lt;a href="http://www.ibiblio.org/mc/"&gt;Midnight Commander&lt;/a&gt; etc.  &lt;span style="font-size:100%;"&gt;&lt;span&gt;&lt;a href="https://sourceforge.net/projects/giis"&gt;Giis-gET iT i sAY&lt;/a&gt; also claims to recover files from both ext2 and ext3 file system but I don't know it works or not.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;In Ext3 file system, when the file is deleted, file size and block addresses in inodes are also deleted. Therefore, its not possible to find out where the file was originally located or more specifically it becomes difficult to track back the inode of the file using debugfs.&lt;br /&gt;But, if you are lucky, file could still be there in your hard drive, though in chunks.  Steps you must follow -&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Do not save any file in the same partition in which your deleted files were. This might result in overwriting of occupied blocks of deleted files.&lt;/li&gt;&lt;li&gt;Mount another drive to the system(if not mounted) to save the dump.&lt;/li&gt;&lt;li&gt;Find the Partition in which deleted files was there using &lt;span style="font-weight: bold;"&gt;`mount -t`&lt;/span&gt;&lt;/li&gt;&lt;li&gt;If you know certain lines from the file, which are more or less unique to the file you deleted, then it might be useful. In my case, my Perl code  began with "package rankSentences;", so I used that as the identifying text.&lt;/li&gt;&lt;li&gt;Try the command =&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;strong&gt;grep -a -B[lines before] -A[lines after] ‘identifyingText’ /dev/[partition] &gt; dump.txt&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;    here,&lt;br /&gt;&lt;ul&gt;&lt;li&gt;-a is for treating text file as if it is binary file.&lt;/li&gt;&lt;li&gt;-A Number of lines of the dump that you want to extract after the "indentifyingText" (which was "package rankSentences" in my case.&lt;/li&gt;&lt;li&gt;-B Number of lines before "identifyingText" you want to extract.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;If you don't specify "identifyingText" this might result in dump.txt to be very large in size as it will start dumping the data of complete partition to that file.&lt;br /&gt;And ya, be patient, it might take some time depending upon the size of your partition. After running that command you can look for chunks of your deleted file in &lt;span style="font-style: italic;"&gt;dump.txt&lt;/span&gt;. And if you are lucky, you might find the complete file at one place. :) &lt;span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;--compiled from various sources on net. &lt;/span&gt;&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/6907420233574449401-8262975413126337032?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/8262975413126337032/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=8262975413126337032' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/8262975413126337032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/8262975413126337032'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2007/06/recovering-deleted-files-in-ext3-file.html' title='Recovering deleted files in an ext3 File System'/><author><name>AJ</name><uri>http://www.blogger.com/profile/02632968667981078045</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://3.bp.blogspot.com/_9Q_jSZXB__E/SXG6__IMGiI/AAAAAAAAB6M/c8sZUItHuKc/s1600-R/9.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-4279946152842901050</id><published>2007-06-08T03:36:00.000+05:30</published><updated>2007-06-08T03:37:40.954+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Utilities'/><title type='text'>Recovering Lost Emails from Google Desktop Search's Cache</title><content type='html'>&lt;div style="text-align: justify;"&gt;This post is for you if you&lt;br /&gt;&lt;/div&gt;&lt;ul style="text-align: justify;"&gt;&lt;li&gt;Have accidentally deleted mails and&lt;/li&gt;&lt;li&gt;Use Google Desktop Search (GDS) and&lt;/li&gt;&lt;li&gt;Were fortunate or sensible enough or possibly farsighted [:)] to have enabled email      caching in GDS and&lt;/li&gt;&lt;li&gt;Want to retrieve your mails&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;a href="http://duramecho.com/"&gt;Andrew Hardwick&lt;/a&gt; has written a very simple and useful script for the above task. His script was tested on GDS version 2 (build 20051208-en). Refer to the instructions given on his &lt;a href="http://duramecho.com/ComputerInformation/HowToRecoverLostEmailsFromGdsCache/"&gt;page&lt;/a&gt; to get the details of the script.&lt;br /&gt;&lt;br /&gt;I recently needed to do similar task for someone who was using Google Desktop 5.1.0705.04505-en-pb. The above script worked just fine with slight modifications in the regular expressions. I am uploading the modified script in &lt;a href="http://mayankjain20.googlepages.com/GDSCachedEmailExtractor.pl"&gt;here&lt;/a&gt; and a copy of Andrew's Instructions &lt;a href="http://mayankjain20.googlepages.com/GDSGetMailFromCache.htm"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Enjoy !!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6907420233574449401-4279946152842901050?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/4279946152842901050/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=4279946152842901050' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/4279946152842901050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/4279946152842901050'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2007/06/recovering-lost-emails-from-google.html' title='Recovering Lost Emails from Google Desktop Search&apos;s Cache'/><author><name>Mayank</name><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-6907420233574449401.post-3756226446814483892</id><published>2007-01-05T01:00:00.000+05:30</published><updated>2007-01-05T02:31:30.857+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='finance'/><title type='text'>Stock Index</title><content type='html'>&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:trebuchet ms;"&gt;What does the stock Index indicate?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;First, let’s look at what an index number represents. Although there are different ways to calculate index numbers, it is important to remember the numbers represent a change from an original or base value. &lt;/span&gt;&lt;/span&gt;&lt;p style="font-family: trebuchet ms;font-family:trebuchet ms;" &gt;&lt;span style="font-size:100%;"&gt;The number is not important. What is important is the percent change over time. This movement up or down gives you and idea of how the index is performing. Is the Dow up or down? The index is calculated “on the fly” during trading to give investors a sense of direction to the market it represents&lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: trebuchet ms;font-family:trebuchet ms;" &gt;&lt;span style="font-size:100%;"&gt; The sensex's calculation involves dividing the total &lt;a href="http://www.google.com.sg/search?q=define%3A+market+capitalization&amp;ie=utf-8&amp;amp;oe=utf-8&amp;rls=org.mozilla:en-US:official&amp;amp;client=firefox-a"&gt;market capitalisation &lt;/a&gt;of 30 companies in the index by the index divisor — the only link to the original base period value of the sensex.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:trebuchet ms;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family: trebuchet ms;"&gt;These 30 companies are taken as the representative of the Market. There may be more than 30 companies registered in the exchange.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:10;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:10;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6907420233574449401-3756226446814483892?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/3756226446814483892/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=3756226446814483892' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/3756226446814483892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/3756226446814483892'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2007/01/stock-index.html' title='Stock Index'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-2094137261658837750</id><published>2007-01-05T00:41:00.000+05:30</published><updated>2007-01-05T01:00:29.086+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='technology'/><category scheme='http://www.blogger.com/atom/ns#' term='Algos'/><title type='text'>Spell Checkers</title><content type='html'>Ever Wondered how search engines like Google, Yahoo or for instance Microsoft word Does spell checking.&lt;br /&gt;&lt;br /&gt;Well the basic idea is to get &lt;a href="http://en.wikipedia.org/wiki/Levenshtein_distance"&gt;Levenshtein&lt;/a&gt; or &lt;a href="http://en.wikipedia.org/wiki/Damerau-Levenshtein_distance"&gt;Damerau-levenshtein&lt;/a&gt; distance between the mis-spelled word and the other word. But do we find the distance with all the other words that are in the vocabulary. The answer is No. We reduce the subset of the words to checked. In the Search Engines it can be the most recent or the most used words and there are &lt;a href="http://www-128.ibm.com/developerworks/java/library/j-jazzy/"&gt;other techniques to do so&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://answers.google.com/answers/threadview?id=526503"&gt;Some insight into Google spell checking&lt;/a&gt;.&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Spelling_suggestion"&gt;Spelling Suggestion at Wiki&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6907420233574449401-2094137261658837750?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/2094137261658837750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=2094137261658837750' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/2094137261658837750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/2094137261658837750'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2007/01/spell-checkers.html' title='Spell Checkers'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-4190521488633117986</id><published>2007-01-02T02:50:00.000+05:30</published><updated>2007-01-02T02:53:26.293+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='maths'/><title type='text'>Casting Out Nines</title><content type='html'>How do you check the answer of a large multiplication like 8216*4215=36430440 without actually doing the multiplication.&lt;br /&gt;&lt;br /&gt;Sum 8+2+1+6=17. Take modulo 9 = 8.&lt;br /&gt;Sum 4+2+1+5=12. Take modulo 9 = 3.&lt;br /&gt;&lt;br /&gt;Sum 3+6+4+3+4+4=24. Take modulo 9 = 6.&lt;br /&gt;&lt;br /&gt;Now check 8*3=24 and 2+4 = 6.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6907420233574449401-4190521488633117986?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/4190521488633117986/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=4190521488633117986' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/4190521488633117986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/4190521488633117986'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2007/01/casting-out-nines.html' title='Casting Out Nines'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-301444647055332336</id><published>2007-01-02T02:42:00.000+05:30</published><updated>2007-01-02T02:49:05.309+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='maths'/><title type='text'>Austrian Method of Subtraction</title><content type='html'>&lt;span style="font-family: trebuchet ms;"&gt;How do you subtract 5592 from 11149. Simple question....&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;There's an interesting method which involves only addition as it is easier to do than subtraction. Add from the amount to be subtracted upto the next higher unit, then to the next and so on.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;Example 5592 + 8 = 5600. 5600 + 400 = 6000. 6000 + 5000 = 11000. 11000 + 149 = 11149. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;so the answer is 8+400+5000+149 = 5557.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6907420233574449401-301444647055332336?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/301444647055332336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=301444647055332336' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/301444647055332336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/301444647055332336'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2007/01/austrian-method-of-subtraction.html' title='Austrian Method of Subtraction'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-1207124735430462514</id><published>2007-01-02T02:14:00.000+05:30</published><updated>2007-01-02T02:38:03.285+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='maths'/><title type='text'>Pascal's Triangle</title><content type='html'>&lt;a href="http://en.wikipedia.org/wiki/Pascals_triangle"&gt;There's a very good article about Pascal's Triangle in Wiki.&lt;/a&gt; I am just enumerating some important points for quick reference.&lt;br /&gt;&lt;br /&gt;- Construction of Triangle,   value of the element is equal to the sum of the above two adjecent values.&lt;br /&gt;&lt;br /&gt;- Sum of the elements of the mth row is equal to 2 raised to power m-1.&lt;br /&gt;&lt;br /&gt;- Elements of mth row correspond to coefficients of  11 raised to power m-1.&lt;br /&gt;&lt;br /&gt;- Generally  the elements of mth row are the coefficients of the binomial expression (x+y) raised to power  m-1.&lt;br /&gt;&lt;br /&gt;- The diagonals next to the edge diagonals contain the &lt;a href="http://en.wikipedia.org/wiki/Natural_number" title="Natural number"&gt;natural numbers&lt;/a&gt; in order. Moving inwards, the next pair of diagonals contain the &lt;a href="http://en.wikipedia.org/wiki/Triangular_number" title="Triangular number"&gt;triangular numbers&lt;/a&gt; in order.&lt;br /&gt;&lt;br /&gt;- Starting at the top 1, without backtracking or going sideways, try to get to another node via these grid paths as many ways as possible. The answer is whatever number the node has.&lt;br /&gt;&lt;br /&gt;- Sum of a shallow diagonal is a Fibonacci's number.&lt;br /&gt;&lt;br /&gt;- In rows where the second number (the 1st number following 1) is prime, all the terms in that row except the 1s are multiples of that prime.&lt;br /&gt;&lt;br /&gt;- Pascal's triangle can be used as a &lt;a href="http://en.wikipedia.org/wiki/Lookup_table" title="Lookup table"&gt;lookup table&lt;/a&gt; for the number of arbitrarily dimensioned elements within a single arbitrarily dimensioned version of a triangle (known as a &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Simplex" title="Simplex"&gt;simplex&lt;/a&gt;&lt;/i&gt;).&lt;br /&gt;&lt;br /&gt;- No one knows whether any number occurs 5 times in a Pascal's triangle.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6907420233574449401-1207124735430462514?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/1207124735430462514/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=1207124735430462514' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/1207124735430462514'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/1207124735430462514'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2007/01/pascals-triangle.html' title='Pascal&apos;s Triangle'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-4346532167136227489</id><published>2007-01-01T19:45:00.000+05:30</published><updated>2007-01-01T19:55:03.877+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='puzzles'/><category scheme='http://www.blogger.com/atom/ns#' term='logical'/><title type='text'>Hats</title><content type='html'>&lt;span style="font-family: trebuchet ms;"&gt;There are 5 persons in a line, all facing in the same direction. There are 5 hats, 2 white and 3 black. A person can't see the color of his own hat, but can see the color of the hat of all the people standing in front of him.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;The Third/middle person was asked to tell the color of his own hat. He couldn't answer. Then the second person( the person in front of the middle one) was asked the color of his own hat. He too couldn't answer. Tell the color of the Hat of the first person in the line?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;===========================================&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;Middle person couldn't tell the color. It means of the two persons standing in front of him at-least one of them was wearing a black hat.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;Second person couldn't tell the Hat's color. He knows that there has to be at-least black hat either on him or on the first person. If the first person is wearing white then he is surely wearing black. But if the first person is wearing black, then he can't tell. Thus the first person is wearing black.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6907420233574449401-4346532167136227489?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/4346532167136227489/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=4346532167136227489' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/4346532167136227489'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/4346532167136227489'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2007/01/hats.html' title='Hats'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-985469595560885338</id><published>2007-01-01T19:39:00.000+05:30</published><updated>2007-01-01T19:45:12.167+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='puzzles'/><category scheme='http://www.blogger.com/atom/ns#' term='logical'/><title type='text'>Salaries of three persons</title><content type='html'>&lt;span style="font-size:100%;"&gt;&lt;span style="font-family: trebuchet ms;"&gt;There are 3 persons A,B,C and their salaries are X, Y, Z respectively.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;Problem: Device a scheme so that all three of them know X+Y+Z, by asking each other questions. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;Constraint: None should come to the other one's salary, i.e. A should not know Y and Z and so on...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;===============================================&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;C tells B that its salary is K (a fake value)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;B tells A the total K+Y&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;A tells C the total K+Y+X&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;Finally C calculates X+Y+Z and tells it to everybody.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&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/6907420233574449401-985469595560885338?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/985469595560885338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=985469595560885338' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/985469595560885338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/985469595560885338'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2007/01/salaries-of-three-persons.html' title='Salaries of three persons'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-8635435747943521458</id><published>2006-12-30T17:52:00.000+05:30</published><updated>2006-12-30T17:53:41.095+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><title type='text'>Calculate n-1</title><content type='html'>&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Well the problem is : your input in 'n' and you have to calculate n-1 without using the '-' opertaor... simple one I guess&lt;br /&gt;&lt;br /&gt;The solution I thought was:&lt;br /&gt;/*&lt;br /&gt;sum=0;&lt;br /&gt;while(i &lt; a="~0;" b="n+a;"&gt;  &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&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/6907420233574449401-8635435747943521458?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/8635435747943521458/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=8635435747943521458' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/8635435747943521458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/8635435747943521458'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/12/calculate-n-1.html' title='Calculate n-1'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-3679529392840876927</id><published>2006-12-30T17:51:00.000+05:30</published><updated>2006-12-30T17:52:23.556+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><title type='text'>Quine</title><content type='html'>&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;Have u ever come across a code that prints its own code as an output....&lt;br /&gt;&lt;br /&gt;these type of codes are calle Quines... and here is a &lt;a href="http://www.nyx.net/%7Egthompso/self_c.txt"&gt;link &lt;/a&gt;containg many single liners .&lt;br /&gt;&lt;br /&gt;but the most simple one in linux would be&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;system("cat &lt;filename c=""&gt; filename.c");&lt;br /&gt;}&lt;br /&gt;I tried this code.. it compiled with a warning but executed...&lt;br /&gt;&lt;br /&gt;Aneways there is in iterestiing &lt;a href="http://groups.google.nl/group/alt.folklore.computers/browse_thread/thread/4fa3cf2c993211a2/ee31e5d3cb83531e"&gt;link&lt;/a&gt;  which gives the world's shortest quine... if u have two spare minutes,  go throught it.. it would be interesting...&lt;/filename&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6907420233574449401-3679529392840876927?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/3679529392840876927/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=3679529392840876927' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/3679529392840876927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/3679529392840876927'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/12/quine.html' title='Quine'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-7242254207601252474</id><published>2006-12-30T17:50:00.000+05:30</published><updated>2006-12-30T17:51:12.640+05:30</updated><title type='text'>Scanf</title><content type='html'>&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;&lt;span style="color: rgb(255, 255, 255);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;very often we have encountered problems where a code fragment like&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;for(i=0;i&lt;3;i++)&gt; &lt;span style="color: rgb(0, 0, 0);"&gt;simple... the stray '/n' escape sequence remains in the input stream and is taken by the second scanf. One of the ways is to use a getc() function before second scanf, but not really good one other solution is to use fgets from stdin ... this is a nice solution as it takes the whole string&lt;/span&gt; &lt;span style="color: rgb(0, 0, 0);"&gt;from the input stream including '\n' note that we can't simply flush the input stream by fflush(stdin) as its behaviour on input stream is undefined... we can use it to flush the output stream..&lt;/span&gt;&lt;/span&gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&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/6907420233574449401-7242254207601252474?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/7242254207601252474/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=7242254207601252474' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/7242254207601252474'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/7242254207601252474'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/12/scanf.html' title='Scanf'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-1891738643507890774</id><published>2006-12-30T17:48:00.000+05:30</published><updated>2006-12-30T17:49:44.524+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><title type='text'>Increment Operators</title><content type='html'>&lt;span style="color: rgb(0, 0, 0);font-family:trebuchet ms;font-size:100%;"  &gt;is the C statement /*printf("%d, %d, %d\n", i,i++,++i)*/ a valid statement?&lt;br /&gt;Think hard before arriving to any conclusions....&lt;br /&gt;&lt;br /&gt;Well its not!!&lt;br /&gt;&lt;br /&gt;firstly ehat do u expect the evalution order of functions a(), b() and c() in the following statement&lt;br /&gt;printf("%d,%d,%d",a(),b(),c());&lt;br /&gt;&lt;br /&gt;well by the C standards the behaviour is *unspecified* i.e. the arguments of a function may be evaluated in any order that may also be interleaved.... now this unspecified behaviour of evalution of the arguments may lead to undefined behaviour and hence the ambiguous result.&lt;br /&gt;&lt;br /&gt;Secondly there is no &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang/html/_clang_c_sequence_points.asp"&gt;sequence point&lt;/a&gt; between the different expressions(i, ++i, i++) and according to C standards modifying the value of an expression more than once between two sequence points leads to undefined behaviour and hence explains the ambiguous result.&lt;br /&gt;&lt;br /&gt;try printf("%d", (i++,++i)); note: there is a sequence point in the expression.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(0, 0, 0);font-family:trebuchet ms;" &gt; &lt;/span&gt;&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/6907420233574449401-1891738643507890774?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/1891738643507890774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=1891738643507890774' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/1891738643507890774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/1891738643507890774'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/12/increment-operators.html' title='Increment Operators'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-8904054839537361758</id><published>2006-12-30T17:45:00.000+05:30</published><updated>2006-12-30T17:48:19.545+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><title type='text'>sizeof()</title><content type='html'>&lt;span style="color: rgb(0, 0, 0);font-family:trebuchet ms;font-size:100%;"  &gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Well found something new about the sizeof()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;firstly it is an unary operator and shouldn't be mistaken for a function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;secondaly, what do you expect the output of &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;int i=10;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;j=sizeof(i++);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;printf("%d, %d",i,j);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;well the value of i doesn't get incremented as sizeof is a compile time operator and produces a compile-time integer constant value. The expession inside sizeof() is only expected to deduce its type and is not fully evaluated.... should have known this though!!!!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;also found a new thing today.... sizeof('x') returns 2 or 4 but not 1. This is because by definition, in C, character constants are integers and not characters!!!! I also found this somewhere that sizeof("") will give the size of char in both C and C++, but haven't tried it yet.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;Al&lt;span style="color: rgb(0, 0, 0);"&gt;so,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;char chr[1000];&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;sizeof(chr) will give 1000 and not 4.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;span style="font-family:trebuchet ms;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6907420233574449401-8904054839537361758?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/8904054839537361758/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=8904054839537361758' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/8904054839537361758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/8904054839537361758'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/12/sizeof.html' title='sizeof()'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-7535111397433352597</id><published>2006-12-30T17:33:00.000+05:30</published><updated>2006-12-30T17:45:29.243+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><title type='text'>gets()</title><content type='html'>&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;Well we all know that whenever we compile a file containing a refference to gets() function, the compiler gives a warning that using gets() might be dangerous.....&lt;br /&gt;&lt;br /&gt;The reason is very simple... gets simply copies the input string on to the program stack without inpecting its size... for example the code...&lt;br /&gt;void enterstring()&lt;br /&gt;{&lt;br /&gt;char string[FIXEDLENTH];&lt;br /&gt;gets(string);&lt;br /&gt;}&lt;br /&gt;now when the function is called then the space for the local variable string gets allocated in the program stack. If the length of the input is now greater than the FIXEDSIZE then the stack gets over written... but how this is dangerous???&lt;br /&gt;&lt;br /&gt;Well one can very easily modify the flow of control in a program by just buffer overflow... consider for example... when the function enterstring was called then the stack contains the return address in to the main function.. now I could input the buffer in such way such that my buffer contains a malicious machine code and also changes the return address in the stack to a position in the buffer from where my malicious code starts... bas ho gaya kam.... or even if you cant write a machine language code in the buffer than also you could change the return address and thereby modifying the program execution...&lt;br /&gt;&lt;br /&gt;I have a very interesting &lt;a href="http://www.cs.princeton.edu/courses/archive/spring05/cos217/asgts/overrun/"&gt;link&lt;/a&gt; which gives the above task as an lab assignment!!!!! Its really COOL have a look.... and for those who really wanna hack theres an another &lt;a href="http://www.greenend.org.uk/rjk/random-stack.html"&gt;link&lt;/a&gt; .&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;span style="font-family: trebuchet ms;"&gt; &lt;/span&gt;&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/6907420233574449401-7535111397433352597?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/7535111397433352597/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=7535111397433352597' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/7535111397433352597'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/7535111397433352597'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/12/gets.html' title='gets()'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-4224657395085539745</id><published>2006-12-30T17:32:00.000+05:30</published><updated>2006-12-30T17:33:35.116+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><title type='text'>string inside scanf()</title><content type='html'>&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;what will the following statement do???&lt;br /&gt;&lt;br /&gt;scanf( " %d %d" +  scanf("%d %d",&amp;i,&amp;amp;amp;j) ,&amp;a);&lt;br /&gt;&lt;br /&gt;the inner scanf will take two integers as input and storing them in i and j respectively and returning 2.&lt;br /&gt;&lt;br /&gt;the outer scanf's expression will now become "%d %d"+2 which will become " %d".... how??? now the expression inside the " " in scanf in considered as a string and is stored in some part of the memory and when we call the scanf function then a pointer to this memory location is passed on to scanf... but in this case the pointer gets incremented by two and thus points to the string " %d" rather than "%d %d", and since the former one is a legitimate expression for scanf the function takes one input in a.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;span style="font-family: trebuchet ms;"&gt; &lt;/span&gt;&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/6907420233574449401-4224657395085539745?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/4224657395085539745/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=4224657395085539745' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/4224657395085539745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/4224657395085539745'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/12/string-inside-scanf.html' title='string inside scanf()'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-4256076019289511909</id><published>2006-12-30T17:30:00.000+05:30</published><updated>2006-12-30T17:31:57.384+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><title type='text'>not a big deal</title><content type='html'>&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;what would be the output of the following code statement&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;&lt;br /&gt;main(_){for(--_;putchar(_++["J!Mpwf!Zpv\1"]-1););}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;think, think.....&lt;br /&gt;&lt;br /&gt;Well the output is "I Love You" :-)&lt;br /&gt;&lt;br /&gt;How?? It goes as follows: firstly the underscore in the main is a variable equivalent to argc but I cant understand thet why the code doesn't give warning in the main, beacuse either ir should have both the arguments of main in it or none of them....anyways since we run the program by the command ./a.out the argc value is 1 and hence '_' is initialized to 1&lt;br /&gt;going further in the for loop the variable _ gets its inital value 0. Now there is something important to understand... a[i]=*(a+i)=*(i+a)=i[a] thus in C it doesn't matter that what is the base and waht is the subscript.... thus the *thing* inside the putchar can be understood as arbitString[_++]-1 which goes on printing the the elements of the string -1 which comes out to I Love You and stops when the string ends.... simple... isn't it.&lt;/span&gt;&lt;span style="font-family: trebuchet ms; color: rgb(0, 0, 0);font-size:100%;" &gt;&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/6907420233574449401-4256076019289511909?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/4256076019289511909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=4256076019289511909' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/4256076019289511909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/4256076019289511909'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/12/not-big-deal.html' title='not a big deal'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-2458905266333915431</id><published>2006-12-30T17:28:00.000+05:30</published><updated>2006-12-30T17:30:41.141+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Algos'/><category scheme='http://www.blogger.com/atom/ns#' term='Complexity'/><title type='text'>P NP</title><content type='html'>&lt;span style="color: rgb(0, 0, 0);font-family:trebuchet ms;font-size:100%;"  &gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Well I have always been consufed with NP, P CO-NP and all such funda.... so today decided to get the basic funda clear about this:&lt;br /&gt;&lt;br /&gt;NP: It is the class of problems that can be solved by non deterministic finite automata by making a polynomial number of guesses and the solution can be verified in polynomial time.&lt;br /&gt;&lt;br /&gt;P: is a set of problems that can be solved in an polynomial time thus concluding that if a problem is P then it is NP&lt;br /&gt;&lt;br /&gt;now the question comes that whether NP=P.... the answer to this is uncertain as P is the class of problems that can be solved "easily" in polynomial time while NP is a class of problems that can be varified in a polynomial time and hence they are considered to be different.&lt;br /&gt;&lt;br /&gt;NP - complete: a problem is said to be NP - Complete if it is NP and every other NP problem can be reduced to it in polynomial time.... now its significance is that to show how hard a particular problem is: i.e. we can prove that for a particular problem no polynomial time algorithm exsists by contradiction if we reduce a problem for which no polynomial time solution exsists to it in polynomial time.... and finally if for any NP complete problem we find a polynomial time algorithm then since all the NP problems are reducible to it, all of them will have a polynomial time solution and hence NP class will now become equivalent to P and thus existance of NP complete problems is a factor which makes people believe that NP != P....&lt;br /&gt;&lt;br /&gt;finally if a problem is not NP but all the NP problems are reducible to it in polynomial time then it is known as NP- hard.... which implies that a NP hard problem is atleast as hard as any other NP problem, infact it might be harder.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;span style="font-family:trebuchet ms;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6907420233574449401-2458905266333915431?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/2458905266333915431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=2458905266333915431' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/2458905266333915431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/2458905266333915431'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/12/p-np.html' title='P NP'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-9176989428807076394</id><published>2006-12-30T17:27:00.000+05:30</published><updated>2006-12-30T17:28:08.831+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><title type='text'>Memory Leak</title><content type='html'>&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;In simple terms memory leaks may be defined as the loss of any memory allocated during the program... for a more precise and informative defineation refer &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/waguide/htm/memleak_3.asp"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;A very simple code exhibting memory leak:&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;int *p,q;&lt;br /&gt;p=(int*)malloc(sizeof(int));&lt;br /&gt;q=10;&lt;br /&gt;p=&amp;q;&lt;br /&gt;printf("the value of p=%d",*p);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;in the above case the memory allocated to p is lost in line number 6 and may be considered as a memory leak.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;span style="font-family: trebuchet ms;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6907420233574449401-9176989428807076394?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/9176989428807076394/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=9176989428807076394' title='186 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/9176989428807076394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/9176989428807076394'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/12/memory-leak.html' title='Memory Leak'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>186</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-571521542362050715</id><published>2006-12-30T17:22:00.000+05:30</published><updated>2006-12-30T17:26:56.633+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><title type='text'>Goto</title><content type='html'>&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;It has always been suugested to not use Goto in our programs, instead use for while and other stuff like it. why??&lt;br /&gt;&lt;br /&gt;firstly, using goto may insert labels into the program and when we encounter a label at a particular place in the program, it becomes very difficult to say from where might have the control landed up there. It makes the understanding of the difficult and hence the debugging gets even tougher.&lt;br /&gt;&lt;br /&gt;secondly, using constructs like for, while makes the program somewhat structured and its easy to trace the flow of control withinn the code... also using these constructs maps the code to real world scenario where a conditional statement may be represented as an decision and a for while may be regarded as repeating sometimes over and over.... but what does Goto represent in real world scenario??&lt;br /&gt;&lt;br /&gt;Thirdly, making use of too much Goto may result in &lt;a href="http://en.wikipedia.org/wiki/Spaghetti_code"&gt;speghetti code&lt;/a&gt; . There is also a story associated with goto. have a &lt;a href="http://www.acm.org/classics/oct95/"&gt;look&lt;/a&gt;.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;span style="font-family: trebuchet ms;"&gt; &lt;/span&gt;&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/6907420233574449401-571521542362050715?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/571521542362050715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=571521542362050715' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/571521542362050715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/571521542362050715'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/12/goto.html' title='Goto'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-8622026172900892502</id><published>2006-12-30T17:21:00.001+05:30</published><updated>2006-12-30T17:21:59.374+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><title type='text'>Twelve days of Christmas</title><content type='html'>&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;This is my fisrt post about obfuscated programming and this stuff seems to be amazing...... at first when I saw this &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;a style="font-family: trebuchet ms;" href="http://tiduherecdata.blogspot.com/2006/01/12-days-of-christmas-program.html"&gt;code&lt;/a&gt;&lt;span style="font-family: trebuchet ms;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;, I was amazed to see its &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;a style="font-family: trebuchet ms;" href="http://tiduherecdata.blogspot.com/2006/01/output.html"&gt;output&lt;/a&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;&lt;a href="http://tiduherecdata.blogspot.com/2006/01/output.html"&gt; &lt;/a&gt;.....  kaise ho sakta hain yaar... Then finally found the&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;a style="font-family: trebuchet ms;" href="http://research.microsoft.com/%7Etball/papers/XmasGift/"&gt; solution&lt;/a&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt; to it... and it was really nicely explained and dealt with... and about the author of the code... he might be a real genius I might say....&lt;br /&gt;&lt;br /&gt;During the study of how the program works, I learned about listed expressions and how the value of the whole expression becomes that of the last expression. Aneways the links are nice going through if you have some time.&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;span style="font-family: trebuchet ms;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6907420233574449401-8622026172900892502?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/8622026172900892502/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=8622026172900892502' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/8622026172900892502'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/8622026172900892502'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/12/twelve-days-of-christmas.html' title='Twelve days of Christmas'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-1739392874592300169</id><published>2006-12-30T17:20:00.001+05:30</published><updated>2006-12-30T17:20:29.869+05:30</updated><title type='text'>Puzzle</title><content type='html'>&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;consider the following code fragment:&lt;br /&gt;&lt;br /&gt;void fun()&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;int i=10;&lt;br /&gt;fun();&lt;br /&gt;printf("%d\n",i);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Now the task is to write something in function fun() such that main prints any other value than 10.... note that the value is to be printed in main()&lt;br /&gt;think.....&lt;br /&gt;&lt;br /&gt;Well the answer is as follows:&lt;br /&gt;void fun()&lt;br /&gt;{&lt;br /&gt;#define printf(a,b) printf("20\n")&lt;br /&gt;}&lt;br /&gt;simple... isn't it :-)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;span style="font-family: trebuchet ms;"&gt; &lt;/span&gt;&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/6907420233574449401-1739392874592300169?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/1739392874592300169/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=1739392874592300169' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/1739392874592300169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/1739392874592300169'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/12/puzzle_30.html' title='Puzzle'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-3438926159606446106</id><published>2006-12-30T17:17:00.000+05:30</published><updated>2006-12-30T17:19:05.785+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><title type='text'>To find the greater of two number</title><content type='html'>&lt;span style="color: rgb(51, 51, 51); font-family: trebuchet ms;font-size:100%;" &gt;Yes, but without using comparison operators!!!!&lt;br /&gt;&lt;br /&gt;the first solution came from Mayank... which was:&lt;br /&gt;&lt;br /&gt;int max(a,b)&lt;br /&gt;{&lt;br /&gt;if(a/b)&lt;br /&gt;return a;&lt;br /&gt;else return b;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;The above would not work if b=0... now the second one came from Muneish which was:&lt;br /&gt;&lt;br /&gt;x=(a-b)/|a-b|&lt;br /&gt;&lt;br /&gt;if(x+|x|)&lt;br /&gt;return a;&lt;br /&gt;else return b;&lt;br /&gt;&lt;br /&gt;Now this one is also wrong since a-b could cause overflow...&lt;br /&gt;Well the correct solution goes as follows:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt; &lt;dl style="font-family: trebuchet ms; color: rgb(51, 51, 51);" id="comments-block"&gt;&lt;dd style="color: rgb(255, 102, 102);" class="comment-body"&gt;&lt;p&gt;&lt;span style="color: rgb(255, 255, 255);font-size:100%;" &gt;&lt;span style="color: rgb(0, 0, 0);"&gt;void compare (int a, int b)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;int diff, msb;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;   msb = 1 &lt;&lt; (sizeof(int)*8&lt;/span&gt; - 1); &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;/dd&gt;&lt;dd class="comment-body"&gt;&lt;p&gt;&lt;span style="color: rgb(255, 255, 255);font-size:100%;" &gt;&lt;span style="color: rgb(0, 0, 0);"&gt;if ((a &amp; msb) &amp;amp;amp;&amp; !(b &amp;amp;msb)) /* a is negative and not b */ return b; else if ((b &amp; msb) &amp;amp;amp;amp;amp;amp;amp;&amp; !(a &amp;amp;msb)) /* b is negative and not a */ return a; /* a and b are of same sign */ diff = a-b; if (!diff || !(diff &amp; msb)) /* a==b and a &gt; b */&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;       return a;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;   return b;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;span style="color: rgb(51, 51, 51); font-family: trebuchet ms;font-size:100%;" &gt;I have shamelessly copied this code from Joju John, but was worth the search... A point to be noticed is that msb and diif variables are taken as int but you have to make there types as same as that of a and b.&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);font-size:100%;" &gt;&lt;span style="font-family: trebuchet ms;"&gt; &lt;/span&gt;&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/6907420233574449401-3438926159606446106?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/3438926159606446106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=3438926159606446106' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/3438926159606446106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/3438926159606446106'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/12/to-find-greater-of-two-number.html' title='To find the greater of two number'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-6643948820146262226</id><published>2006-12-30T17:15:00.000+05:30</published><updated>2006-12-30T17:16:13.768+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Algos'/><category scheme='http://www.blogger.com/atom/ns#' term='Complexity'/><title type='text'>Puzzle</title><content type='html'>&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;You are given an array with n elements { x1, x2 ... xk ... xn }. You are also given an array location k. Using constant space and O(n) time, rotate the array such that it contains { xk, xk+1 ... xn, x1, x2 ... xk-1 }.&lt;/span&gt;&lt;span style="font-family: trebuchet ms; color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;Well the first thoughts which came to my mind were those involving swapping the elements and one can also achieve the solution this way, but its not the best way. The best way out is as follows:&lt;/span&gt;&lt;span style="font-family: trebuchet ms; color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;We know that reversing of a list can be done in constant time. Thus do as follows:&lt;/span&gt;&lt;span style="font-family: trebuchet ms; color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;1.reverse the list from x1 to xk-1    {xk-1, xk-2, ....., x1, xk, ...... , xn}&lt;/span&gt;&lt;span style="font-family: trebuchet ms; color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;2.reverse the list from xk to xn       {xk-1, xk-2, ....., x1, xn, ......., xk}&lt;/span&gt;&lt;span style="font-family: trebuchet ms; color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;3.reverse the whole list                     {xk, xk+1, ..... xn, x1, x2, ......., xk-1}&lt;/span&gt;&lt;span style="font-family: trebuchet ms; color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;Nice na!!!!&lt;/span&gt;&lt;span style="font-family: trebuchet ms; color: rgb(0, 0, 0);font-size:100%;" &gt;&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/6907420233574449401-6643948820146262226?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/6643948820146262226/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=6643948820146262226' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/6643948820146262226'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/6643948820146262226'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/12/puzzle.html' title='Puzzle'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-6533501165610077955</id><published>2006-12-30T17:14:00.001+05:30</published><updated>2006-12-30T17:14:52.956+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><title type='text'>Simple One</title><content type='html'>&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;Consider the following program&lt;br /&gt;#include&lt;stdio.h&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;if(.....)&lt;br /&gt;printf("AB");&lt;br /&gt;else&lt;br /&gt;printf("C");&lt;br /&gt;}&lt;br /&gt;Q: fill in the blank within if condition so that o/p is ABC&lt;br /&gt;&lt;br /&gt;here is ans &lt;/stdio.h&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" class="I" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;   if(!printf("AB"))&lt;br /&gt;------&lt;br /&gt;else&lt;br /&gt;----&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;:)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;span style="font-family: trebuchet ms;"&gt; &lt;/span&gt;&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/6907420233574449401-6533501165610077955?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/6533501165610077955/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=6533501165610077955' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/6533501165610077955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/6533501165610077955'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/12/simple-one.html' title='Simple One'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-1527033703545173640</id><published>2006-12-30T17:10:00.000+05:30</published><updated>2006-12-30T17:13:07.205+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Pointers and Reference</title><content type='html'>&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;Although they look the same but have major differences. These are said to be valid in C++. I don't know about C. The info can be found &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;&lt;a href="http://rafb.net/efnet_cpp/faq/concepts/ptrref/"&gt;here&lt;/a&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;. &lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51); font-family: trebuchet ms;font-size:100%;" &gt;&lt;span style="color: rgb(204, 204, 255);"&gt;Also we may say that pointers consume memory but references may be thought of as alias for an object and thus having no memory consumption butI not 100% sure on this point.&lt;/span&gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6907420233574449401-1527033703545173640?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/1527033703545173640/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=1527033703545173640' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/1527033703545173640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/1527033703545173640'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/12/pointers-and-reference.html' title='Pointers and Reference'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-6458386802986375213</id><published>2006-12-30T17:09:00.000+05:30</published><updated>2006-12-30T17:10:14.963+05:30</updated><title type='text'>String Constants</title><content type='html'>&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;char *a = "abc";&lt;/span&gt;&lt;span style="font-family: trebuchet ms; color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;a = "def";&lt;/span&gt;&lt;span style="font-family: trebuchet ms; color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;The above is correct but the code crashes when we do  a[1] = 'd';&lt;/span&gt;&lt;span style="font-family: trebuchet ms; color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;This may be because actually when we say char * a ="abc"; then it means a is pointing to a const memory location which contains "abc" and when we say a= "def"; its again modifying pointer's value to be now pointing to some other constant location; but when u\we say a[1]= 'd' then we are modyfying a const so it crashes!&lt;/span&gt;&lt;span style="font-family: trebuchet ms; color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;C doesnot defines behaviour when you chnage a string literal that is why it is crashing.You will end up getting different results with different compilers or on diff machines too.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;span style="font-family: trebuchet ms;"&gt; &lt;/span&gt;&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/6907420233574449401-6458386802986375213?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/6458386802986375213/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=6458386802986375213' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/6458386802986375213'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/6458386802986375213'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/12/string-constants.html' title='String Constants'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-998099848853906432</id><published>2006-12-30T17:08:00.000+05:30</published><updated>2006-12-30T17:09:27.825+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><title type='text'>Padding</title><content type='html'>&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;static struct&lt;br /&gt;{&lt;br /&gt;unsigned char **segment;&lt;br /&gt;unsigned int *reg1;&lt;br /&gt;unsigned int *reg2;&lt;br /&gt;int offset;&lt;br /&gt;int offset16;&lt;br /&gt;int pad[3]; /* Make structure power of 2 bytes wide for speed */&lt;br /&gt;} ModRMRM[256];&lt;br /&gt;&lt;br /&gt;wat is d significant of pad[3]????&lt;br /&gt;how it become fast if structure is of power 2???&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ou are taking array of structures...&lt;br /&gt;so for that say u have to access jth element of array ..u do it by array[j] ...how does ur compiler do it is array+j*size of &lt;struct&gt;(that is *array) right!!&lt;br /&gt;so if sizefo struct if power of 2 then the multiplication can be speed up by just doing shifting of bits ..accessing array elements by subscript is quite frequent...thats why this practice gives a lot of performance speedup&lt;/struct&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;span style="font-family: trebuchet ms;"&gt; &lt;/span&gt;&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/6907420233574449401-998099848853906432?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/998099848853906432/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=998099848853906432' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/998099848853906432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/998099848853906432'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/12/padding.html' title='Padding'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-3132513273289510227</id><published>2006-12-30T17:07:00.000+05:30</published><updated>2006-12-30T17:08:11.241+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><title type='text'>Size of a Datatype</title><content type='html'>&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;how to find the size of any datatype in c ,without using sizeof operator and also without using the technique of bitwise operator?&lt;br /&gt;&lt;br /&gt; U can use this technique&lt;br /&gt;&lt;br /&gt;#define MY_SIZE(p) ((char *)((&amp;p)+1)) - ((char *)&amp;amp;p)&lt;br /&gt;&lt;br /&gt;The problem with this is u have to pass the variable and can't directly use as sizeof(int).&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;span style="font-family: trebuchet ms;"&gt; &lt;/span&gt;&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/6907420233574449401-3132513273289510227?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/3132513273289510227/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=3132513273289510227' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/3132513273289510227'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/3132513273289510227'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/12/size-of-datatype.html' title='Size of a Datatype'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-1979396707492217710</id><published>2006-12-30T17:06:00.000+05:30</published><updated>2006-12-30T17:07:14.685+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><title type='text'>Reverse an Array</title><content type='html'>&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;An array of size N has distinct values 1…N in random order. You have only operator called rev(X) (where X is any value from 0 to N-1) which reverses all values from 0 to X (example values 2,3,1,4 and rev(2) gets you 1,3,2,4). Our objective is to sort the array using minimum number of Rev(X) functions. How many permutations of N size array require exactly N number of rev(X) operators to get sorted?&lt;br /&gt;&lt;br /&gt;My answer is,&lt;br /&gt;1) find out max num. in an array say position i, use rev(i) and after use rev(N).&lt;br /&gt;2) repeat above step by decreasing N by one each time&lt;/span&gt;&lt;span style="font-family: trebuchet ms; color: rgb(0, 0, 0);font-size:100%;" &gt;&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/6907420233574449401-1979396707492217710?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/1979396707492217710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=1979396707492217710' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/1979396707492217710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/1979396707492217710'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/12/reverse-array.html' title='Reverse an Array'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-5453669265834512114</id><published>2006-12-30T16:58:00.000+05:30</published><updated>2006-12-30T17:01:46.904+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><title type='text'>More Efficient</title><content type='html'>&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;which is more efficient of these two&lt;br /&gt;FOR LOOPS&lt;br /&gt;&lt;br /&gt;for(int i=0;i&lt;10;i++);&lt;br /&gt;for(int i=0;i&lt;10;++i);&lt;br /&gt;&lt;br /&gt; Post increment is less efficient that Pre because in former the value is first updated and then a temporary variable having the previous value is returned. See &lt;a href="http://www.gotw.ca/gotw/002.htm"&gt;this&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Anyways for(int i=10; i&gt;0; --i) is the most efficient this is more efficient bcoz in this case ur comparing i with 0 rather than pre stored value(10) which takes some more operations wher as comparision with 0 can be easily done by comparing with a logical value 0.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6907420233574449401-5453669265834512114?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/5453669265834512114/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=5453669265834512114' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/5453669265834512114'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/5453669265834512114'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/12/more-efficient.html' title='More Efficient'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-2419850834737503262</id><published>2006-12-30T16:55:00.000+05:30</published><updated>2006-12-30T16:58:00.081+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><title type='text'>without "" in printf</title><content type='html'>&lt;span style="color: rgb(0, 0, 0);font-family:trebuchet ms;font-size:100%;"  &gt;can u print any string wthout using " " in printf function?&lt;br /&gt;&lt;br /&gt;without using " " anywhere in the program&lt;br /&gt;&lt;br /&gt;#define str(a) #a&lt;br /&gt;&lt;br /&gt;printf(str(Hi there));&lt;br /&gt;&lt;br /&gt;I haven't figured out how this happens , but happens for sure!&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:85%;"  &gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt; &lt;/span&gt;&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/6907420233574449401-2419850834737503262?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/2419850834737503262/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=2419850834737503262' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/2419850834737503262'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/2419850834737503262'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/12/can-u-print-any-string-wthout-using-in.html' title='without &quot;&quot; in printf'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-2130306937183424938</id><published>2006-12-30T16:53:00.001+05:30</published><updated>2006-12-30T16:53:51.023+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><title type='text'>without main</title><content type='html'>&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;Although its not possible to write a program without main() but still it may be possible that main() is not present explicitly... as follows:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;#include &lt;stdio.h&gt;&lt;br /&gt;#define decode(s,t,u,m,p,e,d) m##s##u##t&lt;br /&gt;#define begin decode(a,n,i,m,a,t,e)&lt;br /&gt;begin()&lt;br /&gt;{&lt;br /&gt;printf("Stumped??\n");&lt;br /&gt;}&lt;br /&gt;&lt;/stdio.h&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt;But main()&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-family: trebuchet ms;font-size:100%;" &gt; is indirectly present.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;span style="font-family: trebuchet ms;"&gt; &lt;/span&gt;&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/6907420233574449401-2130306937183424938?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/2130306937183424938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=2130306937183424938' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/2130306937183424938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/2130306937183424938'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/12/without-main.html' title='without main'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-5797110993580115651</id><published>2006-12-30T16:51:00.000+05:30</published><updated>2006-12-30T16:52:38.433+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><title type='text'>Integer Limits</title><content type='html'>&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;Any way to get the limits of an integer using a code?&lt;br /&gt;&lt;br /&gt;There are two ways:&lt;br /&gt;&lt;br /&gt;1.Simpler one&lt;br /&gt;&lt;br /&gt; #include &lt;limits.h&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;printf("Range of int: %d to %d\n", INT_MIN, INT_MAX);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;2. Another One&lt;br /&gt;&lt;br /&gt;upper_limit=(~(0u)&gt;&gt;1);&lt;br /&gt;0u&lt;br /&gt;fill in all 0s in the register so it looks like 000...000 (represented as MSB...LSB)&lt;br /&gt;~(0u)&lt;br /&gt;Now, flip all bits so it looks like 111...111&lt;br /&gt;~(0u)&gt;&gt;1&lt;br /&gt;Shift right one bit so that MSB is zero&lt;br /&gt;011...111 which is maximum positive number that you can represent.&lt;br /&gt;&lt;br /&gt;for lower range:&lt;br /&gt;lower_limit=( (~0)^(~0u&gt;&gt;1)) (or lower_limit = ~upper_limit) logic flips 011...111 to 100...000 which is the lowest number presentable.&lt;br /&gt;&lt;/stdio.h&gt;&lt;/limits.h&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6907420233574449401-5797110993580115651?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/5797110993580115651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=5797110993580115651' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/5797110993580115651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/5797110993580115651'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/12/integer-limits.html' title='Integer Limits'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-2305901818746867659</id><published>2006-12-30T16:44:00.000+05:30</published><updated>2006-12-30T17:54:36.645+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C'/><title type='text'>Maximal Munch</title><content type='html'>&lt;span style="color: rgb(0, 0, 0);font-family:trebuchet ms;font-size:100%;"  &gt;   How is the expression x+++y parsed? As x++ + y or x + ++y ? Why?&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-family:trebuchet ms;font-size:100%;"  &gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-family:trebuchet ms;font-size:100%;"  &gt;The issue is with tokenization. The ANSI C standard requires that the longest possible sequence of characters be considered as a token. + and ++ are both valid tokens. When a +++ is encountered , the longest possible token is the ++. So, +++ is tokenized into ++ +.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-family:trebuchet ms;font-size:100%;"  &gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-family:trebuchet ms;font-size:100%;"  &gt;On a similar note, x+++++y is always tokenized as x ++ ++ + y, and gives a syntax error. This is inspite of the fact that the tokenization x ++ + ++ y would not have an error.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-family:trebuchet ms;font-size:100%;"  &gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-family:trebuchet ms;font-size:100%;"  &gt;   This 'oddity' is known as the "maximal munch" principle.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-family:trebuchet ms;font-size:100%;"  &gt;&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/6907420233574449401-2305901818746867659?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/2305901818746867659/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=2305901818746867659' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/2305901818746867659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/2305901818746867659'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/12/how-is-expression-xy-parsed-as-x-y-or-x.html' title='Maximal Munch'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-6850718041503101882</id><published>2006-11-04T19:08:00.000+05:30</published><updated>2006-11-04T19:35:09.908+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web 2.0'/><title type='text'>Web 2.0, for the layman!</title><content type='html'>&lt;span style="font-family:trebuchet ms;"&gt;We have often heard the term Web 2.0. What does it mean? Surely there's no new version of the web available and neither there are any particular group of web sites that open only in Firefox 2.0. Then, what is it?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Web 2.0 points out to the new era of web which is much different from delivering just HTML content to the user. It is a new way of thinking, it points out to the web that is getting smarter and richer as more and more people start to use it. The trend  for the Web nowadays is Social interaction, user-generated content and blogs which when taken together form the next generation, user driven, intelligent web.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Soon gone will be the days when people used desktop software that came in versions. The software has become an service now. The versions are no more there, only improvement goes on. Do you know which version of Google reader or Gmail do you use, or do you know what have been the improvements going on? The whole software cycle of design-develop-test-ship-install will be finished. Software will now rely on the Beta development model, where it is continually refined and improved and the users will become beta developers. It is Web 2.0.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;The above description has been taken from the Expert of the Web2.0 report published by &lt;/span&gt;&lt;a style="font-family: trebuchet ms;" href="http://blog.programmableweb.com/"&gt;John Musser&lt;/a&gt;&lt;span style="font-family:trebuchet ms;"&gt; and  &lt;/span&gt;&lt;a style="font-family: trebuchet ms;" href="http://radar.oreilly.com/"&gt;Tim O'Reilly&lt;/a&gt;&lt;span style="font-family:trebuchet ms;"&gt; called the "&lt;/span&gt;&lt;a style="font-family: trebuchet ms;" href="http://www.oreilly.com/radar/web2report"&gt;Web 2.0, Principles and Best Practices&lt;/a&gt;&lt;span style="font-family:trebuchet ms;"&gt;".&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Also there is a Third Annual Web2.0 Conference from November 7-9 , 2006.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;The term Web 2.0 was coined by O'Reilly's Media in 2004, pointing out the second generation of web services , where people could collaborate and share information. There are many examples of Web 2.0 services:&lt;/span&gt;&lt;a style="font-family: trebuchet ms;" href="http://www.orkut.com/"&gt;Orkut&lt;/a&gt;&lt;span style="font-family:trebuchet ms;"&gt; and &lt;/span&gt;&lt;a style="font-family: trebuchet ms;" href="http://www.myspace.com/"&gt;MySpace&lt;/a&gt;&lt;span style="font-family:trebuchet ms;"&gt; are two of the most popular web social networking sites, &lt;/span&gt;&lt;a style="font-family: trebuchet ms;" href="http://docs.google.com/"&gt;Google's Spreadsheet and documents &lt;/a&gt;&lt;span style="font-family:trebuchet ms;"&gt;are an another example, then there is &lt;/span&gt;&lt;a style="font-family: trebuchet ms;" href="http://www.youtube.com/"&gt;YouTube&lt;/a&gt;&lt;span style="font-family:trebuchet ms;"&gt; for sharing videos and &lt;/span&gt;&lt;a style="font-family: trebuchet ms;" href="http://www.slideshare.net/"&gt;Slideshare.net&lt;/a&gt;&lt;span style="font-family:trebuchet ms;"&gt; for sharing slide shows. Also there's an Indian startup like &lt;/span&gt;&lt;a style="font-family: trebuchet ms;" href="http://www.burrp.com/"&gt;burrp&lt;/a&gt;&lt;span style="font-family:trebuchet ms;"&gt;, where users write reviews and recommendations for  the right spots, be it a pan vaala  or a good restaurant......and the list is unending!! &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;I would like to end with line by Ross Mayfield,&lt;/span&gt; &lt;blockquote style="font-style: italic; color: rgb(204, 102, 0);"&gt;Web 1.0 was commerce , Web 2.0 is people.&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6907420233574449401-6850718041503101882?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/6850718041503101882/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=6850718041503101882' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/6850718041503101882'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/6850718041503101882'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/11/web-20-for-layman.html' title='Web 2.0, for the layman!'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-1435690581913065110</id><published>2006-11-04T17:30:00.000+05:30</published><updated>2006-11-04T19:39:47.847+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Personalization'/><title type='text'>Biasing Web Results for Topic Fimiliarity</title><content type='html'>&lt;p style="font-family: trebuchet ms;font-family:trebuchet ms;"  class="MsoNormal"&gt;This post is based on a research paper by Yahoo! Research written by &lt;a href="http://research.yahoo.com/%7Eomidmadani"&gt;Omid Madani&lt;/a&gt; and &lt;a href="http://research.yahoo.com/%7Erosiejones_au"&gt;Rosie Jones&lt;/a&gt; of Yahoo! and Giridhar Kumaran from University of Massachusetts. &lt;span style=""&gt; &lt;/span&gt;It is based on the fact that based on the user’s familiarity with the search topic, it would be appropriate to give him either introductory or advanced search results.&lt;/p&gt;    &lt;p style="font-family: trebuchet ms;" face="verdana" class="MsoNormal"&gt;The findings are based on a four-fold procedure. Firstly, the definition of advanced and introductory web pages is given.&lt;/p&gt;    &lt;p  style="color: rgb(102, 102, 102); font-family: trebuchet ms;font-family:trebuchet ms;" class="MsoNormal"&gt;&lt;i style=""&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;An Introductory webpage is defined as a page that doesn’t presuppose any background knowledge of the topic and to an extent introduces or defines key terms in the topic.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/p&gt;    &lt;p style="font-family: trebuchet ms;font-family:verdana;" class="MsoNormal" &gt;&lt;i style=""&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;An advanced webpage would be one which assumes sufficient background knowledge of the topic and probably builds upon them.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/p&gt;    &lt;p style="font-family: trebuchet ms;font-family:trebuchet ms;"  class="MsoNormal"&gt;Then it is shown that the definitions above hold for a set od people, by the inter-labeler agreement. Three annotators are asked to label randomized sets of results for particular queries and are found to agree about 70% of the time. Also based on their labeling it is found that the&lt;span style="color: rgb(102, 102, 102);"&gt; &lt;/span&gt;&lt;span style="font-style: italic; color: rgb(102, 102, 102);"&gt;search engines have an equal bias towards both introductory and advanced web pages&lt;/span&gt;. Also the precision for an introductory page to be at position 1 is slightly more than 0.5, showing that &lt;span style="font-style: italic; color: rgb(200, 102, 0);"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;search engines generally make the top result an introductory one&lt;/span&gt;.&lt;/span&gt; The work tries to improve the precision for introductory documents from the positions 1 to 10.&lt;/p&gt;    &lt;p style="font-family: trebuchet ms;" class="MsoNormal"&gt;An experiment was performed on the introductory and the advanced documents according to Fog, Flesch and Kincaid indices. All of them marked the documents as unreadable and weren’t able to distinguish the introductory from the advanced thus showing that the &lt;span style="font-style: italic; color: rgb(102, 102, 102);"&gt;reading level measures aren’t enough to distinguish the documents&lt;/span&gt;. Also an experiment was performed in which a query was expanded using introductory trigger words. But it was found that it didn’t bring about significant improvement in the rankings of the introductory documents. &lt;/p&gt;    &lt;p style="font-family: trebuchet ms;" face="trebuchet ms" class="MsoNormal"&gt;Thus a familiarity classifier was developed using reading level measures, distribution of stop words in the text and the non text features like the average line-length. This classifier when trained could label documents as introductory or advanced. It could be used to increase the precision at the top rankings by including more results there.&lt;span style=""&gt;  &lt;/span&gt;However relevance can’t be increased this way. But the documents can be classified at crawl time, thus addressing this problem too.&lt;/p&gt;    &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; font-family: trebuchet ms;font-family:trebuchet ms;"&gt;&lt;span style="font-style: italic; color: rgb(102, 102, 102);"&gt;The study was able to &lt;/span&gt;&lt;span style=""&gt;&lt;span style="font-style: italic; color: rgb(102, 102, 102);"&gt;re-rank the documents, producing a statistically significantly higher proportion of introductory documents at top most 5 positions and at topmost 10 positions, over baseline search engine retrieval. This kind of topic-independent, user-independent classifier is empowering for personalized search, as with a single change to the retrieval reranking, any user can specify whether they want introductory or advanced documents for any query.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; font-family: trebuchet ms;font-family:trebuchet ms;"&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;  &lt;/p&gt; &lt;span style="font-family: trebuchet ms;font-family:trebuchet ms;" &gt;Further work in this area would be &lt;span style="font-style: italic; color: rgb(200, 102, 0);"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;integrate user profile to automatically know the knowledge level of the user,&lt;/span&gt; &lt;/span&gt;so that user doesn’t have to point out explicitly whether he wants advanced results or introductory results. &lt;span style="font-style: italic; color: rgb(102, 102, 102);"&gt;This scheme could have majority of the10 results matching the user profile information. If the user clicks upon the minority results, its clear that he wants the opposite information.&lt;/span&gt; Also the classifier could include more features which help in better identification of advanced documents from the introductory documents.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;font-family:verdana;" &gt;The publication is available &lt;/span&gt;&lt;a style="font-family: trebuchet ms;" href="http://research.yahoo.com/publication/biasing_web_search_results_for_topic_familiarity"&gt;here&lt;/a&gt;&lt;span style="font-family: trebuchet ms;font-family:verdana;" &gt;.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6907420233574449401-1435690581913065110?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/1435690581913065110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=1435690581913065110' title='26 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/1435690581913065110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/1435690581913065110'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/11/biasing-web-results-for-topic.html' title='Biasing Web Results for Topic Fimiliarity'/><author><name>Romram</name><uri>http://www.blogger.com/profile/09818521394278809071</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_DMbaA6zdbyA/S6kT6DCHuSI/AAAAAAAABRA/Fc60E1jckwA/s1600-R/9125_169692382015_520767015_3338144_7472365_n.jpg'/></author><thr:total>26</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6907420233574449401.post-3198106669941994910</id><published>2006-11-03T13:50:00.000+05:30</published><updated>2006-11-03T21:44:46.854+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips n Tricks'/><title type='text'>Useful Keyboard shortcuts for Microsoft Word</title><content type='html'>&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;C refers to Control&lt;br /&gt;S refers to Shift&lt;br /&gt;&lt;br /&gt;C+Home   Go to first line of Page from anywhere&lt;br /&gt;S+End    Go to last line of a Page from anywhere&lt;br /&gt;C+S+&gt;    Increase selected text in increments like the drop down font menu&lt;br /&gt;C+S+&lt;    Decrease selected text in increments like the drop down font menu &lt;br /&gt;C+S++    Apply superscript formatting&lt;br /&gt;C+=      Apply subscript formatting&lt;br /&gt;C+S+]    Increase selected text one point&lt;br /&gt;C+S+[    Decrease selected text one point &lt;br /&gt;S+F3     Change case of the letters&lt;br /&gt;C+S+W    Underline words but not spaces&lt;br /&gt;C+E      Center a paragraph&lt;br /&gt;C+BkSp   Delete one word to the left&lt;br /&gt;C+Del    Delete one word to the right&lt;br /&gt;C+J      Justify a paragraph&lt;br /&gt;C+L      Left align a paragraph&lt;br /&gt;C+R      Right align a paragraph  &lt;br /&gt;C+S+(&lt;--/--&gt;) Extend selection to the beginning/end of a word&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6907420233574449401-3198106669941994910?l=innovatei.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://innovatei.blogspot.com/feeds/3198106669941994910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6907420233574449401&amp;postID=3198106669941994910' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/3198106669941994910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6907420233574449401/posts/default/3198106669941994910'/><link rel='alternate' type='text/html' href='http://innovatei.blogspot.com/2006/11/useful-keyboard-shortcuts-for-microsoft.html' title='Useful Keyboard shortcuts for Microsoft Word'/><author><name>Mayank</name><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></feed>
