Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Tavern of the Rising Sun > Thread: Official Programming Thread
Thread: Official Programming Thread This thread is 3 pages long: 1 2 3 · «PREV
Corribus
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

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
dimis
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

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
dimis
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

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Corribus
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

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
dimis
dimis


Responsible
Supreme Hero
Digitally signed by FoG
posted March 06, 2010 02:43 AM


____________
The empty set

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
ihor
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?

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
Geny
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.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
AlexSpl
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#?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
ihor
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.

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This thread is 3 pages long: 1 2 3 · «PREV
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0424 seconds