|
Hello everyone,
i want to use curve line interpolation in order to draw smooth curve line through a collection of points, i tried to use MSchart but it only use Spline algorithm and sometimes it's not smooth. is there other solution, or is it possible to draw curve lines using other algorithm on MSchart that MSchart doesn't provide, so i can get benefit of the Component properties.
thanks a lot
|
|
|
|
|
You can do custom painting on a chart in its PostPaint event. Alternatively, you can calculate the data for the interpolated line and add it as a series.
|
|
|
|
|
Hi, any ideas on how to solve this problem?
double.IsNaN((NC / (Math.Pow(NX, 0.5) * Math.Pow(NY, 0.5))))
returns true when the visual studio debugger is showing valid values of the doubles NC, NX, and NY (e.g. 1, 2, and 2 respectively)?
Thanks, stegzzz
Using C#, VS2010 Professional, .Net Framework 3.5
|
|
|
|
|
I've just run it and it's outputting false. How have you declared NC, NX and NY - I tested it with double and int and it returned false in both cases.
|
|
|
|
|
Hi, NC, NX, and NY are locals with values arrived at by calling functions C and L
double NC = C(X,Y);
double NX = L(X);
double NY = L(Y);
double.IsNaN((NC / (Math.Pow(NX, 0.5) * Math.Pow(NY, 0.5))))
now returns true, for example when NC=1, NX=NY=2, as shown in the debugger. I should stress that these are not the only values of NC,NX, and NY which produce this strange result, it happens on a range of different (and apparently valid values) and not consistent - I only get the problem on some evaluations so I guess there is something outside the code presented here but I really have no idea where to start to look!
stegzz
|
|
|
|
|
Change it to:
double NC=1;
double NX = 2;
double NY = 2; When I ran this, the NAN check returns false.
|
|
|
|
|
Yes, this works as you say, so I suppose this points to the conclusion that the values shown in the debugger are not the ones which are being used when IsNaN returns true.
How can I work out what values are actually being evaluated and why doesn't the debugger show them?
|
|
|
|
|
Use System.Diagnostics.Debug.WriteLine and write the values to the output window.
|
|
|
|
|
Math.Pow(a, b) gives NaN if (but not only if) a is less than zero but not NegativeInfinity and b is not an integer and not infinite.
Which means, in this case, that if one or both of NX or NY are less than zero but not NegativeInfinity, you get a NaN.
NC can make it NaN if NC=NX=NY=0.
And of course the entire thing will be NaN if any of the inputs are NaN.
The values shown by the debugger must somehow be wrong.
|
|
|
|
|
The debugger stops on the return, right after checking IsNaN(S)
double S =(NC / (Math.Pow(NX, (double)0.5) * Math.Pow(NY, (double)0.5)));
if (double.IsNaN(S))
return 0;
And the debugger values for NC, NX, and NY are 1,2, and 2, respectively, so as suggested there is something wrong with the values being shown in the debugger.
Any ideas how to find out what the real values are that go into the calculation of S?
The code works fine when tested alone, in isolation from the rest of the program.
Thanks, stegzzz
|
|
|
|
|
Are there other variables named NC or NY that you or the debugger might confuse for each other? That is often what goes wrong.
Or is there any threading going on that might change NX or NY?
I'd put a break on the line that does the calculation, and hover over the various parts of the expression there (instead of looking in the locals window).
Btw, I get the expected result of S = 0.5
|
|
|
|
|
Is there any sample code or article based on Asp.net nested Accordion menu which drives values from sql server.
|
|
|
|
|
Probably lots, did you try looking at the articles pages[^] here on CodeProject, or typing your question into Google?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Yes.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
i already done web page but i have a problem..now i have 2 web page window which is button window and graph window....so, i want to make button and graph in a window..the graph always refresh...how can i do that?
|
|
|
|
|
Your question is not very clear, and would probably be better in the ASP.NET or Web Development forums.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
|
when I start run remoting It show problem:
No connection could be made because the target machine actively refused it 127.0.0.1:8080
how can Fix this Problem...Thank in advanced
|
|
|
|
|
Try remoting to a machine (IP address and port) that will accept your request. Do you have a process listening on port 8080 of your own machine? I assume you understand that 127.0.0.1 is the loopback address.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
there is debate in my local office as whether or not we would benefit from migrating from C++ to C# to work with our SQL Server database.
currently we are using MS SQL Server Express R2 as a test model and making connections and doing some stored procedure work from C++ front end. Eventually, we will work in our customer's environment of the full fledged Microsoft SQL Server.
Can I get some feedback/opinions on the pros and cons of each - C++ and C# ?
Thank you,
JJ Mackey
|
|
|
|
|
If you're using ADO.net with either then there shouldn't be much difference.
My first experiences with SQL Server was with C++ and ODBC to access SQL Server 6; I hope you're not doing that.
|
|
|
|
|
Currently, i am using C++ with ADO commands. My programming team maintains several thousand lines of code in C++ (Visual Studio 2008) and there are roughly 1K-3K lines that interact with external databases in the Microsoft SQL Server environment.
The majority of the system(s) code we maintain don't perform SQL Server interaction - maybe 25% will interact with SQL Server.
Maybe i'm missing the difference between ADO and ADO.net. Also, back to the original question, what do i gain if i choose C# over C++ ?
Most of the team knows C++/MFC and we are clueless on C#.
Thanks.
|
|
|
|
|
john john mackey wrote: what do i gain if i choose C# over C++ ?
Undying gratitude from Microsoft?
john john mackey wrote: Most of the team knows C++/MFC and we are clueless on C#.
Then stick with what you know.
|
|
|
|
|
I don't think there is any difference from the database POV, I doubt there is any difference from the connection and interaction POV either. I'd be astonished if changing from C++ to C# made the slightest difference, changing from ADO to ADO.Net "may" make some slight difference.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks for the insight. Now I must look at the differences/advantages of ADO.net v ADO.
Regards,
John John
|
|
|
|