Found it quiet not quite:) interesting so here i go
System.FlagsAttribute
[Flags]
enum StateWithFlags
{
None = 0,
Read = 1,
Write = 2,
Delete = 4
}
enum StateWithNoFlags
{
None = 0,
Read = 1,
Write = 2,
Delete = 4
}
for (int enumValue = 0; enumValue <= 8; enumValue++)
Console.WriteLine("StateWithFlags: " + enumValue.ToString() + " " + ((StateWithFlags)enumValue).ToString());
/*
this returns:(2=1 in case of 3 as 3 is not defined similarly for 5=4+1)
StateWithFlags: 0 None
StateWithFlags: 1 Read
StateWithFlags: 2 Write
StateWithFlags: 3 Read, Write
StateWithFlags: 4 Delete
StateWithFlags: 5 Read, Delete
StateWithFlags: 6 Write, Delete
StateWithFlags: 7 Read, Write, Delete
StateWithFlags: 8 8
*/
for (int enumValue = 0; enumValue <= 4; enumValue++)
Console.WriteLine("StateWithNoFlags: " + enumValue.ToString() + " " + ((StateWithNoFlags)enumValue).ToString());
/*
this returns:
0 None
1 Read
2 Write
3 3
4 Delete
*/
Hope this is self explanatory :)
Wednesday, November 11, 2009
Thursday, October 29, 2009
RS 6230 for Who you are
Sum that people pay at times to discuss bullshit....
"Kya hai" "Kyun hai" "Main kaun hoon" "Kyun Hoon" Sounds Like Chuck this guy out...He is asa/ramdev extra types that are seen on pragya tv....
A simple question i am trying to evaluate from past (after 8th standard there is a long story behind this period you would need to be 8 10 pegs down with me before i start this chapter enough...focus after closing bracket now) 14 years ....didnt get an answer though. Does anyone has that answer go ahead and i ask you yes you to provide me and help me in every possible way you can (your motive could be being a human being)all answers will lead me to somewhere.......
An incident today :-So there was a small discussion within a group of intellectually percepted and knowledgeably masturbated(original term is intellectual masturbation hats off) people and the crux is no one is sure what it is why it is types but yes i am sure thats an intriguing question which everyone must evaluate and try to answer.It will surely help him(I am a male chauvinist) in leading his life in a meaningful manner....
I don't want to say-utter what i have percepted or learned (a relatively permanent change in behavior is learning) so far....
Just a thought may be but i assume its intriguing for sure i am still struggling...
"Kya hai" "Kyun hai" "Main kaun hoon" "Kyun Hoon" Sounds Like Chuck this guy out...He is asa/ramdev extra types that are seen on pragya tv....
A simple question i am trying to evaluate from past (after 8th standard there is a long story behind this period you would need to be 8 10 pegs down with me before i start this chapter enough...focus after closing bracket now) 14 years ....didnt get an answer though. Does anyone has that answer go ahead and i ask you yes you to provide me and help me in every possible way you can (your motive could be being a human being)all answers will lead me to somewhere.......
An incident today :-So there was a small discussion within a group of intellectually percepted and knowledgeably masturbated(original term is intellectual masturbation hats off) people and the crux is no one is sure what it is why it is types but yes i am sure thats an intriguing question which everyone must evaluate and try to answer.It will surely help him(I am a male chauvinist) in leading his life in a meaningful manner....
I don't want to say-utter what i have percepted or learned (a relatively permanent change in behavior is learning) so far....
Just a thought may be but i assume its intriguing for sure i am still struggling...
Tuesday, October 27, 2009
How to insert ' character in sql server
Heard Many done Many times but couldn't find a better google link
so posting it here for my own use or someone elses may be :)
Had a requirement to insert special characters ' in nvarchar
Now the data to be inserted is
Integrated Security=SSPI;Pooling='true';Persist Security Info=False;Initial Catalog=xyz;Data Source=LocalHost;Min Pool Size=5
we have a table whose value coulmn(Value column is of nvarchar(1024) type) needs to be inserted with this data(note the data to be inserted carries a 'true' value also)
so the trick is here-
update mytable set
value= 'Integrated Security=SSPI;Pooling=''true'';Persist Security Info=False;Initial Catalog=sleepme;Data Source=LocalHost;Min Pool Size=5' where idname='DataLocation'
Relief....
so posting it here for my own use or someone elses may be :)
Had a requirement to insert special characters ' in nvarchar
Now the data to be inserted is
Integrated Security=SSPI;Pooling='true';Persist Security Info=False;Initial Catalog=xyz;Data Source=LocalHost;Min Pool Size=5
we have a table whose value coulmn(Value column is of nvarchar(1024) type) needs to be inserted with this data(note the data to be inserted carries a 'true' value also)
so the trick is here-
update mytable set
value= 'Integrated Security=SSPI;Pooling=''true'';Persist Security Info=False;Initial Catalog=sleepme;Data Source=LocalHost;Min Pool Size=5' where idname='DataLocation'
Relief....
Wednesday, October 14, 2009
To Rohit student of IIIrd B
This is something coming straight from my heart...
I got a card today from Rohit a student of IIIrd -B Quoting "To Mr.Sandeep Lohani"
With a message "Help is always considered in the eyes of GOD. Thanks! From, Rohit"
To tel you some features of this card..
1. Amazing Clean and Neat Hand Writing...
2. Flawless Drawing of a beautiful Rose in the front(Created by Cute Rohit)
3. The Message....
Now you must be wondering why i got this card ...
Reason:In his eyes i made a difference to his life by contributing a meagre amount to his education.....which was not a significant amount from my end at all....
filled with emotions and Abbot to cry is what i feel right nowow..
Guys Trust me go ahead and make a difference to the life's of these children and trust me again end of the day it would be worth seeing the growth of these wonderful brilliant kids....
Go ahead and make a difference to someones life and this would be worth it....
I got a card today from Rohit a student of IIIrd -B Quoting "To Mr.Sandeep Lohani"
With a message "Help is always considered in the eyes of GOD. Thanks! From, Rohit"
To tel you some features of this card..
1. Amazing Clean and Neat Hand Writing...
2. Flawless Drawing of a beautiful Rose in the front(Created by Cute Rohit)
3. The Message....
Now you must be wondering why i got this card ...
Reason:In his eyes i made a difference to his life by contributing a meagre amount to his education.....which was not a significant amount from my end at all....
filled with emotions and Abbot to cry is what i feel right nowow..
Guys Trust me go ahead and make a difference to the life's of these children and trust me again end of the day it would be worth seeing the growth of these wonderful brilliant kids....
Go ahead and make a difference to someones life and this would be worth it....
Thursday, October 1, 2009
H1N1 Cases are Curable....
Well this one goes to all the people who are frightened with H1N1 and haven't seen any positive news so far as to "IS H1N1 CURABLE"???.Answer is YES....
Recently i saw one of the cases in our relatives recently and on the first day itself he was showing symptoms of H1N1 so he was on the Tami flu medications from the day one by the doctors and by the time he got tested positive with the report which come after 5 days (horrible)he got himself tested again and the report was negative and he came out of this deadly disease..
This one for spreading positivity around H1N1 Curability!!!!!
Hale Hearty
Recently i saw one of the cases in our relatives recently and on the first day itself he was showing symptoms of H1N1 so he was on the Tami flu medications from the day one by the doctors and by the time he got tested positive with the report which come after 5 days (horrible)he got himself tested again and the report was negative and he came out of this deadly disease..
This one for spreading positivity around H1N1 Curability!!!!!
Hale Hearty
Tuesday, September 29, 2009
Wheel Balancing And Wheel Alignment
Goofed up !!!!!
How much important is it to get your Wheel Balancing And Wheel Alignment done in time i realized this hard way :(..Let me take you through this...
Its been long that i have been observing that when i left my power drive steering all alone my steering was bending towards right direction always and Car was moving in right direction due to which my Tyres on the right side of Car were getting "Kahoed" as explained to me by few drivers "Gaadi Tyre khaa rahi hai jee aaapkey" and i was astonished to hear that did my Car is turning into a rubber eating monster :(.... anyways by this time damage to my pcket to my tyres and to my trip was already done and on the top of it the four studs thorugh which wheel get married were broken too (my bad rajeev/kb/pankaj :))
after having all this trauma done to my beauty babe getz i hooked up to micheline(3100 EACH TYRE ) and got the two right side tyres replaced with a sturdy booty :)....
Gosh and on wheel balancing alignment i had spent nearly 2k + 3100* 2 + 2 days(din ka kya hai free hi hai)...
How much important is it to get your Wheel Balancing And Wheel Alignment done in time i realized this hard way :(..Let me take you through this...
Its been long that i have been observing that when i left my power drive steering all alone my steering was bending towards right direction always and Car was moving in right direction due to which my Tyres on the right side of Car were getting "Kahoed" as explained to me by few drivers "Gaadi Tyre khaa rahi hai jee aaapkey" and i was astonished to hear that did my Car is turning into a rubber eating monster :(.... anyways by this time damage to my pcket to my tyres and to my trip was already done and on the top of it the four studs thorugh which wheel get married were broken too (my bad rajeev/kb/pankaj :))
after having all this trauma done to my beauty babe getz i hooked up to micheline(3100 EACH TYRE ) and got the two right side tyres replaced with a sturdy booty :)....
Gosh and on wheel balancing alignment i had spent nearly 2k + 3100* 2 + 2 days(din ka kya hai free hi hai)...
Friday, July 31, 2009
# Drived me Crazy............(Unable to Open CHM files)
This one is another learning for me....
I had a folder(Kyun Banaya tha mainey grrrrr) in my Lappy(Vista 64 Bit) named C# Tutorials and under that i had some great stuff in the form of *.chm files...To My surprise i was not able to view those files(I knw...I knw Unblock feature).....
So i removed those chm files to my c:\ drive directly and tried opening them and it worked ....after a two week of re-search and scratching....i found it was the # in the "c:\C# Tutorials" that was breaking the whole damm thing....
Anyway now its ok :)
I had a folder(Kyun Banaya tha mainey grrrrr) in my Lappy(Vista 64 Bit) named C# Tutorials and under that i had some great stuff in the form of *.chm files...To My surprise i was not able to view those files(I knw...I knw Unblock feature).....
So i removed those chm files to my c:\ drive directly and tried opening them and it worked ....after a two week of re-search and scratching....i found it was the # in the "c:\C# Tutorials" that was breaking the whole damm thing....
Anyway now its ok :)
Monday, June 29, 2009
Focusing on Problems and Focusing on Solutions
Difference between Focusing on Problems and Focusing on Solutions
Case 1
When NASA began the launch of astronauts into space, they found out
that the pens wouldn't work at zero gravity (ink won't flow down to the
writing surface). To solve this problem, it took them one decade and $12 million. They developed a pen that worked at zero gravity, upside down, underwater, in practically any surface including crystal and in a temperature range from below freezing to over 300 degrees C.
And what did the Russians do...?? They used a pencil.
Case 2
One of the most memorable case studies on Japanese management was the
case of the empty soapbox, which happened in one of Japan's biggest
cosmetics companies. The company received a complaint that a consumer had bought a soapbox that was empty. Immediately the authorities isolated the
problem to the assembly! line, which transported all the packaged boxes of
soap to the delivery department. For some reason, one soapbox went through
the assembly line empty. Management asked its engineers to solve the
problem. Post-haste, the engineers worked hard to devise an X-ray machine with high-resolution monitors manned by two people to watch all the
soapboxes that passed through the line to make sure they were not empty. No
doubt, they worked hard and they worked fast but they spent a whoopee amount to do so. But when a rank-and-file employee in a small company was posed with the same problem, he did not get into complications of X-rays, etc., but instead came out with another solution. He bought a strong industrial
electric fan and pointed it at the assembly line. He switched the fan
on, and as each soapbox passed the fan, it simply blew the empty boxes out
of the line.
Moral : Always look for simple solutions .
Devise the simplest possible solution that solves the problems
Case 1
When NASA began the launch of astronauts into space, they found out
that the pens wouldn't work at zero gravity (ink won't flow down to the
writing surface). To solve this problem, it took them one decade and $12 million. They developed a pen that worked at zero gravity, upside down, underwater, in practically any surface including crystal and in a temperature range from below freezing to over 300 degrees C.
And what did the Russians do...?? They used a pencil.
Case 2
One of the most memorable case studies on Japanese management was the
case of the empty soapbox, which happened in one of Japan's biggest
cosmetics companies. The company received a complaint that a consumer had bought a soapbox that was empty. Immediately the authorities isolated the
problem to the assembly! line, which transported all the packaged boxes of
soap to the delivery department. For some reason, one soapbox went through
the assembly line empty. Management asked its engineers to solve the
problem. Post-haste, the engineers worked hard to devise an X-ray machine with high-resolution monitors manned by two people to watch all the
soapboxes that passed through the line to make sure they were not empty. No
doubt, they worked hard and they worked fast but they spent a whoopee amount to do so. But when a rank-and-file employee in a small company was posed with the same problem, he did not get into complications of X-rays, etc., but instead came out with another solution. He bought a strong industrial
electric fan and pointed it at the assembly line. He switched the fan
on, and as each soapbox passed the fan, it simply blew the empty boxes out
of the line.
Moral : Always look for simple solutions .
Devise the simplest possible solution that solves the problems
Stephen Covey 90/10 Principle
Author: Stephen Covey
Discover the 90/10 Principle.It will change your life (at least the way you react to situations).
What is this principle? 10% of life is made up of what happens to you. 90% of life is decided by how you react.
What does this mean? We really have no control over 10% of what happens to us.
We cannot stop the car from breaking down. The plane will be late arriving, which throws our whole schedule off. A driver may cut us off in traffic.We have no control over this 10%. The other 90% is different. You determine the other 90%. How? ……….By your reaction.
You cannot control a red light. but you can control your reaction. Don't let people fool you; YOU can control how you react.
You are eating breakfast with your family. Your daughter knocks over a cup of coffee onto your business shirt. You have no control over what just happened.
What happens next will be determined by how you react.
You curse.
You harshly scold your daughter for knocking the cup over. She breaks down in tears. After scolding her, you turn to your spouse and criticize her for placing the cup too close to the edge of the table. A short verbal battle follows. You storm upstairs and change your shirt. Back downstairs, you find your daughter has been too busy crying to finish breakfast and get ready for school. She misses the bus.
Your spouse must leave immediately for work. You rush to the car and drive your daughter to school. Because you are late, you drive 40 miles an hour in a 30 mph speed limit.
After a 15-minute delay and throwing $60 traffic fine away, you arrive at school. Your daughter runs into the building without saying goodbye. After arriving at the office 20 minutes late, you find you forgot your briefcase. Your day has started terrible. As it continues, it seems to get worse and worse. You look forward to coming home.
When you arrive home, you find small wedge in your relationship with your spouse and daughter.
Why? …. Because of how you reacted in the morning.
Why did you have a bad day?
A) Did the coffee cause it?
B) Did your daughter cause it?
C) Did the policeman cause it?
D) Did you cause it?
The answer is “D".
You had no control over what happened with the coffee. How you reacted in those 5 seconds is what caused your bad day.
Here is what could have and should have happened.
Coffee splashes over you. Your daughter is about to cry. You gently say, "Its ok honey, you just need to be more careful next time". Grabbing a towel you rush upstairs. After grabbing a new shirt and your briefcase, you come back down in time to look through the window and see your child getting on the bus. She turns and waves. You arrive 5 minutes early and cheerfully greet the staff. Your boss comments on how good the day you are having.
Notice the difference?
Two different scenarios. Both started the same. Both ended different.
Why?
Because of how you REACTED.
You really do not have any control over 10% of what happens. The other 90% was determined by your reaction.
Here are some ways to apply the 90/10 principle. If someone says something negative about you, don't be a sponge. Let the attack roll off like water on glass. You don't have to let the negative comment affect you!
React properly and it will not ruin your day. A wrong reaction could result in losing a friend, being fired, getting stressed out etc.
How do you react if someone cuts you off in traffic? Do you lose your temper? Pound on the steering wheel? A friend of mine had the steering wheel fall off) Do you curse? Does your blood pressure skyrocket? Do you try and bump them?
WHO CARES if you arrive ten seconds later at work? Why let the cars ruin your drive?
Remember the 90/10 principle, and do not worry about it.
You are told you lost your job.
Why lose sleep and get irritated? It will work out. Use your worrying energy and time into finding another job.
The plane is late; it is going to mangle your schedule for the day. Why take outpour frustration on the flight attendant? She has no control over what is going on.
Use your time to study, get to know the other passenger. Why get stressed out? It will just make things worse.
Now you know the 90-10 principle. Apply it and you will be amazed at the results. You will lose nothing if you try it. The 90-10 principle is incredible. Very few know and apply this principle.
The result?
Millions of people are suffering from undeserved stress, trials, problems and heartache. We all must understand and apply the 90/10 principle.
It CAN change your life!!!
Subscribe to:
Posts (Atom)