Below is one of the ancient saying that i would like to share with you.It is well said by our ancestors & has a deeper meaning in terms of living life.Our life is complete then. | |
PEHLA SUKH NIROGI KAYA DOOSRA SUKH GHAR MEIN HO MAYA TEESRA SUKH KULWANTI NARI CHAUTHA SUKH PUTRA AGYAKARI | |
You have bliss if you have a healthy body You have bliss if you have a home filled with wealth You have bliss if you have a faithful wife You have bliss if you have an obedient son. Thanks, Have a Nice Day.! Nitin Sharma | |
Tuesday, August 10, 2010
Ancient Saying - Pehla Sukh Nirogi Kaya . . . .
Monday, June 14, 2010
IM Chat with God : i like it much
Did You Call Me?
===========
God: Hello. Did you call me?
Me: Called you? No... Who is this?
God: This is GOD. I heard your prayers.
So, I thought I will chat.
Me: I do pray. Just makes me feel good.
I am actually busy now.
God: What are you busy at? Ants are busy too.
Me: Don't know. But, I can't find free time.
Life has become hectic. It's rush hour all the time.
God: Sure. Activity gets you busy.
Productivity gets you results.
Activity consumes time. Productivity frees it.
Me: I understand. Yet, I still can't figure out. By the way,
I was not expecting YOU to call me on instant messaging chat
God: I wanted to solve your fight for time, by giving you some
clarity. In this internet era, I wanted to reach you
through the way in which you would understand.
Me: Tell me, why has life become complicated now?
God: Stop analyzing life. Just live it. Analysis makes it
complicated.
Me: Why are we constantly unhappy?
God: Your today is the tomorrow that you worried about
yesterday. You are worrying because you are analyzing.
Worrying has become your habit. That's why you are not
happy.
Me: How can we not worry when there is so much uncertainty?
God: Uncertainty is inevitable. Worrying is optional.
Me: There is so much pain due to uncertainty.
God: Pain is inevitable - it will come. Suffering is optional,
you can choose.
Me: If suffering is optional, why do good people also suffer?
God: Diamonds cannot be polished without friction.
Gold cannot be purified without fire.
Good people go through trials, but, don't suffer.
With that experience, their life becomes better,
not bitter.
Me: You mean to say such experience is useful?
God: Yes. Experience is a hard teacher.
She gives the test first and the lessons afterwards.
Me: Still, why should we go through such tests?
Why can't we be free from problems?
God: Problems are purposeful roadblocks offering beneficial
lessons to develop strength.
Inner strength comes from struggle and endurance,
not when you are free from problems.
Me: Frankly, in the midst of so many problems,
we don't know where we are heading...
God: If you look outside, you will not know where you are going.
Look inside.
Looking outside, you dream.
Looking inside, you awaken.
Eyes provide sight. Heart provides insight.
Me: Sometimes not succeeding fast seems to hurt more than
moving in the right direction. What should I do?
God: Success is a measurement decided by others.
Satisfaction is a measurement decided by you.
Knowing the road ahead is more satisfying.
You work with the compass. Let others work with the clock.
Me: In tough times, how do you stay motivated?
God: Always look at how far you have come rather than how far
you have to go.
Always count your blessing, not what you are missing.
Me: What surprises you about people?
God: When they suffer they ask, "Why me?"
When they prosper, they never ask "Why me?"
Everyone wishes to have truth on their side.
Few want to be on the side of the truth.
Me: Sometimes, I ask, "Who am I? Why am I here?"
I can't get the answer.
God: Seek not to find who you are, but, to determine who you
want to be. Stop looking for a purpose as to why you are
here. Create it.
Life is not a process of discovery.
It's a process of creation.
Me: How can I get the best out of life?
God: Face your past without regret.
Handle your present with confidence.
Prepare for the future without fear.
Me: One last question. Sometimes, I feel my prayers are not
answered.
God: There are no unanswered prayers. At times, the answer is
"NO."
Me: Thank you for this wonderful chat.
God: Well, keep the faith and drop the fear.
Life is a mystery to solve not a problem to resolve.
Trust me.
Friday, April 9, 2010
Fetch Files with more than one extension from a Directory and Sorth them
where fn.Contains(".jpg") || fn.Contains(".txt") || fn.Contains(".png")
orderby new FileInfo(fn).CreationTime descending
select fn;
I hope you know var keyword :p.(The anonymous types introduced in C# 3.0).
In the above example it gives the collection.
So at the end you get filtered all files from the directory/folder by just providing the extension name in file.contains() syntax like fn.Contains(".jpg")
Thursday, March 18, 2010
Delete Selected item from XML Node

private voidForm1_Load(object sender,EventArgs e)
{
XmlDocument xDoc = newXmlDocument();
xDoc.Load(@"D:\DocumentsOrder.xml");
for (int i = 0; i <>
{
//Add the innertext of the xml document to the listbox
listBox1.Items.AddRange(newobject[] { xDoc.DocumentElement.ChildNodes[i].InnerText });
}
}
On Delete Button Click event write the following Code:
private voidbutton5_Click(object sender,EventArgs e)
{
XmlDocument xDoc = newXmlDocument();
xDoc.Load(@"D:\DocumentsOrder.xml");
//Add the innertext of the xml document to the listbox
xDoc.DocumentElement.RemoveChild(xDoc.DocumentElement.ChildNodes[listBox1.SelectedIndex]);
FileStream WRITER = newFileStream(@"D:\DocumentsOrder.xml", FileMode.Truncate,FileAccess.Write,FileShare.ReadWrite);
xDoc.Save(WRITER);
//Close the writer filestream
WRITER.Close();
//Form1_Load(new object(), new EventArgs());
}

Send Outlook E mail using VB macros
Sub SendMail()
'
'This macro requires the Outlook Object library to be checked
'in the vba editor Tools > References
Dim bStarted As Boolean
Dim oOutlookApp 'As outloo
Dim oItem 'As Outlook.MailItem
On Error Resume Next
'see if Outlook is running and if so turn your attention there
Set oOutlookApp = GetObject(, "Outlook.Application")
If Err <> 0 Then 'Outlook isn't running
'So fire it up
Set oOutlookApp = CreateObject("Outlook.Application")
bStarted = True
End If
'Open a new e-mail message
Set oItem = oOutlookApp.CreateItem(olMailItem)
With oItem 'and add the detail to it
.To = "abc@yahoo.com" 'send to this address
.Subject = "This is a Test Mail using VB Macros" 'This is the message subject
.Body = "See attached document" ' This is the message body text
.Attachments.Add ActiveDocument.FullName
ActiveDocument.SaveAs strFilePath & strDate
.Send
'**********************************
'If you want to view the message before it goes
'change the line above from .Send to .Display
'Otherwise the message is sent straight to the Outbox
'and if you have Outlook set to send mail immediately,
'it will simply be Sent
'with no obvious sign that Outlook has operated.
'Apart from the copy in the Outlook Sent folder
'**********************************
End With
If bStarted Then 'If the macro started Outlook, stop it again.
oOutlookApp.Quit
End If
'Clean up
Set oItem = Nothing
Set oOutlookApp = Nothing
End Sub
Regards,
Nitin Sharma