Wednesday, December 08, 2010

Thank you from the Wikimedia Foundation

From: Sue Gardner <...@wikimedia.org>
Date: Wed, Dec 8, 2010 at 1:41 PM
Subject: Thank you from the Wikimedia Foundation


Dear Divye,

Thank you for your gift of USD 100 to the Wikimedia Foundation, received on December 8, 2010. I'm very grateful for your support.
Your donation celebrates everything Wikipedia and its sister sites stand for: the power of information to help people live better lives, and the importance of sharing, freedom, learning and discovery. Thank you so much for helping to keep these projects freely available for their more than 400 million monthly readers around the world.

Your money supports technology and people. The Wikimedia Foundation develops and improves the technology behind Wikipedia and nine other projects, and sustains the infrastructure that keeps them up and running. The Foundation has a staff of about fifty, which provides technical, administrative, legal and outreach support for the global community of volunteers who write and edit Wikipedia.
Many people love Wikipedia, but a surprising number don't know it's run by a non-profit. Please help us spread the word by telling a few of your friends.

And again, thank you for supporting free knowledge.

Sincerely Yours,


Sue Gardner
Executive Director

* To donate: http://donate.wikimedia.org
* To visit our Blog: http://blog.wikimedia.org
* To follow us on Twitter: http://twitter.com/wikimedia
* To follow us on Facebook: http://www.facebook.com/wikipedia

Wikipedia - A big "Thank you"

Support Wikipedia

I just made a donation of $100 to Wikipedia in recognition of the shared treasure of knowledge it maintains on such a huge wealth of topics. Thank you so much Wikipedia for all that you've done for me. I am indebted to you.

Friday, December 03, 2010

Google Interview Questions and the Google Campus Interview Process 2011

Hi Guys,
   I know I'm not really writing a letter, but I really felt that I should jot down my impression of the Google Campus Placement process of 2010 before I forgot most of it. As a lot of my Facebook friends know by now, I've been given a campus placement offer by Google. Naturally, I'm really excited about it. Here's the story of how it all happened - a blow by blow account. (Tip: The interview questions are well marked out in the narrative and you can skip to them if you're not really interested in the campus process narrative).

   Google's hiring process is known to be pretty tough and their engineers are counted among the best in the world. The first whiff of that came through when a couple of young techies and an HR landed on campus sometime in November to carry out their written test. 50 eligible candidates for the test and 50 copies of the question paper: +3 -1 was the scoring scheme - so no guessing! (or atleast very calculative guessing). Most of the interview questions were pretty standard in nature - probability, expectation, some coding questions. Judge for yourself. Here are the questions for 2010 (reconstructed from collective memory of all the candidates that gave the test).

Google Placement Paper 2010
10th November 2010
Eligibility : B Tech/IDD/M Tech/PHD-CSE
CGPA-7.0 for B Tech, 7.5 for M Tech
Time Allocated : 65 mins

There were 17 objective questions and 1 subjective question.

1) Given preorder traversal of a Binary Search Tree. From the given options you have to select which one can possibly be the inorder traversal of the tree.

[If it is indeed a BST, then the correct answer should be the one which is in sorted order]

2) If u could find the (n/4)th element of an array in O(n) time, then what is the worst time complexity of quick sort algo if this algo is used to decide the pivot element.

Answer : It's O(nlogn), since we can write the execution time as

T(n) = . T(n . r) + T(n (1 - r)) + O(n)
where r is 1/4 for this case.
for any r < 1, we have the expression recursively approaching
T(n ) = T(n * r^2) + 2 T(n * r * (1 - r)) + T(n * (1 - r)^2) + 2O(n) ;  [O(n) = O(nr) + O(n(1-r))]
the number of O(n)s adds = log n/log r or logn/log(1-r) whichever is higher... but just logn times


3) find the min no of comparisons required to find both the max and min elements of an array containing 20 elements.

Ans) Can be done in a total of 28 comparisons.

4) If an array[0...m-1,0....n-1] is stored in column major format how will u find the (i,j) element?
a)i*n+j
b)i*m+j
c)j*n+i
d)j*m+i


5)If an insurance company pays $5000 for complete loss, $1500 in case of a loss of $2000 and more and nothing in case the loss is less that $2000. It obviously pays nothing in case of no loss.
If the probability of the first 3 events are 0.02,0.10 and 0.3 , find what should the company charge in order to make a profit of $50 from each customer

6) the prob of finding the parking slot occupied is 1/3.
U find it empty for 9 consecutive days.
Find the prob that it will be empty on the 10th day.

7) consider a NxN matrix in which the elements are either 0 or 1.
Find how many such matrixes are possible that are symmetric in nature(the matrix and its transpose count as 1.


8) 1<=i,j,k<=300.
Find (i,j,k) pairs such that their sum is divisible by 3.
(2,2,1) and (2,1,2) are counted as different.

9) in the loop
int counter=0;
for(i=0;i<10;i++)
 for(j=i+1;j<10;j++)
   for(k=j+1;k<10;k++)
     for(l=k+1;l<10;l++)
       for(m=l+1;m<10;m++)
         counter++;

Find the value of counter in the end.
Ans. 10C5
i,j,k,l,m can be any 5 different numbers between [0-9] such that i<j<k<l<m. So, choose any 5 numbers and there is only one way to arrange.

10) Consider a set S of the first 10 natural numbers.
Find the number of subsets that do not contain consecutive elements.
Ans)

Subsets of length 0 = 1

Subsets of length 1 = 10

Subsets of length 2 = 36

Subsets of length 3 = 56

Subsets of length 4 = 35

Subsets of length 5 = 6

                      Total = 144


11) A question on TestandSet(), which are used as locks.....taught in OS course.
enter_CS() //This is what I remember
{
while(TestandSet(X));
}
Exit_CS()
{
X=0;
}

12) A disk contains 16 partition unit , each unit contains 128 subunits, and each subunit contains 256 sectors of 512 byte each.
Find out what is total storage capacity?
Also find out the no of bits required to identify each sector?
Ans) 256 MB, 19 bits

13) Which of the following is not a Regular Language :
a)None given
b)(0^i).(1^j) such that i<j
c)(0^i).w.(1^j) such that w belongs to {0,1}* and i>=0
d) such that every pth input digit is 0 where p is a prime number

14)find the output

void f(char * x)
{
x++;
*x='a';
}    

int main()
{
char * str="hello";
f(str);
cout<<str;
system("pause");
return 0;
}

a) hello
b)hallo
c)allo
d)empty string

15)Given an sorted array, what is the complexity of finding weather a number is present n/2 times or not.
a)O(lgn)
b)O(n)
c)O((lgn)^2)
d)O(1)
[Ans is option d]

16)The weight of a squence a0, a1,a2,... ,an is defined as a0+a1/2+a2/(2^2)+...+an/(2^(n)). A subsequence of a sequence is said to be a sequence with some of the elements deleted from the original sequence but the order of the sequence remaining the same. Now let X be  the maximum weight for a subsequence of a sequence a0,a1,a2,a3..,an. And Y be the maximum weight for a subsequence of the sequence a1,a1,a2,a3.....,an. Then X in terms of Y is
a) max(Y,a0+Y)
b)max(Y,a0+Y/2)
c)max(Y,a0+2*Y)
d)a0+Y/2
[opn b]

17) What is the complexity for finding all the leaders in an array? A leader is defined as an element which is greater than all the elements to its right.

18) Subjective question
Write a program to find the index in an circular array such that the string that is formed starting from that index is first in lexicographic order.

For Ex : in the circular array ABCDEABCCDE
The answer is 6 because the circular string starting from the element A in the 6th position comes first in the dictionary formed from all the possible strings of the circular array.

   The pre-placement talk was well received (especially since the brother of one of the 2010 B.Tech passouts and an IIT Roorkee alumni had come for giving the PPT). Most of the interaction was very informal with questions ranging from mundane to the technical. Google Instant and the "Did you mean?" feature of Google were the hot topics of discussion and of course, how can we omit the discussion on the Google core search algorithm. The actual interview process was slated for 29th November. A number of questions were asked by the curious audience and very candidly answered by the techies. 

   The interview process began dot on time at 6:00 pm on 29th November. A couple of minutes spent getting things in order and off we go!

   The first indication that we were dealing with a company that was serious about the people it hired was the fact that it had arrived on campus as a team of 16 people hiring for 3 different profiles. The fact was that they were interviewing only 12 candidates shortlisted from the written test. A quick, back of the envelope calculation shows that they've spent more than Rs. 1 lakh per campus that they've visited (5,000 x 16 airfare + hotel + travel). All the interviews were soon cubbyholed in the board rooms on the first floor of the placement office and off started the mating ritual: people would go into rooms and emerge 45-50 minutes later after having an intense session. Here's how my interviews went.

Interview 1: 45 minutes

Q1. Given a graph with all vertices of even degree, how will you print the Euler's tour of the graph?
A: Fleury's Algorithm

Q2. Given a set of overlapping intervals of the form (start, end), each of which is associated with a property (say S), print a sequence of disjoint intervals with all properties current valid in that interval.
eg. (1, 3, S0) (2, 3, S1) (2, 4, S2) yields (1,2, S0), (2, 3, S0 + S1 + S2), (3,4,S2) as the disjoint intervals.
Also, code a solution to the above problem.

Q3. Design a site similar to tinyurl.com

Q4. Now scale it to higher loads.

Q5. Given that you now have 2 geographically separated datacenters and a request comes in for a url that's not present in your current datacentre, how will you handle it?

Q6. Various questions about failovers, replication, node failures, load balancing, redirects etc.

Interview 2: 45 minutes - This one went horribly.
Q1. Given a 2^n x 2^n chessboard and an infinite number of L shaped tiles (of size 2x2) which may be rotated and placed, is it possible to tile the entire chessboard leaving just a single gap?
A: Yes. You can prove this by induction. Unfortunately, the solution didn't strike during the interview.

Q2. Delete a node from a Binary search tree.
A: Standard data structures question

Interview 3: 45 minutes
Q1. Print the elements of a matrix in spiral order (outside to inside). Make your code as efficient as possible. (an icebreaker question)

Q2. Given 2 numbers in base 10 with digits given in MSB to LSB order in a singly linked list, add the two numbers and return the result as a linked list in MSB to LSB order. Do this in < 4n operations on the given linked lists (including traversals) (this constraint was stated somewhat vaguely). Code up the solution. The more efficient the better. I gave multiple solutions to this problem (the first few methods had 4n operations).


The primary challenge in the interviews was the tight time limits within which we had to figure out solutions and code them up. Finally, I guess there was some CV evaluation from Mountain View and the offer letters materialized after a sleepless night for us. Congratulations Naman, Parth, Tanmay and Gunjan for also clearing Google. You guys rock!

Other interesting questions:

Q1. Given a credit card number with a certain number of fixed digits and a certain number of digit placeholders, find the number of solutions such that the entire number yields a remainder of 3 when divided by 13. Use properties of modulus.
A: This question has a DP that can be solved in O(m n) where n is the number of digit placeholders and m = 13. Brute force is O(10^n). Quite a tough question.

Q2. Given numbers of the form 2^i x 3^j x 5^k x 7^l - generate the numbers in ascending order of the sequence given i,j,k,l >= 0 and are integers. Give an efficient solution to this problem.

Best of luck to those that are still giving Google Interviews this season! :)

Monday, November 22, 2010

Tune Meri Jaana Kabhi Nahin Jaana - Lonely (Emptiness) - IIT Guwahati - Rohan Rathore


Update: Rohan Rathore and his tragic story is a hoax for sure. This is confirmed.
I've talked to my friends at IIT Guwahati and there is no record of such a person ever existing on campus. Nobody at IIT-G knew him and if a person dies in tragic circumstances, nearly everyone in the IIT knows it. The story about Rohan Rathore was created in order to gain views for a video on Youtube. So let us all put the "fake" Rohan Rathore to rest permanently as a person who never existed. Therefore, we can be very sure that the original singer of the song is Gajendra Verma. I'm leaving the original post below for archival purposes.

------ Original Post follows ----

I was introduced to this song by Sanat nearly a month ago and today, after listening to it again on Youtube,  I really felt that I needed to transcribe its lyrics. It's such a soulful song that you can't help feeling sentimental after hearing it - especially since the IITian (Rohan Rathod) who wrote and sang it died of cancer 15 days after finishing this beautiful piece of music. Everywhere I've looked on the net, the lyrics have been littered with mistakes. This is my cleaned up version and hopefully it makes much more sense than the others.


(English Section)
Oh love of mine, with a song and a whine,
You're harsh and divine like truths and a lie.
But the tale ends not here; I have nothing to fear
for my love is a yell of forgiving and hold on.

In the bright emptiness, in a room full of it,
is a cruel mistress - my heart!
I feel this unrest, that nests all hollowness,
for I have nowhere to go and I'm cold.

And I feel so lonely yeah...
There's a better place than this: emptiness.
And I'm so lonely yeah... 
There's a better place than this: emptiness yeah...

<alaap>

(Hindi Section)

Tune mere jaana, kabhi nahin jaana,
Ishq mera, dard mera
Tune mere jaana, kabhi nahin jaana,
Ishq mera, dard mera

Aashiq tera... 
Bheed mein khoya rehta hai...
Jaane jahaan.... 
Poocho toh itna kehta hai - 

That I feel so lonely yeah...
There's a better place than this: emptiness.
And I'm so lonely yeah... 
There's a better place than this: emptiness yeah...

<piano closing instrumentals with alaap >

Also, for those who don't speak or understand hindi - here's a line by line translation of the hindi section:

Tune mere jaana, kabhi nahin jaana, (You, my love, have never ever realized)
Ishq mera, dard mera (my love, my pain) 
Tune mere jaana, kabhi nahin jaana, (You, my love, have never ever realized)
Ishq mera, dard mera (my love, my pain)

Aashiq tera... (Your lover)
Bheed mein khoya rehta hai... (remains lost in the crowd)
Jaane jahaan....  (My dear love, wherever ...)
Poocho toh itna kehta hai - (... asked, he just says ...)

That I feel so lonely yeah...
There's a better place than this: emptiness.
And I'm so lonely yeah... 
There's a better place than this: emptiness yeah...

Hope all of you enjoy this as much as I do.

Wednesday, October 20, 2010

What Microsoft is Today

I read this on the LinkedIn groups' Microsoft current and ex-employees forum and it really touched my heart. I've worked (more accurately, interned) at Microsoft and I can understand the pain that he has felt. Read the mail below and form your own opinions about MSFT.

LinkedIn Groups

Here's my personal experience of trying to innovate at Microsoft. I spent 14.5 years at there. I'm one of the co-inventors of ClearType, I have some 20-odd granted US Patents, so I think I have some credibility...

Approximately 2.5 of my Microsoft years were the best years of my (long) working life. About 12 of them were the worst years of my working life - by a very long way.

I came to Microsoft in 1995 because I believed that with Windows and Office, it was the one company in the world best-placed to lead the transition from reading on paper to reading on screen which I could see was inevitable. Most of Microsoft thought I was crazy back in 1995 - "No-one will ever read anything longer than a short email on a screen" was the general consensus. Not so crazy now, eh?

My boss, Steve Shaiman, believed and supported the vision. We produced a strategic plan called "Read It Anywhere", and began executing. In 1995. We were many years ahead of ANYONE else. Then Shaiman left - after a run-in with his VP, I understand.

The group I had come to Microsoft to run was tossed into the Windows organization (and later the NT organization). I had six different managers in three years, none of whom cared about the plan, all of whom wanted me to roll over and let the circling sharks of other teams tear the group to bits by taking its best engineers...

I fought successfully to keep the group together - right up to Divisional VP level, twice! - because I still believed the mission was important. I took most of that pain myself, while keeping the group focused on the plan - and innovating.

In 1998 I was fired, and only rescued with six hours left to run on my jobsearch by Dick Brass, who was an outsider (and thus viewed as prey by most of his fellow-VPs). He had come to Microsoft at BillG's invitation to develop an eBooks project. TabletPC also came out of that team - but was forced to try to run a sprint while dragging a millstone behind it (Windows).

Jason Atlas has it right. Microsoft has become GM - or the IBM it used to ridicule. Ironically, IBM has rediscovered how to innovate, in the services space. If you'd invested in IBM a year ago, you'd have made a profit of 17%.

Microsoft will not die, at least not for a very long time. But it has become a plumbing company.

Microsoft has had no leader able to drive innovation for a very long time. BillG checked out a number of years before he officially left. And the Windows & Office teams learned a long time ago how to frustrate his calls for more rapid innovation. I watched it happen. It took TEN YEARS before ClearType was turned on by default in Windows. Oh, it was grudgingly put in XP. But it was buried so deep few customers ever found it.

If you read my 1999 paper, The Magic of Reading (
http://www.billhillsite.com/osprey.doc ), you'll see we laid all the groundwork for Amazon's Kindle and most of the other eBook software in the market today. Microsoft was there years before, and blew it.

I was one of the 2009 casualties. Microsoft was right to get rid of me, at keast by teir rationale. I couldn't find any way to get traction any more. I was just a spinning wheel. Now, I'm obviously biased. But I believe that when a company that knows how to innovate sees a team of smart people who're really fired up to change the world, it moves obstacles out of their way.

Microsoft did exactly the opposite...

Posted by Bill Hill

Comment &#187 Stop Following Discussion &#187

LinkedIn values your privacy. At no time has LinkedIn made your email address available to any other LinkedIn user without your permission. ©2010, LinkedIn Corporation.


Friday, August 27, 2010

Are NoSQL implementations really faster than the usual SQL thing?

This was the question that I received from France via Aardvark. Here's my response:

"Faster" when applied to software implies a number of things - including the quality of implementation (which can sometimes play a very significant role).

Firstly, it is unfair to compare NoSQL and Relational databases because many NoSQL implementations do away with many of the hard guarantees of the relational world. So even though you might get a speed boost because of that, you're compromising on durability or consistency in some cases.

Secondly, space usage is definitely a concern. Not everyone can afford the humongous disks that NoSQL implementations will invariably require (denormalization eats up space because of repetition - but this does not apply in all scenarios and can be mitigated with careful thought - YMMV).

Thirdly, nothing can beat RAM - so pure memcached implementations will beat a database anyday at the cost of durability of data.

In short, treat "fast" as a term to be used with caution in this scenario as you are essentially comparing apples with oranges. If you still wish to look at some figures, check out http://www.mysqlperformanceblog.com/2009/10/19/mysql_memcached_tyrant_part3/

Hope this helps.


Sunday, July 25, 2010

This Blog is Officially in Hibernation

Over the past few days (months?? year?) I've become just too busy to blog about anything of interest to anyone. That has left me with a number of tricks, tips, ideas and unfinished blog posts. It is high time that I officially post on my blog my inability to service it with content. For those of you looking to find me or to take my advice, please mail me at my email id that is there somewhere on the sidebar of this page. FB and LinkedIn are good ways to connect. That's it for now. Ciao!

Wednesday, March 31, 2010

Zigndog 3rd Session - Django

Hey guys and girls,
   I have the screencast nearly ready, but it is hugely boring and very very long. Not only that, it's very impossible to download because of the large file size. So, if you're interested, what is the max file size that you can download? Ping in the comments, I'll try and make it smaller.

Divye

Wednesday, March 17, 2010

The super duper not-so-secret recipe for a great Pasta

Pasta in White Sauce

Okay, here goes the super duper ultra not-so-secret recipe to awesome indianized pasta created by the resident geek who writes on these hallowed pages.

Part 1: Preparing the pasta
1. Take a huge kadhai and fill it with sufficient water (sufficient = enough to cover all the pasta you will put into it later completely).
2. Add enough salt to make the water quite salty. Exact quantity doesn't matter too much here..
3. Start heating the water, put in the pasta (penne version preferably as it doesn't break easily) and bring to boil. The water will start frothing.
4. Keep the pasta boiling in the water till it grows in size and changes colour from hard, deep yellow to a lighter, softer, larger size (closer to off-white)
    Acid test for this step: you are able to break the pasta easily with a tablespoon's edge.
5. Remove from boil and drain away all the water with a sieve. (you can taste the pasta to judge its saltiness if you like, it won't be much)
6. Typically, you should be in a position to directly add the pasta to the white sauce that you should have prepared in the meanwhile. If you keep the pasta out for too long, it might start to stick. You can avoid that by coating it with a little oil (similar to noodles).

But I guess you know all that... here's the recipe for the sauce:

Part 2: Preparing the white sauce
0. Cut carrots and beans into 2" long, thin strips. Using about a 1-2 teaspoon of oil and about 1/2 tsp salt, cook the vegetables in an open pan at high heat till they are ready to eat but slightly crunchy. These vegetables will be used in step 6 (can be done in parallel with the remaining steps).
1. Take a kadhai and put in 1.5 - 2 tablespoons of butter and start heating till the butter melts
2. If you want an indianized version of the pasta, now is a good time to put in all the spices - Ajwain for the flavour, some jeera as per taste (any other spices of your choosing). Fry them till they change colour slightly. Add about 1 tablespoon (about 3 teaspoons) of garlic paste freshly prepared from garlic cloves (critical) (erring and adding more is good, adding less is not). Fry till slightly brown and aromatic. Add salt to taste (make sure to account for the salt in the butter and the vegetables and the slight salt in the boiled pasta). 
Reduce the heat and add milk as per the next step.
3. Add 1/2-1 litre of milk (do a bit of judgement here).
    The quantity should be just enough to cover the pasta after accounting for the reduction.
4. Bring the mixture to near-boil at high flame and then add 1-2 teaspoons of dissolved cornflower (dissolved smoothly in 1/2-3/4 cup of water) to the sauce.  This will cause the milk sauce to thicken slightly. Keep stirring the mixture to ensure no lumps form and cook for a minute or two.
5. Add 1-2 tablespoons of tinned cream (optional) and turn the heat down slightly for thickening. Simultaneously, add 3 cubes of grated cheese (where 1 cube is as per Amul's processed cheese pack), lots of oregano (to taste - about 3 to 5 heaped teaspoons), 3-5 cloves for flavour and about 1-2 teaspoons of freshly ground black pepper. Keep heating at slightly reduced flame, thicken for a short while (2-3 minutes (estimated) - the sauce will thicken further on cooling)
6. When the sauce is of the desired consistency but slightly more flu, add the vegetables prepared in step 0 and mix well.
7. Add the boiled pasta prepared separately. Mix well and cook a little so that the flavours seep into the pasta.
8. Pour into a separate container for serving, dust with oregano, grated cheese and black pepper powder (freshly prepared)
9. Garnish with a sprig of freshly plucked Tulsi leaves. Serve hot.

List of ingredients:
1. Carrots, Beans - as per quantity desired in the final dish (example values - 2 long carrots, about 10 beans) - cut into 2" long thin strips (french fries type but much thinner)
2. Penne pasta - I don't know the grammage exactly, but 1 big packet (use only 1/2 or 3/4 of it)
3. Butter - upto 2 tablespoon
4. Ajwain, Jeera - to taste (optional)
5. Garlic paste prepared fresh from garlic cloves - roughly 1 heaped tablespoon or slightly more
6. Milk (boiled preferably) - 1 litre
7. Cornflower - 2 teaspoons
8. Black Pepper (freshly ground) - min 2 teaspoons + more for garnishing
9. Tinned Cream - about 2 tablespoons (optional, but highly recommended)
10. Oregano - lots of it. 3 to 5 heaped teaspoons + more for garnishing.
11. Cloves - 3 to 5 (optional)
12. Cheese cubes (grated) - 2-3 cubes for sauce + more for garnishing
13. Tulsi leaves - for garnishing

Serves: 4

The standard disclaimers apply:
1. I don't take any responsibility should you try this recipe and it blows up in your face, leaving you much the poorer on an empty stomach.
2. All the measurements are approximate as I'm an experimental cook and not a theoretical one.
3. Should you so decide to go ahead, feel free to tell me of the results. I would love to know.


A few closing comments
To the Dieters: What are you doing here?
To the masochist dieters: What's the calorie count of this dish?
To the Geeks: Please learn to cook. It is an important survival skill that will serve you well in life.
To the CS Geeks: No, that fancy robot you've just programmed cannot cook this for you. Get up and do it yourself.
To those in Google/Facebook: Just get your fix from your in-house cook, will ya? Cooking this could prevent you from saving the world! :P


Take care guys! Until next time, Chef DK signing off!



Friday, March 12, 2010

How to enable Compile and Run for C/C++ files in gedit

I never liked using gedit for programming because it needed extensive customization before it even came close to becoming a programming editor. However, those that are just starting out with linux will feel most at home in gedit. So here is how to enable "Compile and Run" functionality in gedit.

1. Enable the External Tools plugin by going to Edit -> Preferences -> Plugins as shown in the screenshot below

2. Go to Tools -> Manage External Tools and create a new Tool by clicking on the "new" icon near the Help button.

3. Name the new tool "Compile and Run" and press enter
4. In the coding area, paste the following script:

#!/bin/sh
cd $GEDIT_CURRENT_DOCUMENT_DIR
g++ -Wall -g $GEDIT_CURRENT_DOCUMENT_NAME && xterm -e "sh -c './a.out; echo Press enter to quit... && read KEY'"

5. Put in a shortcut key (eg. Ctrl + F5) in the shortcut key area
6. Set the save setting to Current Document
7. In the applicability setting, select C and C++

That's it. You're done! Press Ctrl + F5 to start off with compile and run. Happy coding!

PS: All the tools to make gedit programming worthy can be found in the blog posts here:
http://www.makeuseof.com/tag/top-plugins-to-extend-and-make-gedit-a-more-useful-text-editor-linux/
http://www.micahcarrick.com/09-29-2007/gedit-html-editor.html

Compile and Run For C/C++ programmers on vim

If the file is named file.cpp or file.c, in the vim command mode just type in:

:!make abc
:!./abc

The first command compiles file abc.cpp to the executable file abc in the current directory. You can then execute it using the second command.

Alternatively, you could use something like :!g++ -g -Wall file.cpp -o file if you want to specify your own compilation options. (Anything more complex and you should be using a Makefile anyway).

Wednesday, March 10, 2010

Reprint of Zigndog Certificate

This post should probably belong to the Zigndog site, but seeing that I have no time to update it, let me just post it here. I trust that most of you who are interested will be mailing me soon (common self-interest reasons) :)

To get your rewritten certificates, you need to perform the following tasks:
1. Get in touch with me on my Zigndog id (divye kapoor (at the rate of) zigndog (dot) com
2. Send in a scanned copy of your old certificate along with your correct spelling and the address to which you want the certificates dispatched.
3. I'll acknowledge the receipt of your email and dispatch the revised certificate soon.
4. On receipt of the revised certificate, please mail back the original certificate via speed post.

That's all folks!

Looking forward to your mails...