|
Thread: Official Programming Thread | This thread is pages long: 1 2 3 · «PREV |
|
Corribus
Hero of Order
The Abyss Staring Back at You
|
posted March 06, 2010 01:03 AM |
|
|
That's a nice thread, dimis. I wasn't aware of its existence. It was mighty helpful, and I got a program to run without any compiling errors. Of course, that doesn't mean it actually fits my data correctly, but it's a start.
____________
I'm sick of following my dreams. I'm just going to ask them where they're goin', and hook up with them later. -Mitch Hedberg
|
|
dimis
Responsible
Supreme Hero
Digitally signed by FoG
|
posted March 06, 2010 01:36 AM |
|
|
Haha. That's usually the case. You can only say "horray!" in the end!
____________
The empty set
|
|
dimis
Responsible
Supreme Hero
Digitally signed by FoG
|
posted March 06, 2010 02:03 AM |
|
Edited by dimis at 02:10, 06 Mar 2010.
|
I don't know what exactly you want to do, but I will write down some stuff.
If all you really care is to approximate your data in a fixed interval (and only inside the interval which is going to be predetermined), then, you can probably use polynomial approximation. The idea is the following.
* Through any 2 points, there is a unique line that goes through them (pol. degree = 1).
* Through any 3 points, there is a unique quadratic that goes through them (pol. degree = 2).
In general, through any N+1 points, there is a unique polynomial of degree N that goes through these points.
key words for your searches: polynomial interpolation, polynomial extrapolation, Lagrange polynomial, Aitken's Algorithm (I think no one uses this method anymore), Neville's algorithm (probably this is the way to go).
In any case, I haven't worked on these for years, so others might have better ideas, but the above ones pretty much capture the gist of the methods.
____________
The empty set
|
|
Corribus
Hero of Order
The Abyss Staring Back at You
|
posted March 06, 2010 02:31 AM |
|
|
Well thankfully Origin takes care of the actual fitting routines. Those codes are all already built into the program. However, if you want to fit the data to a function that isn't previously built into the software, you have to write the function, which is what I was trying to do. Once you write the function properly, Origin will fit a dataset to it. I've done this before many times, but usually just to simple polynomial or exponential functions. I've never had to worry about using an integration or summation before, which is what sort of threw me off this time.
(actually, now that you mention cheering, I did actually throw my hands up in the air and cheer when I finally got it to compile without an error. Such elation over such a tiny thing - maybe it should go in my Happiness in Small Packages thread. )
____________
I'm sick of following my dreams. I'm just going to ask them where they're goin', and hook up with them later. -Mitch Hedberg
|
|
dimis
Responsible
Supreme Hero
Digitally signed by FoG
|
posted March 06, 2010 02:43 AM |
|
|
____________
The empty set
|
|
ihor
Supreme Hero
Accidental Hero
|
posted July 23, 2010 11:15 AM |
|
|
I know there are several programmers here in HC and I have an interesting question.
So I want to implement some kind of color inversion.
In general, lets say we have background of some arbitrary color and foreground text may have either black or white color. Which color to use for best looking effect? In other words it would be bad if we use black color over dark background or white over light.
What is the algorithm if we have background color in RGB? in HSL?
|
|
Geny
Responsible
Undefeatable Hero
What if Elvin was female?
|
posted July 23, 2010 11:27 AM |
|
|
Darkness is pretty easy to define in HSV. Just make a threshold number for Value, everything above it would be considered bright background and below it - dark background.
____________
DON'T BE A NOOB, JOIN A.D.V.E.N.T.U.R.E.
|
|
AlexSpl
Responsible
Supreme Hero
|
posted July 23, 2010 11:48 AM |
|
Edited by AlexSpl at 11:49, 23 Jul 2010.
|
What do you think about the future of F# and, in general, functional programming? Has it any chances to substitute C++, C#?
|
|
ihor
Supreme Hero
Accidental Hero
|
posted July 23, 2010 05:52 PM |
|
|
Quote: Darkness is pretty easy to define in HSV. Just make a threshold number for Value, everything above it would be considered bright background and below it - dark background.
Thx Geny, yes I thought about it but like a robot I automatically chose 0.5 as this threshold value, and got not exactly what I wanted. Though I also asked about RGB, which I have. Seems I will google for transformations from RGB to HSV and back.
Quote: What do you think about the future of F# and, in general, functional programming? Has it any chances to substitute C++, C#?
I don't know much about F# now. But from what I heared F# and C# are like a spoon and a fork. When you eat soup, better use spoon , while for meat fork is the choice. Some food you can eat both with spoon or fork. Similarly in one solution programmers could select which tasks they'll eat with spoon(implementation via F#) and which with fork(C#). So F# is considered to be not a substitute but a complement to C#.
As for C++, I still think that C# will supplent it.
|
|
|