Click here to Skip to main content
15,893,508 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Angle Algorithm Pin
CPallini4-Apr-07 4:04
mveCPallini4-Apr-07 4:04 
GeneralRe: Angle Algorithm Pin
cp98764-Apr-07 18:09
cp98764-Apr-07 18:09 
GeneralRe: Angle Algorithm Pin
CPallini4-Apr-07 21:05
mveCPallini4-Apr-07 21:05 
GeneralRe: Angle Algorithm Pin
cp98764-Apr-07 21:53
cp98764-Apr-07 21:53 
QuestionColor generation algorithm Pin
roel_v3-Apr-07 22:20
roel_v3-Apr-07 22:20 
AnswerRe: Color generation algorithm Pin
Nathan Addy6-Apr-07 1:45
Nathan Addy6-Apr-07 1:45 
GeneralRe: Color generation algorithm Pin
roel_v7-Apr-07 6:56
roel_v7-Apr-07 6:56 
QuestionReading text file problem with casting to double Pin
kelvinic3-Apr-07 18:28
kelvinic3-Apr-07 18:28 
I've trying to read a .txt files in order to plot the data on a ZedGraph. The problem is I cannot convert the data to double. The compiler gives bunch of errors(Error 1 Cannot convert type 'string' to 'double'). The following is a piece of code that i'm having trouble with.

private void BRead(GraphPane myPane)
{
FileStream fleReader = new FileStream("kel.txt", FileMode.Open, FileAccess.Read);
StreamReader stmReader = new StreamReader(fleReader);
StringBuilder lstChars = new StringBuilder();
double x = 0, y;
int iChar = stmReader.Read();
lstChars.Append((char)iChar);

// double[] yx = new double[lstChars.Length];
PointPairList list = new PointPairList();
while (iChar > -1)
{
x = x + (double)0.0002;
iChar = stmReader.Read();
lstChars.Append((char)iChar);
y = (double)(lstChars.ToString()); //error
list.Add(x, y);
}

this.textBox1.Text = lstChars.ToString();
stmReader.Close();

CurveItem myCurve = myPane.AddCurve("My Curve",list, Color.Red, SymbolType.Diamond);
}

can anyone help me please!!

AnswerRe: Reading text file problem with casting to double Pin
cp98763-Apr-07 18:58
cp98763-Apr-07 18:58 
AnswerRe: Reading text file problem with casting to double Pin
cjengler4-Apr-07 2:09
cjengler4-Apr-07 2:09 
GeneralRe: Reading text file problem with casting to double Pin
kelvinic4-Apr-07 2:17
kelvinic4-Apr-07 2:17 
GeneralRe: Reading text file problem with casting to double Pin
cjengler4-Apr-07 2:36
cjengler4-Apr-07 2:36 
QuestionPermutations of an election result Pin
Colin Angus Mackay31-Mar-07 10:32
Colin Angus Mackay31-Mar-07 10:32 
AnswerRe: Permutations of an election result Pin
Luc Pattyn31-Mar-07 11:05
sitebuilderLuc Pattyn31-Mar-07 11:05 
GeneralRe: Permutations of an election result Pin
Colin Angus Mackay31-Mar-07 11:27
Colin Angus Mackay31-Mar-07 11:27 
GeneralRe: Permutations of an election result Pin
Luc Pattyn31-Mar-07 11:47
sitebuilderLuc Pattyn31-Mar-07 11:47 
GeneralRe: Permutations of an election result Pin
Colin Angus Mackay31-Mar-07 23:03
Colin Angus Mackay31-Mar-07 23:03 
GeneralRe: Permutations of an election result Pin
Luc Pattyn31-Mar-07 23:33
sitebuilderLuc Pattyn31-Mar-07 23:33 
GeneralRe: Permutations of an election result Pin
Luc Pattyn31-Mar-07 12:55
sitebuilderLuc Pattyn31-Mar-07 12:55 
QuestionRe: Permutations of an election result Pin
David Crow4-Apr-07 4:11
David Crow4-Apr-07 4:11 
Questionmatlab a function in m-file Pin
akira3231-Mar-07 2:13
akira3231-Mar-07 2:13 
AnswerRe: matlab a function in m-file Pin
rbuchana31-Mar-07 9:48
rbuchana31-Mar-07 9:48 
AnswerRe: matlab a function in m-file Pin
Sean Cundiff31-Mar-07 13:24
Sean Cundiff31-Mar-07 13:24 
Questionbandwidth question Pin
Planker29-Mar-07 19:08
Planker29-Mar-07 19:08 
AnswerRe: bandwidth question Pin
Rilhas19-May-07 10:03
Rilhas19-May-07 10:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.