“The 22 Rules That Turned Me From Invisible to Irresistible With Women… Starting Tonight”

You can skip the expensive cars, the fancy clothes, and the endless gym selfies. Completely unnecessary.

I used to freeze the second a beautiful woman looked my way. Frustrated. Awkward. Watching other guys walk away with the girl while I stood there tongue-tied.

Then I discovered 22 simple rules that rewired my entire dating life. The anxiety vanished. Conversations flowed effortlessly. Women started chasing me for a change.

These rules trigger a woman's subconscious attraction switches. And you can start using them tonight.

Read more...

c# proyect

azrael

Don Juan
Joined
Aug 30, 2008
Messages
72
Reaction score
1
i think there are some programmers here so i am looking for a little bit of help.
i need to make a temp. converter in c# (using visual studio express 2010)

the form is : enter a value in a text box,
choose from what temp. to the other to convert using a "combo box"
for example from

Fahrenheit to Celsius. and when you press a "execute button" the conversion would display in another textbox

but i am having troubles doing it, my approach was


if (comboBox1.Text == "FAHRENHEIT A CELSIUS")
{

a =Convert.ToInt32( textbox1.Text);
c= (a - 32) / 1.8;
textbox2.Text = c.ToString();
}

but that is not working . i made a calculator using something like that.

if you guys can point me in the right direction it would be much appreciated
 

What happens, IN HER MIND, is that she comes to see you as WORTHLESS simply because she hasn't had to INVEST anything in you in order to get you or to keep you.

You were an interesting diversion while she had nothing else to do. But now that someone a little more valuable has come along, someone who expects her to treat him very well, she'll have no problem at all dropping you or demoting you to lowly "friendship" status.

Quote taken from The SoSuave Guide to Women and Dating, which you can read for FREE.

mikeyb

Senior Don Juan
Joined
May 10, 2007
Messages
472
Reaction score
16
Age
38
Location
UK
Trying to use int32 type for floating point operations (i.e. decimals) will produce problems because int32 only stores integers. Use the "double" type instead.
 

synergy1

Master Don Juan
Joined
Sep 22, 2006
Messages
1,984
Reaction score
192
mikeyb said:
Trying to use int32 type for floating point operations (i.e. decimals) will produce problems because int32 only stores integers. Use the "double" type instead.
In C, you can use both i believe, int32 would likely only truncate the answer by removing trailing decimals and rounding, not cause an compile error but will clearly be a runtime error.

Also not sure on the rules of C#, if you have an int in an equation and divide by a double, will the result convert to an int or a double? Had a lot of runtime errors based on passing integers through functions and having them convert or drop decimal places.
 

Teflon_Mcgee

Master Don Juan
Joined
Apr 3, 2006
Messages
918
Reaction score
27
Besides the whole int32 vs. double (which shouldn't be that big of a deal in c#)
there is also this

comboBox1.Text == "FAHRENHEIT A CELSIUS"


A more proper way would be to use any of the following:


1. if(comboBox1.Text.CompareTo("FAHRENHEIT A CELSIUS") == 1);
2. if(String.Compare(comboBox1.text, "FAHRENEHEIT A CELSISU") == 1);
3. if(comboBox1.Text.Equals("FAHRNEHEIGHT A CELSIUS") == 1);
 

azrael

Don Juan
Joined
Aug 30, 2008
Messages
72
Reaction score
1
thank you so much!!!!!

i just needed to change the way i was declaring the value for the program to run


up here i did not pust it but it was a:

int a=0,c=0;
i just needed to change the int for double


if (comboBox1.Text == "FAHRENHEIT A CELSIUS")
{

a =Convert.ToInt32( textbox1.Text);
c= (a - 32) / 1.8;
textbox2.Text = c.ToString();



and +1 to you guys

}
 

Huffman

Master Don Juan
Joined
Oct 29, 2007
Messages
1,499
Reaction score
166
Teflon_Mcgee said:
A more proper way would be to use any of the following:


1. if(comboBox1.Text.CompareTo("FAHRENHEIT A CELSIUS") == 1);
2. if(String.Compare(comboBox1.text, "FAHRENEHEIT A CELSISU") == 1);
3. if(comboBox1.Text.Equals("FAHRNEHEIGHT A CELSIUS") == 1);
As long as he's staying with C#, the == will do just fine. The whole reference vs value comparison is an ugly thing and I agree that for good style you should always use Equals, but just saying that in C# the == operator is overloaded for equals.

In Java it wouldn't work however I think... makes for alot of ugly bugs.
 

Teflon_Mcgee

Master Don Juan
Joined
Apr 3, 2006
Messages
918
Reaction score
27
Huffman said:
As long as he's staying with C#, the == will do just fine. The whole reference vs value comparison is an ugly thing and I agree that for good style you should always use Equals, but just saying that in C# the == operator is overloaded for equals.

In Java it wouldn't work however I think... makes for alot of ugly bugs.

Yes, that's why C# is so awesome. Any Windows utility I make I ALWAYS do in C# (where I used to use Java as it's easier to do GUI's than C++.)

But I'm a hardware guy so I spend my time in assembly and C, unfortunately.
 
Top