<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5966303661451578311</id><updated>2024-12-19T08:50:15.712+05:30</updated><category term="Python"/><category term="Programming"/><category term="MIT 6.00x"/><category term="edX"/><category term="Competitive Programming"/><category term="Algorithms"/><category term="Blogger"/><category term="C Program"/><category term="Graphic Design"/><category term="Photo Editing"/><category term="Portfolio"/><category term="Wordpress"/><category term="Adsense and Alternatives"/><category term="Blogging"/><category term="Computer Engineering"/><category term="Do&#39;s and Don&#39;ts of Adsense"/><category term="GIMP"/><category term="GIMP Development"/><category term="HackerEarth"/><category term="Open Source"/><category term="Personal"/><category term="SEO"/><category term="Software Development"/><title type='text'>Rookie&#39;s Lab</title><subtitle type='html'>Programming and Blogger Lab</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rookieslab.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://rookieslab.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05336645400007023377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>25</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5966303661451578311.post-7507454031701992953</id><published>2015-09-09T03:47:00.000+05:30</published><updated>2016-10-14T15:17:45.936+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Competitive Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="HackerEarth"/><category scheme="http://www.blogger.com/atom/ns#" term="Software Development"/><title type='text'>Hobbyist Competitive Programmer to Software Developer at HackerEarth</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Prologue - Late December 2012, beginning of a new semester.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Reached college campus 2-3 days earlier only to know that we have planned to &lt;i&gt;&quot;mass bunk&quot;&lt;/i&gt; the first week. Had no plans whatsoever for the 10 days that lied ahead. Took a stroll around the hostel and found a guy who, I speculated had already started studying for mid-semester exam. On later inspection I found that he was solving some mathematical puzzle on codechef.com. I had heard that name before but never bothered to browse around. He explained me that puzzle with sample input and asked me for output. It all started there, the craving for the green AC tick.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Fast forward to February 2014.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
All of the last 14 months, I consistently kept on participating in various contests on CodeForces, HackerEarth and CodeChef. I saw people around me were launching apps, websites and I was stuck in a loop. Competitive Programming taught me how to write an efficient solution, but it didn&#39;t teach me how to build a product. It taught me how to code faster, but it didn&#39;t teach me how to write cleaner, reusable code. It made me a great debugger, but not so great tester. Debugging in 500 lines of shitty code didn&#39;t scare me but 50000 lines of beautiful codebase (with comments) did. My code lived for hours, say a day given that I brag about its beauty among my friends :p. This is when I realized it was time to move on. I had to do something substantial, that would leave an impact, that real people would use.&lt;br /&gt;
&lt;br /&gt;
Right then I, along with &lt;a href=&quot;https://codeaccepted.wordpress.com/about/&quot; target=&quot;_blank&quot;&gt;Abhinav&lt;/a&gt;, started a &lt;a href=&quot;https://github.com/akatsuki10b/ByteJudge&quot; target=&quot;_blank&quot;&gt;project&lt;/a&gt; which had edX like test environment and HackerEarth like functionality with the motive to use it for offline college practical exams. We finished 90% of work in 2 months but the other 10% is still pending. Yes, it&#39;s easy to build a working (beta) product but that extra push, the final finishing touch takes much more time than anticipated.&lt;br /&gt;
&lt;br /&gt;
In Summer 2014, I started work as Software Engineer Intern at HackerEarth. I had already used the product in and out. As a preparatory step, I also went through their other products viz.&amp;nbsp;&lt;a href=&quot;http://mycareerstack.com/&quot; target=&quot;_blank&quot;&gt;MyCareerStack&lt;/a&gt; (now HackerEarth Academy), &lt;a href=&quot;http://codetable.org/&quot; target=&quot;_blank&quot;&gt;CodeTable&lt;/a&gt;&amp;nbsp;(collaborative code editor), &lt;a href=&quot;http://api.hackerearth.com/&quot; target=&quot;_blank&quot;&gt;API&lt;/a&gt;. Also, it was fascinating to read about the &lt;a href=&quot;http://engineering.hackerearth.com/&quot; target=&quot;_blank&quot;&gt;engineering&lt;/a&gt; behind such a powerful product. I believe, for a tech startup, engineering blog drives better job applications than their careers page. I sent out an email (in search of internship) to &lt;a href=&quot;https://www.hackerearth.com/users/vivekprakash/&quot; target=&quot;_blank&quot;&gt;Vivek&lt;/a&gt; right after reading about &lt;a href=&quot;http://engineering.hackerearth.com/2013/03/20/hackerearth-technology-stack/&quot; target=&quot;_blank&quot;&gt;HackerEarth technology stack&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
I began to commit code from Day 1. The fact that my code is going to affect thousands of users was&amp;nbsp;exhilarating. I enjoyed the ownership of the features I developed. Everyone does end-to-end full stack development. You pick a task, develop and deploy and own it for the rest of your stay. 9 weeks passed like a breeze and I left for college with a mindset of coming back to HackerEarth next summer as a full-timer.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;June 2015 - Back to HackerEarth!&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Whoa! I left a team of 10 and now I see a team of 50. I observed drastic changes in the way we operate. Last year we were close to a dozen people who did development, designing, marketing, operations, sales, support, content generation etc as a whole. Now we have dedicated teams for Engineering, Design, Sales, Operations, Marketing, Support etc. There&#39;s more to it. Engineering team is further subdivided into teams according to the product they work on. I&#39;m currently working on the &lt;a href=&quot;https://www.hackerearth.com/recruit/&quot; target=&quot;_blank&quot;&gt;recruiter end&lt;/a&gt; of HackerEarth.&lt;br /&gt;
&lt;br /&gt;
The development and deployment process has also changed a lot. Now, every single line of code I write goes through a review process. Is it optimized? Is it modular? Does it follow our writing guidelines? Oh and obviously, does it work without breaking anything else in the production? The whole process slowed down the development. But it is important that we maintain the quality of code pushed into master because by-and-by you&#39;d spend more time reading someone else&#39;s code than writing your own.&lt;br /&gt;
&lt;br /&gt;
The description of complete development cycle is not in the scope of this post, but I&#39;ll make sure I write about it someday. We make quick decisions and adapt to changes in no time. For instance, recently we moved from JIRA to Phabricator in order to improve code review process. Everyone still works in full-stack end-to-end on any product/feature, which ultimately leads to fast and easy development. I do not work 9-5 but I make sure my tasks are delivered within reasonable time frame. On major deployment days, I might stay till 12 or even 2 in midnight while sometimes I&#39;d spend whole day playing and chilling without accomplishing anything :P. You get the trend now, right?&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Epilogue - 100&lt;sup&gt;th&lt;/sup&gt; day at HackerEarth&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Today, September 9&lt;sup&gt;th&lt;/sup&gt;, marks my 100&lt;sup&gt;th&lt;/sup&gt; day at HackerEarth as full-time Software Engineer. I truly enjoyed the last 3 months. This change from Competitive Programmer to Software Developer was meant to happen. It&#39;s not that I didn&#39;t enjoy CP but shipping features is far more challenging and rewarding than AC tick in a contest. My work gets recognized by the team and more importantly by real users around the world. I double my knowledge and productivity every week. My code is going to live longer, for years. And more so than anything else, I have faith in the guys who run the company.&lt;br /&gt;
&lt;br /&gt;
Till next time. &lt;a href=&quot;http://en.wiktionary.org/wiki/evviva#Descendants&quot;&gt;Evíva&lt;/a&gt;!&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/7507454031701992953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/7507454031701992953'/><link rel='alternate' type='text/html' href='http://rookieslab.blogspot.com/2015/09/hobbyist-competitive-programmer-to-software-developer-at-hackerearth.html' title='Hobbyist Competitive Programmer to Software Developer at HackerEarth'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05336645400007023377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><georss:featurename>Bengaluru, Karnataka, India</georss:featurename><georss:point>12.9715987 77.594562699999983</georss:point><georss:box>12.4764182 76.949115699999979 13.4667792 78.240009699999987</georss:box></entry><entry><id>tag:blogger.com,1999:blog-5966303661451578311.post-5243126379474299964</id><published>2015-08-16T04:28:00.000+05:30</published><updated>2016-02-05T00:24:18.677+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Engineering"/><category scheme="http://www.blogger.com/atom/ns#" term="Personal"/><title type='text'>Open Diary Post: How I lead 4 years of Computer Engineering</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Life is like a real-time strategy game. Its great to know beforehand how others played it when they were at your situation. In this short post, I&#39;m summing up scenarios I faced, decisions I made and their outcomes during four years of Computer Engineering.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;First year:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Freshman, Computer Engineering, NIT Surat. I had only coded tiny C programs that prints a triangle pattern, or swap two numbers. I hadn&#39;t realized the true meaning of programming. For instance, I wrote the following cute little code to swap two numbers.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;#include &amp;lt;stdio.h&amp;gt;
int main()
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; int a, b;
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;Enter two numbers: \n&quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;Enter a: &quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp; scanf(&quot;%d&quot;,&amp;amp;a);
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;Enter b: &quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp; scanf(&quot;%d&quot;,&amp;amp;b);
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;A is %d and B is %d\n&quot;, a, b);
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;After Swapping...\n&quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;A is %d and B is %d\n&quot;, b, a); // wtf...!!?
&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;
}
&lt;/pre&gt;
My invigilator, who never cared looking at the code, ran my program and checked the output. Works fine. 10/10.&lt;br /&gt;
&lt;br /&gt;
And there I was, on the verge of finishing first year and yet unsure if the code above was conceptually valid.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Second Year:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Linked-lists, queues, stacks. That &lt;i&gt;&quot;feel&quot;&lt;/i&gt; of programming, I was so close to &lt;i&gt;feel&lt;/i&gt; it, wrote logically correct code for these data structures. A slight rise in confidence but not long when I was blown away by Trees and Graphs. Just couldn&#39;t find a way to implement them (I was terrible at recursion).&lt;br /&gt;
&lt;br /&gt;
Meanwhile, I stumbled upon edX - a MOOC platform started by MIT and Harvard in 2012. I registered for the very first course they offered in August 2012, &lt;a href=&quot;https://www.edx.org/course/introduction-computer-science-mitx-6-00-1x7&quot; target=&quot;_blank&quot;&gt;6.00x by MITx&lt;/a&gt;. This is when I started to get a grip on programming. One of my batch-mates (&lt;a href=&quot;https://codeaccepted.wordpress.com/about/&quot; target=&quot;_blank&quot;&gt;Abhinav Sharma&lt;/a&gt;), who now happens to be a great friend, also took the same course. I realized how discussions with him on problems lead to quicker solutions.&lt;br /&gt;
&lt;br /&gt;
Later, after learning a bunch of new stuff from edX 6.00x, we started with Competitive Programming on various websites like CodeChef, HackerEarth, CodeForces etc. I participated in those contests every once in a while and kept on improving with time and effort. It taught me how to be a better debugger and how to write accurate code in first go. What it didn&#39;t teach me is how to write a readable, reusable code.&lt;br /&gt;
&lt;br /&gt;
I also had an inclination towards designing, so I used to engage in college fests and worked as a junior designer.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Third Year:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
We were being taught Algorithms and I had been practicing them since a year as competitive programmer. We decided to pass on our tactics to juniors and started a college level competitive contest series &quot;&lt;a href=&quot;https://www.hackerearth.com/search/search-results/?q=Epiphany&quot; target=&quot;_blank&quot;&gt;Epiphany&lt;/a&gt;&quot; on HackerEarth. Our work was noticed by HackerEarth team and were contacted by them if we could work as Problem Setter for their monthly challenge, to which we agreed.&lt;br /&gt;
&lt;br /&gt;
On the other hand, I joined college&#39;s ACM Committee as &lt;a href=&quot;http://www.rookieslab.com/search/label/Portfolio&quot; target=&quot;_blank&quot;&gt;Graphic Designer&lt;/a&gt;. Also started working on TopCoder Studio projects. It was just a hobby, however I somehow secured a position in top 5 in many of their contests. Later on, I secured first place in 3 of their UI/UX contests.&lt;br /&gt;
&lt;br /&gt;
To make my résumé effective, started working on a project as front-end developer. In the midst of all such activities, I got delayed on sending internship applications to companies. Unfortunately, no any company came to recruit interns that year. I wrote an email to &lt;a href=&quot;https://www.hackerearth.com/users/vivekprakash/&quot; target=&quot;_blank&quot;&gt;Vivek Prakash&lt;/a&gt;, CTO of HackerEarth asking for more ways I can contribute to them. After a series of conversation, I was offered Summer Internship at HackerEarth.&lt;br /&gt;
&lt;br /&gt;
As a competitive programmer, you have an edge in development. You get things done really fast. During my internship, I pushed lot of code at blazing fast speed with high accuracy. By the end of internship, I was offered a full-time position which I gladly accepted. However, they also expected me to opt out of campus placement. There wasn&#39;t an official agreement, but anyway I promised to stay committed.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Final Year:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
First things first, choose a research project, group mates and research guide. I chose to be in an all-star group. Everyone was self motivated to contribute to the project which resulted in balanced work distribution. For the most part, we beat the deadlines and finished the project with distinction. For some guys, this might be first time you&#39;ll be working in a team on something that is official, so be careful before you randomly select a group.&lt;br /&gt;
&lt;br /&gt;
I got a call from Amazon to interview for a position at Bangalore office. I acted on instincts that reminded me of the promise I made to HackerEarth and said no to them. I also opted out of campus placements. However, I participated in Google APAC and was called for onsite interview. Three other batch-mates, who happened to be my project group-mates also received the call. Two of us made it through; sadly, I was among the other two. Yeah, Google is an exception to that promise, I would have given up on HackerEarth if I had an offer from Google. Later on, received more calls from startups but I politely declined to interview.&lt;br /&gt;
&lt;br /&gt;
Sometimes, I wonder if I made the right decision to say &quot;No&quot; to everyone and join a startup. Should I have taken up a better job offer in a tech giant during campus placements? Did I undervalue myself? Before taking the decision, I spent a good time thinking about what a startup had to offer. Exponential learning curve. Open startup culture. Fast paced environment. No big tag name as such to put on the&amp;nbsp;résumé. Finally, I made the judgement call. And here I am, writing this post on a Saturday midnight, listening to &lt;a href=&quot;https://www.youtube.com/watch?v=yydZbVoCbn0&quot; target=&quot;_blank&quot;&gt;this&lt;/a&gt;&amp;nbsp;music, simultaneously adding some hacky code to HackerEarth codebase.&lt;br /&gt;
&lt;br /&gt;
That&#39;s all. Till next time.&amp;nbsp;&lt;a href=&quot;http://en.wiktionary.org/wiki/evviva#Descendants&quot;&gt;Evíva&lt;/a&gt;!&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/5243126379474299964'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/5243126379474299964'/><link rel='alternate' type='text/html' href='http://rookieslab.blogspot.com/2015/08/four-years-of-computer-engineering-summed-up.html' title='Open Diary Post: How I lead 4 years of Computer Engineering'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05336645400007023377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5966303661451578311.post-892572445414427568</id><published>2014-08-29T17:21:00.000+05:30</published><updated>2014-09-26T20:38:30.030+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="GIMP"/><category scheme="http://www.blogger.com/atom/ns#" term="GIMP Development"/><category scheme="http://www.blogger.com/atom/ns#" term="Open Source"/><title type='text'>Install GIMP via Git - Getting Started Contributing to GIMP</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJN1Zaqf6z3hRto8rgZnodm-1jfpSZGmBJRuRvdOfpSK6Fr8rI6PH-n2VWBzNY3K6pSWOS50nfrOv8zzGC_QJ9f6CVbkYn1WhL6451nIClFRVGdMutq1gD4RmsxWg5CFWd3PRD1KYu4-oQ/s1600/gimp_development_version.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJN1Zaqf6z3hRto8rgZnodm-1jfpSZGmBJRuRvdOfpSK6Fr8rI6PH-n2VWBzNY3K6pSWOS50nfrOv8zzGC_QJ9f6CVbkYn1WhL6451nIClFRVGdMutq1gD4RmsxWg5CFWd3PRD1KYu4-oQ/s1600/gimp_development_version.png&quot; /&gt;&lt;/a&gt;You may be wondering why I should install GIMP via Git and go through all of the &quot;trouble&quot; when I have a short way out via apt-get or deb package or tar ball or many other ways depending on your OS or Linux distribution. &lt;br /&gt;
&lt;br /&gt;
Well, one reason can be you want to use the latest update as soon as they&#39;re pushed in the repository. The other, more probable one, can be that you want to contribute to GIMP and are looking for a guide that helps you to compile and make GIMP from source, apart from the GIMP which you may already have.&lt;br /&gt;
&lt;br /&gt;
This guide is tested on Ubuntu 14.04 32 bit, I can only hope it works on other distros of linux as well. :p &lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Tip-off: Use the most recent version of your distro or if you have LTS installed on your machine then make sure it is up-to-date. &lt;/blockquote&gt;
&lt;b&gt;Step 1:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Let&#39;s create a directory where we will store all the clones or tar balls. Fire up the terminal and run the following commands. (I&#39;d recommend not to close the terminal session until the installation is done)&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;mkdir -p ~/sourcefiles
cd ~/sourcefiles&lt;/pre&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Step 2:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Get the latest source code of GIMP from https://git.gnome.org/browse/gimp using one of the following commands.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;git clone git://git.gnome.org/gimp&lt;/pre&gt;
OR&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;git clone https://git.gnome.org/browse/gimp&lt;/pre&gt;
&lt;br /&gt;
This might take few minutes depending on connection speed. Feed your pet by the time its cloned. :D&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Step 3:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Now, you wouldn&#39;t want the GIMP you already have in your machine to interfere with the GIMP you&#39;re going to install. So let&#39;s set the path for the new GIMP.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;prefix=/opt/gimp
export PATH=$prefix/bin:$PATH
export PKG_CONFIG_PATH=$prefix/lib/pkgconfig
export LD_LIBRARY_PATH=$prefix/lib&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Step 4:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
While compiling the GIMP source, you&#39;ll need lot of GIMP development dependencies. So let&#39;s install them first.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;sudo apt-get build-dep gimp&lt;/pre&gt;
&lt;br /&gt;
This might take quite a time depending on connection speed. Meanwhile have a coffee or something. :p&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Step 5:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
We should also have babl and gegl packages before we start compiling GIMP source.&lt;br /&gt;
&lt;br /&gt;
For babl:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;cd ~/tmp
git clone git://git.gnome.org/babl
cd babl
./autogen.sh --prefix=$prefix
make
sudo make install&amp;nbsp;&lt;/pre&gt;
&lt;br /&gt;
For gegl:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;cd ~/tmp
git clone git://git.gnome.org/gegl
cd gegl
./configure --prefix=$prefix
make
sudo make install&amp;nbsp;&lt;/pre&gt;
&lt;br /&gt;
Note: Please drop a comment below (along with the error) if you face any issue while building and installing babl or gegl&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;Step 6:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Now we are ready to build GIMP from source. &lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;cd ~/tmp/gimp
./configure --prefix=$prefix&lt;/pre&gt;
&lt;br /&gt;
Look out for any errors. You might be missing any dependencies or packages. Feel free to comment below if you face any difficulties and share how you solved it. I&#39;ll append your comment in the Issues and Resolves section below. If you can&#39;t figure out the resolve for your problem the GIMP community is always there to help. Join us on IRC. Server: GimpNet Channel:#gimp&lt;br /&gt;
&lt;br /&gt;
Once it is compiled, run the following.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;make
sudo make install
&lt;/pre&gt;
Time to test the product to make sure everything went well.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;/opt/gimp/bin/gimp-2.9&lt;/pre&gt;
&lt;br /&gt;
Your version might be different according to the source. 2.9 was the latest source at the time of this writing. Welcome to the GIMP Developers&#39; world :)&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;Disclaimer:&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;This guide was meant for beginners and has been made easy using the following sources:&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;[1] &lt;a href=&quot;http://www.chromecode.com/2009/12/best-way-to-keep-up-with-gimp-from-git_26.html&quot; target=&quot;_blank&quot;&gt;Martin Nordholts&#39; Tutorial&lt;/a&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;[2] &lt;a href=&quot;http://www.gimpusers.com/tutorials/compiling-gimp-for-ubuntu&quot; target=&quot;_blank&quot;&gt;GimpUsers.com Tutorial&lt;/a&gt; (This link is down at the moment)&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Issues and resolves:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The issues you might face solely depend on your system&#39;s state. You might be missing libraries that the latest source of GIMP needs.&lt;code class=&quot;inline-word&quot;&gt;sudo apt-get build-dep gimp &lt;/code&gt;installs the libraries that are needed by the stable version of GIMP. The latest source code of GIMP might require more. &lt;br /&gt;
&lt;br /&gt;
I faced following issues while compiling GIMP 2.9 :&lt;br /&gt;
&lt;br /&gt;
1. Missing 
&lt;code class=&quot;inline-word&quot;&gt;gexiv2&lt;/code&gt;
. This &lt;a href=&quot;https://wiki.gnome.org/Projects/gexiv2/BuildingAndInstalling&quot; target=&quot;_blank&quot;&gt;gnome wiki link&lt;/a&gt; should have you with that. But make sure instead of
&lt;code class=&quot;inline-word&quot;&gt;./configure --enable-introspection&lt;/code&gt; run
&lt;code class=&quot;inline-word&quot;&gt; ./configure --prefix=$prefix --enable-introspection&lt;/code&gt;
&lt;/div&gt;
2. While making the 
&lt;code class=&quot;inline-word&quot;&gt;gexiv2&lt;/code&gt;
package, 
&lt;code class=&quot;inline-word&quot;&gt;g-ir-scanner&lt;/code&gt;
was missing. This can be solved by
&lt;code class=&quot;inline-word&quot;&gt;sudo apt-get install gobject-introspection&lt;/code&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Welcome to the world of Open Source&lt;br /&gt;
Eviva 
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/892572445414427568'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/892572445414427568'/><link rel='alternate' type='text/html' href='http://rookieslab.blogspot.com/2014/08/install-gimp-via-git-getting-started-contributing-to-GIMP.html' title='Install GIMP via Git - Getting Started Contributing to GIMP'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05336645400007023377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJN1Zaqf6z3hRto8rgZnodm-1jfpSZGmBJRuRvdOfpSK6Fr8rI6PH-n2VWBzNY3K6pSWOS50nfrOv8zzGC_QJ9f6CVbkYn1WhL6451nIClFRVGdMutq1gD4RmsxWg5CFWd3PRD1KYu4-oQ/s72-c/gimp_development_version.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5966303661451578311.post-6314153461006015754</id><published>2014-05-10T17:42:00.000+05:30</published><updated>2014-05-28T20:27:14.016+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Graphic Design"/><category scheme="http://www.blogger.com/atom/ns#" term="Photo Editing"/><category scheme="http://www.blogger.com/atom/ns#" term="Portfolio"/><title type='text'>Graphic Designs for ACM NIT Surat</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
During pre-final year of Computer Engineering at NIT Surat, I took over the responsibility of graphics/poster design activities of ACM Chapter NIT Surat. Below follows my work and experience during their creation.&lt;br /&gt;
&lt;br /&gt;
EPIPHANY! Online Coding Competition of SVNIT. This one&#39;s quite geeky actually. Solely based on 
idea generation. All I did is take a screenshot of my terminal window, 
added some spices and peppers from Iron Man, and final touch using idea 
of console based applications.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEFOP7zOIna5t8Hzyw5JZ9WwFSTDiC5DFQsSKU_EmLLY8jyDdoKSOfwBFx-ifzeiEGb9clzAh13x4huuVBcnB8gAh-2J-FEIHinDjo2MeIeZn1b3-WGczWD6KaA4yDzXDh4XKUY0QRDdOF/s1600/epiphany_ours_1.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Programming Contest Poster&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEFOP7zOIna5t8Hzyw5JZ9WwFSTDiC5DFQsSKU_EmLLY8jyDdoKSOfwBFx-ifzeiEGb9clzAh13x4huuVBcnB8gAh-2J-FEIHinDjo2MeIeZn1b3-WGczWD6KaA4yDzXDh4XKUY0QRDdOF/s400/epiphany_ours_1.png&quot; height=&quot;273&quot; title=&quot;Epiphany Terminal&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Orientation
 Programme poster for ACM Chapter - NIT Surat. Idea was to connect 
every single student irrespective of his/her branch. I used several 
human shapes and connected them with ACM logo. That&#39;s it! Implementation
 was a little tough though!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFWinWTu1dmlbI2mYdnr6qSViNQaV7D7M-ok3A-plG-43eisa_EsTG0SOmMCf48KcmWPRw95vS1bV8w1lPWfA9V7WLjyrGmk_zvIkj0CcmWdEF1UNQgXu_LnNtx6sIRM7l_dDYlmhECDj6/s1600/orientation_to_up.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Orientation Programmer Poster&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFWinWTu1dmlbI2mYdnr6qSViNQaV7D7M-ok3A-plG-43eisa_EsTG0SOmMCf48KcmWPRw95vS1bV8w1lPWfA9V7WLjyrGmk_zvIkj0CcmWdEF1UNQgXu_LnNtx6sIRM7l_dDYlmhECDj6/s400/orientation_to_up.png&quot; height=&quot;282&quot; title=&quot;Orientation Programmer Poster&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
Then came one of the biggest event by our ACM Chapter, Quest 2013. There were several events like CodeWars, Capture the Flag, AI Challenge etc. We needed a website and I had to design the interface for that. Below are few screens of the interface I proposed and was implemented by the team.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEtoOD2mYOkohPEnu-84bgb09omnOhQ_IHAh2HaYcSutdnYkXHbEOaeyUSVwYL-aTRh6rxaHsVT8CA-E5rIsIbpCbutMAaqMS6AaT7YfFyjfG6iCG3Fwt7DL8cjFalSUUe_owqDfpWbsNz/s1600/1_acm2013_home_to_up.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Quest ACM website&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEtoOD2mYOkohPEnu-84bgb09omnOhQ_IHAh2HaYcSutdnYkXHbEOaeyUSVwYL-aTRh6rxaHsVT8CA-E5rIsIbpCbutMAaqMS6AaT7YfFyjfG6iCG3Fwt7DL8cjFalSUUe_owqDfpWbsNz/s1600/1_acm2013_home_to_up.png&quot; height=&quot;300&quot; title=&quot;Quest ACM website&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRyPon6a7_fTxplqaKIfWxJ7efeyQ_F1aMW5gwVHlUFCcNLmYYrTz9VZg-7n2K42NdznkL-dVn1FqiQ4d3ZGFyeSr1IC_V0-nfaRJXN9xAO0o2KzIfR1mMrd0QG3kKZnmBHuaT6taEDxgK/s1600/2_acm2013_tab_hover_to_up.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Quest NIT Surat website&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRyPon6a7_fTxplqaKIfWxJ7efeyQ_F1aMW5gwVHlUFCcNLmYYrTz9VZg-7n2K42NdznkL-dVn1FqiQ4d3ZGFyeSr1IC_V0-nfaRJXN9xAO0o2KzIfR1mMrd0QG3kKZnmBHuaT6taEDxgK/s1600/2_acm2013_tab_hover_to_up.png&quot; height=&quot;300&quot; title=&quot;Quest NIT Surat Website&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQibm8uST9Cv_HB1KeG3yE_98vaCklL-z9aYokn_Y8AWRZHXlS3Pd7CIZInLrVzkorqpXnqcpC4fN7UZu7GNno6i9CgOLXYV148BQ9yNaiR0JEajf_PNOdtWwhQOs0wbV-pWnVZ_9bX2vJ/s1600/3_acm2013_active_event_to_up.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Quest NIT Surat ACM&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQibm8uST9Cv_HB1KeG3yE_98vaCklL-z9aYokn_Y8AWRZHXlS3Pd7CIZInLrVzkorqpXnqcpC4fN7UZu7GNno6i9CgOLXYV148BQ9yNaiR0JEajf_PNOdtWwhQOs0wbV-pWnVZ_9bX2vJ/s1600/3_acm2013_active_event_to_up.png&quot; height=&quot;300&quot; title=&quot;Quest NIT Surat ACM&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Then again a poster for in-house publicity. A poster that accommodates all the events in one. First of all, created a circular-maze like frame and used it everywhere applicable. Several relevant icons according to the event were used inside this frame. Felt like that&#39;s enough, its already looking crowded with a little description about each event.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiw5OeRnT217yuEh-u5VZ9ITls6bk4o2ACw8bXU0OBERxuqba4F06dDHaUnUK_zkKuaw4XNo2D7Y7ykpo_U0k-TbmTxvYJkZ8VAkyL9L5E5EuGqVr7q7bbPoqJt7ODKfmfmWrPlrAx59Dhy/s1600/quest_to_upload.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Quest SVNIT Poster&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiw5OeRnT217yuEh-u5VZ9ITls6bk4o2ACw8bXU0OBERxuqba4F06dDHaUnUK_zkKuaw4XNo2D7Y7ykpo_U0k-TbmTxvYJkZ8VAkyL9L5E5EuGqVr7q7bbPoqJt7ODKfmfmWrPlrAx59Dhy/s1600/quest_to_upload.png&quot; height=&quot;282&quot; title=&quot;Quest SVNIT Poster&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Basic C Workshop. A feel of C Programming was needed for this one. The background works well, &#39;C&#39; was fixed in the poster as if it was meant to be there :-p. Used some translucent text for the keywords of C program and opaque text for real information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDAy_ft80NCmm0MzfHQLAlq7MKUNsbkd_yyzUkKpLp7SzRxzGEwhJ25riQU8RG62BPUuym91kRQLG9hZk4nhyyz5A3j8QNLtylxKeSjVX-Erd3dTPAQa3pcl05PYvRoT4XUFp9qNUWqh40/s1600/c_workshop_to_up.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;C Programming Workshop Poster&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDAy_ft80NCmm0MzfHQLAlq7MKUNsbkd_yyzUkKpLp7SzRxzGEwhJ25riQU8RG62BPUuym91kRQLG9hZk4nhyyz5A3j8QNLtylxKeSjVX-Erd3dTPAQa3pcl05PYvRoT4XUFp9qNUWqh40/s1600/c_workshop_to_up.png&quot; height=&quot;300&quot; title=&quot;C Programming Workshop Poster&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Again, Epiphany. This time it was hosted on CodeChef.com and had to keep dimensions according to their requirements. Focused on keeping it clean and flat and professional.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhY6VleO-JoU5CNOLo6w5-sL7D0ib0V_CUvtrfRDcQsSad5DPJFPAuNeU2xAkymB0FSaoktkiXKO5pxPxhu-yyYk-_3X8DndM_kkM-02S7A1tIubz61_bLIo2f8t_XI-BH5yAUuKWePg5jB/s1600/epiphany_3_to_up.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;competitive programming contest&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhY6VleO-JoU5CNOLo6w5-sL7D0ib0V_CUvtrfRDcQsSad5DPJFPAuNeU2xAkymB0FSaoktkiXKO5pxPxhu-yyYk-_3X8DndM_kkM-02S7A1tIubz61_bLIo2f8t_XI-BH5yAUuKWePg5jB/s1600/epiphany_3_to_up.jpg&quot; height=&quot;190&quot; title=&quot;competitive programming contest&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Also, there was time when we needed a T-shirt. It was way to tough to come up with a smart idea for it. We outsourced it to juniors to come up with an idea and then I simply implemented the following for which everyone settled.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcCMFW6M2N92g3-ihhLkf7i4e4N7vslb_hM3ESF_9eymrP8XMMUhGYBhpedz3WZuizYCmAy2yQ5z17IPhFNTCjpe-SXwIpyu6kfYLsglss04ytaqM_upI44iSDDvkSh3HDVgZXyed-_1W1/s1600/t_shirt_acm_computer_science_to_up.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;t shirt design front &quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcCMFW6M2N92g3-ihhLkf7i4e4N7vslb_hM3ESF_9eymrP8XMMUhGYBhpedz3WZuizYCmAy2yQ5z17IPhFNTCjpe-SXwIpyu6kfYLsglss04ytaqM_upI44iSDDvkSh3HDVgZXyed-_1W1/s1600/t_shirt_acm_computer_science_to_up.png&quot; height=&quot;400&quot; title=&quot;t shirt design front &quot; width=&quot;363&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Front&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYyooNIt2daiy9kT0pxJpql-R7csLw_VtOOfAy1D2RjFw_AcEBqB5qlRW-9OD1womZAQomF_pZMDSqI8pMmfoX6lZybZ6X8sgj2m7MVlFSSPVJHTTXqX-AJQJRU1Oh-c0XW93RIzjOVLNA/s1600/t_shirt_computer_back.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;T shirt design back&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYyooNIt2daiy9kT0pxJpql-R7csLw_VtOOfAy1D2RjFw_AcEBqB5qlRW-9OD1womZAQomF_pZMDSqI8pMmfoX6lZybZ6X8sgj2m7MVlFSSPVJHTTXqX-AJQJRU1Oh-c0XW93RIzjOVLNA/s1600/t_shirt_computer_back.png&quot; height=&quot;400&quot; title=&quot;T shirt design back&quot; width=&quot;330&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Back&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Yet another Epiphany! This time it was around January 26th, Republic Day of India. And I came up with this idea. It looks simple and attention grabbing if you ask me :-p One important thing to notice, I didn&#39;t use as much as &quot;blue&quot; I used in all other designs. :-D&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbZ8KwGLvFDLtB0imxOsEcQk_Qttz55zM-vFmoHJM1bAyTs3Qp6CJ0VDWL6uESoKuK2jfHfXj6_z0eV5ZVne1Va6xEE4_zZfG5Su7B3q-JPZVOfMUIlmbRk5YDswfC2V9QOqQtCuUA-CBA/s1600/posterepi32_to_up_republic_india.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;coding contest republic day&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbZ8KwGLvFDLtB0imxOsEcQk_Qttz55zM-vFmoHJM1bAyTs3Qp6CJ0VDWL6uESoKuK2jfHfXj6_z0eV5ZVne1Va6xEE4_zZfG5Su7B3q-JPZVOfMUIlmbRk5YDswfC2V9QOqQtCuUA-CBA/s1600/posterepi32_to_up_republic_india.jpg&quot; height=&quot;286&quot; title=&quot;coding contest republic day &quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Android Workshop. I&#39;m getting over the &quot;blue&quot; and trying different colours and shades. It is green this time. Actually its android that inspired me to choose green. Seems like the perfect match for android poster.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOtxe-FvKgFeImO6RmPwzbjOiG_BBAH44VRdentlnZRf8rGNgwui2M_HZjl5xHAV69Dnw12yK21I8giQWSOevyKi4SJZIE8UZgo9ScCZCMQeMdKsGt4SdWoKhdPodIm2qksgNsJfenyu1H/s1600/android_workshop_poster_to_up.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;android workshop poster&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOtxe-FvKgFeImO6RmPwzbjOiG_BBAH44VRdentlnZRf8rGNgwui2M_HZjl5xHAV69Dnw12yK21I8giQWSOevyKi4SJZIE8UZgo9ScCZCMQeMdKsGt4SdWoKhdPodIm2qksgNsJfenyu1H/s1600/android_workshop_poster_to_up.png&quot; height=&quot;282&quot; title=&quot;Android Workshop POster&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Web Development Workshop. Used several sizes of screen to indicate that its going to be dynamic website building workshop. Also icons of several languages which were going to be taught in the workshop. On the first glance it feels like if it is something related to web, and that is enough to grab attention of targeted people.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZqipylaLY_6SraQonWyrrkV5lMsDskSgF2yuKAtv0lw9P5tlGChd_-IIgretxEPQGC008HU5wgmjHaMYIaimcV095InKdd4YV4F1Xa8h8KSTHL3kzSzrMC8T5l2SnxUlaxRRYtLqcBkSa/s1600/web_dev_workshop_to_up.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Web Development Workshop Poster&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZqipylaLY_6SraQonWyrrkV5lMsDskSgF2yuKAtv0lw9P5tlGChd_-IIgretxEPQGC008HU5wgmjHaMYIaimcV095InKdd4YV4F1Xa8h8KSTHL3kzSzrMC8T5l2SnxUlaxRRYtLqcBkSa/s1600/web_dev_workshop_to_up.png&quot; height=&quot;247&quot; title=&quot;Web Development Workshop Poster&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
And finally, hopefully the last major event of this year by ACM Chapter, ACM Fair. People have to show off what they built, as simple as that. Any app based on any platform can be presented. And I&#39;m back with my &quot;blue&quot; :-p&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidI8Ila-wxbTS18z3LlDdhEZqeGBR8a-6En-_3imaP3Da2BdDEDDYB4MkNZrzycM6YkhKYZ3pUnDpQt1VmLYZ4sFUHmNBeoEIA0DRwXx3ZvneLChm3O_fulNS1wVBHcLdqrP7qMiNcyxeG/s1600/acm_fair_poster_to_up.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;ACM Fair poster&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidI8Ila-wxbTS18z3LlDdhEZqeGBR8a-6En-_3imaP3Da2BdDEDDYB4MkNZrzycM6YkhKYZ3pUnDpQt1VmLYZ4sFUHmNBeoEIA0DRwXx3ZvneLChm3O_fulNS1wVBHcLdqrP7qMiNcyxeG/s1600/acm_fair_poster_to_up.png&quot; height=&quot;282&quot; title=&quot;ACM Fair Poster SVNIT&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
A poster about interactive talk session. Went completely flat a shade of purple. Left some white space around, which actually gives a feel that the poster is clean even though there&#39;s quite enough text populating it.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAOEf_QiK5opTYezEkhd1QQo04i-p7X0H39bLuDDE5iWWNmmLbkcBtwbybg75IuXzKm_3rVBzsgXf3tIiNrgw5dHU1dAdzOh1a7kj6eAslO9_PNltDyhQgJH4nZ54Nv-u7njVB9oppVpb7/s1600/venkat_v2_to_upload_on_blog.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;talk session poster&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAOEf_QiK5opTYezEkhd1QQo04i-p7X0H39bLuDDE5iWWNmmLbkcBtwbybg75IuXzKm_3rVBzsgXf3tIiNrgw5dHU1dAdzOh1a7kj6eAslO9_PNltDyhQgJH4nZ54Nv-u7njVB9oppVpb7/s1600/venkat_v2_to_upload_on_blog.png&quot; height=&quot;282&quot; title=&quot;Talk Session Poster&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
The end of our era. Time to choose new committee and hence a poster for that too. Clean and Effective with a perfect message for the interested candidates.&lt;br /&gt;
And that was officially my final work as a part of ACM NIT Surat Chapter 2013-14 Committee. Actually there&#39;s one more, the Certificate, but can&#39;t publish it for security reasons.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDL8VONlXUGrb67N7m_yX7Pazxps-YC8HiwAqZxbRFjaEwOa4H1iySQB5JqxpGMyedy0lfyqhnJ5yP0pUi7GkLewTufPXNPIdLFGj5sPDdXpYJYwPM5ZZPB_L_rlNd3Y0V3DsevCtokBrv/s1600/interview_poster_to_blog.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDL8VONlXUGrb67N7m_yX7Pazxps-YC8HiwAqZxbRFjaEwOa4H1iySQB5JqxpGMyedy0lfyqhnJ5yP0pUi7GkLewTufPXNPIdLFGj5sPDdXpYJYwPM5ZZPB_L_rlNd3Y0V3DsevCtokBrv/s1600/interview_poster_to_blog.png&quot; height=&quot;282&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
There are some more designs, I&#39;ll upload them on my leisure :-)&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/6314153461006015754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/6314153461006015754'/><link rel='alternate' type='text/html' href='http://rookieslab.blogspot.com/2014/03/graphic-designs-for-acm-nit-surat.html' title='Graphic Designs for ACM NIT Surat'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05336645400007023377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEFOP7zOIna5t8Hzyw5JZ9WwFSTDiC5DFQsSKU_EmLLY8jyDdoKSOfwBFx-ifzeiEGb9clzAh13x4huuVBcnB8gAh-2J-FEIHinDjo2MeIeZn1b3-WGczWD6KaA4yDzXDh4XKUY0QRDdOF/s72-c/epiphany_ours_1.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5966303661451578311.post-3751446988838432167</id><published>2013-06-07T00:56:00.000+05:30</published><updated>2016-02-04T23:51:38.529+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Algorithms"/><category scheme="http://www.blogger.com/atom/ns#" term="C Program"/><category scheme="http://www.blogger.com/atom/ns#" term="Competitive Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>Dynamic Programming or Memoization : Simple optimizing Concept yet Effective </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Dynamic Programming or Memoization is a well known technique for optimization.&amp;nbsp; It is just a method that remembers your previously calculated results and stores it somewhere so that when time comes you can use it again.&lt;br /&gt;
&lt;br /&gt;
Just to begin with, a straightforward example of Memoization is calculation of &lt;a href=&quot;http://en.wikipedia.org/wiki/Factorial&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Factorial&lt;/a&gt;s. When we calculate &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;Factorial of 5&lt;/span&gt;, i.e.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;5! = 1*2*3*4*5 = 120&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Now when you&#39;re asked to calculate &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;Factorial of 6&lt;/span&gt;, a normal human being wouldn&#39;t go on like &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;1*2*3*4*5*6&lt;/span&gt; rather he would think that &lt;i&gt;&quot;Well, I just calculated upto 5! why not simply multiply 6 to the answer of 5! &quot;&lt;/i&gt; This is exactly what we are going to make our computers to do. &lt;br /&gt;
&lt;br /&gt;
So, How do I make computer to remember pre-calculated results?&lt;br /&gt;
Answer is as simple as the question, just store them at a particular location in any array/list/vector.&lt;br /&gt;
&lt;br /&gt;
Have a look at this simple Python implementation for memoized Factorial.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Line #2: simply creates a list of &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;101&lt;/span&gt; members starting from &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;remember[0]&lt;/span&gt; to &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;remember[100]&lt;/span&gt;&lt;br /&gt;
Line #3: initializing &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;remember[0]&lt;/span&gt;, since &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;0! = 1&lt;/span&gt;&lt;br /&gt;
Line #4 &amp;amp; #5: if we already calculated for that number simply return the value stored at that position.&lt;br /&gt;
Line #7: this is the recursive logic&lt;br /&gt;
Line #8: storing calculated result at correct position in remember array&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/ravi-ojha/5c8a7ee70881ecebe044.js&quot;&gt;&lt;/script&gt;

But problems aren&#39;t as easy as such we dealt till now. You might not be able to incorporate this idea in other examples. Lets have a look at a question where we can use Memoization/DP.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;Q:&lt;/b&gt; We have a triangle of numbers, starting from top of a triangle we are allowed to move exactly below or right-to-exactly-below (see example). Reaching till the last row of triangle we have to find out which way got you the largest sum.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
eg:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;3&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;2 5&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;6 4 1&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
In above triangle, we start with&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt; 3 &lt;/span&gt;and according to the given conditions we can go either to &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;2 &lt;/span&gt;or&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt; 5&lt;/span&gt;, if we go towards &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;2 &lt;/span&gt;we can either go to &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;6&lt;/span&gt; or &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;4&lt;/span&gt; and if we went towards &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;5&lt;/span&gt;, we could either go to&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt; 4&lt;/span&gt; or&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt; 1&lt;/span&gt;. So, we got &lt;br /&gt;
&lt;br /&gt;
Path #1: &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;3-&amp;gt;2-&amp;gt;6&lt;/span&gt;&amp;nbsp;&amp;nbsp; Sum is 3+2+6 = 11&lt;br /&gt;
Path #2: &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;3-&amp;gt;2-&amp;gt;4&lt;/span&gt;&amp;nbsp;&amp;nbsp; Sum is 3+2+4 =&amp;nbsp;&amp;nbsp; 9&lt;br /&gt;
Path #3: &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;3-&amp;gt;5-&amp;gt;4&lt;/span&gt;&amp;nbsp;&amp;nbsp; Sum is 3+5+4 = 12&lt;br /&gt;
Path #4: &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;3-&amp;gt;5-&amp;gt;1&lt;/span&gt;&amp;nbsp;&amp;nbsp; Sum is 3+5+1 =&amp;nbsp;&amp;nbsp; 9&lt;br /&gt;
&lt;br /&gt;
One with the maximum sum is Path 3, we simply have to find this sum i.e. 12&lt;br /&gt;
&lt;br /&gt;
(Few questions around web that are exactly similar and from where I got idea to write down this article are Codechef&#39;s &lt;a href=&quot;http://www.codechef.com/problems/SUMTRIAN/&quot; target=&quot;_blank&quot;&gt;SUMTRAIN&lt;/a&gt;, Problem &lt;a href=&quot;http://projecteuler.net/problem=18&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;18&lt;/a&gt; and &lt;a href=&quot;http://projecteuler.net/problem=67&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;67&lt;/a&gt; on ProjectEuler.net)&lt;br /&gt;
&lt;br /&gt;
Normal guy would simply go through all the possible paths and find maximum sum, but that would definitely eat up a lot of time. So here we jump into Memoization or DP. We&#39;ll store the last maximum sum we found till now at each step. You might feel &lt;i&gt;&quot;what the hell is he talking&quot;&lt;/i&gt;, so lets take our above example.&lt;br /&gt;
&lt;br /&gt;
First of all lets assign it to a 2D array like this.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[0][0]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[1][0]&amp;nbsp;&amp;nbsp; a[1][1]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[2][0]&amp;nbsp;&amp;nbsp; a[2][1]&amp;nbsp;&amp;nbsp; a[2][2]&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[0][0] = 3, a[1][0] = 2, a[1][1] = 5, ....&lt;/span&gt; and so on.&lt;br /&gt;
&lt;br /&gt;
Starting from &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[0][0]&lt;/span&gt;, we can move to &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[1][0]&lt;/span&gt; or &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[1][1]&lt;/span&gt;. So we can arrive to &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[1][0]&lt;/span&gt; only from &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[0][0]&lt;/span&gt;. Lets store the sum till now, store 3+2 = 5 into &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[1][0]&lt;/span&gt;, similarly we can arrive at position &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[1][1]&lt;/span&gt; from &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[0][0]&lt;/span&gt; only, so store 3+5 = 8 into &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[1][1]&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
Now moving to &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[2][0]&lt;/span&gt;, we can arrive here only from &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[1][0]&lt;/span&gt;, so store 5+6 = 11 into&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt; a[2][0]&lt;/span&gt;. &lt;b&gt;Here comes &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[2][1]&lt;/span&gt;, we can arrive &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[2][1]&lt;/span&gt; from either &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[1][0]&lt;/span&gt; or &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[1][1]&lt;/span&gt;, since we want sum to be max we&#39;ll choose the one with greater value i.e. &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[1][1] = 8&lt;/span&gt;. Store 8+4 in &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[2][1]&lt;/span&gt;.&lt;/b&gt; Similarly &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[2][2]&lt;/span&gt; can only reached from &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[1][1]&lt;/span&gt;, so store 8+1 in &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[2][2]&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
Now our array looks like this.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&amp;nbsp;3&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&amp;nbsp;5&amp;nbsp; 8&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;11 12&amp;nbsp; 9&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Maximum of the last row of this array is our answer. Viola its done. We found it without going through all different paths. And believe me its a much better optimization if we take even larger triangles and compare the time taken.&lt;br /&gt;
&lt;br /&gt;
Now we simply have to implement this in code. I&#39;ll do it in Python coz its easily readable.&lt;br /&gt;
&lt;br /&gt;
Line #2:&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt; n&lt;/span&gt; is number of rows in our triangle.&lt;br /&gt;
Line #3 &amp;amp; #4: creating an empty lists, read &lt;a href=&quot;http://www.rookieslab.com/2012/12/python-objects-lists-mutation-of-list.html&quot; target=&quot;_blank&quot;&gt;how lists work in python&lt;/a&gt;&lt;br /&gt;
Line #5 to #7: taking input in the form of 2D array.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;for i in xrange(3)&lt;/span&gt; means it&#39;ll go through 0,1 and 2.&lt;br /&gt;
&lt;br /&gt;
Line #8 to #18 is our logic implementation:&lt;br /&gt;
Line #10: This condition is for &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[1][0]&lt;/span&gt;, &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[2][0]&lt;/span&gt; etc where we can only arrive from just above element.&lt;br /&gt;
Line #12: This condition is for &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[1][1]&lt;/span&gt;, &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;a[2][2]&lt;/span&gt; etc where we can only arrive from element present at diagonal to us.&lt;br /&gt;
&lt;br /&gt;
Line #19: prints out the max of the last row of our array.&lt;br /&gt;
&lt;br /&gt;
Rest is self understood.&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/ravi-ojha/6afab4958f109918c162.js&quot;&gt;&lt;/script&gt;

Try out in your own programming language and verify the results.&lt;br /&gt;
&lt;br /&gt;
Got a burning question you wanna get answered? Leave it in the comments or just leave a thanking comment if this post helped you :-)&lt;br /&gt;
&lt;br /&gt;
Happy Coding.&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/3751446988838432167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/3751446988838432167'/><link rel='alternate' type='text/html' href='http://rookieslab.blogspot.com/2013/06/dynamic-programming-or-memoization-SUMTRAIN-codechef-editorial-python.html' title='Dynamic Programming or Memoization : Simple optimizing Concept yet Effective '/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05336645400007023377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5966303661451578311.post-5512162225315193346</id><published>2013-05-20T19:15:00.000+05:30</published><updated>2013-05-20T19:22:48.449+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Algorithms"/><category scheme="http://www.blogger.com/atom/ns#" term="C Program"/><category scheme="http://www.blogger.com/atom/ns#" term="Competitive Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>C/C++ and Python Program to find GCD of a list of numbers</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
A very easy question though, yet thought posting about it thinking it may improve my explanation prowess.&lt;br /&gt;
&lt;br /&gt;
Lets get back to old school math, how did we find Greatest Common Divisor (GCD) or you may call it Highest Common Factor(HCF) of two numbers?&lt;br /&gt;
&lt;br /&gt;
Assuming you know primary Maths, I&#39;d proceed further.&lt;br /&gt;
&lt;br /&gt;
Lets take an &lt;a href=&quot;http://en.wikipedia.org/wiki/Greatest_common_divisor#Example&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;example&lt;/a&gt; before we go ahead. &lt;br /&gt;
&lt;br /&gt;
Find GCD of 54 and 24.&lt;br /&gt;
&lt;br /&gt;
Divisors of 54 are: &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;b&gt;1, 2, 3, 6,&lt;/b&gt; 9, 18, 27, 54. &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Divisors of 24 are: &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;b&gt;1, 2, 3,&lt;/b&gt; 4, &lt;b&gt;6,&lt;/b&gt; 8, 12, 24. &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Common divisors of 54 and 24: &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;1, 2, 3, &lt;b&gt;6 &lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The greatest of these is 6.&lt;br /&gt;
&lt;br /&gt;
Hence &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;gcd(54,24) = 6&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Okay, lets write an algorithm for this. Well, one would say, there&#39;s nothing to think of any algorithm, things are crystal clear. Find out the factors of two numbers, then find common factors and then the largest of them.&lt;br /&gt;
&lt;br /&gt;
But brother! There exists a better algorithm. Our Father of Geometry, &lt;a href=&quot;http://en.wikipedia.org/wiki/Euclid&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Euclid&lt;/a&gt;, left us an algorithm already. We simply have to implement it.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Lets see how it works.&lt;br /&gt;
&lt;br /&gt;
We are given two numbers, 54 and 24&lt;br /&gt;
&lt;br /&gt;
Lets call &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;a = 54&lt;/span&gt; and &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;b = 24&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
1. Store current value of &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;a&lt;/span&gt; in some temporary variable.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;temp = a&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
2. Store remainder when&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; b&lt;/span&gt; is divided by &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;a&lt;/span&gt; in &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;a&lt;/span&gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;a = b mod a&amp;nbsp;&amp;nbsp; OR&amp;nbsp; a = b % a&amp;nbsp; &lt;span style=&quot;color: #666666;&quot;&gt;//yeah, % is used to get remainder&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
3. Store the previous value of a in b. Oh but we lost a in step 2 :-o . Yeah, that&#39;s why we used temp to record previous a&#39;s value. &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;b = temp&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Continue this process until a becomes 0, you&#39;ll be left with Greatest Common Divisor of two numbers in variable b.&lt;br /&gt;
&lt;br /&gt;
That&#39;s it people, that&#39;s all for the show ;-) Let&#39;s jump into coding.&lt;br /&gt;
&lt;br /&gt;
C/C++ Code Snippet for gcd of two numbers.&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/ravi-ojha/5612103.js&quot;&gt;&lt;/script&gt;

I&#39;ve introduced a little variation in Python code so that we don&#39;t have to use temp variable.&lt;br /&gt;
&lt;br /&gt;
Line #3: yeah, we can directly assign older value of a to b just like that using comma &#39;,&#39; operator in one statement. Python users will know it.&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/ravi-ojha/f930b3357b1d4ce75920.js&quot;&gt;&lt;/script&gt;

Oh, almost forgot, we can also do it using Python in-built library too.&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/ravi-ojha/77bd4ee03c00257e301c.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;
Okay this was just for two numbers, How would you do it for a list of numbers i.e. an array of integers.&lt;br /&gt;
&lt;br /&gt;
Simple enough! Iterate over the list or array.&lt;br /&gt;
&lt;br /&gt;
If you have&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; [4,6,14,10]&lt;/span&gt;, we can cut it down like this:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;gcd(4,6) = 2&lt;/span&gt;, now we have&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; [2,14,10]&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;gcd(2,14) = 2&lt;/span&gt;, now we have &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;[2,10]&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;gcd(2,10) = 2&lt;/span&gt;, now we have&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; [2]&lt;/span&gt;, hence our answer is&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; 2.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Here&#39;s is a generalized method in C/C++ to do it.&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/ravi-ojha/382b906c94a834abcef5.js&quot;&gt;&lt;/script&gt;

This becomes a hell lot easier if you certain built-in functions in Python. &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;reduce(FUNCTION_NAME, LIST)&lt;/span&gt; is one such function.&lt;br /&gt;
&lt;br /&gt;
Its job is as follows:&lt;br /&gt;
&lt;br /&gt;
if we say &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;reduce(gcd,[4,6,14,10])&lt;/span&gt; it will think of it as such a form&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;gcd(gcd(gcd(4,6),14),10)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Note: Comment out line #3 and Comment line #2 in order to take input from user.&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/ravi-ojha/cf4af2bfc71bbb92af2b.js&quot;&gt;&lt;/script&gt;
&lt;br /&gt;
Hope you guys kind of get it. &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
Got a burning question you wanna get answered. Ask it in the comments or leave a message at our &lt;a href=&quot;https://www.facebook.com/RookiesLab&quot;&gt;Facebook&lt;/a&gt; Page&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/5512162225315193346'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/5512162225315193346'/><link rel='alternate' type='text/html' href='http://rookieslab.blogspot.com/2013/05/c-or-c-plus-plus-and-python-program-to-find-gcd-hcf-of-a-list-array.html' title='C/C++ and Python Program to find GCD of a list of numbers'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05336645400007023377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5966303661451578311.post-4054738035375045983</id><published>2013-05-18T21:36:00.000+05:30</published><updated>2016-02-29T00:24:49.254+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Algorithms"/><category scheme="http://www.blogger.com/atom/ns#" term="C Program"/><category scheme="http://www.blogger.com/atom/ns#" term="Competitive Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>Fast Power Algorithm: C/C++ and Python Code</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
In competitive programming, traditional way to finding power may not work sometimes.&lt;br /&gt;
&lt;br /&gt;
By traditional way I mean if we have to find 2^10 (just as an example).&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/ravi-ojha/5604748.js&quot;&gt;&lt;/script&gt;

Or else simply by using library function after including math.h (in C) we can do it by &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;pow(2,10)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Well, but this doesn&#39;t help us anymore when it comes to finding &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;base&lt;/span&gt; to the &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;power (base^power) &lt;/span&gt;where &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;power&lt;/span&gt; could be anything in the range 0 to 1000000 or even greater value, same goes for &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;base&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Whilst you may think it impractical but in competitive programming questions ask us find Modulus of the answer by any prime number such as 1000000007, just to make sure answer remains in range of &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;int&lt;/span&gt; data type.&lt;br /&gt;
&lt;br /&gt;
i.e. &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;pow(2,100)%1000000007 = 976371285&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Lets come to the point and discuss what you have come for :)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Fast Algorithm:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;result = 1&lt;br /&gt;If power is odd:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = result*value&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;value = value*value&lt;br /&gt;power = power/2&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Yeah, I know, above algorithm more looks like a code &amp;amp; was nothing but a bouncer. ;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Lets discuss an example of what exactly &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;we are &lt;/span&gt;&lt;/span&gt;doing here. Same example 2^10.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
We know,&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;2^10&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;=&amp;nbsp; (2*2) * (2*2) * (2*2) * (2*2) * (2*2)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;=&amp;nbsp; 4^5&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #666666;&quot;&gt;// here power has become odd, so lets take out one 4 out of five 4&#39;s &amp;amp; multiply it with &#39;result&#39; &amp;amp; store back in &#39;result&#39; &amp;amp; hence we are left with four 4&#39;s&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
So &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;result = 4&lt;/span&gt; and we are left with 4^4&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;4^4&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;= (4*4) * (4*4)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;= 16^2 &lt;span style=&quot;color: #666666;&quot;&gt;// since power is even no need to mess up our result variable&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;16^2&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;= 256^1&lt;/span&gt; &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;color: #666666;&quot;&gt;// here power has become odd, so lets take out one 256 &amp;amp; multiply it with &#39;result&#39; &amp;amp; store back in &#39;result&#39; hence we are left with zero 256&#39;s&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Viola, &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;power&lt;/span&gt; became zero. Its the end. Now our &lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;result&lt;/span&gt; contains what we want.&lt;br /&gt;
&lt;br /&gt;
Following is C/C++ implementation of fast powering algorithm.&lt;br /&gt;
&lt;br /&gt;
Line #8: (power&amp;amp;1) is a better/faster way to check if a number if odd or not&lt;br /&gt;
Line #14: I commented it out, but that too is an alternative of Line #13&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/ravi-ojha/5604855.js&quot;&gt;&lt;/script&gt;

Following is Python implementation of the Fast/Quick Power Algorithm.&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/ravi-ojha/5604885.js&quot;&gt;&lt;/script&gt;
&lt;br /&gt;
Got a burning question you might wanna get answered?&amp;nbsp; Ask it in the comments or &lt;a href=&quot;mailto:admin@rookieslab.com&quot; target=&quot;_blank&quot;&gt;mail me&lt;/a&gt; or leave a message on my &lt;a href=&quot;https://www.facebook.com/RookiesLab&quot; target=&quot;_blank&quot;&gt;Facebook Page&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Happy Coding. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/4054738035375045983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/4054738035375045983'/><link rel='alternate' type='text/html' href='http://rookieslab.blogspot.com/2013/05/fast-power-algorithm-cc-and-python-code.html' title='Fast Power Algorithm: C/C++ and Python Code'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05336645400007023377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5966303661451578311.post-1336347256007348566</id><published>2013-01-31T02:20:00.003+05:30</published><updated>2016-01-16T15:21:51.797+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Blogger"/><category scheme="http://www.blogger.com/atom/ns#" term="Blogging"/><title type='text'>New 2013 RSS Facebook Twitter Google+ Buttons with Hover Effect</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdvKusGrOp05YnVTQMRsLinorWYUcqkwMZZ-95WYMKhLxEjvBPniE3vwDjzan6Ym28agFpXxoYPed4_ek9tC8aLURG3OdhCFNMOMxQKhUdSFAxSfS3kWa_IcLsAvQQFl3UnWOXGRogUASU/s1600/new_widget_for_rookies.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img alt=&quot;RSS Facebook Twitter Hover&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdvKusGrOp05YnVTQMRsLinorWYUcqkwMZZ-95WYMKhLxEjvBPniE3vwDjzan6Ym28agFpXxoYPed4_ek9tC8aLURG3OdhCFNMOMxQKhUdSFAxSfS3kWa_IcLsAvQQFl3UnWOXGRogUASU/s1600/new_widget_for_rookies.jpg&quot; title=&quot;Facebook Twitter Google Plus RSS&quot; /&gt;&lt;/a&gt;A new share button widget for 2013 with RSS Facebook Twitter and Google+ buttons (YouTube too on request)&lt;br /&gt;
&lt;br /&gt;
Tried to make as looks as simple as possible like Windows 8 :p&lt;br /&gt;
&lt;br /&gt;
It&#39;ll consume a very little space of your blog &amp;amp; can even be placed in a size of search bar&#39;s area :)&lt;br /&gt;
&lt;br /&gt;
Qualities of the gadget are same as we had in earlier versions &lt;a href=&quot;http://www.rookieslab.com/2012/06/rss-facebook-twitter-google-buttons.html&quot; target=&quot;_blank&quot;&gt;v1&lt;/a&gt;, &lt;a href=&quot;http://www.rookieslab.com/2012/07/rss-facebook-twitter-google-buttons.html&quot; target=&quot;_blank&quot;&gt;v2&lt;/a&gt;. These versions were colored. But this one is Black &amp;amp; White for education or decent tech blogs.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I got the idea for this from one of the educational open source website edx.org&lt;br /&gt;
&lt;br /&gt;
There are four buttons here &amp;amp; the code below also contains these 4 buttons but if you need YouTube then you may leave a comment, I will send you the code for that too.&lt;br /&gt;
&lt;br /&gt;
Since these four are widely used I&#39;m posting a general code for them.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;Live Demo: &lt;/b&gt;Top right corner of this blog&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;pre class=&quot;alt2&quot; dir=&quot;ltr&quot; style=&quot;background: #E6E6E6; border: 1px solid grey; height: 400px; margin: 0px; overflow: auto; padding: 6px; text-align: left; width: 600px;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #676767;&quot;&gt;

&amp;lt;style&amp;gt;
.rlab {
display: block;
margin: 30px -50px -30px 50px;
width: 200px;
}
.rlab span {
float: left;
display: inline;
margin-right: 10px;
}
.rlab span a {
display: block;
width: 32px;
height: 34px;
text-indent: -9999px;
background-color: none;
background: transparent url(&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjm2Ab6tydMNHcqqzNbXiWUg1_XQT2oZD5x2bjQKo8c6H19TjOHPqmSW31NbweCcbrBYGL3zxwd4aeKcxPvkYimJbzDQvOA8SHkLVmKQH-yuDrW-mP0FVwjQp5XKvHRwRi6zTyEpqqIAgbQ/s1600/RookiesLab_share_buttons.png&quot;) 0 0 no-repeat;
}
#iconRSS {background-position: 0 -32px;}
#iconFacebook {background-position: -66px -32px;}
#iconTwitter {background-position: -33px -32px;}
#iconGooglePlus {background-position: -132px -32px;}
#iconRSS:hover{background-position:0 0}
#iconFacebook:hover{background-position:-66px 0}
#iconTwitter:hover {background-position: -33px 0;}
#iconGooglePlus:hover{background-position:-132px 0}
&amp;lt;/style&amp;gt;
&amp;lt;div class=&#39;rlab&#39;&amp;gt;&amp;lt;span&amp;gt;&amp;lt;a href=&#39;&lt;span style=&quot;background-color: #6fa8dc;&quot;&gt;http://feeds.feedburner.com/RookiesLab&lt;/span&gt;&#39; id=&#39;iconRSS&#39; target=&#39;_blank&#39; title=&#39;RSS Feed&#39;&amp;gt;RSS&amp;lt;/a&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span&amp;gt;&amp;lt;a href=&#39;&lt;span style=&quot;background-color: #6fa8dc;&quot;&gt;http://www.facebook.com/RookiesLab&lt;/span&gt;&#39; id=&#39;iconFacebook&#39; target=&#39;_blank&#39; title=&#39;Facebook&#39;&amp;gt;Facebook&amp;lt;/a&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span&amp;gt;&amp;lt;a href=&#39;&lt;span style=&quot;background-color: #6fa8dc;&quot;&gt;http://www.twitter.com/RookiesLab&lt;/span&gt;&#39; id=&#39;iconTwitter&#39; target=&#39;_blank&#39; title=&#39;Twitter&#39;&amp;gt;Twitter&amp;lt;/a&amp;gt;&amp;lt;/span&amp;gt;  &amp;lt;span&amp;gt;&amp;lt;a href=&#39;h&lt;span style=&quot;background-color: #6fa8dc;&quot;&gt;ttps://profiles.google.com/103866379854774290108?rel=author&lt;/span&gt;&#39; id=&#39;iconGooglePlus&#39; target=&#39;_blank&#39; title=&#39;Google Plus&#39;&amp;gt;Google&amp;lt;/a&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;a title=&quot;Get this Widget or try more social sharing buttons&quot; style=&quot; font-size:9px; color:#E4E3E3; text-decoration:none; on-hover: underline; float:right; margin-right: 80px;&quot; href=&quot;http://www.rookieslab.com/search/label/Essential%20Widgets%20-%20worth%20trying&quot;&amp;gt;Widget&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
That&#39;s it.&lt;br /&gt;
&lt;br /&gt;
Change the links highlighted to your respective links.&lt;br /&gt;
&lt;br /&gt;
Copy &amp;amp; Paste the above code in Layout &amp;gt;&amp;gt; Add a new Gadget &amp;gt;&amp;gt; HTML/JavaScript&lt;br /&gt;
&lt;br /&gt;
Save and you&#39;ll see a decent new Social Sharing Buttons on your blog.&lt;br /&gt;
&lt;br /&gt;
Do &#39;Like&#39; us on FB or &#39;Follow&#39; us on Twitter for more such Gadgets and Tutorials.&lt;br /&gt;
&lt;br /&gt;
Happy Blogging.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Footnote:&lt;/b&gt; Bloggers who copy the above code and publish it in their posts are requested to give a backlink to this post.&lt;span style=&quot;color: red;&quot;&gt;!Imp &lt;/span&gt;Also
 please respect the hard work &amp;amp; don&#39;t remove the Widget link. I&#39;d be
 glad to help you customize the widget on your request.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Related Widgets:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.rookieslab.com/2012/08/floating-share-buttons-with-twitter.html&quot; target=&quot;_blank&quot;&gt;Floating Share Bar with FB,Tweet,G+,Stumble&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.rookieslab.com/2012/07/rss-facebook-twitter-google-buttons.html&quot; target=&quot;_blank&quot;&gt;Colored Facebook, Twitter, RSS ,Google+ Buttons with Hover Effect&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.rookieslab.com/2012/08/Floating-Share-Bar-2012-Transparent-with-Facebook-Stumble-Upon-Google-AddThis.html&quot; target=&quot;_blank&quot;&gt;Floating Share bar with FB,G+,Stumble,AddThis&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.rookieslab.com/2012/12/email-subscription-form-blogger-widget.html&quot; target=&quot;_blank&quot;&gt;Email Subscription Widget &lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/1336347256007348566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/1336347256007348566'/><link rel='alternate' type='text/html' href='http://rookieslab.blogspot.com/2013/01/New-2013-Facebook-RSS-Twitter-Google-Plus-Hover-Effect-Buttons.html' title='New 2013 RSS Facebook Twitter Google+ Buttons with Hover Effect'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05336645400007023377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdvKusGrOp05YnVTQMRsLinorWYUcqkwMZZ-95WYMKhLxEjvBPniE3vwDjzan6Ym28agFpXxoYPed4_ek9tC8aLURG3OdhCFNMOMxQKhUdSFAxSfS3kWa_IcLsAvQQFl3UnWOXGRogUASU/s72-c/new_widget_for_rookies.jpg" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5966303661451578311.post-8678364910740983828</id><published>2013-01-06T13:49:00.000+05:30</published><updated>2013-01-06T14:16:48.336+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Blogger"/><category scheme="http://www.blogger.com/atom/ns#" term="SEO"/><category scheme="http://www.blogger.com/atom/ns#" term="Wordpress"/><title type='text'>Sub-Domain/Custom Domain: Advantages of Custom Domain</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Okay firstly I&#39;ll clear that What is a custom domain? and What is Subdomain?&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;b&gt;Subdomain:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTpPENuRVU7xp-gXMxQzVm7SXn4Plp7yvOw6-VOTLAyO68JDW38DW62v1gDbDQfVsrNuVC4qXolZGbWJSd9pGPjMOv0SuiMCErBtx2Zt01P4OSW7G5Rppw7CPAs3YyxkfpPZLHwmJDReWF/s1600/image.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img alt=&quot;blogger subdomain&quot; border=&quot;0&quot; height=&quot;108&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTpPENuRVU7xp-gXMxQzVm7SXn4Plp7yvOw6-VOTLAyO68JDW38DW62v1gDbDQfVsrNuVC4qXolZGbWJSd9pGPjMOv0SuiMCErBtx2Zt01P4OSW7G5Rppw7CPAs3YyxkfpPZLHwmJDReWF/s320/image.png&quot; title=&quot;blogger subdomain&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;The free domain that blogspot provides you with the extension .blogspot.com is a subdomain.&lt;br /&gt;
&lt;br /&gt;
Actually the blogspot.com itself is a domain and when you &lt;a href=&quot;http://www.rookieslab.com/2012/06/starting-up-with-blogger-deciding-blog.html&quot; target=&quot;_blank&quot;&gt;sign up to create a blog&lt;/a&gt; you&#39;ll be prompted for a subdomain like &quot;SUB-DOMAIN&quot;.blogspot.com&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: right; text-align: right;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik_kfAb4bR9NMzp21n8QvxTJcbyH0B3hzjfJhzGKpjL3MFa9LZvvQGKKENn7i2JmsbXQ3Edt2MEcOLFE8OKKhqJevhGJIJ9VcUe0MuTET1OrBnORVhUbygrmH3qgzT6gI4P_ftCd0-I6gk/s1600/images.jpeg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;custom domain&quot; border=&quot;0&quot; height=&quot;149&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik_kfAb4bR9NMzp21n8QvxTJcbyH0B3hzjfJhzGKpjL3MFa9LZvvQGKKENn7i2JmsbXQ3Edt2MEcOLFE8OKKhqJevhGJIJ9VcUe0MuTET1OrBnORVhUbygrmH3qgzT6gI4P_ftCd0-I6gk/s200/images.jpeg&quot; title=&quot;custom domain&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Image Credit: &lt;a href=&quot;http://joomla365.com/&quot;&gt;joomla365.com&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Got it? Proceeding further with a &#39;Yes&#39; :-)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Custom Domain:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Its a Top Level Domain (TLD) with extension .com .org .net .biz&amp;nbsp; and many more like .in(regionally targeted for India) .us .me(for personal site) etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we&#39;ll discuss the &lt;b&gt;Advantages of having a Custom Domain&lt;/b&gt; for your blog.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
1. People are found to be more aligned towards links with .com extension than .blogspot.com when your site gets searched in search results.&lt;br /&gt;
&lt;br /&gt;
2. Visitors feel no hesitation while sharing a top level domain with their social network. Hence more traffic sources generated.&lt;br /&gt;
&lt;br /&gt;
3. A reputation in the blogging and tech world around you.&lt;br /&gt;
&lt;br /&gt;
4. Most of the reputed Advertisers approve the Top Level Domain easily.(By including the word &#39;reputed&#39; excludes lot of advertising networks) Best advertising network is the one and only Google Adsense (Buy-Sell Ads and some others are emerging well though).&lt;br /&gt;
&lt;br /&gt;
5. You don&#39;t have to host your blog somewhere else, just have to buy a custom domain and point it to your current blogspot subdomain.&lt;br /&gt;
&lt;br /&gt;
6. Alexa rank and Google Page Rank increases at higher rate due to above reasons with a custom domain.&lt;br /&gt;
&lt;br /&gt;
7. It costs just $10 to buy a custom domain from via Google Apps. There are other domain providers like GoDaddy, HostGator, BigRock etc but their charges will be more than what Google will charge you.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;Tipoff:&lt;/b&gt; I&#39;d recommend you to register a domain via Google Apps. With that Google will freely hide your Whois lookup registration info. With Whois not hidden anyone can know your contact details.&lt;br /&gt;
&lt;br /&gt;
Also a free email id like this: yourname@yoursitename.com&lt;br /&gt;
And many more features of Google Apps. &lt;/blockquote&gt;
So go ahead, have your custom domain if you wish to expand as virtual Inc.&lt;br /&gt;
&lt;br /&gt;
(&lt;b&gt;Free Advice:&lt;/b&gt; Some bloggers may put some &lt;a href=&quot;http://en.wikipedia.org/wiki/Affiliate_marketing&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;affiliate links&lt;/a&gt; of their preferred Domain Registrant. I&#39;d say don&#39;t just do it instantly, do some googling about the services before registering via them. If you&#39;re fully convinced and would like to thank the author then use the affiliate link by them.)&lt;br /&gt;
&lt;br /&gt;
I recommend Google Apps because Google never does anything like that and I&#39;m not even endorsed to any affiliate network for domain selling. :-)&lt;br /&gt;
&lt;br /&gt;
Stay Safe. Stay Happy.&lt;br /&gt;
&lt;br /&gt;
Eviva.&lt;br /&gt;
&lt;br /&gt;
Recommended Reading (targeted to Indian audience without Paypal or Credit Card to register a domain):&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.rookieslab.com/2012/07/5-factors-to-ensure-before-buying.html&quot; target=&quot;_blank&quot;&gt;5 Factors to ensure before buying a domain. &lt;/a&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/8678364910740983828'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/8678364910740983828'/><link rel='alternate' type='text/html' href='http://rookieslab.blogspot.com/2012/06/advantages-of-custom-domain-for-blogger.html' title='Sub-Domain/Custom Domain: Advantages of Custom Domain'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05336645400007023377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTpPENuRVU7xp-gXMxQzVm7SXn4Plp7yvOw6-VOTLAyO68JDW38DW62v1gDbDQfVsrNuVC4qXolZGbWJSd9pGPjMOv0SuiMCErBtx2Zt01P4OSW7G5Rppw7CPAs3YyxkfpPZLHwmJDReWF/s72-c/image.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5966303661451578311.post-4036919688381643832</id><published>2013-01-04T04:18:00.001+05:30</published><updated>2013-01-04T15:45:58.417+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="edX"/><category scheme="http://www.blogger.com/atom/ns#" term="MIT 6.00x"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>6.00x MITx Python: Final Exam Preparation</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMsCC1JFdZhHWDIM_wVpjvVwFYMl3l7bTnqH8U50rTVEls_reQ_R27J8tKGVgEIc0umM4hdiGQiedjEk-ALXGK4OSZBDtk05O8AVs5A70ms7PvUHlGIskfNRueDIYbnwTZ-Ufhzm0Y1ByX/s1600/Mission-Impossible-Ghost-Protocol-2011.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img alt=&quot;MITx 6.00x Finals&quot; border=&quot;0&quot; height=&quot;176&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMsCC1JFdZhHWDIM_wVpjvVwFYMl3l7bTnqH8U50rTVEls_reQ_R27J8tKGVgEIc0umM4hdiGQiedjEk-ALXGK4OSZBDtk05O8AVs5A70ms7PvUHlGIskfNRueDIYbnwTZ-Ufhzm0Y1ByX/s320/Mission-Impossible-Ghost-Protocol-2011.jpg&quot; title=&quot;MITx 6.00x Finals Fall 2013&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;Just thought of creating an online journal to revise things on the go, cause when I was reviewing video lectures from the beginning it took a lot of time. Sometimes I&#39;ve to fast forward, normal pace at confusing situations &amp;amp; again fast forward made me sick of revising videos.&lt;br /&gt;
&lt;br /&gt;
I&#39;m only considering the Python language and use of its objects in this section.&lt;br /&gt;
This is just an index of all the topics upto Mid Term 1: (Still revising Classes is left for me :( )&lt;br /&gt;
&lt;br /&gt;
Lets begin: (All the links lead to quick overview of respective topic and below the Titles I&#39;ve briefly written about the stuff that topic contains)&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.rookieslab.com/2012/12/learning-python-edx-mitx-600x-lec-1-summary-revision.html&quot;&gt;Syntax, Static Semantics, Semantics of a Language&lt;/a&gt; &lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Deals with types of Knowledge, Computer Program and Aspects of Language&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.rookieslab.com/2012/12/compilers-interpreters-objects-in-python-operators-comparisons.html&quot; target=&quot;_blank&quot;&gt;Compiler-Interpreter, Objects of Python and Type Casting&lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Is Python Compiled or Interpreted? Scalar-Non Scalar Objects and &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;int&lt;/span&gt;, &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;float&lt;/span&gt; operations and comparisons, Type Casting &lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.rookieslab.com/2012/12/operations-on-string-some-simple.html&quot; target=&quot;_blank&quot;&gt;Operations on String and Taking input from User &lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Declaring, Concatenating, Extracting, Indexing and Slicing. Using &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;raw_input &lt;/span&gt;for script to pause and wait for user to input.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.rookieslab.com/2012/12/branching-program-using-if-if-else-nested-if-else-elif.html&quot; target=&quot;_blank&quot;&gt;Branching Program: Using if, if-else, if-elif &lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Some simple scripts to introduce branching (I don&#39;t think we need to go through this, but posted just to maintain flow)&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.rookieslab.com/2012/12/learning-python-iteration-or-looping-for-loop-while-loop.html&quot; target=&quot;_blank&quot;&gt;Iteration or Looping and How to use &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;range()&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;A simple code explaining iteration, &lt;span style=&quot;color: red;&quot;&gt;!Imp:&lt;/span&gt; How &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;b&gt;range() &lt;/b&gt;&lt;/span&gt;works.&amp;nbsp; When to use &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;while&lt;/span&gt; and when &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;for&lt;/span&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.rookieslab.com/2012/12/finding-square-root-guess-and-check-method-in-python.html&quot; target=&quot;_blank&quot;&gt;Guess and Check method &lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Two small codes for finding square root of a perfect square and imperfect square. Use of &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;abs()&lt;/span&gt; done in between.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span id=&quot;goog_931231853&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_931231854&quot;&gt;&lt;/span&gt;&lt;a href=&quot;http://www.rookieslab.com/2012/12/linear-search-vs-bisection-search-algorithm-python-code.html&quot; target=&quot;_blank&quot;&gt;Linear Search v/s Binary (Bisection) Search&lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Efficiency of Linear and Bisection search discussed along with algorithm and scripts of really simple example.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.rookieslab.com/2012/12/learning-python-finding-roots-advanced.html&quot; target=&quot;_blank&quot;&gt;Finding nth root &lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;This one is included to resurrect forgotten ;-) programming skills that we learned in video lectures. Worth going through, it won&#39;t take much time though.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.rookieslab.com/2012/12/learning-python-recursion-explained-how-recursive-functions-work.html&quot; target=&quot;_blank&quot;&gt;Recursion - How it works?&lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;First coded an example in Iterative manner, then recursively, and then explained the recursive environment changes by using different colors.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.rookieslab.com/2012/12/learnign-python-objects-of-python-tuples.html&quot; target=&quot;_blank&quot;&gt;Python Object - Tuples&lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Declaration, Singleton Tuple, Nested Tuple, Concatenation, Indexing and Slicing in Tuples&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.rookieslab.com/2012/12/python-objects-lists-mutation-of-list.html&quot; target=&quot;_blank&quot;&gt;Python Object - Lists and its Mutation&lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;color: red;&quot;&gt;Imp!&lt;/span&gt; Difference between Assigning a list and Copying a list (a self made image in the end explains it perfectly) and How &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;List&lt;/span&gt; is different from &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;String&lt;/span&gt; and &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;Tuple&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.rookieslab.com/2012/12/complexity-or-order-of-growth-in-programming.html&quot; target=&quot;_blank&quot;&gt;Complexity or Order of Growth in Programming&lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Till now O(1) , O(n), O(log n) and O(n log n) are discussed with simplest of the examples and images.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;ul&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/4036919688381643832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/4036919688381643832'/><link rel='alternate' type='text/html' href='http://rookieslab.blogspot.com/2013/01/600x-mitx-python-final-exam-preparation.html' title='6.00x MITx Python: Final Exam Preparation'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05336645400007023377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMsCC1JFdZhHWDIM_wVpjvVwFYMl3l7bTnqH8U50rTVEls_reQ_R27J8tKGVgEIc0umM4hdiGQiedjEk-ALXGK4OSZBDtk05O8AVs5A70ms7PvUHlGIskfNRueDIYbnwTZ-Ufhzm0Y1ByX/s72-c/Mission-Impossible-Ghost-Protocol-2011.jpg" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5966303661451578311.post-3794721463685316795</id><published>2012-12-28T16:12:00.000+05:30</published><updated>2013-01-02T03:15:57.775+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Adsense and Alternatives"/><category scheme="http://www.blogger.com/atom/ns#" term="Blogger"/><category scheme="http://www.blogger.com/atom/ns#" term="Do&#39;s and Don&#39;ts of Adsense"/><category scheme="http://www.blogger.com/atom/ns#" term="Wordpress"/><title type='text'>Before submitting an Application Form to Adsense</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3BbHXrnUCAiJI7LyWgLJIoVQXgbAEzHlwbXSAkbjQrJfw9qVhxvZAyeKByNHRptxYTGl7YreLZpcAA1pi5ZkcSedKlHzMKW6yKXvANfOt12M0Ks-fj_YUpNkjjabsyFNHz491K1wc6_Qu/s1600/adsense_y_u_no.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img alt=&quot;adsense approval&quot; border=&quot;0&quot; height=&quot;184&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3BbHXrnUCAiJI7LyWgLJIoVQXgbAEzHlwbXSAkbjQrJfw9qVhxvZAyeKByNHRptxYTGl7YreLZpcAA1pi5ZkcSedKlHzMKW6yKXvANfOt12M0Ks-fj_YUpNkjjabsyFNHz491K1wc6_Qu/s200/adsense_y_u_no.jpg&quot; title=&quot;Adsense_Aprroval_Rejection&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;When you make a blog or start your own website you&#39;d come across a term Adsense. Google Adsense actually. Following may be the reasons why you&#39;d like to read this article.&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;You were blogging just for fun but suddenly discovered that you can even earn via advertising. Of course, Adsense is the first choice. Then you went googling &amp;amp; landed here. &lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Your sole aim after blogging/website building was to make some extra bucks. If you&#39;ve seeded &amp;amp; watered, you&#39;d hopefully wait for fruits &amp;amp; flowers, No Doubt.&lt;/li&gt;
&lt;/ul&gt;
We&#39;ll take it from here considering ourselves a newbie.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1.&lt;/b&gt; First step of yours before submitting an application to Adsense is to check whether you &amp;amp; your blog/website are eligible for the program or not?&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;You have to be at least 18 years old.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Your blog/website must be in comply with Adsense Policies.&lt;/li&gt;
&lt;/ul&gt;
&lt;u&gt;&lt;b&gt;A short overview of Adsense Policies&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;2.&lt;/b&gt; Next, your blog/website has to be atleast 6 months old. This is more known as 6-months-rule these days. However the rule is applied to few countries &amp;amp; picture is not clear about the countries to whom it is applied, &#39;cause Google has only mentioned India &amp;amp; China in the following statement.&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
In some locations, including China and India, we require publishers to have owned their sites for 6 months.&lt;/blockquote&gt;
It is believed that this so called 6-month-rule is applicable to countries where you cannot change the Payee Name once the Application is approved.&lt;br /&gt;
So the countries listed under this restriction are listed on &lt;a href=&quot;http://support.google.com/adsense/bin/answer.py?hl=en&amp;amp;ctx=as2&amp;amp;answer=160202&amp;amp;rd=1&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Change Payee Name&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;3.&lt;/b&gt; By approving your application Google Adsense approves you as one of their partners representing them on your blog/website. So thinking this way, you have to develop a standard that Adsense expects from their publishers.&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;Quick view of Adsense standardized blog/website.&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
i. Your Identity is clearly presented on the blog/website, so that Adsense can verify that its you (This include Google+ Widget and About me Page).&lt;br /&gt;
&lt;i&gt;- Authorship not verified&lt;/i&gt; is one of the reasons to be rejected.&lt;br /&gt;
&lt;br /&gt;
ii.&amp;nbsp; Your content is your sole property &amp;amp; does not violate any copyrights.&lt;br /&gt;
&lt;i&gt;- Copyright violation&amp;nbsp;&lt;/i&gt;is most common reason, along with Unacceptable Site Content.&lt;br /&gt;
&lt;br /&gt;
iii. Your website is easy to Navigate.&lt;br /&gt;
- &lt;i&gt;Tough Navigation&lt;/i&gt; is another common reason.&lt;br /&gt;
&lt;br /&gt;
iv. Content that Adsense doesn&#39;t care about like: &lt;i&gt;Unacceptable Site Content&lt;/i&gt; Reasons.&lt;br /&gt;
- Illegal distribution of pirated softwares or entertainment stuff.&lt;br /&gt;
- Publishing Hacking Tutorials.&lt;br /&gt;
- Violent, hatred, adult, gambling, drug, alcohol etc kind of content. &lt;br /&gt;
- Site still under construction.&lt;br /&gt;
- Broken Links on your blog/websites. &lt;br /&gt;
&lt;br /&gt;
Please refer to the official Adsense &lt;a href=&quot;http://support.google.com/adsense/bin/answer.py?hl=en&amp;amp;answer=1348688&amp;amp;topic=1271507&amp;amp;ctx=topic&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Prohibited Content Guide&lt;/a&gt; for detailed info with examples.&lt;br /&gt;
&lt;br /&gt;
v. Privacy Policy - One of the major reasons for rejection but rarely considered into account. &lt;a href=&quot;http://www.rookieslab.com/2012/07/what-is-privacy-policy-and-how-to-make.html&quot; target=&quot;_blank&quot;&gt;Read More about Privacy Policy&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
vi. Insufficient Site Content&lt;br /&gt;
- This includes both number of posts and number of words in each post.&lt;br /&gt;
- A rough idea of number of posts is 30+ and number of words in each post is 500+ &lt;br /&gt;
&lt;br /&gt;
Wish you luck for your application to Google Adsense.&lt;br /&gt;
&lt;br /&gt;
Happy Blogging.&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/3794721463685316795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/3794721463685316795'/><link rel='alternate' type='text/html' href='http://rookieslab.blogspot.com/2012/12/before-submitting-application-form-to-adsense.html' title='Before submitting an Application Form to Adsense'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05336645400007023377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3BbHXrnUCAiJI7LyWgLJIoVQXgbAEzHlwbXSAkbjQrJfw9qVhxvZAyeKByNHRptxYTGl7YreLZpcAA1pi5ZkcSedKlHzMKW6yKXvANfOt12M0Ks-fj_YUpNkjjabsyFNHz491K1wc6_Qu/s72-c/adsense_y_u_no.jpg" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5966303661451578311.post-6669402032875275450</id><published>2012-12-27T16:40:00.002+05:30</published><updated>2013-01-03T01:16:57.675+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="edX"/><category scheme="http://www.blogger.com/atom/ns#" term="MIT 6.00x"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>Complexity or Order of Growth in Programming</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Complexity or Order of Growth of a program plays a major role in efficient programming. It actually gives an idea of the time taken by your code to run and return correct answer.&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Constant Complexity O(1) : constant       running time&lt;/li&gt;
&lt;li&gt;Linear Complexity O(n) :       linear       running time&lt;/li&gt;
&lt;li&gt;Logarithmic Complexity O(log       n) :       logarithmic       running time &lt;/li&gt;
&lt;li&gt;Log-Linear Complexity O(n       log       n) :       log-­linear       running time&lt;/li&gt;
&lt;li&gt;Polynomial Complexity O(n^c) :       polynomial       running time       (c       is       a constant)&lt;/li&gt;
&lt;li&gt;Exponential Complexity O(c^n) :       exponential       running time       (c       is       a constant       being       raised       to       a       power       based       on       size       of input)&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
But this doesn&#39;t explain anything, so lets go through some simple examples of each of them.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;u&gt;&lt;b&gt;O(1): Constant Complexity&lt;/b&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
The code will run for a fixed amount of time. Consider following code:&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;pre class=&quot;brush: python&quot;&gt;def constant():
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i&amp;nbsp; = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while i&amp;lt;10: 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print i
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i = i+1&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;Output:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; constant()&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;0&lt;br /&gt;1&lt;br /&gt;2&lt;br /&gt;3&lt;br /&gt;4&lt;br /&gt;5&lt;br /&gt;6&lt;br /&gt;7&lt;br /&gt;8&lt;br /&gt;9 &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
The &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;while&lt;/span&gt; loop will run 10 times and its fixed i.e. constant, hence the term &lt;b&gt;Constant Complexity&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;u&gt;&lt;b&gt;O(n) : Linear Complexity&lt;/b&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Run time depends on the value passed into the function. Consider a function that return a^b ( a to the power b)&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;pre class=&quot;brush: python&quot;&gt;def iterPower(a, b):
&amp;nbsp;&amp;nbsp; result = 1
&amp;nbsp;&amp;nbsp; while b &amp;gt; 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result *= a
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b -= 1
&amp;nbsp;&amp;nbsp; return result&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Here the number of times &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;while&lt;/span&gt; loop is iterated depends on the value of b passed in. So the &lt;b&gt;Complexity&lt;/b&gt; or &lt;b&gt;Order of Growth&lt;/b&gt; for this program is &lt;b&gt;O(n) &lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;u&gt;&lt;b&gt;O(log n) : Logarithmic Complexity&lt;/b&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Consider following code that converts an&amp;nbsp;integer to string (you may need to convert &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;int&lt;/span&gt; to &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;string&lt;/span&gt; when &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;int&lt;/span&gt; is too long to store in&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; int &lt;/span&gt;type)&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;def intToStr(i): #assumes i to be a positive integer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; digits = &#39;0123456789&#39;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if i == 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &#39;0&#39;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = &#39;&#39;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while i &amp;gt; 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = digits[i%10] + result
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i = i/10
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return result&lt;/pre&gt;
&lt;br /&gt;
Take a look at &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;while&lt;/span&gt; loop, guess how many times will this &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;while&lt;/span&gt; loop be executed when we run this code?&lt;br /&gt;
It&#39;ll depend on how many times we can divide i by 10.&lt;br /&gt;
eg.: for i = 100, code will run 2 times(since 100 can be divided by 10 atmost twice) and log 10 also equals 2.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for 1= 10000, code will run 4 times and log 10000 also equals 4 &lt;br /&gt;
&lt;br /&gt;
Hence &lt;b&gt;Complexity&lt;/b&gt; or &lt;b&gt;Order of Growth&lt;/b&gt; is &lt;b&gt;O(log n)&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;O(n log n) : Log-Linear Complexity&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
One of the examples of Log-Linear Order of Growth is Merge Sort Algorithm.&lt;br /&gt;
&lt;br /&gt;
Say we have list, &lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;l = [5,2,4,7,1,3,2,6]&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
In Merge Sort algorithm, we keep dividing the list into half until we get the easiest form where we can directly compare two values. Have a glance here.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijh_3Lpktybmz01OgHN9tXcoBrsvSlaCmYTxFfv8fxALVFnGmCaZqyOomYlLL8iRu3eQQoPJD4iprrAJ_zvmb6jD2SRnA9y3qWIwVIBNCkSaL8bd4lRHKPQEqoPlwHFQXPSs3YeAltUoqk/s1600/merge-sort-divide.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Log-Linear Order of Growth&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijh_3Lpktybmz01OgHN9tXcoBrsvSlaCmYTxFfv8fxALVFnGmCaZqyOomYlLL8iRu3eQQoPJD4iprrAJ_zvmb6jD2SRnA9y3qWIwVIBNCkSaL8bd4lRHKPQEqoPlwHFQXPSs3YeAltUoqk/s1600/merge-sort-divide.jpg&quot; title=&quot;O(n logn) Complexity&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
So we finally got a bunch of &lt;a href=&quot;http://www.rookieslab.com/2012/12/python-objects-lists-mutation-of-list.html&quot; target=&quot;_blank&quot;&gt;Singleton Lists&lt;/a&gt;. Upto now Complexity is &lt;b&gt;O(log n).&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Now we&#39;ll go through each of lists like iteration. Please go through following from bottom to top.(acc. to how arrows indicate)&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE8EDlPn5D843_a7qwAjNaoPOF7FvTFOr8DDfFgcL0VYgev11Lds_yQ-elS-Ihvgfnc2rgTU2rpiLvjqex8wGTW-VMjvol2IJFeAL7mNVoaqoSIpVXodlQoTTFEOn7MFoEiqK8AJej2Tgy/s1600/merge-sort-compare.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;O(n logn) Complexity&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE8EDlPn5D843_a7qwAjNaoPOF7FvTFOr8DDfFgcL0VYgev11Lds_yQ-elS-Ihvgfnc2rgTU2rpiLvjqex8wGTW-VMjvol2IJFeAL7mNVoaqoSIpVXodlQoTTFEOn7MFoEiqK8AJej2Tgy/s1600/merge-sort-compare.jpg&quot; title=&quot;Log-Linear Order of Growth&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
We iterate through each part linearly in each step from bottom to top. This makes O(n) Complexity along with previous O(log n). So final result is &lt;b&gt;O(n log n) Order of Growth.&lt;/b&gt;&lt;br /&gt;
Remaining complexities will be discussed later as we proceed. Stay in touch meanwhile or choose &lt;a href=&quot;http://www.rookieslab.com/search/label/Python&quot; target=&quot;_blank&quot;&gt;another interesting topic in Python here&lt;/a&gt;.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
&lt;b&gt;&lt;b&gt;Note:&lt;/b&gt;&lt;br /&gt;
&lt;/b&gt;This is a part of what I learn in an online Open Course Ware offered by MIT on &lt;a href=&quot;http://edx.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;edX&lt;/a&gt;&lt;br /&gt;
Its for my personal reference &amp;amp; also for those who have missed the course.&lt;br /&gt;
You too can enroll yourself on &lt;a href=&quot;http://edx.org/&quot; target=&quot;_blank&quot;&gt;edX&lt;/a&gt; (if they are still offering the course MITx 6.00x) &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/6669402032875275450'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/6669402032875275450'/><link rel='alternate' type='text/html' href='http://rookieslab.blogspot.com/2012/12/complexity-or-order-of-growth-in-programming.html' title='Complexity or Order of Growth in Programming'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05336645400007023377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijh_3Lpktybmz01OgHN9tXcoBrsvSlaCmYTxFfv8fxALVFnGmCaZqyOomYlLL8iRu3eQQoPJD4iprrAJ_zvmb6jD2SRnA9y3qWIwVIBNCkSaL8bd4lRHKPQEqoPlwHFQXPSs3YeAltUoqk/s72-c/merge-sort-divide.jpg" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5966303661451578311.post-8128449963854921011</id><published>2012-12-25T16:12:00.002+05:30</published><updated>2013-01-03T01:16:29.475+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="edX"/><category scheme="http://www.blogger.com/atom/ns#" term="MIT 6.00x"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>Python Objects: Dictionary (dict)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Dictionary or &lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;dict&lt;/span&gt;&lt;/b&gt; is generalization of &lt;a href=&quot;http://www.rookieslab.com/2012/12/python-objects-lists-mutation-of-list.html&quot; target=&quot;_blank&quot;&gt;Lists&lt;/a&gt;&lt;br /&gt;
In &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;list &lt;/span&gt;we use [], while in &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;dict&lt;/span&gt; {}&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; l = [&#39;three&#39;, &#39;five&#39;, &#39;one&#39;, &#39;seven&#39;]
&amp;gt;&amp;gt;&amp;gt; l[0] #here 0 in l[0] is called index and 0th index refers to three
&#39;three&#39;
&amp;gt;&amp;gt;&amp;gt; l[1]
&#39;five&#39;
&amp;gt;&amp;gt;&amp;gt; l[2]
&#39;one&#39;
&amp;gt;&amp;gt;&amp;gt; l[3]
&#39;seven&#39;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Now let&#39;s see how dictionary can be defined and used. We explicitly define index of data we insert.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;dict = {index:data, index:data.... and so on}&lt;/span&gt;&lt;br /&gt;
Also known as &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;dict = {key:value , key: value .... so on}&lt;/span&gt;&lt;br /&gt;
We can access the &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;value&lt;/span&gt; or &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;data&lt;/span&gt; only by using the &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;key&lt;/span&gt; or &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;index&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; d = {3:&#39;three&#39;, 5:&#39;five&#39;, 1:&#39;one&#39;, 7:&#39;seven&#39;}
&amp;gt;&amp;gt;&amp;gt; d[3] # 3 is the index of data &#39;three&#39;
&#39;three&#39;&amp;nbsp;&amp;nbsp;&amp;nbsp; # 3 is also called &#39;key&#39; and &#39;three&#39; is called &#39;value&#39;
&amp;gt;&amp;gt;&amp;gt; d[5]
&#39;five&#39;
&amp;gt;&amp;gt;&amp;gt; d[1]
&#39;one&#39;
&amp;gt;&amp;gt;&amp;gt; d[7]
&#39;seven&#39;
&amp;gt;&amp;gt;&amp;gt; d[0] #since we didn&#39;t define 0th index in our dict, it returns an error
Traceback (most recent call last):
&amp;nbsp; File &quot;&amp;lt;pyshell#10&amp;gt;&quot;, line 1, in &amp;lt;module&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; d[0]
KeyError: 0&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
We can have any datatype as &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;key&lt;/span&gt; and any datatype as &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;value&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; month = {1:&#39;Jan&#39;, 2:&#39;Feb&#39;, 3:&#39;Mar&#39;, 4:&#39;Apr&#39;, 5: &#39;May&#39;, 6: &#39;June&#39;}
&amp;gt;&amp;gt;&amp;gt; month[5] #here integers are keys while strings are values.
&#39;May&#39;
&amp;gt;&amp;gt;&amp;gt; month1={&#39;Jan&#39;:1, &#39;Feb&#39;:2, &#39;Mar&#39;:3, &#39;Apr&#39;:4,&amp;nbsp; &#39;May&#39;:5,&amp;nbsp; &#39;June&#39;:6}
&amp;gt;&amp;gt;&amp;gt; month1[&#39;Jan&#39;] #here integers are values while strings are keys.
1
&amp;gt;&amp;gt;&amp;gt; month2={1:&#39;Jan&#39;, 2:&#39;Feb&#39;,&#39;Mar&#39;:3,4:&#39;Apr&#39;,&#39;May&#39;:5,&#39;Jun&#39;:6} #here its mixed
&amp;gt;&amp;gt;&amp;gt; month2[2] 
&#39;Feb&#39;
&amp;gt;&amp;gt;&amp;gt; month2[&#39;Mar&#39;]
3&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
We can also use &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;_____.keys()&lt;/span&gt; and &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;_____.values()&lt;/span&gt; to get list of all keys and values seperately.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; month.keys()
[1, 2, 3, 4, 5, 6]
&amp;gt;&amp;gt;&amp;gt; month.values()
[&#39;Jan&#39;, &#39;Feb&#39;, &#39;Mar&#39;, &#39;Apr&#39;, &#39;May&#39;, &#39;June&#39;]
&amp;gt;&amp;gt;&amp;gt; month2.keys() 
[1, 2, &#39;Mar&#39;, 4, &#39;May&#39;, &#39;Jun&#39;]
&amp;gt;&amp;gt;&amp;gt; month2.values() 
[&#39;Jan&#39;, &#39;Feb&#39;, 3, &#39;Apr&#39;, 5, 6]&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
Inserting into already existing dictionary.&lt;br /&gt;
Insertion into already existing dict is done by &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;_____[key] = value&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;&amp;gt;&amp;gt;&amp;gt;month[7] = &#39;July&#39;
&amp;gt;&amp;gt;&amp;gt; month
{1: &#39;Jan&#39;, 2: &#39;Feb&#39;, 3: &#39;Mar&#39;, 4: &#39;Apr&#39;, 5: &#39;May&#39;, 6: &#39;June&#39;,&amp;nbsp; 7: &#39;July} 
&amp;gt;&amp;gt;&amp;gt; month.keys()
[1, 2, 3, 4, 5, 6, 7]
&amp;gt;&amp;gt;&amp;gt; month.values()
[&#39;Jan&#39;, &#39;Feb&#39;, &#39;Mar&#39;, &#39;Apr&#39;, &#39;May&#39;, &#39;June&#39;, &#39;July&#39;]&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
Keys can also be complex. Here keys are &lt;a href=&quot;http://www.rookieslab.com/2012/12/learnign-python-objects-of-python-tuples.html&quot; target=&quot;_blank&quot;&gt;tuples&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; myDict = {(1,2):&#39;Twelve&#39;, (1,3):&#39;Thirteen&#39;} #(1,2) is a tuple
&amp;gt;&amp;gt;&amp;gt; myDict[(1,2)]
&#39;Twelve&#39;&lt;/pre&gt;
&lt;br /&gt;
Related Articles:&lt;br /&gt;
&lt;a href=&quot;http://www.rookieslab.com/2012/12/operations-on-string-some-simple.html&quot; target=&quot;_blank&quot;&gt;Python Objects: Strings and Operations on Strings&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.rookieslab.com/2012/12/learnign-python-objects-of-python-tuples.html&quot; target=&quot;_blank&quot;&gt;Python Objects: Tuples and its use&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.rookieslab.com/2012/12/python-objects-lists-mutation-of-list.html&quot; target=&quot;_blank&quot;&gt;Python Objects: Lists, its use, Mutation of Lists&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;b&gt;Note:&lt;/b&gt;&lt;br /&gt;
&lt;/b&gt;This is a part of what I learn in an online Open Course Ware offered by MIT on &lt;a href=&quot;http://edx.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;edX&lt;/a&gt;&lt;br /&gt;
Its for my personal reference &amp;amp; also for those who have missed the course.&lt;br /&gt;
You too can enroll yourself on &lt;a href=&quot;http://edx.org/&quot; target=&quot;_blank&quot;&gt;edX&lt;/a&gt; (if they are still offering the course MITx 6.00x) &lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/8128449963854921011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/8128449963854921011'/><link rel='alternate' type='text/html' href='http://rookieslab.blogspot.com/2012/12/python-objects-dictionary-dict-examples-insertion-lists.html' title='Python Objects: Dictionary (dict)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05336645400007023377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5966303661451578311.post-5483383790274648653</id><published>2012-12-23T15:48:00.000+05:30</published><updated>2013-01-03T01:16:15.352+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="edX"/><category scheme="http://www.blogger.com/atom/ns#" term="MIT 6.00x"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>Python Objects: Lists: Mutation of List</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Lists are almost same as &lt;a href=&quot;http://www.rookieslab.com/2012/12/learnign-python-objects-of-python-tuples.html&quot; target=&quot;_blank&quot;&gt;Tuples&lt;/a&gt;, but a huge difference is, Lists are mutable i.e. Lists can be modified after they are created unlike &lt;a href=&quot;http://www.rookieslab.com/2012/12/learnign-python-objects-of-python-tuples.html&quot; target=&quot;_blank&quot;&gt;Tuples&lt;/a&gt; and &lt;a href=&quot;http://www.rookieslab.com/2012/12/operations-on-string-some-simple.html&quot; target=&quot;_blank&quot;&gt;Strings&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
For example, consider a Tuple:&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; t1 = (1,&#39;two&#39;,3)
&amp;gt;&amp;gt;&amp;gt; t1
(1, &#39;two&#39;, 3)
&amp;gt;&amp;gt;&amp;gt; t1[1]
&#39;two&#39;
&amp;gt;&amp;gt;&amp;gt; t1[1] = 2 #trying to replace &#39;two&#39; by 2
Traceback (most recent call last):
&amp;nbsp; File &quot;&amp;lt;pyshell#22&amp;gt;&quot;, line 1, in &amp;lt;module&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; t1[1] = 2
TypeError: &#39;tuple&#39; object does not support item assignment&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
Same error while mutating a String.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; s1 = &#39;Kate&#39;
&amp;gt;&amp;gt;&amp;gt; s1[0]
&#39;K&#39;
&amp;gt;&amp;gt;&amp;gt; s1[0] = &#39;M&#39; #trying to replace &#39;K&#39; by &#39;M&#39;
Traceback (most recent call last):
&amp;nbsp; File &quot;&amp;lt;pyshell#25&amp;gt;&quot;, line 1, in &amp;lt;module&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; s1[0] = &#39;M&#39;
TypeError: &#39;str&#39; object does not support item assignment&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
That is why we have Lists&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; l1 = [1,&#39;two&#39;,3] #List is declared in between [] unlike Tuple ()
&amp;gt;&amp;gt;&amp;gt; l1
[1, &#39;two&#39;, 3]
&amp;gt;&amp;gt;&amp;gt; l1[1]
&#39;two&#39;
&amp;gt;&amp;gt;&amp;gt; l1[1] = 2
&amp;gt;&amp;gt;&amp;gt; l1
[1, 2, 3]&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
Declaring a Singleton List&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; l2 = [4] #No comma operator required unlike Tuple &amp;gt;&amp;gt;&amp;gt; t2 = (4,)
&amp;gt;&amp;gt;&amp;gt; l2
[4]
&amp;gt;&amp;gt;&amp;gt; type(l2)
&amp;lt;type &#39;list&#39;&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;Important!&lt;/span&gt; Understand the difference between Assigning a List and Copying a List&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; l1 = [1,2,3]
&amp;gt;&amp;gt;&amp;gt; l2 = l1 #This is called Assignment. List l1 is assigned to l2
&amp;gt;&amp;gt;&amp;gt; l3 = l1[:] #This is called Copying. List l1 is copied into l3
&amp;gt;&amp;gt;&amp;gt; l1[2] = &#39;three&#39;
&amp;gt;&amp;gt;&amp;gt; l1
[1, 2, &#39;three&#39;]
&amp;gt;&amp;gt;&amp;gt; l2
[1, 2, &#39;three&#39;]
&amp;gt;&amp;gt;&amp;gt; l3
[1, 2, 3]&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
Here, we are confused, Why is only l2 affected and not l3.&lt;br /&gt;
That is because, l2 points to the address of l1 in computer memory, but l3 is created as a whole new list and acquires specific memory units that contains all the elements of l1. Have a glance of it here.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGufRpAmzbFn5OnVCzK0sXOHd42QsdQ6uYfke1h8TNfCGBXqWw2ayCQy0Nu40It1R7r7bk9wc9d0VhqBNR9KmE8vSTaAm615sh207Fx8d4tWMXGnk7wOAGsnT3erD0QfXfn8GPan6js7it/s1600/lists.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Mutation of List&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGufRpAmzbFn5OnVCzK0sXOHd42QsdQ6uYfke1h8TNfCGBXqWw2ayCQy0Nu40It1R7r7bk9wc9d0VhqBNR9KmE8vSTaAm615sh207Fx8d4tWMXGnk7wOAGsnT3erD0QfXfn8GPan6js7it/s1600/lists.png&quot; title=&quot;Mutating Lists&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Related Articles:&lt;br /&gt;
&lt;a href=&quot;http://www.rookieslab.com/2012/12/python-objects-dictionary-dict-examples-insertion-lists.html&quot; target=&quot;_blank&quot;&gt;Python Objects: Dictionary (dict) &lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.rookieslab.com/2012/12/operations-on-string-some-simple.html&quot; target=&quot;_blank&quot;&gt;Python Objects: Strings and Operations on Strings&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.rookieslab.com/2012/12/learnign-python-objects-of-python-tuples.html&quot; target=&quot;_blank&quot;&gt;Python Objects: Tuples and its use&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;b&gt;Note:&lt;/b&gt;&lt;br /&gt;
&lt;/b&gt;This is a part of what I learn in an online Open Course Ware offered by MIT on &lt;a href=&quot;http://edx.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;edX&lt;/a&gt;&lt;br /&gt;
Its for my personal reference &amp;amp; also for those who have missed the course.&lt;br /&gt;
You too can enroll yourself on &lt;a href=&quot;http://edx.org/&quot; target=&quot;_blank&quot;&gt;edX&lt;/a&gt; (if they are still offering the course MITx 6.00x)&amp;nbsp; &lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/5483383790274648653'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/5483383790274648653'/><link rel='alternate' type='text/html' href='http://rookieslab.blogspot.com/2012/12/python-objects-lists-mutation-of-list.html' title='Python Objects: Lists: Mutation of List'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05336645400007023377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGufRpAmzbFn5OnVCzK0sXOHd42QsdQ6uYfke1h8TNfCGBXqWw2ayCQy0Nu40It1R7r7bk9wc9d0VhqBNR9KmE8vSTaAm615sh207Fx8d4tWMXGnk7wOAGsnT3erD0QfXfn8GPan6js7it/s72-c/lists.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5966303661451578311.post-4456518163488901112</id><published>2012-12-23T14:22:00.001+05:30</published><updated>2013-01-03T01:15:56.846+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="edX"/><category scheme="http://www.blogger.com/atom/ns#" term="MIT 6.00x"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>Objects of Python : Tuples</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
What are Tuples?&lt;br /&gt;
Just go through following operations. &lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; t1 = (1,&#39;two&#39;,3) #declaring tuple
&amp;gt;&amp;gt;&amp;gt; t1
(1, &#39;two&#39;, 3)
&amp;gt;&amp;gt;&amp;gt; print t1 #does the same thing as above
(1, &#39;two&#39;, 3)
&amp;gt;&amp;gt;&amp;gt; type(t1) #lets check the type of tuple
&amp;lt;type &#39;tuple&#39;&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
How to declare a Singleton Tuple (Tuple with only one element) :&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; t2 = (5) #trying to declare a singleton tuple
&amp;gt;&amp;gt;&amp;gt; t2
5
&amp;gt;&amp;gt;&amp;gt; type(t2) #Oops! We didn&#39;t expect it to be an int type
&amp;lt;type &#39;int&#39;&amp;gt;
&amp;gt;&amp;gt;&amp;gt; t2 = (5,) #Note comma after 5
&amp;gt;&amp;gt;&amp;gt; t2
(5,)
&amp;gt;&amp;gt;&amp;gt; type(t2) #Now you&#39;re talking!!
&amp;lt;type &#39;tuple&#39;&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
We can even have a tuple inside a tuple (Nested Tuples).&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; t3 = (t1,4,t2)
&amp;gt;&amp;gt;&amp;gt; t3
((1, &#39;two&#39;, 3), 4, (5,))&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
We can add(concatenate) two or more tuples&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; t4 = (t1 + (4,) + t2)
&amp;gt;&amp;gt;&amp;gt; t4
(1, &#39;two&#39;, 3, 4, 5)&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
Indexing and Slicing are same as how we do with strings&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; t4
(1, &#39;two&#39;, 3, 4, 5)
&amp;gt;&amp;gt;&amp;gt; t4[3] #Indexing
4
&amp;gt;&amp;gt;&amp;gt; t4[2:4] #Slicing
(3, 4)&lt;/pre&gt;
&lt;br /&gt;
Related Articles:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.rookieslab.com/2012/12/operations-on-string-some-simple.html&quot; target=&quot;_blank&quot;&gt;Operations on String: Concatenation, Indexing &amp;amp; Slicing&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.rookieslab.com/2012/12/python-objects-dictionary-dict-examples-insertion-lists.html&quot; target=&quot;_blank&quot;&gt;Python Objects: Dictionary (dict)&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.rookieslab.com/2012/12/python-objects-lists-mutation-of-list.html&quot; target=&quot;_blank&quot;&gt;Python Objects: Lists, its use, Mutation of Lists&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;b&gt;Note:&lt;/b&gt;&lt;br /&gt;
&lt;/b&gt;This is a part of what I learn in an online Open Course Ware offered by MIT on &lt;a href=&quot;http://edx.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;edX&lt;/a&gt;&lt;br /&gt;
Its for my personal reference &amp;amp; also for those who have missed the course.&lt;br /&gt;
You too can enroll yourself on &lt;a href=&quot;http://edx.org/&quot; target=&quot;_blank&quot;&gt;edX&lt;/a&gt; (if they are still offering the course MITx 6.00x) &amp;nbsp; &lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/4456518163488901112'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/4456518163488901112'/><link rel='alternate' type='text/html' href='http://rookieslab.blogspot.com/2012/12/learnign-python-objects-of-python-tuples.html' title='Objects of Python : Tuples'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05336645400007023377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5966303661451578311.post-4833451090906231809</id><published>2012-12-22T21:02:00.002+05:30</published><updated>2013-01-03T01:15:30.106+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="edX"/><category scheme="http://www.blogger.com/atom/ns#" term="MIT 6.00x"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>Recursion in Programming - Explained</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
We&#39;ll take an example of multiplying two numbers without using multiplication operator. This can be done in typical way of iteration.&lt;br /&gt;
&lt;br /&gt;
For eg: If we are asked to multiply&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; x &lt;/span&gt;and&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; y&lt;/span&gt;, we&#39;ll keep adding &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;x&lt;/span&gt; to&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; x&lt;/span&gt; for &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;y&lt;/span&gt; times&lt;br /&gt;
&lt;br /&gt;
See the following code:&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;def iterMul(x, y):
&amp;nbsp;&amp;nbsp;&amp;nbsp; result = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp; while y &amp;gt; 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result += x #same as result = result + x
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y -= 1 #same as y = y - 1
&amp;nbsp;&amp;nbsp;&amp;nbsp; return result&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;Output:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;iterMul(3,7)&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;21&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Recursion does the same thing, but in a bit different way.&lt;br /&gt;
We call the function itself in our function.&lt;br /&gt;
How to think of it?&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNEWZHBQEjHnse0eReV0_phSMIFGEEnedAhgKKvGrHTiqGbfDgWGfuhXZhjaZDXEJsoPNhwd6KeOHJShqo9A0FaHzWvu26OR6_mZa34Nf2wF5T_JsuPnAT8ztyQW61qrVVL3DjLxZjI3G0/s1600/Screenshot+from+2012-12-22+20:37:22.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;How does recursive function work&quot; border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNEWZHBQEjHnse0eReV0_phSMIFGEEnedAhgKKvGrHTiqGbfDgWGfuhXZhjaZDXEJsoPNhwd6KeOHJShqo9A0FaHzWvu26OR6_mZa34Nf2wF5T_JsuPnAT8ztyQW61qrVVL3DjLxZjI3G0/s200/Screenshot+from+2012-12-22+20:37:22.png&quot; title=&quot;Recursion Algorithm&quot; width=&quot;197&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
But still, this doesn&#39;t make things clear. It&#39;ll get clear with an example.&lt;br /&gt;
&lt;br /&gt;
See the following code (don&#39;t worry if you don&#39;t get it, see the example below it):&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;def recurMul(x, y):
&amp;nbsp;&amp;nbsp;&amp;nbsp; if y == 1:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return x
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return x + recurMul(x, y-1)&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;Output:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; recurMul(7,3)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;21&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;recurMul(7,3) returns &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;7&lt;/span&gt;+recurMul(7,2)&lt;/b&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Checks if y=1, here y=2, So recurMul(7,2) returns &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;7&lt;/span&gt;+recurMul(7,1)&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;So our ans is&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;7&lt;/span&gt;+&lt;span style=&quot;color: red;&quot;&gt;7&lt;/span&gt;+recurMul(7,1)&lt;/b&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Checks if y=1, yes y=1, so returns x, and x = &lt;b&gt;&lt;span style=&quot;color: green;&quot;&gt;7&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;So our answer is &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;7&lt;/span&gt;+&lt;span style=&quot;color: red;&quot;&gt;7&lt;/span&gt;+&lt;span style=&quot;color: green;&quot;&gt;7&lt;/span&gt;&lt;/b&gt; which sums up to give 21&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;/ul&gt;
So, thats how recursion works. Note the color of 7 in the above explanation in order to feel which 7 is added to which 7.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;b&gt;Note:&lt;/b&gt;&lt;br /&gt;
&lt;/b&gt;This is a part of what I learn in an online Open Course Ware offered by MIT on &lt;a href=&quot;http://edx.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;edX&lt;/a&gt;&lt;br /&gt;
Its for my personal reference &amp;amp; also for those who have missed the course.&lt;br /&gt;
You too can enroll yourself on &lt;a href=&quot;http://edx.org/&quot; target=&quot;_blank&quot;&gt;edX&lt;/a&gt; (if they are still offering the course MITx 6.00x)&amp;nbsp; &lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/4833451090906231809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/4833451090906231809'/><link rel='alternate' type='text/html' href='http://rookieslab.blogspot.com/2012/12/learning-python-recursion-explained-how-recursive-functions-work.html' title='Recursion in Programming - Explained'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05336645400007023377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNEWZHBQEjHnse0eReV0_phSMIFGEEnedAhgKKvGrHTiqGbfDgWGfuhXZhjaZDXEJsoPNhwd6KeOHJShqo9A0FaHzWvu26OR6_mZa34Nf2wF5T_JsuPnAT8ztyQW61qrVVL3DjLxZjI3G0/s72-c/Screenshot+from+2012-12-22+20:37:22.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5966303661451578311.post-7342051136958958278</id><published>2012-12-21T16:21:00.001+05:30</published><updated>2013-01-03T01:15:14.877+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="edX"/><category scheme="http://www.blogger.com/atom/ns#" term="MIT 6.00x"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>Finding Roots - Advanced (in Python)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Following is the explanation for finding roots (square root, cube root.... nth root) It requires prior knowledge of &lt;a href=&quot;http://www.rookieslab.com/2012/12/linear-search-vs-bisection-search-algorithm-python-code.html&quot; target=&quot;_blank&quot;&gt;Bisection Search&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
This is the advancement of basic version of &lt;a href=&quot;http://www.rookieslab.com/2012/12/finding-square-root-guess-and-check-method-in-python.html&quot; target=&quot;_blank&quot;&gt;finding square root of only perfect squares&lt;/a&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;def findRoot1(x, power, epsilon):
&amp;nbsp;&amp;nbsp;&amp;nbsp; low = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp; high = x
&amp;nbsp;&amp;nbsp;&amp;nbsp; ans = (high+low)/2.0
&amp;nbsp;&amp;nbsp;&amp;nbsp; while abs(ans**power - x) &amp;gt; epsilon:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ans**power &amp;lt; x:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; low = ans
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; high = ans
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ans = (high+low)/2.0
&amp;nbsp;&amp;nbsp;&amp;nbsp; return ans&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;Output:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: orange;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;print&lt;/span&gt; &lt;/span&gt;findRoot1(25.0, 2, .001)&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;4.99992370605&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;print&lt;/span&gt; findRoot1(27.0, 3, .001)&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;2.99998855591&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;print&lt;/span&gt; findRoot1(-27.0, 3, .001)&lt;/span&gt;&lt;br /&gt;
This case fails, it actually gets caught into an infinite loop&lt;br /&gt;
What happens is, &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;low = 0&lt;/span&gt; and &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;high = -27&lt;/span&gt;, whereas actually 0&amp;gt;-27, so it should be&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; low = -27&amp;nbsp;&lt;/span&gt;and&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; high = 0&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
So we need to insert a code such that it assigns lower value to &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;low &lt;/span&gt;and higher value to &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;high&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;def findRoot2(x, power, epsilon):
&amp;nbsp;&amp;nbsp;&amp;nbsp; if x &amp;lt; 0 and power%2 == 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return None
&amp;nbsp;&amp;nbsp;&amp;nbsp; # can&#39;t find even powered root of negative number
&amp;nbsp;&amp;nbsp;&amp;nbsp; low = min(0, x) #min() will return the minimum of 0 and x
&amp;nbsp;&amp;nbsp;&amp;nbsp; high = max(0, x) #max() will return the maximum of 0 and x
&amp;nbsp;&amp;nbsp;&amp;nbsp; ans = (high+low)/2.0
&amp;nbsp;&amp;nbsp;&amp;nbsp; while abs(ans**power - x) &amp;gt; epsilon:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ans**power &amp;lt; x:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; low = ans
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; high = ans
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ans = (high+low)/2.0
&amp;nbsp;&amp;nbsp;&amp;nbsp; return ans&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;b&gt;Output: &lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;print &lt;/span&gt;findRoot2(25.0, 2, .001)&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;4.99992370605&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;print&lt;/span&gt; findRoot2(27.0, 3, .001)&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;2.99998855591&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;print&lt;/span&gt; findRoot2(-27.0, 3, .001)&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;-2.99998855591&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;print&lt;/span&gt; findRoot2(0.25, 2, .001)&lt;/span&gt;&lt;br /&gt;
This case fails, because when       we       call       with       a       fractional       argument,       like       0.25,       we       are       searching between 0       and 0.25&lt;br /&gt;
&lt;br /&gt;
Which       means       our       first       guess       will       be       0.125&lt;br /&gt;
&lt;br /&gt;
Our       original       idea       used       the       fact       that       the       root       of       x       was       between       0       and       x,       but       when       x       is       fractional,       the       root       is       between       x       and       1    &lt;br /&gt;
&lt;br /&gt;
So, we have to modify &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;min(0,x)&lt;/span&gt; and &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;max(0,x) &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;def findRoot3(x, power, epsilon):
&amp;nbsp;&amp;nbsp;&amp;nbsp; if x &amp;lt; 0 and power%2 == 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return None
&amp;nbsp;&amp;nbsp;&amp;nbsp; # can&#39;t find even powered root of negative number
&amp;nbsp;&amp;nbsp;&amp;nbsp; low = min(-1.0, x) #think of findRoot3(-0.125, 3, .001)
&amp;nbsp;&amp;nbsp;&amp;nbsp; high = max(1.0, x) #think of findRoot3(0.25, 2, .001)
&amp;nbsp;&amp;nbsp;&amp;nbsp; ans = (high+low)/2.0
&amp;nbsp;&amp;nbsp;&amp;nbsp; while abs(ans**power - x) &amp;gt; epsilon:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ans**power &amp;lt; x:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; low = ans
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; high = ans
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ans = (high+low)/2.0
&amp;nbsp;&amp;nbsp;&amp;nbsp; return ans&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;print&lt;/span&gt; findRoot3(25.0, 2, .001)&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;4.99992370605&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;print&lt;/span&gt; findRoot3(27.0, 3, .001)&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;2.99998474121&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;print&lt;/span&gt; findRoot3(-27.0, 3, .001)&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;-2.99998474121&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;print&lt;/span&gt; findRoot3(0.25, 2, .001)&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;0.5&lt;/span&gt; &lt;span style=&quot;color: #38761d;&quot;&gt;#sweet&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;print&lt;/span&gt; findRoot3(-0.125, 3, .001)&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;-0.5&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Happy coding.&lt;br /&gt;
&lt;br /&gt;
Eviva.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;b&gt;Note:&lt;/b&gt;&lt;br /&gt;
&lt;/b&gt;This is a part of what I learn in an online Open Course Ware offered by MIT on &lt;a href=&quot;http://edx.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;edX&lt;/a&gt;&lt;br /&gt;
Its for my personal reference &amp;amp; also for those who have missed the course.&lt;br /&gt;
You too can enroll yourself on &lt;a href=&quot;http://edx.org/&quot; target=&quot;_blank&quot;&gt;edX&lt;/a&gt; (if they are still offering the course MITx 6.00x)&amp;nbsp; &lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/7342051136958958278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/7342051136958958278'/><link rel='alternate' type='text/html' href='http://rookieslab.blogspot.com/2012/12/learning-python-finding-roots-advanced.html' title='Finding Roots - Advanced (in Python)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05336645400007023377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5966303661451578311.post-936753510238974721</id><published>2012-12-20T22:32:00.002+05:30</published><updated>2013-01-03T01:14:54.096+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'> Linear Search v/s Bisection (Binary) Search </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Linear Search:&lt;/b&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;It is a sequential search over a list.&lt;/li&gt;
&lt;li&gt;A simple searching technique.&lt;/li&gt;
&lt;li&gt;Used when elements in the list are Unsorted.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Its not efficient. (Efficiency discussed below)&amp;nbsp;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;Explanation:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Say we have a list [4, 8, 45, 24, 10, 32, 9, 56]&lt;/li&gt;
&lt;li&gt;We are searching for 32.&lt;/li&gt;
&lt;li&gt;In Linear Search we&#39;ll go through all the elements of the list &amp;amp; compare if its equal to 32&lt;/li&gt;
&lt;li&gt;If not, then proceed to next element, else if yes then return the position of 32.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;def linear(n):
     s = [4,8,45,24,10,32,9,56]
     iterations = 0
     for i in s:
          iterations += 1
          if i == n:
               print &#39;iterations&#39;,&#39;=&#39;,str(iterations)
               return
     print str(n),&#39;not found&#39;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;Output:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; linear(32)&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;iterations = 6 &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;#compare with the iterations of Bisection Search&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; linear(22)&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;22 not found&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Bisection (Binary) Search:&lt;/b&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Used when list is Sorted.&lt;/li&gt;
&lt;li&gt;A more efficient way of Searching&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;Explanation: &lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Say we have a list [4, 8, 9, 10, 24, 32, 45, 56]&lt;/li&gt;
&lt;li&gt;We are searching for 32.&lt;/li&gt;
&lt;li&gt;Divide list in two halves, &amp;amp; compare 32 with the middle element&lt;/li&gt;
&lt;li&gt;32&amp;gt;25, therefore neglect first half, i.e. our list becomes [&lt;strike&gt;4, 8, 9, 10, 24, &lt;/strike&gt;32, 45, 56]&lt;/li&gt;
&lt;li&gt;Now our list is [32, 45, 56]&lt;/li&gt;
&lt;li&gt;Compare 32 again with middle element, 32 &amp;lt; 45&lt;/li&gt;
&lt;li&gt;So list becomes&amp;nbsp;  [32,&lt;strike&gt; 45, 56]&lt;/strike&gt;&lt;/li&gt;
&lt;li&gt;[32] is our list now, 32 = 32.&lt;/li&gt;
&lt;li&gt;Hence 32 found&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;brush: python&quot;&gt;def bisection(n):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s = [4,8,9,10,24,32,45,56]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; iterations = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; low = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; high = len(s)-1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ans = (high + low)/2
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; iterations += 1 #because we&#39;ve already divided list in half at this point
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while s[ans] != n:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if&amp;nbsp; s[ans] &amp;lt; n:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; low = ans + 1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; high = ans
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ans = (high + low)/2
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; iterations += 1 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print &#39;iterations = &#39;,str(iterations)&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;Output:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; bisection(32)&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;iterations =&amp;nbsp; 2&lt;/span&gt;&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;#compare with the iterations of Linear Search&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Points to note between Linear Search &amp;amp; Bisection Search:&lt;/b&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Note that we cut down the list in half each time we compare 32 with any element, while in Linear Search we kept on searching through whole list. &lt;/li&gt;
&lt;li&gt;Hence Bisection Search is way better than Linear Search.&lt;/li&gt;
&lt;li&gt;There is technical term to say this, &#39;Complexity&#39;, &amp;amp; represented as O()&lt;/li&gt;
&lt;li&gt;Complexity of Linear Search is O(n), where n is the number of elements in the list.&lt;/li&gt;
&lt;li&gt;Complexity of Bisection Search is O(log n) &lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;&lt;b&gt;Note:&lt;/b&gt;&lt;br /&gt;
&lt;/b&gt;This is a part of what I learn in an online Open Course Ware offered by MIT on &lt;a href=&quot;http://edx.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;edX&lt;/a&gt;&lt;br /&gt;
Its for my personal reference &amp;amp; also for those who have missed the course.&lt;br /&gt;
You too can enroll yourself on &lt;a href=&quot;http://edx.org/&quot; target=&quot;_blank&quot;&gt;edX&lt;/a&gt; (if they are still offering the course MITx 6.00x) &lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;/ul&gt;
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/936753510238974721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/936753510238974721'/><link rel='alternate' type='text/html' href='http://rookieslab.blogspot.com/2012/12/linear-search-vs-bisection-search-algorithm-python-code.html' title=' Linear Search v/s Bisection (Binary) Search '/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05336645400007023377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5966303661451578311.post-1530735778366135395</id><published>2012-12-20T18:02:00.000+05:30</published><updated>2013-01-03T01:14:33.550+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="edX"/><category scheme="http://www.blogger.com/atom/ns#" term="MIT 6.00x"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>Finding Square Root: Examples of Guess &amp; Check  Algorithm</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&quot;Guess and Check&quot; - The phrase itself says that we will guess the answer and check, if condition is satisfied, that guess is our answer, else iterate.&lt;br /&gt;
&lt;br /&gt;
An example for this can be, lets say we want to find square root of any perfect square. &lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;#ask user for the number whose square root is to be found
x = int(raw_input(&#39;Enter an integer : &#39;)) 
if x &amp;lt; 0: #if the number entered by user was negative
    print &#39;Square of any number cannot be negative&#39;
else:
    ans = 0
     
    #following while loop checks if square of our guess exceeds the actual number
    while ans**2 &amp;lt; abs(x):  #abs() is explained below
        ans = ans + 1 #iterating &#39;ans&#39;
     
    #if square of ans is not equals to actual number, then x is not a perfect square
    if ans**2 != abs(x):
        print(str(x) + &#39; is not a perfect square&#39;)
    else:
        print(&#39;Square root of &#39; + str(x) + &#39; is &#39; + str(ans))&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;Enter an integer: -25&lt;br /&gt;Square of any number cannot be negative&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; &lt;br /&gt;Enter an integer : 25&lt;br /&gt;Square root of 25 is 5&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; &lt;br /&gt;Enter an integer : 24&lt;br /&gt;24 is not a perfect square&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;How &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;abs()&lt;/span&gt;works:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; abs(10)
10
&amp;gt;&amp;gt;&amp;gt; abs(-10)
10
&amp;gt;&amp;gt;&amp;gt; abs(10.11)
10.11
&amp;gt;&amp;gt;&amp;gt; abs(-10.11)
10.11
&amp;gt;&amp;gt;&amp;gt; abs(0.003)
0.003
&amp;gt;&amp;gt;&amp;gt; abs(-0.003)
0.003&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;How to find Square Root of number that is not a perfect square?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
For this we will need the accuracy upto what decimal points do we need the answer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;x = 25 #we are finding square root of 25
epsilon = 0.01 #used for accuracy. See the condition in While Loop
step = epsilon**2 #used to increment our guess &#39;ans&#39;
numGuesses = 0
ans = 0.0
while (abs(ans**2 - x)) &amp;gt;= epsilon and ans &amp;lt;= x:
&amp;nbsp;&amp;nbsp;&amp;nbsp; ans += step # same as &#39;ans = ans+step&#39;
&amp;nbsp;&amp;nbsp;&amp;nbsp; numGuesses += 1
print(&#39;numGuesses = &#39; + str(numGuesses))
if abs(ans**2-x) &amp;gt;= epsilon:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print(&#39;Failed on square root of &#39; + str(x))
else:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print(str(ans) + &#39; is close to the square root of &#39; + str(x))&lt;/pre&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;Output:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;numGuesses = 49990&lt;br /&gt;4.999 is close to the square root of 25&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;b&gt;Note:&lt;/b&gt;&lt;br /&gt;
&lt;/b&gt;This is a part of what I learn in an online Open Course Ware offered by MIT on &lt;a href=&quot;http://edx.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;edX&lt;/a&gt;&lt;br /&gt;
Its for my personal reference &amp;amp; also for those who have missed the course.&lt;br /&gt;
You too can enroll yourself on &lt;a href=&quot;http://edx.org/&quot; target=&quot;_blank&quot;&gt;edX&lt;/a&gt; (if they are still offering the course MITx 6.00x) &lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/1530735778366135395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/1530735778366135395'/><link rel='alternate' type='text/html' href='http://rookieslab.blogspot.com/2012/12/finding-square-root-guess-and-check-method-in-python.html' title='Finding Square Root: Examples of Guess &amp; Check  Algorithm'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05336645400007023377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5966303661451578311.post-1863623654022471750</id><published>2012-12-20T15:39:00.000+05:30</published><updated>2013-01-03T01:14:18.776+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="edX"/><category scheme="http://www.blogger.com/atom/ns#" term="MIT 6.00x"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>Iteration or Looping</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;Iteration:&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhghy1CJjAVYHCFT1L6VrzsGxbdZ-2MEqj4uAzi-6LzOM3JltsRHfNYemAKnz5TkEL_zZzfqJCt-s0ncRTrpdgB77JFZneJoTo9XYtdffxJzriCytDSw5_pA5aRsL-Wrs_V60xADU7sYFsT/s1600/iteration.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Iteration, Repetition, Looping&quot; border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhghy1CJjAVYHCFT1L6VrzsGxbdZ-2MEqj4uAzi-6LzOM3JltsRHfNYemAKnz5TkEL_zZzfqJCt-s0ncRTrpdgB77JFZneJoTo9XYtdffxJzriCytDSw5_pA5aRsL-Wrs_V60xADU7sYFsT/s320/iteration.jpg&quot; title=&quot;Iteration, Repetition, Looping&quot; width=&quot;222&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Start       with       a       test&lt;/li&gt;
&lt;li&gt;If       evaluates       to       True,       then       execute loop       body       once,       and       go       back       to       reevaluate       the       test&lt;/li&gt;
&lt;li&gt;Repeat       until       test       evaluates       to       False,       after       which       code       following       iteration       statement       is       executed&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Taking an example to understand this would be more easy.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush: python&quot;&gt;x = 1
ans = 0
upto = 10
while (x != upto+1): #looping condition, explained below
&amp;nbsp;&amp;nbsp;&amp;nbsp; ans = ans + x
&amp;nbsp;&amp;nbsp;&amp;nbsp; x = x+1 #incrementing x by 1 each time
print &#39;Sum of first&#39;,str(upto),&#39;numbers is&#39;,str(ans)&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;Output:Sum of first 10 numbers is 55 &lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
Line#4: the &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;while&lt;/span&gt; loop will be repetitively executed unless x becomes equals to 11. Hence while loop is iterated 10 times for &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;x=1, x=2,.......x=10&lt;/span&gt; and when &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;x=11&lt;/span&gt;, condition becomes &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;False&lt;/span&gt; &amp;amp; hence execution comes out of &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;while&lt;/span&gt; loop &amp;amp; executes the &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;print&lt;/span&gt; statement.&lt;br /&gt;
&lt;br /&gt;
In programming we can write code in many different ways. Above code can also be written as.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;ans = 0
for x in range(1,11): #range() function explained below
&amp;nbsp;&amp;nbsp;&amp;nbsp; ans = ans + x
print &#39;Sum of first&#39;,str(x),&#39;numbers is&#39;,str(ans)
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;Output:Sum of first 10 numbers is 55&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;
&lt;b&gt;How &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;range() &lt;/span&gt;works:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; range(10) #returns a list that contains numbers from 0 to (10-1)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]  #its called a &#39;list&#39;
&amp;gt;&amp;gt;&amp;gt; range(1,10) #here we forcefully tell range() to start from 1 &amp;amp; end before 10
[1, 2, 3, 4, 5, 6, 7, 8, 9]
&amp;gt;&amp;gt;&amp;gt; range(1,11)
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
&amp;gt;&amp;gt;&amp;gt; range(1,11,2) # 2 says that it will jump 2 steps. 2 is called &#39;step argument&#39;
[1, 3, 5, 7, 9]
&amp;gt;&amp;gt;&amp;gt; range(1,11,3) # 3 makes it jump 3 numbers
[1, 4, 7, 10]
&lt;/pre&gt;
&lt;br /&gt;
Now Line#2: &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;for x in range(1,11):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Since &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;range (1,11)&lt;/span&gt; returns a &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;list&lt;/span&gt; of &lt;/span&gt;numbers from 1 to 10,&lt;br /&gt;
So when loop is executed for the first time, x = 1&lt;br /&gt;
On 2nd iteration, x = 2...... this goes on &amp;amp; finally after 10th iteration x=10,&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; for&lt;/span&gt; loop ends.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;What to use &amp;amp; When?&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Use &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;while&lt;/span&gt; when you don&#39;t know the number of times the loop should repeat. Its only used when you know the condition when loop should break.&lt;/li&gt;
&lt;li&gt;Use &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;for&lt;/span&gt; when you know the fixed number of times the loop should repeat.&lt;b&gt; &lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;&lt;b&gt;&lt;b&gt;Note:&lt;/b&gt;&lt;br /&gt;
&lt;/b&gt;This is a part of what I learn in an online Open Course Ware offered by MIT on &lt;a href=&quot;http://edx.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;edX&lt;/a&gt;&lt;br /&gt;
Its for my personal reference &amp;amp; also for those who have missed the course.&lt;br /&gt;
You too can enroll yourself on &lt;a href=&quot;http://edx.org/&quot; target=&quot;_blank&quot;&gt;edX&lt;/a&gt; (if they are still offering the course MITx 6.00x) 
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/1863623654022471750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/1863623654022471750'/><link rel='alternate' type='text/html' href='http://rookieslab.blogspot.com/2012/12/learning-python-iteration-or-looping-for-loop-while-loop.html' title='Iteration or Looping'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05336645400007023377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhghy1CJjAVYHCFT1L6VrzsGxbdZ-2MEqj4uAzi-6LzOM3JltsRHfNYemAKnz5TkEL_zZzfqJCt-s0ncRTrpdgB77JFZneJoTo9XYtdffxJzriCytDSw5_pA5aRsL-Wrs_V60xADU7sYFsT/s72-c/iteration.jpg" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5966303661451578311.post-4520027855126782189</id><published>2012-12-20T01:34:00.001+05:30</published><updated>2013-01-04T03:08:04.443+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="edX"/><category scheme="http://www.blogger.com/atom/ns#" term="MIT 6.00x"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>Branching Program: Using if, if else, nested if else, elif in Python</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Branching       programs       &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The       simplest       branching       statement       is       a       conditon&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhpmFP80UN6pyzbHuScdenc5PqsLgUSq4l9d8PQtjje4sjIo6mRmUezNlmGQ1443rq-LVYwxRCTbI0_ugPuTlRglvrijMc4IZueQEs7JNhQzh31mXbba-nAlKDElMXjy8NXPnDt9xbqkFt/s1600/branching.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;How to use if else, elif&quot; border=&quot;0&quot; height=&quot;302&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhpmFP80UN6pyzbHuScdenc5PqsLgUSq4l9d8PQtjje4sjIo6mRmUezNlmGQ1443rq-LVYwxRCTbI0_ugPuTlRglvrijMc4IZueQEs7JNhQzh31mXbba-nAlKDElMXjy8NXPnDt9xbqkFt/s320/branching.jpg&quot; title=&quot;Using if else branching&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;A       test       (expression       that       evaluates       to       True or       False)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;A       block       of       code       to       execute&lt;/li&gt;
&lt;li&gt;if       the       test       is       True!&lt;/li&gt;
&lt;li&gt;An       optional       block       of       code       to       execute       if       the       test       is False!&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
A       simple       example&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;pre class=&quot;brush: python&quot;&gt;x = int(raw_input(&#39;Enter an integer: &#39;))
if x%2 == 0:  # % (modulo) returns the remainder when x/2
    print(‘’)
    print(&#39;Even&#39;)
else:
    print(‘’)
    print(&#39;Odd&#39;)
print(’Done with conditional&#39;)&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
&lt;b&gt;Some       observations       &lt;/b&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;The       expression       x%2 == 0 evaluates       to       True when       the       remainder       of       x divided       by       2 is       0!&lt;/li&gt;
&lt;li&gt;Note       that       == is       used       for       comparison,       since       = is reserved       for       assignment       &lt;/li&gt;
&lt;li&gt;The       indentation       is       important       –       each       indented       set of       expressions       denotes       a       block       of       instructions       &lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;For       example,       if       the       last       statement       were       indented,       it would       be       executed       as       part       of       the       else block       of       code       &lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Note       how       this       indentation       provides       a       visual structure       that       reflects       the       semantic       structure       of the       program       &lt;/li&gt;
&lt;/ul&gt;
We       can       have       nested       conditions       &lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;if x%2 == 0:
    if x%3 == 0:
        print(&#39;Divisible by 2 and 3’)
    else:
        print(&#39;Divisible by 2 and not by 3’)
elif x%3 == 0:
    print(&#39;Divisible by 3 and not by 2’)&lt;/pre&gt;
&lt;br /&gt;
And       we       can       use       compound       Boolean       &lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;if x &amp;lt; y and x &amp;lt; z:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print(&#39;x is least’)
elif y &amp;lt; z:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print(&#39;y is least’)
else:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print(&#39;z is least’)&lt;/pre&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Branching       programs       allow       us       to       make       choices and       do       different       things       &lt;/li&gt;
&lt;li&gt;But       still       the       case       that       at       most,       each       statement gets       executed       once.       &lt;/li&gt;
&lt;li&gt;So       maximum time       to       run       the       program depends       only       on       the       length       of       the       program       &lt;/li&gt;
&lt;li&gt;These       programs       run       in       constant time&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;&lt;b&gt;Note:&lt;/b&gt;&lt;br /&gt;
&lt;/b&gt;This is a part of what I learn in an online Open Course Ware offered by MIT on &lt;a href=&quot;http://edx.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;edX&lt;/a&gt;&lt;br /&gt;
Its for my personal reference &amp;amp; also for those who have missed the course.&lt;br /&gt;
You too can enroll yourself on &lt;a href=&quot;http://edx.org/&quot; target=&quot;_blank&quot;&gt;edX&lt;/a&gt; (if they are still offering the course MITx 6.00x) &lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/4520027855126782189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/4520027855126782189'/><link rel='alternate' type='text/html' href='http://rookieslab.blogspot.com/2012/12/branching-program-using-if-if-else-nested-if-else-elif.html' title='Branching Program: Using if, if else, nested if else, elif in Python'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05336645400007023377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhpmFP80UN6pyzbHuScdenc5PqsLgUSq4l9d8PQtjje4sjIo6mRmUezNlmGQ1443rq-LVYwxRCTbI0_ugPuTlRglvrijMc4IZueQEs7JNhQzh31mXbba-nAlKDElMXjy8NXPnDt9xbqkFt/s72-c/branching.jpg" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5966303661451578311.post-6810810352037809927</id><published>2012-12-20T01:11:00.001+05:30</published><updated>2012-12-30T19:35:06.261+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="edX"/><category scheme="http://www.blogger.com/atom/ns#" term="MIT 6.00x"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>Operations on String &amp; some Simple Program Scripts</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;How to declare a string:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; myString = &quot;We are learning&quot; #double quotes are necessary
&amp;gt;&amp;gt;&amp;gt; myStr2 = &#39;Python&#39; #even a single quote can be used
&amp;gt;&amp;gt;&amp;gt; print myString #print a Python in-built function
We are learning
&amp;gt;&amp;gt;&amp;gt; myString
&#39;We are learning&#39; #single quote indicates that variable myString is a string
&amp;gt;&amp;gt;&amp;gt; myStr2
&#39;Python&#39;&lt;/pre&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;Operations on String:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; print myString + myStr2
We are learningPython
&amp;gt;&amp;gt;&amp;gt; print myString + &#39; &#39; + myStr2
We are learning Python
&amp;gt;&amp;gt;&amp;gt; print myString, myStr2 #comma leaves a space between them
We are learning Python
&amp;gt;&amp;gt;&amp;gt; 3*&#39;x&#39;
&#39;xxx&#39;
&amp;gt;&amp;gt;&amp;gt; &#39;x&#39;+&#39;x&#39;
&#39;xx&#39;
&amp;gt;&amp;gt;&amp;gt; &#39;x&#39;+str(3) #note that 3 is converted to string by Type Casting
&#39;x3&#39;
&amp;gt;&amp;gt;&amp;gt; len(&#39;xyz&#39;) #len() in Python in-built that returns the length of string or list
3&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Extracting Parts of String:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; s = &#39;xyz&#39;
&amp;gt;&amp;gt;&amp;gt; s[0] # its called indexing
&#39;x&#39;
&amp;gt;&amp;gt;&amp;gt; s[1]
&#39;y&#39;
&amp;gt;&amp;gt;&amp;gt; s[2]
&#39;z&#39;
&amp;gt;&amp;gt;&amp;gt; s[-1]
&#39;z&#39;
&amp;gt;&amp;gt;&amp;gt; s[-2]
&#39;y&#39;
&amp;gt;&amp;gt;&amp;gt; s[-3]
&#39;x&#39;
&amp;gt;&amp;gt;&amp;gt; s[1:3]  # its called Slicing. Explained below
&#39;yz&#39;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;s[a:b]&lt;/span&gt; will start from&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; s[a]&lt;/span&gt; &amp;amp; prints upto &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;s[b-1]&lt;/span&gt;..so here it prints from &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;s[1] &lt;/span&gt;to &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;s[2]&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Taking Input from User:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; name = raw_input(&#39;Enter your name: &#39;)
#as soon as I run above line it shows following text
Enter your name:
#Now When I type my name &amp;amp; press Enter
Enter your name: Ravi Ojha
&amp;gt;&amp;gt;&amp;gt; name
&#39;Ravi Ojha&#39;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Related Articles:&lt;br /&gt;
&lt;a href=&quot;http://www.rookieslab.com/2012/12/learnign-python-objects-of-python-tuples.html&quot; target=&quot;_blank&quot;&gt;Python Objects: What are Tuples and Indexing &amp;amp; Slicing of Tuples&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.rookieslab.com/2012/12/python-objects-dictionary-dict-examples-insertion-lists.html&quot; target=&quot;_blank&quot;&gt;Python Objects: Dictionary (dict) &lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.rookieslab.com/2012/12/python-objects-lists-mutation-of-list.html&quot; target=&quot;_blank&quot;&gt;Lists and Mutation of Lists with examples&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;Note:&lt;/b&gt;&lt;br /&gt;
This is a part of what I learn in an online Open Course Ware offered by MIT on &lt;a href=&quot;http://edx.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;edX&lt;/a&gt;&lt;br /&gt;
Its for my personal reference &amp;amp; also for those who have missed the course.&lt;br /&gt;
You too can enroll yourself on &lt;a href=&quot;http://edx.org/&quot; target=&quot;_blank&quot;&gt;edX&lt;/a&gt; (if they are still offering the course MITx 6.00x
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/6810810352037809927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/6810810352037809927'/><link rel='alternate' type='text/html' href='http://rookieslab.blogspot.com/2012/12/operations-on-string-some-simple.html' title='Operations on String &amp; some Simple Program Scripts'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05336645400007023377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5966303661451578311.post-3293475978830267103</id><published>2012-12-20T00:27:00.001+05:30</published><updated>2013-01-03T01:12:00.062+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="edX"/><category scheme="http://www.blogger.com/atom/ns#" term="MIT 6.00x"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>Core Elements of Program: Compilation, Interpretation, Objects, Type Casting</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
For a code to run on your machine, machine should first understand the code and run the script accordingly.&lt;br /&gt;
&lt;br /&gt;
There are two options for modern &lt;a href=&quot;http://en.wikipedia.org/wiki/High-level_programming_language&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;high level programming languages&lt;/a&gt;. A compiled language or an interpreted language.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1. Compiled Language:&lt;/b&gt; Your code is first converted into &lt;a href=&quot;http://en.wikipedia.org/wiki/Low-level_programming_language&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Low Level&lt;/a&gt; instructions which in turn are executed when the script is run. &lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTnNNXcQ6f2MwxQykYSAeXPJI1-sWMXmG12L8oXEzDxByyszGH13hFu0sgmKw1WcUoBsvXPlEKi2tKoI2sNgKLKagurf3VlkxvimnEodFYVtnYegkBpjdTb_JYrzsAvk73dEKxl-YJiz1E/s1600/Compiler.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Compiler Object Code Executable&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTnNNXcQ6f2MwxQykYSAeXPJI1-sWMXmG12L8oXEzDxByyszGH13hFu0sgmKw1WcUoBsvXPlEKi2tKoI2sNgKLKagurf3VlkxvimnEodFYVtnYegkBpjdTb_JYrzsAvk73dEKxl-YJiz1E/s1600/Compiler.png&quot; title=&quot;High Level Programming Language&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Just so you know, &#39;Checker&#39; checks for &lt;a href=&quot;http://www.rookieslab.com/2012/12/learning-python-edx-mitx-600x-lec-1-summary-revision.html&quot; rel=&quot;&quot; target=&quot;_blank&quot;&gt;static semantic errors&lt;/a&gt; (Refer to 3rd point, &lt;i&gt;Aspects of Language&lt;/i&gt; of &lt;a href=&quot;http://www.rookieslab.com/2012/12/learning-python-edx-mitx-600x-lec-1-summary-revision.html&quot; target=&quot;_blank&quot;&gt;this link&lt;/a&gt;).&lt;br /&gt;
&lt;br /&gt;
&#39;Compiler&#39; produces an object code, &#39;Interpreter&#39; runs the object code line by line &amp;amp; hence produces the Output.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;2. Interpreted Language:&lt;/b&gt; &lt;span style=&quot;font-size: small;&quot;&gt;As shown in following flow chart, Interpreted Language sequentially converts each step into low level machine instruction and executes. &lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Python&lt;/span&gt; be&lt;span style=&quot;font-size: small;&quot;&gt;longs t&lt;span style=&quot;font-size: small;&quot;&gt;o this &lt;span style=&quot;font-size: small;&quot;&gt;type o&lt;span style=&quot;font-size: small;&quot;&gt;f Programm&lt;span style=&quot;font-size: small;&quot;&gt;ing Language.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJz_AjH7nlbcr64P1gJlLS7z6M5lyW2OBMF6HlyUYjOct5rfCwthlwbe5B83JBb5BbtdYvssz6AJR19RBqBkAOkLRlwq8yfATx9TXuBbx7sLsEE2qQxZuSh2WcvYVcwGOMAXnHa1Z0tPZY/s1600/Interpreter.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Interpreted Language Flow chart&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJz_AjH7nlbcr64P1gJlLS7z6M5lyW2OBMF6HlyUYjOct5rfCwthlwbe5B83JBb5BbtdYvssz6AJR19RBqBkAOkLRlwq8yfATx9TXuBbx7sLsEE2qQxZuSh2WcvYVcwGOMAXnHa1Z0tPZY/s1600/Interpreter.png&quot; title=&quot;Interpreted Programming Language&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
I recommend you to read this discussion on &lt;a href=&quot;http://stackoverflow.com/questions/6889747/is-python-interpreted-or-compiled-or-both&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Whether Python is Compiled or Interpreted&lt;/a&gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Part B:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Objects:&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Scalar: (Discussed Below)&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;integers -&amp;nbsp; &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;font-family: inherit;&quot;&gt;eg.: 3 or 90756&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;decimal - &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;float &lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;eg.: 99.5 or 0.0007&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;boolean - &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;bool &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;it&lt;/span&gt; can either True or False&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Non Scalar: (Discissed here)&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;strings - &#39;abc&#39; &lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;list - [1,2,3,4,5,6]&lt;/li&gt;
&lt;li&gt;dictionary - {&#39;Jan&#39;:1, &#39;Feb&#39;:2, .........so on... &#39;1&#39;:Jan, &#39;2&#39;:Feb......so on}&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;pre class=&quot;brush: python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; a = 5 #This statement is called assignment since 5 is being assigned 
&amp;gt;&amp;gt;&amp;gt; a #since 5 is int, &#39;a&#39; is called int variable.
5
&amp;gt;&amp;gt;&amp;gt; b = 3.33
&amp;gt;&amp;gt;&amp;gt; b
3.33
&amp;gt;&amp;gt;&amp;gt; type(6) #type() is an in-built function that returns &#39;type&#39; of value passed in
&amp;lt;type &#39;int&#39;&amp;gt;
&amp;gt;&amp;gt;&amp;gt; type(a)
&amp;lt;type &#39;int&#39;&amp;gt;
&amp;gt;&amp;gt;&amp;gt; type(7.166666)
&amp;lt;type &#39;float&#39;&amp;gt;
&amp;gt;&amp;gt;&amp;gt; type(b)
&amp;lt;type &#39;float&#39;&amp;gt; 
&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Operations on &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;int&lt;/span&gt; &amp;amp; &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;float&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; 6+3 #addition
9
&amp;gt;&amp;gt;&amp;gt; 5-4 #subtraction
1
&amp;gt;&amp;gt;&amp;gt; 6*4 #multiplication
24
&amp;gt;&amp;gt;&amp;gt; 18/2 #division
9
&amp;gt;&amp;gt;&amp;gt; 6*6 
36
&amp;gt;&amp;gt;&amp;gt; 6**2 #raise to the power. 6 to the power 2
36
&amp;gt;&amp;gt;&amp;gt; 3.14*20
62.800000000000004
&amp;gt;&amp;gt;&amp;gt; (2+3)*4 # parentheses has the highest priority 
20
&amp;gt;&amp;gt;&amp;gt; 2+3*4
14&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
In absence of parentheses,&amp;nbsp; priority order is: &lt;b&gt;**&lt;/b&gt; has highest,then&lt;b&gt; *&lt;/b&gt; and&amp;nbsp;&lt;b&gt; /&lt;/b&gt;, then &lt;b&gt;+&lt;/b&gt; and &lt;b&gt;-&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Comaprisons&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;i &amp;gt; j&amp;nbsp;&lt;/span&gt;&amp;nbsp; -&amp;nbsp;&amp;nbsp; returns True if strictly greater than&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;i &amp;gt;= j&amp;nbsp; &lt;/span&gt;-&amp;nbsp; returns True if greater than or equal&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;i &amp;lt; j&lt;/span&gt;&amp;nbsp; -&amp;nbsp; returns True if strictly less than&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;i &amp;lt;= j&amp;nbsp;&lt;/span&gt; -&amp;nbsp; returns True if less than or equal&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;i == j&amp;nbsp;&lt;/span&gt; -&amp;nbsp; returns True if equal&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;i != j&lt;/span&gt;&amp;nbsp; -&amp;nbsp; returns True if not equal&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;Operators on &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;bools&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;/span&gt;&lt;/b&gt;a &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;and&lt;/span&gt; b is       True if       both       are       True&amp;nbsp;&lt;/li&gt;
&lt;li&gt;a &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;or&lt;/span&gt; b is       True if       at       least       one       is       True&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;not&lt;/span&gt; a is       True if       a is       False;       it       is       False if       a is       True &lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;Type Conversions (Type Casting)&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;pre class=&quot;brush: python&quot;&gt;&amp;gt;&amp;gt;&amp;gt; float(5) #makes 5 a float
5.0
&amp;gt;&amp;gt;&amp;gt; int(4.555) #it returns the integer part of the number
4
&amp;gt;&amp;gt;&amp;gt; int(4.444)
4
&amp;gt;&amp;gt;&amp;gt; round(4.555)
5.0
&amp;gt;&amp;gt;&amp;gt; round(4.444) &lt;/pre&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Note the difference between &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;int()&lt;/span&gt; and&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt; round()&lt;/span&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
This is a part of what I learn in an online Open Course Ware offered by MIT on &lt;a href=&quot;http://edx.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;edX&lt;/a&gt;&lt;br /&gt;
Its for my personal reference &amp;amp; also for those who have missed the course.&lt;br /&gt;
You too can enroll yourself on &lt;a href=&quot;http://edx.org/&quot; target=&quot;_blank&quot;&gt;edX&lt;/a&gt; (if they are still offering the course MITx 6.00x)&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;span class=&quot;item-control blog-admin pid-262715156&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;post-icons&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/3293475978830267103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/3293475978830267103'/><link rel='alternate' type='text/html' href='http://rookieslab.blogspot.com/2012/12/compilers-interpreters-objects-in-python-operators-comparisons.html' title='Core Elements of Program: Compilation, Interpretation, Objects, Type Casting'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05336645400007023377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTnNNXcQ6f2MwxQykYSAeXPJI1-sWMXmG12L8oXEzDxByyszGH13hFu0sgmKw1WcUoBsvXPlEKi2tKoI2sNgKLKagurf3VlkxvimnEodFYVtnYegkBpjdTb_JYrzsAvk73dEKxl-YJiz1E/s72-c/Compiler.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5966303661451578311.post-6214774644827487197</id><published>2012-12-19T17:02:00.000+05:30</published><updated>2012-12-30T19:34:38.798+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="edX"/><category scheme="http://www.blogger.com/atom/ns#" term="MIT 6.00x"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>Syntax, Static Semantics, Semantics of a Language</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
As the title suggests &#39;Learning Python&#39; &amp;amp; also &lt;a href=&quot;https://www.edx.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;MIT&#39;s 6.00x course&lt;/a&gt;&#39;s Revision, we hereby will go through every aspect of the course as quickly as possible along with some frequently used Python tools.&lt;br /&gt;
&lt;br /&gt;
I take this opportunity as a part of the Final Exam preparation. So we&#39;ll include all exam oriented points from the courseware. Best way to revise is to recall examples rather than going through all theory stuff.&lt;br /&gt;
&lt;br /&gt;
Here we go.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Lecture 1&lt;/u&gt;:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Three main points to note.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1. Knowledge:&lt;/b&gt; Declarative Knowledge &amp;amp; Imperative knowledge.&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Declarative knowledge is statement of facts.&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;for eg: &lt;span class=&quot;selflink&quot;&gt;&lt;span class=&quot;texhtml&quot;&gt;π = 3.14. Its a fact.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;div style=&quot;text-align: right;&quot;&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span class=&quot;selflink&quot;&gt;&lt;span class=&quot;texhtml&quot;&gt;Imperative knowledge is the method on how you reached to that fact.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class=&quot;selflink&quot;&gt;&lt;span class=&quot;texhtml&quot;&gt;for eg:&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;selflink&quot;&gt;&lt;span class=&quot;texhtml&quot;&gt;π = circumference of any circle/diameter of that circle&lt;/span&gt;&lt;/span&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;2. Computer Program:&lt;/b&gt; Fixed Computer Program &amp;amp; Stored Computer Program&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Fixed CP computes precisely only computation&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;for eg: while playing computer games a missile tracks you down if you fly over a &#39;Non-Civilian&#39; area. That missile is an example of fixed computer program.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Stored CP&amp;nbsp; computes computes a set of instructions&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;for eg: a calculator&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;b&gt;3. Aspects of Language:&amp;nbsp; &lt;/b&gt;Syntax, Static Semantics &amp;amp; Semantics&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Syntax:&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;for eg: &quot;Mouse Cat Dog&quot; is not in a correct syntax as far as English language is concerned.&lt;/li&gt;
&lt;li&gt;Same way there is a particular syntax in any other language. We&#39;ll consider Python syntaxes later as we proceed, as for now &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;3.2 + 3.2&lt;/span&gt; is a syntactically valid statement.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Static Semantics: Whether syntactically valid statements have any meaning.&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;for eg: &quot;I are big&quot;... the syntax is correct, but there&#39;s a static semantic error that we know as grammatical error.&lt;/li&gt;
&lt;li&gt;Similarly &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;3/&#39;three&#39; &lt;/span&gt;is a static semantic error in Python because &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;int 3&lt;/span&gt; is being divided by string &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&#39;three&#39;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Semantics: There should not be more than one meaning associated with any statement because computer cannot figure out what meaning to consider then.&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;for eg: In English if I say &quot;I&#39;m having a friend for dinner&quot; :p can be interpreted in two different ways. Such things should not, or I should say cannot happen in computer languages like Python.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;b&gt;Note:&lt;/b&gt;&lt;br /&gt;
This is a part of what I learn in an online Open Course Ware offered by MIT on &lt;a href=&quot;http://edx.org/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;edX&lt;/a&gt;&lt;br /&gt;
Its for my personal reference &amp;amp; also for those who have missed the course.&lt;br /&gt;
You too can enroll yourself on &lt;a href=&quot;http://edx.org/&quot; target=&quot;_blank&quot;&gt;edX&lt;/a&gt; (if they are still offering the course MITx 6.00x)&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;ul&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/6214774644827487197'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/6214774644827487197'/><link rel='alternate' type='text/html' href='http://rookieslab.blogspot.com/2012/12/learning-python-edx-mitx-600x-lec-1-summary-revision.html' title='Syntax, Static Semantics, Semantics of a Language'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05336645400007023377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5966303661451578311.post-1160133734557760781</id><published>2012-11-30T15:59:00.000+05:30</published><updated>2014-12-19T23:48:31.249+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Graphic Design"/><category scheme="http://www.blogger.com/atom/ns#" term="Photo Editing"/><category scheme="http://www.blogger.com/atom/ns#" term="Portfolio"/><title type='text'>Hands on Photoshop/GIMP</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
As a part of design team of major events MindBend &amp;amp; Sparsh in my institution &lt;a href=&quot;http://svnit.ac.in/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;NIT Surat&lt;/a&gt; I&#39;ve designed following posters &amp;amp; a logo.&lt;br /&gt;
&lt;br /&gt;
This is one of my favorites because the only GIMP tool used is Pen Tool. Rest effects were given by Gradient &amp;amp; Shadow features&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdg4xBDU4OXJFatywl5MXJ60pXVct-TR_heuAgJDx2yY-TLzbgqS4vFDAJT_T1Zr_Wq_XLg5HqVyHw03xvM8M42WqNPvYn3LZBaPCZPX_2epOamhn_Jl8XO5boJd-n84nLnX79OrBhjdqe/s1600/_tail_coming_soon.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Sparsh 2013 SVNIT&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdg4xBDU4OXJFatywl5MXJ60pXVct-TR_heuAgJDx2yY-TLzbgqS4vFDAJT_T1Zr_Wq_XLg5HqVyHw03xvM8M42WqNPvYn3LZBaPCZPX_2epOamhn_Jl8XO5boJd-n84nLnX79OrBhjdqe/s400/_tail_coming_soon.jpg&quot; height=&quot;230&quot; title=&quot;Sparsh 2013&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Logo for annual cultural fest SPARSH: Theme &#39;Superheroes&#39;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following poster also illustrates the same stuff as above.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOBPBOoLGGwM20g_UcYjWelIBOi5rjVpSV56kxok4anDzVRxvFzyJnb8FBhpsQKLC01xM_f0ijXvIPd-BhCDf1G5qSX9nCTE8_e1oTvx2cWbLUR42qoXdPaqgHQa5oIpOJ4xda_wnGBl4A/s1600/poster_coming_soon.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Sparsh 2013 SVNIT&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOBPBOoLGGwM20g_UcYjWelIBOi5rjVpSV56kxok4anDzVRxvFzyJnb8FBhpsQKLC01xM_f0ijXvIPd-BhCDf1G5qSX9nCTE8_e1oTvx2cWbLUR42qoXdPaqgHQa5oIpOJ4xda_wnGBl4A/s400/poster_coming_soon.jpg&quot; height=&quot;286&quot; title=&quot;Sparsh 2013&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Coming Soon Poster based on above logo&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
This one was the first poster I ever made.. &amp;amp; I love it. See the slanted 1010101 &amp;amp; other text in background.. I literally wrote it down in MS Word. Took a screenshot &amp;amp; then utilized them here. Ankit Fadia&#39;s pic is copied from his website :p&amp;nbsp; &lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnJ4lUkNtfTzI3JFdfjUhyphenhyphenVj-uJ52fo5ovCt_PknQw4oLxVUG552XpIcdPVdLAw0iWEVneoT-MnvDCwyqpxG7sckVONdAZ7EQc4PDf9oVPilapTSJwPHX1npcnAqLlCC8HmhHxptZrBLNH/s1600/full_bw_ethical_hacking.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;MindBend SVNIT&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnJ4lUkNtfTzI3JFdfjUhyphenhyphenVj-uJ52fo5ovCt_PknQw4oLxVUG552XpIcdPVdLAw0iWEVneoT-MnvDCwyqpxG7sckVONdAZ7EQc4PDf9oVPilapTSJwPHX1npcnAqLlCC8HmhHxptZrBLNH/s400/full_bw_ethical_hacking.jpg&quot; height=&quot;282&quot; title=&quot;Ankit fadia Poster&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Official Poster for MindBend 2012 Workshop&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Introductory poster for technical student chapter DRISHTI of NIT Surat. It looks a bit complex coz I 
merged a lot of images which is not considered good as valuable 
designer. So I don&#39;t like this one, however just posted all of it, the 
good, bad &amp;amp; ugly :)&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSMEf60pZ4Ri0cf6Z_GkfrQ3OJ4yNMrILQSW4ty9Gm4YzudgI49u2PyoUu2ITlNlHkwBM-KjP4VhDSQJ3nedh6paz-kHNBy2c-rsNQQbnDfMyeBm_CZbDZDeppiSp7F9yisRe51nUEnZo-/s1600/Drishti_for_blog.jpg&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;MindBend Drishti SVNIT&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSMEf60pZ4Ri0cf6Z_GkfrQ3OJ4yNMrILQSW4ty9Gm4YzudgI49u2PyoUu2ITlNlHkwBM-KjP4VhDSQJ3nedh6paz-kHNBy2c-rsNQQbnDfMyeBm_CZbDZDeppiSp7F9yisRe51nUEnZo-/s400/Drishti_for_blog.jpg&quot; height=&quot;281&quot; title=&quot;MindBend Drishti SVNIT&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Introductory Poster for Technical Student Chapter DRISHTI&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Workshop on Touchscreen &amp;amp; similar stuff. Idea was to reflect the 
touch-pad look &amp;amp; did so successfully by background that has squares 
of different sizes resembling touch screens.. Overall makes a 
touchy-geeky look.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfnvuwTVkgmxdTe6c4qRomC8GtezFffvMfAL_mX2DRl60jFPucD-ttc017L1d6rOdzeixBr3p785DFPJSVm2-apXvN-5_Hi0_QjsV86HTh61uDX45V1fn17iUnthk1U7W3TMvmZCpZjWir/s1600/touchscreen.jpg&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;MindBend SVNIT Workshop&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfnvuwTVkgmxdTe6c4qRomC8GtezFffvMfAL_mX2DRl60jFPucD-ttc017L1d6rOdzeixBr3p785DFPJSVm2-apXvN-5_Hi0_QjsV86HTh61uDX45V1fn17iUnthk1U7W3TMvmZCpZjWir/s400/touchscreen.jpg&quot; height=&quot;282&quot; title=&quot;SVNIT MindBend&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Official Poster for Touchscreen Workshop in MindBend 2012&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
Treasure Hunt Poster. This was one of the most time consuming poster. You see the path in background? I actually drew it using brush by following &lt;a href=&quot;http://www.svnit.ac.in/campus/images/map.jpg&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;our college map&lt;/a&gt;. And extra foot-steps and dotted lines are just for decorative purpose. Those coffee-stain effects were given using custom scripts. Had to use Blur tool for creating the canvas behind the background.&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6C6VtnUFQ7BiGTz8NmyKeddBC0KO-XEhxS3RFlKgJy0qdvEdrVLpQYLiQ8JXBgVuT0ENeWUzFQtF6ClqS3aGCNTiJUBweqWsO3jZqVayIZW75wf_mUgUEBJbkaU5yZyM7Lgf8XCM0vc8U/s1600/treasure_hunt_to_upload.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Treasure Hunt Poster&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6C6VtnUFQ7BiGTz8NmyKeddBC0KO-XEhxS3RFlKgJy0qdvEdrVLpQYLiQ8JXBgVuT0ENeWUzFQtF6ClqS3aGCNTiJUBweqWsO3jZqVayIZW75wf_mUgUEBJbkaU5yZyM7Lgf8XCM0vc8U/s400/treasure_hunt_to_upload.jpg&quot; height=&quot;297&quot; title=&quot;Treasure Hunt&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Treasure Hunt Poster&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
LAN Gaming Poster, this was done in quickest amount of time, I just had to think as a gamer to design this one and I&#39;m myself an addictive gamer :-p. So this was pretty easy for me to design and you can see how effectively gaming theme was implemented. Of-course images of several game posters were used and were resized to thumbnail-size images with frames around them.&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEix1Wms6P7ygjPWZPAbKSIk4oOyFOlVKQvgRDkfsB4Ew4QLBhXsO0LjCFM5XuG4fuv4F_XZSyQpRqWNDKzcyRM4zcb-am94Odv9FHs8gxkRRw83EBpq3xOQu87sVDldZGbxGaEKaoTMRpxW/s1600/lan_gaming_event_poster.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;LAN Gaming Poster&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEix1Wms6P7ygjPWZPAbKSIk4oOyFOlVKQvgRDkfsB4Ew4QLBhXsO0LjCFM5XuG4fuv4F_XZSyQpRqWNDKzcyRM4zcb-am94Odv9FHs8gxkRRw83EBpq3xOQu87sVDldZGbxGaEKaoTMRpxW/s400/lan_gaming_event_poster.jpg&quot; height=&quot;281&quot; title=&quot;LAN Gaming&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;height: 2px; margin-left: auto; margin-right: auto; text-align: center; width: 12px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Singing Night Poster:&amp;nbsp; In the beginning I made it quite busy. Too many colors and all but then struck the idea of rendering the feel of a stage by simple black human figures. It worked out well and after some spot-light effect the poster was ready to be printed!&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjf306qlfcUFTHhLfxU9LbQMVXJBW7G_0mcrs5UhRRbFQnKyRun0rrejvNT8zjkYAOZA9OCfsU9cZ8DQM2D7hQ2EWyPjImO7154r15Dax8p-YiGmEAE6v1eGZKTZ16Y7Pg2YPcdD245IOJ0/s1600/singing_night_to_up.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;singing contest poster&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjf306qlfcUFTHhLfxU9LbQMVXJBW7G_0mcrs5UhRRbFQnKyRun0rrejvNT8zjkYAOZA9OCfsU9cZ8DQM2D7hQ2EWyPjImO7154r15Dax8p-YiGmEAE6v1eGZKTZ16Y7Pg2YPcdD245IOJ0/s400/singing_night_to_up.jpg&quot; height=&quot;282&quot; title=&quot;Singing Contest&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Coding Competition Poster: To be honest I&#39;d mention that following was not liked by a few of the organizers, but still I&#39;m putting it here because I like the color combination and the way how it described the event both with respect to background and font selection.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1AO_VM5eMkZXJIYRWLDr3dFxAtXFETpmsK1AVaZQnknWFmZFrIHGXVo8_0drcfW2Ig52-4guTE99cBBwCnnhr8Gs7RF65fVgm-z8tsDerk8axUlZI56jJWarT9yZ-fAeHlIJZypbik2MZ/s1600/coding_contest_poster.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Coding Contest Poster&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1AO_VM5eMkZXJIYRWLDr3dFxAtXFETpmsK1AVaZQnknWFmZFrIHGXVo8_0drcfW2Ig52-4guTE99cBBwCnnhr8Gs7RF65fVgm-z8tsDerk8axUlZI56jJWarT9yZ-fAeHlIJZypbik2MZ/s400/coding_contest_poster.jpg&quot; height=&quot;282&quot; title=&quot;Coding contest&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Coding Contest Poster&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Another one for the same event, everyone liked it but me. Because one of the strength of any poster is its background and I admit that the background here was not developed by me. Still its not over. I had to make background represent a coding contest which I tried to imply using a watermark text of names of programming languages.&lt;br /&gt;
&lt;br /&gt;
Next comes the name &quot;EPIPHANY&quot;, special care was taken to decide how its represented. Challenge was to merge it with the &lt;i&gt;falling lines&lt;/i&gt; in background. First used suitable font, then used White-Grey gradient over the text &quot;EPIPHANY&quot; and then drop-shadow effects, both inner and outer. Voila!! Its done. Some more zoom-in editing and it was merged perfectly well with background.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1Nd4kn_mDZKAa02J2zc0IJ8C5ZMMShrIkPOsTG7qvqgv_Zwi2V9904CkvoXcnwo4EtwwzUzaJyEmnTasQy8XlJ_1hms9Nszd6-331nsCMbw7_uen4HQ_U30wc075sAfwpHGIH5HTHYL88/s1600/epiphany_coding_competition.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Coding Competition&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1Nd4kn_mDZKAa02J2zc0IJ8C5ZMMShrIkPOsTG7qvqgv_Zwi2V9904CkvoXcnwo4EtwwzUzaJyEmnTasQy8XlJ_1hms9Nszd6-331nsCMbw7_uen4HQ_U30wc075sAfwpHGIH5HTHYL88/s400/epiphany_coding_competition.jpg&quot; height=&quot;280&quot; title=&quot;Epiphany&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Posters &amp;amp; Logo by &lt;a href=&quot;https://www.facebook.com/raviojha21&quot; target=&quot;_blank&quot;&gt;Ravi Ojha&lt;/a&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/1160133734557760781'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5966303661451578311/posts/default/1160133734557760781'/><link rel='alternate' type='text/html' href='http://rookieslab.blogspot.com/2012/12/sparsh-mindbend-photoshop-gimp-work-svnit-design-teammate.html' title='Hands on Photoshop/GIMP'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05336645400007023377</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdg4xBDU4OXJFatywl5MXJ60pXVct-TR_heuAgJDx2yY-TLzbgqS4vFDAJT_T1Zr_Wq_XLg5HqVyHw03xvM8M42WqNPvYn3LZBaPCZPX_2epOamhn_Jl8XO5boJd-n84nLnX79OrBhjdqe/s72-c/_tail_coming_soon.jpg" height="72" width="72"/></entry></feed>