|
Hi
Does anyone have or know of a site that can show me how to solve a quadratic equation (x2+x+4=0) getting the value of x.Im using C# and i checked the .NET help and nothing useful came up.
Thanks alot i would really appreciate any information that might help.
|
|
|
|
|
This should be fairly easy just look for algorithm. I have such somewhere in C:
:-O
<br />
#include <math.h><br />
#include <iostream><br />
<br />
using namespace std;<br />
<br />
int main( void )<br />
{<br />
float a, b, c;
<br />
float x1Real, x1Imaginary;
float x2Real, x2Imaginary;
<br />
double D;
<br />
cout << "Enter variable a: ";<br />
cin >> a;<br />
<br />
cout << "Enter variable b: ";<br />
cin >> b;<br />
<br />
cout << "Enter variable c: ";<br />
cin >> c;<br />
<br />
if ( a==0 )<br />
{<br />
if ( b==0 )<br />
{<br />
if ( c==0 )<br />
cout << "\nInfinite number of solutions" << endl << endl;<br />
else<br />
cout << "\nNo solutions" << endl << endl;<br />
}<br />
else<br />
{<br />
x1Real = -b/c;<br />
cout << endl << " Result: xl real = " << x1Real << endl << endl;<br />
}<br />
}<br />
else<br />
{<br />
D = b*b - 4*a*c;<br />
if( D >= 0 )<br />
{ <br />
D = sqrt (D) ;<br />
if( b >=0 )<br />
x1Real = (-b-D)/(2*a); <br />
else<br />
x1Real = (-b+D)/(2*a); <br />
x2Real = c/(x1Real*a);<br />
<br />
cout << endl;<br />
cout << " Result: xl real = " << x1Real << endl;<br />
cout << " x2 real = " << x2Real << endl << endl;<br />
}<br />
else<br />
{ <br />
x1Real = -b/ (2*a) ;<br />
x2Real = -x1Real;<br />
<br />
x1Imaginary = sqrt(-D);<br />
x2Imaginary = -x1Imaginary;<br />
<br />
cout << endl;<br />
cout << " Result: xl real = " << x1Real << endl;<br />
cout << " x1 imaginary = " << x1Imaginary << endl;<br />
cout << " x2 real = " << x2Real << endl;<br />
cout << " x2 imaginary = " << x2Imaginary << endl << endl;<br />
}<br />
}<br />
}
|
|
|
|
|
[LocalizableAttribute(true)] <br />
public string[] Lines { get; set; }
If this property is an Array? How can I add a text to a specific line or read a specific line?
this wont work
this.richTextBox.Lines[2] = "row 3";
|
|
|
|
|
Lines returns a read-only array. You can't set individual elements. However, you can replace the array:
string[] newLines = (string[])(this.richTextBox.Lines.Clone());
newLines[2] = "row 3";
this.richTextBox.Lines = newLines
--
I've killed again, haven't I?
|
|
|
|
|
|
Hi
Its very urgent . Can anyone help me in this problem?? I AM ABLE TO DO ALL THE OPERATIONS WITH OUTLOOK EXCEPT READING THE ADDRESS BOOK... PLZ HELP ME ..
Thanks in advance
Akhil
|
|
|
|
|
|
Thanks Robert for ur instant reply...
it helped me to some extend .. but i needed to access global address book.. i got it .. by the following code
int s=oNameSpace.AddressLists.Item(1).AddressEntries.Count;
for(int i=1;i<=s;i++)
{
lb.Items.Add(oNameSpace.AddressLists.Item(1).AddressEntries.Item(i).Name);
}
Thanks Again
|
|
|
|
|
I want to read the pixel value of somae images including 16-bit signed and 16-bit unsigned. of course I have some GIS raster data in USA native format (SRTM3 from NASA)I have also problem with reading theme.
Please can anybody help me?
Regrads and Thanks
Isaac
Dept of Geography
Kharazmi University
|
|
|
|
|
Reading pixel values from Images is rather easy:
Bitmap b = new Bitmap("C:\\myBitmap.bmp");
Color c = b.GetPixel(3, 4);
As this operation might be slow you can also go the unmanaged way. For this have a look at the Image Processing for Dummies[^] article series.
With SRTM3 I can't help you (although I have some knowledge in the GIS area).
|
|
|
|
|
in my program i need to connect the database table to the treeview .
can anybody help me to make this attempt helpful.
thanks in advance
my email id is jinu_p20@yahoo.com
-- modified at 1:24 Friday 12th May, 2006
|
|
|
|
|
|
|
i want to use the visual studio calendar object but i hate its graphic, how can i do?
|
|
|
|
|
I am drawing a binary tree on form.
but when i resize form window to small and resize it back, the portion of drawing which is in resize area, is got erased. how can i get that drawing back..
Pls help me out
|
|
|
|
|
Repaint form on Resize event.
Best regards, Alexey.
|
|
|
|
|
There is no repaint method for form object.
How can i repaint
|
|
|
|
|
Call Invalidate() method. And if you painting in form event Paint - your code repaint your tree.
If you got flickering set form DoubleBuffered property to true.
Why don't you use UserControl, instead of painting on form ?
Best regards, Alexey.
|
|
|
|
|
Hi cshivaprasad!
If you're inherting from a form, add these lines of code to your constructor.
SetStyle(ControlStyles.ResizeRedraw, true);
this will automatically repaint your form when it's resize.
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.DoubleBuffer, true);
this will prevent the flickering of your form.
hope these help!
microsoc
|
|
|
|
|
i build something like a search function.
but he doesn't fill my parameter
the parameter does get a value.. but when he should put it into my select command he give the error:
No value given for one or more required parameters.
so..
this is a little peace of my select command
<br />
WHERE (T075_BORGTOCHTNUMMER_1 LIKE VAL)<br />
en this is my code that should fill the parameter "VAL"
<br />
<br />
string val;<br />
<br />
if (textBox1.Text != string.Empty)<br />
{<br />
val = textBox1.Text;<br />
}<br />
else<br />
{<br />
val = "%";<br />
}<br />
<br />
this.dBANBM_T075_BORGTOCHTTableAdapter.Fill(this.testdb1DataSet.DBANBM_T075_BORGTOCHT);<br />
hope some one can help or give some advise
|
|
|
|
|
It depends on what database you use, but normally you can create commands like this:
SELECT * FROM DBANBM_T075_BORGTOCHT WHERE Id = @Id
And insert parameters into the command like this:
SqlCommand cmd = new SqlCommand(query,connection);<br />
<br />
cmd.AddParameterWithValue("@Id",1);
Be adviced: I do this without the help of a little intellisense
So the syntax of the AddParameterWithValue may vary.
WM.
What about weapons of mass-construction?
-- modified at 3:33 Wednesday 10th May, 2006
For an access database the parameters have a questionmark as placeholder and are position dependend.
|
|
|
|
|
i use a access database and soon i will use a oracle database.
but what do you mean with "are position dependend"?
|
|
|
|
|
If you have
INSERT INTO Tbl (Id,Value) (?,?)
The first parameter to add has to be the parameter that is first mentioned in the command. You cant first add the parameter for the Value and the parameter for Id after that.
WM.
What about weapons of mass-construction?
|
|
|
|
|
oh i see
thanks
error:
Syntax error (missing operator) in query expression '(T075_BORGTOCHTNUMMER_1 = ?VAL)'.
what operator does he need?
i've tried '' and [] and stuf like that.
the other code i didn't change.
|
|
|
|
|
Use this expression: '(T075_BORGTOCHTNUMMER_1 = ?)'.
In Access you can't name the parameters. Thats the reason you have to add their values in the right order.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
www.troschuetz.de
|
|
|
|