Top Stories Photos on Yahoo! News Photos

Friday, September 12, 2008

منٹو کے 'سياہ ماشے' سے ايک اقتباس

'لوٹا ہوا مال برآمد کرنے کيلیے پوليس نے چھاپے مارنے شروع کيے تو لوگ ڈر کے مارے لوٹا ہوا مال رات کے اندھيرے ميں باہر پھينکنے لگے۔ کچھ ايسے بھی تھے جنہوں نے اپنا ذاتی مال بھی موقع پا کر اپنے سے عليحدہ کرديا تاکہ قانونی گرفت سے سرے سے ہی بچ سکيں۔ ايک آدمی کو بہت مشکل پيش آئي، اسکے پاس شکر کی دو بورياں تھيں جو اس نے لوٹی ہوئی تھيں۔ ايک بوری تو اس نے رات کو کنويں ميں پھينک دی ليکن جب دوسری بوری اٹھا کر کھوہ ميں پھينکنے لگا تو خود بھی ساتھ چلا گيا۔ شور سن کر لوگوں نے کھوہ رسياں ڈال کر آدمی کو باہر نکالا ليکن وہ باہر آکر مرگيا۔ دوسرے دن لوگوں نے استعمال کيلیے پانی نکالا تو وہ ميٹھا تھا، اسی رات اس آدمی کی قبر پر دیے جل رہے تھے اور "سبحان اللہ سبحان اللہ" کا ورد ہو رہا تھا۔

Wednesday, September 10, 2008

Get Active Directory User Name/Loging Name/Email in C#.NET

This code snippet is a continuing part of my existing post that has been posted in August 2008.Here I m explaining how to get User Login Name,User Actual Name,User Email Addresses and other active directory information using C#.In the example below I m extracting only user login name[UserPrincipalname] but all filter has been applied for your convince.You can replace any one as per your requirement.
You can also remove other filters that are not related to you.

DirectoryEntry de = GetDirectoryObject();
DirectorySearcher deSearch = new DirectorySearcher();
deSearch.SearchRoot = de;
int Count =0;
deSearch.Filter = "(&(objectClass=user))";
deSearch.SearchScope = SearchScope.Subtree;
deSearch.PropertiesToLoad.Add("cn"); // username
deSearch.PropertiesToLoad.Add("name"); // full name
deSearch.PropertiesToLoad.Add("givenname"); // firstname
deSearch.PropertiesToLoad.Add("sn"); // lastname
deSearch.PropertiesToLoad.Add("mail"); // mail
deSearch.PropertiesToLoad.Add("initials"); // initials
deSearch.PropertiesToLoad.Add("ou"); // organizational unit
deSearch.PropertiesToLoad.Add("userPrincipalName"); // login name
deSearch.PropertiesToLoad.Add("distinguishedName"); // distinguised nam

SearchResultCollection results = deSearch.FindAll();
//lstADUsers.Items.Clear();
if ((results != null))
{
foreach (System.DirectoryServices.SearchResult value in results)
{
Count++;
if (value.GetDirectoryEntry().Properties != null)
{
if (value.GetDirectoryEntry().Properties["sn"].Value != null)
{
if (value.GetDirectoryEntry().Properties["userPrincipalName"].Value != null)
{
string AdUsername = value.GetDirectoryEntry().Properties["userPrincipalName"].Value.ToString();
if (AdUsername.Length > 0)
{
if (AdUsername.Contains("@"))
AdUsername = AdUsername.Substring(0, AdUsername.IndexOf('@'));

lstADUsers.Items.Add(AdUsername);
if (Count % 2 == 0)
lblWait.Text = "PLEASE WAIT. ";
else
lblWait.Text = "PLEASE WAIT...";
Application.DoEvents();

}
}
}
}
}

}

//return arlUsers;

}

private DirectoryEntry GetDirectoryObject()
{
DirectoryEntry oDE;
oDE = new DirectoryEntry("LDAP://AD.LMKR.NET", @"DOMAINNAME\LOGINNAME", "PASSWORD", AuthenticationTypes.ReadonlyServer );
return oDE;
}

Like it or dislike it please comment....If you like it then forward this
Khuda Hafiz
Raja Imran Nisar

Tuesday, September 9, 2008

I thought you were bringing her back.

A Ban bury senior citizen drove his brand new BMW Z3 convertible out of the car salesroom. Taking off down the motorway, he floored it to 90 mph, enjoying the wind blowing through what little hair he had left. "Amazing!" he thought as he flew down the M40, enjoying pushing the pedal to the metal even more. Looking in his rear view mirror, he saw a police car behind him, blue lights flashing and siren blaring.

"I can get away from him - no problem!" thought the elderly nutcase as he floored it to 110mph, then 120, then 130mph. Suddenly, he thought, "What on earth am I doing? I'm too old for this nonsense!" So he pulled over to the side of the road and waited for the police car to catch up with him.

Pulling in behind him, the police officer walked up to the driver's side of the BMW, looked at his watch and said, "Sir, my shift ends in 10 minutes. Today is Friday and I'm taking off for the weekend. If you can give me a reason why you were speeding that I've never heard before, I'll let you go."

The man, looked very seriously at the policeman, and replied, "Years ago, my wife ran off with a policeman. I thought you were bringing her back."

"Have a good day, Sir," said the policeman

Know Your Baby By Their Month of Birth

*Jan*
Pretty/handsome. Loves to dress up. Easily bored. Fussy. Seldom shows
emotions. Takes time to recover when hurt. Sensitive. Down-to-Earth.
Stubborn.
*Feb *
Abstract thoughts. Loves reality and abstract. Intelligent and clever.
Changing personality. Attractive. Sexiest out of everyone. Temperamental.
Quiet, shy and humble. Honest And loyal. Determined to reach goals. Loves
freedom. Rebellious when restricted. Loves aggressiveness. Too sensitive and
easily hurt. Gets angry really easily but does not show it. Dislikes
unnecessary things. Loves making friends but rarely shows it. Horny. Daring
and stubborn. Ambitious. Realizing dreams and hopes. Sharp. Loves
entertainment and leisure. Romantic on the inside not outside. Superstitious
and ludicrous. Spendthrift. Tries to learn to show emotions.
*Mar *
Attractive personality. Sexy. Affectionate Shy and reserved. Secretive.
Naturally honest, generous and sympathetic. Loves peace and serenity.
Sensitive to others. Great kisser.. Easily angered. Trustworthy.
Appreciative and returns kindness. Hardly shows emotions. Tends to bottle
up feelings. Observant and assesses others.
*Apr*
Suave and compromising. Funny and humorous. Stubborn. Very talkative.
Calm and cool. Kind and sympathetic. Concerned and detailed. Loyal. Does
work well with others. Very confidant. Sensitive. Positive Attitude.
Thinking generous. Good memory. Clever and knowledgeable. Loves to look for
information. Able to cheer everyone up and/or make them laugh. Able to
motivate oneself and others. Understanding. Fun to be around. Outgoing.
Hyper. Bubbly personality. Secretive. Boy/girl crazy. Loves sports, music,
leisure and traveling. Systematic. Hot but has brains.
*May*
** Stubborn and hard-hearted. Strong-willed and highly motivated. Sharp
thoughts. Easily angered. Attracts others and loves attention. Deep
feelings. Beautiful physically and mentally. Firm Standpoint. Needs no
motivation. Shy towards opposite sex. Easily consoled. Systematic (left
brain). Loves to dream. Strong clairvoyance. Understanding. Sickness usually
in the ear and neck. Good imagination. Good physical. Weak breathing. Loves
literature and the arts. Loves traveling. Dislike being at home. Restless.
Not having many children. Hardworking. High-spirited.
*Jun*
You've got the best personality and are an absolute pleasure to be around.
You love to make new friends and be outgoing. You are a great flirt and more
than likely have an a very attractive partner. a wicked hottie. It is also
more than likely that you have a massive record collection. You have a great
choice in films, and may one day become a famous actor/actress yourself -
heck, you've got the looks for it!!!
*Jul *
Fun to be with. Secretive. Difficult to fathom and to be understood. Quiet
unless excited or tensed. Takes pride in oneself. Has reputation. Easily
consoled. Honest. Concerned about people's feelings. Tactful. Friendly.
Approachable. Emotional temperamental and unpredictable. Moody and easily
hurt. Witty and sparkly. spazzy at times. Not revengeful. Forgiving but
never forgets. dislikes nonsensical and unnecessary things. Guides others
physically and mentally. Sensitive and forms impressions carefully. Caring
and loving. Treats others equally. Strong sense of sympathy. Wary and sharp.
Judges people through observations. Hardworking. No difficulties in
studying. Loves to be alone. Always broods about the past and the old
friends. Waits for friends. Never looks for friends. Not aggressive unless
provoked. Loves to be loved. Easily hurt but takes long to recover. Repost
this in the next 5 mins and your reputation will boost someway in the next
12 days *
Aug*
Outgoing personality. takes risks. feeds on attention. No self-control.
Kind hearted. Self-confident. Loud and boisterous. VERY revengeful. Easy to
get along with and talk to. Has an "every thing's peachy" attitude. Likes
talking and singing. Loves music. Daydreamer. Easily distracted. Hates not
being trusted. BIG imagination. Loves to be loved. Hates studying. in need
of "that someone". Longs for freedom. Rebellious when withheld or
restricted. Lives by "no pain no gain" caring. Always a suspect. Playful.
Mysterious. "charming" or "beautiful" to everyone. stubborn. curious.
Independent. Strong willed. A fighter.
*Sept*
Active and dynamic. Decisive and haste but tends to regret. Attractive
and affectionate to oneself.. Strong mentality. Loves attention. Diplomatic.
Consoling, friendly and solves people's problems. Brave and fearless.
Adventurous. Loving and caring. Suave and generous. Usually you have many
friends. Enjoys to make love. Emotional. Stubborn. Hasty. Good memory.
Moving, motivates oneself and others. Loves to travel and explore.
Sometimes sexy in a way that only their lover can understand.
*Oct*
Loves to chat. Loves those who love them. Loves to takes things at the
center. Inner and physical beauty. Lies but doesn't pretend. Gets angry
often. Treats friends importantly. Brave and fearless. Always making
friends. Easily hurt but recovers easily. Daydreamer. Opinionated. Does not
care to control emotions. Unpredictable. Extremely smart, but definitely
the hottest AND sexiest of them all.
*Nov*
** Trustworthy and loyal. Very passionate and dangerous. Wild at times.
Knows how to have fun. Sexy and mysterious. Everyone is drawn towards your
inner and outer beauty and independent personality. Playful, but secretive.
Very emotional and temperamental sometimes. Meets new people easily and very
social in a group. Fearless and independent. Can hold their own. Stands out
in a crowd. Essentially very smart. Usually, the greatest men are born in
this month. If you ever begin a relationship with someone from this month,
hold on to them because their one of a kind.
*Dec *
This straight-up means you are the most good-looking person possible...
Better than all of these other months! Loyal and generous. Patriotic.
Competitive in everything. Active in games and interactions. Impatient and
hasty.. Ambitious. Influential in organizations. Fun to be with. Easy to
talk to, though hard to understand. Thinks far with vision, yet complicated
to know. Easily influenced by kindness. Polite and soft-spoken. Having lots
of ideas. Sensitive. Active mind. Hesitating tends to delay. Choosy and
always wants the best. Temperamental. Funny and humorous. Loves to joke.
Good debating skills. Has that someone always on his/her mind. Talkative.
Daydreamer. Friendly. Knows how to make friends. Abiding. Able to show
character. One guy/girl kind of person. Loveable. Easily hurt. Prone to
getting colds. Loves music. Pretty/handsome. Loves to dress up. Easily
bored. Fussy. Seldom shows emotions. Takes time to recover when hurt.
Sensitive.

Airhostess

A man was sitting in the bar at Heathrow Terminal 3 and noticed a really beautiful woman sitting next to him. He thought to himself: 'Wow, she's so gorgeous she must be an air hostess. I wonder which airline she works for. '

Hoping to pick her up, he leaned towards her and uttered the Delta Airline slogan, 'Love to fly and it shows?'

She gave him a blank, confused stare and he immediately thought to himself:' Well, she obviously doesn't work for Delta.'

A moment later, another slogan popped into his head, so he leaned towards her again and said, 'Something special in the air?'

She gave him the same confused look, and he mentally kicked himself, while scratching Singapore Airlines off the list.

He thought 'Perhaps she works for Thai Airways...' and said, 'Smooth as Silk?'

This time the woman turned on him and said, 'What the F*** do you want?' The man smiled, slumped back in his chair, and said - 'Ahhhhh, Finnair!'....

Power of Prayers

In a small town, a person decided to open up his Bar business, which was right opposite to a Temple. The Temple & its congregation started a campaign to block the Bar from opening with petitions and prayed daily against his business.

Work progressed. However, when it was almost complete and was about to open a few days later, a strong lightning struck the Bar and it was burnt to the ground.

The temple folks were rather smug in their outlook after that, till the Bar owner sued the Temple authorities on the grounds that the Temple through its congregation & prayers was ultimately responsible for the demise of his bar shop, either through direct or indirect actions or means.

In its reply to the court, the temple vehemently denied all responsibility or any connection that their prayers were reasons to the bar shop's demise. As the case made its way into court, the judge looked over the paperwork at the hearing and commented:

'I don't know how I'm going to decide this case, but it appears from the paperwork, we have a bar owner who believes in the power of prayer and we have an entire temple and its devotees that doesn't.'

Monday, September 8, 2008

Thursday, September 4, 2008

The Zen of Sarcasm

01. Do not walk ahead of me for I may not follow. Do not walk behind me for I may not lead. Do not walk beside me either. Just pretty much leave me alone.
02. The journey of a thousand miles begins with a broken fan belt and leaky tire.
03. It is always darkest before dawn. So if you're going to steal your neighbor's newspaper, that's the time to do it.
04. Don't be irreplaceable. If you can't be replaced, you can't be promoted.
05. Always remember that you're unique. Just like everyone else.
06. Never test the depth of the water with both feet.
07. If you think nobody cares if you're alive, try missing a couple of car payments.
08. Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes.
09. If at first you don't succeed, skydiving is probably not for you.
10. Give a man a fish and he will eat for a day. Teach him how to fish, and he will sit in a boat and drink beer all day .
11. If you lend someone $20 and never see that person again, it was probably a wise investment.
12. If you tell the truth, you don't have to remember anything.
13. Some days you're the bug; some days you're the windshield.
14. Everyone seems normal until you get to know them.
15. The quickest way to double your money is to fold it in half and put it back in your pocket.
16. A closed mouth gathers no foot.
17. Duct tape is like 'The Force'. It has a light side and a dark side, and it holds the universe together.
18. There are two theories to arguing with women. Neither one works.
19. Generally speaking, you aren't learning much when your lips are moving.
20. Experience is something you don't get until just after you need it.
21. Never miss a good chance to shut up.

AND

22. Never, under any circumstances, take a sleeping pill and a laxative on the same night.

Wednesday, September 3, 2008

Funny India-Pakistan Cricket

First Get The Dog Out Of Water

ہم آمریت کو گالی دیتے ہیں اسکے اسباب رفع نہیں کرتے۔جيسا کہ
ہم دھوکے باز مذہبی و غیر مذہبی سیاستدانوں کے منہ سے آمریت کے خلاف تقریریں سن سن کر آمریت کو تو اپنا سب سے بڑا دشمن سمجھنے لگے ہیں، مگر اس آمریت کو جنم دینے والے اور اسے پروان چڑھانے والے (مذہبی و غیر مذہبی) کاروباری سیاستدانوں کو اپنا مسیحا سمجھتے رہتے ہیں، جنہوں نے ہمیشہ اسلام اور پاکستان کے نام پر اپنی دکانداری چمکائی ہے اوراپنی جیبیں بھرنے کو ہی اسلام اور جمہوریت ٹھہرایا ہوا ہے۔
ان مذہبی و غیر مذہبی سیاستدانوں کی لوٹ مار اور مفاد پرستی پر مبنی سیاست دیکھ کر لامحالہ فوجی افسران کے منہ میں بھی پانی بھر آتا ہے اور وہ یہ سوچنے پر مجبورہوتے ہیں کہ ہم کیوں پیچھے رہیں؟ چنانچہ پچھلے 60 سال میں وہ بھی بار بار میدانِ

عمل میں کودے اور بہتی گنگا میں ہاتھ دھونا شروع کر دیے۔

حقیقت یہ ہے کی یہ مذہبی و غیر مذہبی سیاستدان اور فوجی حکمران پاکستان میںمریکی مفادات کے سب سے بڑے محافظ بن چکے ہیں اور اپنی قوم کی مخلص رہنمائیکی بجائے اسلام اور پاکستان کی دشمن قوموں کے آگے سربسجود ہیں

مشرف حکومت نے اسلام دشمن طاقتوں کے اشاروں پر سرحد اور بلوچستان میںآگ

اور خون کی ہولی کھیل کر وہاں کے عوام کے دلوں سے پاکستان اور پاک فوج کی

محبت و احترام ختم کر کے اس میں نفرت کے بیج بو دیئے ہیں۔

دوسری طرف طالبان کے حامی مذہبی سیاستدان اس ایشو پر بھی صرف اور صرف اپنی سیاست چمکا رہے ہیں۔ طالبان کا دیا ہوا اسلام کا تصور اسلام کا بہت بڑا دشمن ہے مگر جو کچھ مشرف انتظامیہ کر رہی ہے وہ بھی اسلام اور پاکستان کے حق می تباہ کن ہے۔

امریکہ نے اس بار ہم پر بڑا خطرناک وار کیا ہے اور ہمیں ایک ایسے دوراہے پر لاکھڑا کیا ہے کہ دونوں طرف ہمارے دشمن کھڑے ہیں اور بھولی قوم دو دھڑوں میں بٹ چکی ہے۔ ایک دھڑا مشرف کو مخلص سمجھتے ہوئے طالبان کا مخالف ہے تو دوسرا طالبان اور طالبان نما دھوکے بازوں کی ہمدردی میں مشرف کو گالیاں دیتا دکھائی دیتا ہے۔حالانکہ

ہم سب جانتے ہیں کہ کتے کو کنوئیں سے نکالے بغیر خواہ ہم ایک ہزار ڈول پانی نکال باہر کریں، کنواں کبھی صاف نہیں ہو سکتا۔ یونہی اپنے سیاسی ماحول میں در آنے والی گندگی کو صاف کئے بغیر آمریت کا مستقلاً راستہ روکنا ممکن نہیں۔ گزشتہ

سال 60

میں ہم بار ہا یہ تجربہ دہرا چکے ہیں مگر اس سے سبق سیکھنے کو تیار نہیں ہوتے۔

ہم نے کبھی اپنے سیاستدانوں سے یہ نہیں پوچھا کہ پچھلے الیکشن میں وہ کیا منشورپیش کر کے جیتے تھے؟ اور انہوں نے اس پر کتنے فیصد عمل کیا؟ اگر ہم نے اپناوطیرہ تبدیل نہ کیا تو فطرت ہمیں کچل کر رکھ دے گی۔
حکیم الامت علامہ محمد اقبال نے اسی سلسلے میں فرمایا تھا


فطرت افراد سے اِغماض بھی کر لیتی ہے
کبھی کرتی نہیں ملت کے گناہوں کو معاف

ہمارا قومی بگاڑ اپنی حدیں پار کرتے ہوئے اس پوائنٹ تک جا پہنچا ہے کہ اب یہاںایک ہمہ گیر انقلاب کے بغیر کوئی تبدیلی ممکن نہیں۔ ہمیں ضرورت ہے کسی خمینی

کی، جو اس گندی سیاست کے گٹر میں اتر کر اس کی

ایسی صفائی کرے کہ پھر کسی آمر کو اس قوم پر شب خون مارنے کی جرات نہ ہو سکے اور ان کاروباری

مذہبی و غیرمذہبی سیاستدانوں کا ایسا صفایا کرے کہ قوم کی ان سے مستقل جان

چھوٹ جائے۔

علاوہ ازیں جہاں وہ ایک طرف دین کی روح سے واقف ہو تو دوسری طرف جدید دور

کے تقاضوں سے باخبر ہو کہ نہ صرف وہ عوامی مسائل کو حل کر سکے بلکہ اقوامِ

مغرب کی آنکھوں میں آنکھیں ڈال کر باغیرت لہجے میں ان سے بات کر سکے اور

ہمیں زندہ قوموں میں نمایاں مقام پر لا کھڑا کرے

حکیم الامت علامہ محمد اقبال نے فرمایا

بے معجزہ دنیا میں ابھرتی نہیں قومیں

جو ضربِ کلیمی نہیں رکھتا وہ ہنر کیا

Thursday, August 28, 2008

Tuesday, August 26, 2008

Checked Listbox Items Iterations

You can fill you checked list box by two ways.Just simply inserting items by

chekedlistbox.items.add

and by datasource

As below........
You can also give datatable as data source.

NewUserGroup objNewUsrGrp = new NewUserGroup();
try
{
cklbUserGroups.DataSource = null;
cklbUserGroups.DataSource = objNewUsrGrp.GetUserGroups(0);
cklbUserGroups.DisplayMember = "GroupName";
cklbUserGroups.ValueMember = "GroupId";
}
catch (Exception objEx)
{
throw (objEx);
}

Iterating through selected Items/Checked Items to get Selected value....Or the ValueMember of CheckedListBox

for (int aloop = 0; aloop <= cklbUserGroups.Items.Count - 1; aloop++)
{
if (cklbUserGroups.GetItemCheckState(aloop) == CheckState.Checked)
{
cklbUserGroups.SetSelected(aloop, true);
cklbUserGroups.SelectedValue();
MessageBox.Show(cklbUserGroups.SelectedValue.ToString());
}
}
You can add any comments about this

Friday, August 22, 2008

Random acts of kindness

As she stood in front of her 5th grade class on the very first day of school, she told the children an untruth. Like most teachers, she looked at her students and said that she loved them all the same.
However, that was impossible, because there in the front row, slumped in his seat, was a little boy named Teddy Stoddard.

Mrs. Thompson had watched Teddy the year before and noticed that he did not play well with the other children, that his clothes were messy and that he constantly needed a bath. In addition, Teddy could be unpleasant

It got to the point where Mrs. Thompson would actually take delight in marking his papers with a broad red pen, making bold X's and then putting a big "F" at the top of his papers.

At the school where Mrs. Thompson taught, she was required to review each child's past records and she put Teddy's off until last. However, when she reviewed his file, she was in for a surprise.

Teddy's first grade teacher wrote, "Teddy is a bright child with a ready laugh. He does his work neatly and has good manners... he is a joy to be around."

His second grade teacher wrote, "Teddy is an excellent student, well liked by his classmates, but he is troubled because his mother has a terminal illness and life at home must be a struggle."

His third grade teacher wrote, "His mother's death has been hard on him. He tries to do his best, but his father doesn't show much interest, and his home life will soon affect him if some steps aren't taken."

Teddy's fourth grade teacher wrote, "Teddy is withdrawn and doesn't show much interest in school. He doesn't have many friends and he sometimes sleeps in class."

By now, Mrs. Thompson realized the problem and she was ashamed of herself. She felt even worse when her students brought her Christmas presents, wrapped in beautiful ribbons and bright paper, except for Teddy's.

His present was clumsily wrapped in the heavy, brown paper that he got from a grocery bag. Mrs. Thompson took pains to open it in the middle of the other presents. Some of the children started to laugh when she found a rhinestone bracelet with some of the stones missing, and a bottle that was
one-quarter full of perfume. But she stifled the children's laughter when she exclaimed how pretty the bracelet was, putting it on, and dabbing some of the perfume on her wrist.

Teddy Stoddard stayed after school that day just long enough to say, "Mrs. Thompson, today you smelled just like my Mom used to."

After the children left, she cried for at least an hour.

On that very day, she quit teaching reading, writing and arithmetic. Instead, she began to teach children. Mrs. Thompson paid particular attention to Teddy. As she worked with him, his mind seemed to come alive. The more she encouraged him, the faster he responded. By the end of the year, Teddy had become one of the smartest children in the class and, despite her lie that she would love all the children the same, Teddy became one of her "teacher's pets."

A year later, she found a note under her door, from Teddy, telling her that she was the best teacher he ever had in his whole life.

Six years went by before she got another note from Teddy. He then wrote that he had finished high school, third in his class, and she was still the best teacher he ever had in life.

Four years after that, she got another letter, saying that while things had been tough at times, he'd stayed in school, had stuck with it, and would soon graduate from college with the highest of honors. He assured Mrs. Thompson that she was still the best and favorite teacher he had ever had in his whole life.

Then four more years passed and yet another letter came. This time he explained that after he got his bachelor's degree, he decided to go a little further. The letter explained that she was still the best and favorite teacher he ever had. But now his name was a little longer.... The letter was signed, Theodore F. Stoddard, MD.

The story does not end there. You see, there was yet another letter that spring. Teddy said he had met this girl and was going to be married. He explained that his father had died a couple of years ago and he was wondering if Mrs. Thompson might agree to sit at the wedding in the place that was usually reserved for the mother of the groom. Of course, Mrs. Thompson did. And guess what? She wore that bracelet, the one with several rhinestones missing. Moreover, she made sure she was wearing the Perfume that Teddy remembered his mother wearing on their last Christmas together.

They hugged each other, and Dr. Stoddard whispered in Mrs. Thompson's ear, "Thank you Mrs. Thompson for believing in me. Thank you so much for making me feel important and showing me that I could make a difference."

Mrs. Thompson, with tears in her eyes, whispered back. She said, "Teddy, you have it all wrong. You were the one who taught me that I could make a difference. I didn't know how to teach until I met you."

(For you that don't know, Teddy Stoddard is the Dr. at Iowa Methodist in Des Moines that has the Stoddard Cancer Wing.)

Warm someone's heart today. . . pass this along.

I love this story so very much, I cry every time I read it. Just try to make a difference in someone's life today? tomorrow? just "do it".

Random acts of kindness, I think they call it!

Wednesday, August 20, 2008

Authenticate a User in Active Directory Using C#.NET

public user IsAuthenticated(string domainName, string userName, string password)
{
user userinformation = new user();
Result ReturnValue = new Result();
ReturnValue.ErrorCode = ErrorCode.UserAuthentication;


string FullName = domainName + @"\" + userName;
DirectoryEntry entry = new DirectoryEntry(this.ActiveDirectoryPath, FullName, password);
try
{
object AdEntry = entry.NativeObject;
DirectorySearcher search = new DirectorySearcher(entry);
search.Filter = "(SAMAccountName=" + userName + ")";
search.PropertiesToLoad.Add("cn");
search.PropertiesToLoad.Add("mail");
SearchResult result = search.FindOne();

if (result == null)
{
ReturnValue.IsTrue = false;
ReturnValue.Message = "Unable to authenticate " + userName + ".";
userinformation.result = ReturnValue;
return userinformation;
}

this.ActiveDirectoryPath = result.Path;

ReturnValue.IsTrue = true;
ReturnValue.Message = "Welecome " + userName + ".";
ReturnValue.UserName = (string)result.Properties["cn"][0];

userinformation.Username = ReturnValue.UserName;
userinformation.LogonUserName = userName;
if (result.Properties["mail"].Count > 0)
userinformation.Email = (string)result.Properties["mail"][0];
else
userinformation.Email = "no-email@domain.com";

}
catch (Exception ex)
{
ReturnValue.IsTrue = false;
ReturnValue.Message = ex.Message;
ReturnValue.Exception = ex.Message;
}

userinformation.result = ReturnValue;

return userinformation;
}

فراز کی وہ نظم۔۔۔

میں نے اکثر تمہارے قصیدے لکھے
اور آج اپنے نغموں سے شرمندہ ہوں
پابہ زنجیر یاروں سے نادم ہوں میں
اپنے گیتوں کی عظمت سے شرمندہ ہوں
سرحدوں نے کبھی جب پکارا تمہیں
آنسووں سے تمہیں الوداعیں کہیں
تم ظفرمند تو خير کیا لوٹتے
ہار کر بھی نہ جی سے اتارا تمہیں
جس جلال و رعونت سے وارد ہوئے
کس خجالت سے تم سوئے زنداں گئے
تیغ در دست وکف در دہاں آئے تھے
طوق در گردنوں پابہ جولاں گئے
سینہ چاکان مشرق بھی اپنے ہی تھے
جنکا خوں منہ کو ملنے کو تم آئے تھے
مامتائوں کی تقدیس کو لوٹنے
یا بغاوت کچلنے کو تم آئے تھے
انکی تقدیر تم کیا بدلتے مگر
انکی نسلیں بدلنے کو تم آئے تھے
جیسے برطانوی راج میں ڈوگرے
جیسے سفاک گورے تھے ویتنام میں
تم بھی ان سے ذرا مختلف تو نہیں
حق پرستوں پہ الزام انکے بھی تھے
وحشیوں سے چلن عام انکے بھی تھے
رائفلیں وردیاں نام انکے بھی تھے
آج سرحد سے پنجاب و مہران تک
تم نے مقتل سجائے ہیں کیوں غازیو
اتنی غارتگری کس کے ایما پر ہے
کس کی خاطر ہے یہ کشت و خوں غازیو
کس شہنشاہ عالی کا فرمان ہے
کس کے آگے ہو تم سرنگوں غازیو
آج شاعر پہ ہی قرض مٹی کا ہے
اب قلم ميں لہو ہے سیاہی نہیں۔
آج تم آئینہ ہو میرے سامنے
پیشہ ور قاتلو تم سپاہی نہیں

Tuesday, August 19, 2008

Why is a tie-breaker needed in gymnastics?

I was not pleased to learn that Nastia Liukin had been denied a gold in the uneven parallel bars due to a tiebreaker. Judging in gymnastics is under enough fire -- see Sacramone, Alicia -- so no fuel need be added.

Here is my question -- why not two golds? Ties result in two medals of the same color in several different sports. Two silvers were awarded in track and field in the women's 100m dash. Why is it necessary to break a tie in a sport that is overly subjective in the first place? If Liukin and China's He Kexin had routines that were truly identical in difficulty and execution, I see no harm in saying that and giving them both gold. If it is absolutely necessary to break the tie, do as other sports do and continue the competition. Have a tiebreaking routine with three or four required elements. Gold should not come down to an obscure reason.

If I had a gold to give out, I would give it to Liukin, not for her routine, but for her response.

"It’s nothing I can control, and honestly, I can say it has been very fair to me, and I got the biggest gold medal of them all," said Liukin, winner of the women’s all-around gymnastics gold.

Classy and well-spoken yet she still points out that she won the crown jewel of the Olympics in gymnastics. Well done, Nastia.

Monday, August 18, 2008

Be-aware of Ids of August

At last Pakistan get freed from Musharraf 8 years slavery.Although Zia Regime spend 11 years but we are happy that both dictators downed in the month of August one on 17th and other on 18th.
We should mark these days as
Happy Anti Dictator Day.

I appeal to all democratic peoples to stand with peoples of Pakistan to make this world more peaceful.

Friday, August 15, 2008

Wednesday, August 13, 2008

Get Active Directory Users in C#.NET

Active Directory is the primary user management system used by business and enterprise networks. It's basically just another kind of database, similar to MSSQL or Oracle, but with its own type of query language and protocol, which is based on LDAP.

Being able to query objects in Active Directory from within a C# ASP .NET web application can be a great knowledge tool. Many businesses who are moving their desktop applications to the web are asking for their .NET web applications to contain forms-based LDAP authentication and other hooks into Active Directory to process user objects.

The DirectoryEntry Object

The fundamental starting point for a .NET application using Active Directory is to include the System.DirectoryServices library. This contains the basic Active Directory library routines used to query. Communicating with Active Directory starts out with obtaining a DirectoryEntry object. This object is your root connection into the LDAP database, from which you can query for additional folders or objects. In order to obtain the DirectoryEntry object, you will need an Active Directory server address, username, and password. The server address can be an IP address or a complete LDAP path in the form LDAP://MyCompany.com/DC=MyCompany,DC=com

Connecting to Active Directory for the DirectoryEntry Object

Below is an example function to obtain a DirectoryEntry object for a fictional Active Directory server. Note the user of AuthenticationTypes.Secure to indicate we are making a secure authenticated connection to Active Directory. If you specify a regular user login, you will be restricted in what you may access. This can be handy to enforce role policies within your .NET web application. Alternatively, by connecting with an administrative account, you can perform administrative Active Directory functions such as modifying users, creating users, deleting users, etc.

using System.DirectoryServices;

private DirectoryEntry GetDirectoryObject()
{
DirectoryEntry oDE;
oDE = new DirectoryEntry("LDAP://192.168.1.101", "administrator", "password", AuthenticationTypes.Secure);
return oDE;
}

Grabbing a User from Active Directory in C# ASP .NET


After connecting to Active Directory, you will want to query for an object, such as a user. The below code sample shows how to get a user from Active Directory based on their login name. Note that we use a specific Active Directory query language where clauses are included inside parenthesis. You can only query on certain fields. The below example uses the field "SAMAccountName", which is another word for "username" or "login" in Active Directory. Notice we also query for an objectClass of type "user". Another objectClass is of type "contact". After finding the DirectoryEntry, we create a new DirectoryEntry object pointing to the result and use our administrative login information in the connection (so that we can perform admin functions on the object).

private DirectoryEntry GetUser(string UserName)
{
DirectoryEntry de = GetDirectoryObject();
DirectorySearcher deSearch = new DirectorySearcher();
deSearch.SearchRoot = de;

deSearch.Filter = "(&(objectClass=user)(SAMAccountName=" + UserName + "))";
deSearch.SearchScope = SearchScope.Subtree;
SearchResult results = deSearch.FindOne();

if (!(results == null))
{
de = new DirectoryEntry(results.Path, "administrator", "password", AuthenticationTypes.Secure);
return de;
}
else
{
return null;
}
}

Modifying a User's Properties in Active Directory in C# .NET

Modifying the property of an Active Directory object in C# .NET is fairly simple. You access the DirectoryEntry's Properties field, modify the values as needed (be sure to check for null), and finally call CommitChanges to commit and save the changes. An example is shown below, which modifies the user's Display Name property (this is the name shown as their real name in Active Directory or the Global Address List).

DirectoryEntry de = GetUser("john.doe");
if (de != null)
{
if (de.Properties["displayName"] != null && de.Properties["displayName"].Value != null)
{
de.Properties["displayName"].Value = "John, Doe (Nice Guy)";
de.CommitChanges();
}
}

Note in the above code, if you do not call de.CommitChanges(), the changes will not be saved to Active Directory. Another important note is that any changes you make will not be instantly visible in applications that query Active Directory (such as Active Directory Users and Computers in the control panel). This is because the changes need to synchronize over the servers and throughout the network. Some networks may take between 5-30 minutes for changes to be visible.

Querying Multiple Users in Active Directory with C# ASP .NET

The above discussed querying for individual DirectoryEntry objects. However, if you wish to retrieve a list of objects, you will need to use the SearchResultCollection type combined with deSearch.FindAll instead of deSearch.FindOne.

SearchResultCollection MyUsers = GetAllUsers();
if (MyUsers != null && MyUsers.Count > 0)
{
foreach (SearchResult m_User in MyUsers)
{
DirectoryEntry de = m_User.GetDirectoryEntry();
}
}

Using Active Directory within a C# .NET Web Application can be a powerful tool for business and enterprise networks. By designing web applications to suit the enterprise world, more desktop applications can be ported to the web and empower organizations.

Feel free to Primary Objects if you are in need of a C# .NET Web Application dealing with Active Directory functionality.

About the Author

This article was written by Kory Becker, founder and chief developer of Primary Objects, a software and web application development company.

Some Pics and Thoghts of Partition.

Pakistan & India are going to celebrate there 61st Independence day.Some time I wonder why we use the word independence when two separate countries came into being 60 years ago.
Ever wonder that Hindu & Muslim lived together in India for about 1000 years yet there is not a single incidence of communal violence that widespread the country.Brits ruled only for about 100 years by there famous principal "Divide & Rule".
Here are some heart touching pictures of the moment when India and Pakistan came into being.

Mountbatten arrives at Delhi airport; received by Nehru and Liaquat Ali. March 25, 1947. These guys become first Prime Ministers after partition.


The dead - Punjab, 1947


TRAIN TO PAKISTAN; India 1947. Trains packed with refugees - Hindus and Sikhs headed for India, and Muslims headed for Pakistan - were convenient targets for gangs of killers on both sides of the border. Inadequately protected 'Refugee Specials' were typically stopped, and the occupants butchered, several times in the course of the journey.

While celebrating we should remember all those who sacrifices their life, honor and belongings during the journey of blood and fire.

We are still under the governments who are using "Divide & Rule".

Your comments will be welcomed.Fell free to say any thing.Just respect others.

Thank You All

Raja Imran Nisar

Tuesday, August 12, 2008

Very Funny-Doctor Joke

Joe was moderately successful in his career, but as he got older
he was increasingly hampered by incredible headaches. After being
referred from one specialist to another, he finally came across a
doctor who solved the problem.


"The good news is I can cure your headaches. The bad news is that
it will require castration. You have a very rare condition which
causes your testicles to press up against the base of your spine.
The pressure creates one hell of a headache. The only way to
relieve the pressure is to remove the testicles."

Joe was shocked and depressed. He wondered if he had anything to
live for. He couldn't concentrate long enough to answer, but
decided he had no choice but to go under the knife.

When he left the hospital following the surgery, he felt like he
was missing an important part of himself. Just the same, as he
walked down the street, he realized that he felt like a different
person. He could make a new beginning and live a new life.

He walked past a men's clothing store and thought, "That's what I
need: A new suit." He entered the shop and told the salesman,

"I'd like a new suit."

The salesman eyed him briefly and said, "Let's see . . .Size 44
tall."

Joe laughed, "That's right, how did you know?"

"It's my job," the salesman replied. Joe tried on the suit. It
fit perfectly. As Joe admired himself in the mirror, the salesman
asked,

"How about a new shirt?"

Joe thought for a moment and then said, "Sure."

The salesman eyed Joe and said, "Let's see . . . 34 sleeve and .
. .16-and-a-half neck."

Joe was surprised, "That's right, how did you know?"

"It's my job."

Joe tried on the shirt, and it fit perfectly. As Joe adjusted the
collar in the mirror, the salesman asked,

"How about new shoes?"

Joe was on a roll and said, "Sure."

The salesman eyed Joe's feet and said, "Let's see . . .9-and-a-
half . . .wide.

Joe was astonished, "That's right, how did you know?"

"It's my job."

Joe tried on the shoes and they fit perfectly. Joe walked
comfortably around the shop and the salesman asked,

"How about a new hat?"

Without hesitating, Joe said, "Sure."

The salesman eyed Joe's head and said, "Let's see . . .7 and
5/8."

Joe was incredulous, "That's right, how did you know?"

"It's my job." The hat fit perfectly. Joe was feeling great, when
the salesman asked,

"How about some new underwear?"

Joe thought for a second and said, "Sure."

The salesman stepped back, eyed Joe's waist and said, "Let's see
. . .Size 36."

Joe laughed, "No, I've worn size 34 since I was 18 years old."

The salesman shook his head, "No. You can't wear a size 34. "It
would press your testicles up against the base of your spine and
give you one hell of a headache."

Second Dog- An Amazing Article

Monday, August 11, 2008

Punjabi Cricket Tendulkar Special

Friendship




True Friendship
A friend is someone we turn to
When our spirits need a lift
A friend is someone we treasure
For our friendship is a gift
A friend is someone who fills our lives
with beauty, joy, and grace

And makes the world we live in
a better and happier place.

There is a miracle called friendship
that dwells in the heart.
You do not know how it happens
or when it gets its start.

But you know the special lift
it always brings.
You realize that friendship
is God's most precious gift!
..............................................................................................................................................

Friday, August 8, 2008

My First Blog

I was just sittin and listening some musinc when Faran come to me and open his blog.He told me amazing life of Blogistan and I immediately create my own blog and this is my first post.