<?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-4639351086274939491</id><updated>2011-11-27T16:59:41.530-08:00</updated><category term='prank'/><category term='code optimization'/><category term='surprises'/><category term='enjoy'/><category term='friend'/><category term='multi languages selection.'/><category term='coding efficiency'/><category term='time saver'/><category term='efficiency'/><title type='text'>SaM PC Tricks</title><subtitle type='html'>Simple and Mischievous Personal Collection of Tricks</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sampctricks.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4639351086274939491/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://sampctricks.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>SaM PC Tricks</name><uri>http://www.blogger.com/profile/04327778726478256127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4639351086274939491.post-7677305778845638096</id><published>2011-07-17T12:45:00.000-07:00</published><updated>2011-07-17T12:45:18.933-07:00</updated><title type='text'>Escaping from Viva Tests and Assignments After Being Sucked at Internal Tests</title><content type='html'>Hmm.. it was a nice experience today. I was called for viva by coordinator of one of the department of my university. I could not attend the internal test that was held in the class, so I was expected to sit for the exam today but when I went to my college I found that we are going to have a viva exam. I had only prepared for Multiple Choice Questions and that would not work. To escape the viva test, I had only few choices:&lt;br /&gt;Either I pretend like unable to speak&lt;br /&gt;Or accept that I am lazy ... too lazy&lt;br /&gt;Or get a 'NOT QUALIFIED' icon beside my roll no.&lt;br /&gt;&lt;br /&gt;None of the ideas would work there. Instead, I thought of an idea and went for the viva test. The teacher started asking questions from the studied topics starting from the hardest one. I could not reply... ( to be continued )&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;View more at SamPcTricks.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4639351086274939491-7677305778845638096?l=sampctricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sampctricks.blogspot.com/feeds/7677305778845638096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sampctricks.blogspot.com/2011/07/escaping-from-viva-tests-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4639351086274939491/posts/default/7677305778845638096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4639351086274939491/posts/default/7677305778845638096'/><link rel='alternate' type='text/html' href='http://sampctricks.blogspot.com/2011/07/escaping-from-viva-tests-and.html' title='Escaping from Viva Tests and Assignments After Being Sucked at Internal Tests'/><author><name>SaM PC Tricks</name><uri>http://www.blogger.com/profile/04327778726478256127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4639351086274939491.post-828107668908350115</id><published>2011-07-12T20:06:00.000-07:00</published><updated>2011-07-12T20:07:33.074-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='time saver'/><category scheme='http://www.blogger.com/atom/ns#' term='code optimization'/><category scheme='http://www.blogger.com/atom/ns#' term='multi languages selection.'/><category scheme='http://www.blogger.com/atom/ns#' term='efficiency'/><category scheme='http://www.blogger.com/atom/ns#' term='coding efficiency'/><title type='text'>Writing 1000 lines of code in 5 minutes!</title><content type='html'>Well today while I was writing some code for my project, I found one drawback that we have in the programming languages of today. To cut the long story short, let me give one example. I was writing code for a multiplayer card game in C++. I had to write codes for simulating the 3 players, each holding random of 52 cards each. Hence, I had to write 52x3 'if' cases to make the code go. I put my fingers on the keyboard, wrote one case, that went around 8 lines, copied it 13 times, used the text replacement feature to change the variables, then again copied those 13 blocks twice, each time copying the codes and pasting them. It took me very short time to complete all this; I finished writing around 1000 lines of code in 25 minutes. Wow!&amp;nbsp; &lt;br /&gt;&lt;br /&gt;Was it really a big hit? After I finished for the day, I went to my bed for a nap. A person named 'Jesus', who introduced himself as a 'JS + CSS' entered my room, . Hmm.. It was a Javascript and CSS combination. Well, name didn't matter but what he did to my source code did. He turned on my computer, opened my project file in Notepad++ application, deleted all those lines except the first block of 'if' case, saved the file, copied the block and exitted the application. I was shocked, because it was my code, which was the only copy of it; I didn't have a backup. He deleted and I could not even use 'Ctrl + Z', one of my favourite combinations. I tried to reach him but something was not letting me get up the bed. &lt;br /&gt;&lt;br /&gt;He pasted the code back to a new file in Notepad++, chose 'Javascript' as a syntax highlighting language and pasted the block of code into it. From the 'TextFx' menu, he selected 'Escape all quotes' and again saved the file. He embeded the code in one 'for' loop, created an array variable with 13 items, again enclosed the block inside another 'for' loop and within two minutes there was a nested 'for' loop, and then '&amp;lt;br&amp;gt;' and '&amp;lt;blockquote&amp;gt;' HTML tags. Then whole code embeded inside a '&amp;lt;script&amp;gt;' tag, then again it was embeded inside '&amp;lt;head&amp;gt;' tag, followed by '&amp;lt;body&amp;gt;' tag and finally inside a '&amp;lt;html&amp;gt;' tag. He saved the file with the name "CppHtml.htm" on my desktop folder. He closed the application, and double clicked on the file he had saved. to my surprise, there was a webpage being displayed on my favorite browser 'Mozilla Firefox 3.6'. What I saw was a nicely indented and formatted those 750 lines of code within 5 minutes.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;Well, you must be interested to see the code, since just saying it in plain text proves nothing. Here is the code: &lt;br /&gt;&lt;br /&gt;/* Sample line of code required for the game: */ &lt;br /&gt;/* 52 Such blocks were to be created for it */ &lt;br /&gt;if(active_player = cardN[1] ) &lt;br /&gt;{ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; switch(card){ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; case 'S': { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; for(i=1;i&amp;lt;=3; i++){ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; play(i,'S'); break;} &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; case 'D':&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ... &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; case 'H':&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ... &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; case 'C':&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ... &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; default:{;} &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;} &lt;br /&gt;... &lt;br /&gt;... &lt;br /&gt;&lt;br /&gt;/*Equivalent Javascript Code*/ &lt;br /&gt;&lt;br /&gt;var card={'S', 'D', 'H', 'C'}; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;for(i = 1; i&amp;lt;= 13; i++){ &lt;br /&gt;// use this 'i' for cardN[i] &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(j=0; j&amp;lt;4; j++){ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // use this 'j' for card[j] ; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // put the switch case for here; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;if(active_player = cardN[1] ) &lt;br /&gt;{ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; switch(card){ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; case 'S': { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; for(i=1;i&amp;lt;=3; i++){ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; play(i,'S'); break;} &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; case 'D':&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ... &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; case 'H':&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ... &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; case 'C':&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ... &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; default:{;} &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;If you didn't understand anything above, please do not blame me at all. &lt;b&gt;Motto of the post: ?? Leave your comments. But as far as I understood, feel free to use any of the programming or scripting languages to fulfill the demand of your code... or something like that. I do not have a learning disorder of Language and Music; I am a coder! CHEERS! :D&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;View more at SamPcTricks.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4639351086274939491-828107668908350115?l=sampctricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sampctricks.blogspot.com/feeds/828107668908350115/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sampctricks.blogspot.com/2011/07/writing-1000-lines-of-code-in-5-minutes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4639351086274939491/posts/default/828107668908350115'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4639351086274939491/posts/default/828107668908350115'/><link rel='alternate' type='text/html' href='http://sampctricks.blogspot.com/2011/07/writing-1000-lines-of-code-in-5-minutes.html' title='Writing 1000 lines of code in 5 minutes!'/><author><name>SaM PC Tricks</name><uri>http://www.blogger.com/profile/04327778726478256127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4639351086274939491.post-8405558971979290585</id><published>2011-07-10T19:30:00.000-07:00</published><updated>2011-07-10T19:31:14.084-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='enjoy'/><category scheme='http://www.blogger.com/atom/ns#' term='prank'/><category scheme='http://www.blogger.com/atom/ns#' term='surprises'/><category scheme='http://www.blogger.com/atom/ns#' term='friend'/><title type='text'>Welcome to Sam's Pc Tricks</title><content type='html'>Well guys, do not misunderstand it as the Computer Tricks Site by Mr. Sam. Actually it is Simple and Mischievous Personal Collection of Tricks! :)&lt;br /&gt;Simply like I tricked you with my blog title. Do you love pranks? Do you enjoy doing everything for fun or prank yourself with pleasant surprises on your own? Come one, see this!&lt;div class="blogger-post-footer"&gt;View more at SamPcTricks.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4639351086274939491-8405558971979290585?l=sampctricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sampctricks.blogspot.com/feeds/8405558971979290585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sampctricks.blogspot.com/2011/07/welcome-to-sams-pc-tricks.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4639351086274939491/posts/default/8405558971979290585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4639351086274939491/posts/default/8405558971979290585'/><link rel='alternate' type='text/html' href='http://sampctricks.blogspot.com/2011/07/welcome-to-sams-pc-tricks.html' title='Welcome to Sam&apos;s Pc Tricks'/><author><name>SaM PC Tricks</name><uri>http://www.blogger.com/profile/04327778726478256127</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
