Monday, March 4, 2013

Hank's letter for Karen from Californication

Dear Karen,

If you're reading this, it means I actually worked up the courage to mail it. So, good for me. You don't know me very well, but if you get me started I have a tendency to go on and on about how hard the writing is for me. But this... this is the hardest thing I've ever had to write. There is no easy way to say this, so I'll just say it: I met someone. It was an accident, I wasn't looking for it, I wasn't on the make. It was a perfect storm. She said one thing, I said another... Next thing I knew I wanted to spend the rest of my life in the middle of that conversation. Now there is this feeling in my gut; she might be the one. She is completely nuts in a way that makes me smile highly neurotic, a great deal of maintenance required. She is you, Karen... That's the good news. The bad is that I don't know how to be with you right now, and that scares the shit out of me. Because if I am not with you right now, I have this feeling we will get lost out there. It's a big bad world full of twist and turns, people have a way of blinking and missing the moment. The moment that could have changed everything... I don't know what's going on with us and I can't tell why you should waste a leap of faith on the likes of me. But damn you smell good like home and you make excellent coffee that has to count for something, right? Call me.

Unfaithfully yours,

Sunday, November 4, 2012

वो रुला कर हँस न पाया देर तक
 जब मैं रो कर मुस्कुराया देर तक

भूलना चाहा कभी उसको अगर
और भी वो याद आया देर तक

ख़ुद ब ख़ुद बे-साख्ता मैं हंस पड़ा
उसने इस दर्जा रुलाया देर तक

भूखे बच्चों की तसल्ली के लिए
माँ ने फिर पानी पकाया देर तक

गुनगुनाता जा रहा था इक फक़ीर
धूप रहती है न छाया देर तक

कल अन्धेरी रात में मेरी तरह
एक जुगनू जगमगाया देर तक

-नवाज़ देवबंदी

Friday, October 26, 2012

An inspiring poem by  A. E. Housman, beautifully describing the human nature to leave some thing behind to remind the world of his existence.

Smooth between sea and land
Is laid the yellow sand,
And here through summer days
The seed of Adam plays.

Here the child comes to found
His unremaining mound,
And the grown lad to score
Two names upon the shore.

Here, on the level sand,
Between the sea and land,
What shall I build or write
Against the fall of night?

Tell me of runes to grave
That hold the bursting wave,
Or bastions to design
For longer date than mine.

Shall it be Troy or Rome
I fence against the foam
Or my own name, to stay
When I depart for aye?

Nothing: too near at hand
Planing the figured sand,
Effacing clean and fast
Cities not built to last
And charms devised in vain,
Pours the confounding main.

by A. E. Housman

Friday, June 29, 2012

Xboard Font issue on ubuntu

If you are trying to install xboard chess on Ubuntu, it crashes on start giving the following error:

xboard: no fonts match pattern -*-helvetica-bold-r-normal--*-*-*-*-*-*-*-*

The issue can be resolved by following the steps given below:

1. Install 100dpi font:
sudo apt-get install xfonts-100dpi

2.  Check the font path in xset
 xset q

3.  Add the font path of 100dpi in xset
 xset fp+ /usr/share/fonts/X11/100dpi


Monday, January 16, 2012

A program to check if a binary tree is Binary Search Tree

The basic theory behind this implementation is that the inorder traversal of binary search tree(BST) gives elements in sorted order. So if we traverse the tree and each time we visit next element we get some higher value then we can conclude that the give binary tree is a BST.

bool isBst(node* r)
{
static int no = INT_MAX +1;

if(r == NULL)
return true;
else
{
if(!isBst(r ->left))
return false;
if(r->data > no)
no = r->data;
else
return false;
if(!isBst(r ->right))
return false;
}
return true;
}

Sunday, January 15, 2012

Linear solution of Maximum subarray problem

Maximum subarray problem
Find the contiguous subarray within a one-dimensional array of numbers (containing both positive and negative numbers) which has the largest sum.

#include
using namespace std;
int main()
{
int a[] = {-2,1,-3,4,-1,2,1,-5,4};
int j =0;
int sum = 0, max = 0, str,end,next;
while(j<9) { sum += a[j]; if(sum<0) { sum = 0; next = j+1; } if(sum>max)
{
str = next;
end = j;
max = sum;
}
++j;
}
cout<
cout<<<", "<<
return 0;
}

Friday, September 2, 2011

Excluding folders from indexer in eclipse

Files of certain folders can be excluded from the indexer by marking them Derived. We can mark the directories as derived from folder properties window.

This helps in keeping the size of index file in control and also better performance of eclipse.