
This sounds like a test question.





I'd use
3D Pie Chart By Julijan Sribar. Found on the Code Project!





Geee. I have to ask such a simple question but I AM SURE you folks are ALOT smarter than me! Especially at math! (But I work with with my hands like a Master!) Anyway, seemed so simple untill I tried to do it.. LOL..
Lets say you have a Joystick that inputs 0 to 1000 units. I want to limit the output to some variable (To keep it simple I'll use whole numbers) to some variable such as 40, 50, 60 etc. that gives a output that is from 0 to this variable in equal units?
I'm so STUPID at Math! Sorry my Left or Right brain not working for this simple problem!





divide the actual output by 1000, then multiply by your variable to get the new scaled output.
o_{new} = (o_{old} /1000) * var





SO SORRY I voted a 1 when I should have Voted a 5! I told you I was STUPID!
At first glance my brain said 1 was THE BEST..
Thank You.. DO not be to harsh on me.. I'm really a nice old man..





And if your joystick is connected to an embedded system with no hardware floating point support, you can keep everything in integer with good results by reordering the arithmetic:
onew = (oold * var) / 1000
You might have to cast the old variable to the next larger type to be sure you don't overflow and then cast back.
The evolution of the human genome is too important to be left to chance.





i think solution is in following steps
1.get the maximum value of the out put.say you get that for input 1000.
it means you would want to get myMaxLimit when you get maxOP
2.so now you can use follwoing formula to limit your input
desiredOP = (currentOP/maxOP)*myMaxLimit
sameer





I would like to add, to the other comments psted here, that you can also do integer rounding. For example:
(1456+500)/1000=1
(1677+500)/1000=2
As you can see 1456 gets rounded to 1 and 1677 gets rounded to 2. It is just like rounding floating point numbers 1.456 and 1.677. In fact, all values from 500 to 1499 will be rounded to 1, and all values from 1500 to 2499 will be rounded to 2.
Rogério Rilhas





Hi i'm a maths b student and i need some help with a question on a maths assignment, The question is:
The question asks me to find an equation fo each of the 5 parabolas of a bridge given that:
1. the width of the bridge is 40m
2. The maximum height of the road section at the top is 2m
3. The height of the tallest supporting parabola is 13m
4. The height of the smaller supporting parabolas is 8m.
I know the equation I need to use and it is
y = ax^2 + bx^2 + c
Then the equation goes to
y = a(xp)^2 + q
Can you please help me out because I don't know how i should start it.
PLEASE HELP, ASAP
Any help would be much appreciated.





Try expressing height of a given parabola H as a function of its width at the base W (H(W))





I am hoping somebody can tell me the best method (and possibly links on more info for that method) to use for calculating a line that runs smoothly through a few data points. The points are positions on a fan blade and I am looking at trying to roughly calculate a line that would be the profile of the blade if it was cut along the points. I thought that knowing the the location of the peaks and valleys, and possibly a few extra data points, would allow me to interpolate the other points I need to make a complete profile. I would then do this in several areas to get the surface of the blade by interpolating in the two directions through the points.
My original idea was to use splines, but I am not sure this is the right way to go. More so because I am not sure how you go about calculating the equations to go through the points and how to separate the line into the different regions for the different equations. Since it is a surface, NURBS may be another option. But, if I am having difficulty with splines, what are my chances of figuring out NURBS?
Thanks for any help.
Brad





I'm not sure if it will be easier or harder than doing a cubic spline, but you may want to also look into Bezier curves to see if they can help you.

Marcus Kwok





I'm not sure if it would be easier or harder either.
I am still looking up information and have come across Bezier splines (which I found out use Bernstein polynomials, whatever those are? but are verified using de Casteljau's algorithm), Bezier curves, Bsplines, and cubic splines. I am assuming they are all a different way to do the same thing.
I've been out of school for a little while and this is making my head hurt. I am finding a lot of theory and examples of plotting splines, but not many examples of getting the equations from the points.
Thanks.
Brad





Take a look at the source code to Graph[^]. This has C++ code for calculating curves through points using Logs, Polynomials etc.
It worked very well for me, I did do a conversion to C# a while ago.
BTW, you didn't say if you wanted source code or just advice since you can do this in Excel given enough time and patience. The Graph source code as most (or all, I can't remember) of the methods which Excel uses when curve fitting.
Sig cops got me...





BRShroyer wrote: I am hoping somebody can tell me the best method (and possibly links on more info for that method) to use for calculating a line that runs smoothly through a few data points.
if you have evenly spaced measurements you can use CatmullRom splines[^].
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)





Art of Problem Solving[^]
"A real programmer wishes there was a commandline version for every application and then proceeds to write a GUI to wrap around it."  Bassam AbdulBaki





Hi guys
I would like to copy a process's module. This is how the scenario looks:
Lets say that there is a process called "Main.exe" and it loads plenty of modules and 2 of the modules that it loads are:
1. "Copyer"
2. "Checker"
Now i want to somehow modify something in the module called "Copyer" but if i do that then Checker(which scans this module once in a while) will find out that i have changed something and then exit. So what i have come up with is that i have to somehow copy the Copyer module and then inject it in Main.exe then make this Checker to somehow scan that copyed/injected module instead of the original Copyer module.
Could someone please help me to figure out a way to copy a module and make this Checker scan the copied one instead of the original one?
Thanks





What I used was a string buffer array. Because an original C buffer is continuous memory blocks, it makes it easy to partition it off. Or you can use a structure which does the same thing.
struct {<br />
char findstring[64];<br />
char licensename[64];<br />
time_t licensedate;<br />
time_t licenselen;<br />
unsigned long crc32a;<br />
unsigned long licensedfeatures;<br />
char licensekey[64];<br />
} lincenseinfo;
this does not take into account someone adjusting the clock unless you write the last date of operation somewhere. That is where it takes some long thinking and hard writing to secure only in software. Eventually you realize it is impossible to secure only in software and deal.
But the process is easy. from an external EXE you can scan the binary EXE of your code looking for the findstring value (any string you want to use, even random characters you pregenerated, but you have to know what to search for). By searching for and finding that start of buffer, you know where the rest of the values are. Set in your license times, CRC validations (optional) and the name of your licensee and their key. The key is based on the same information, name, product, date, length of license and any other related information. You then generated a validated buffer and write it into the file replacing the entire buffer within the already compiled EXE.
Inside your code you verify the information in the buffer matches. If it does not, you exit, or disable features, or turn on demo mode, etc. If the buffer all crossverifies, then you proceed as a licensed product.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)





Or, use the FileSystemWatcher Class [^] in the Checker to receive notification that the module has changed.
EricDV Sig
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
 Laurence J. Peters





anyone expert in association rule mining?
and coding the algorithm to be use in classification and prediction in data mining application.
anybody know about where can i find the souce code?
Fear is not the FACTOR





i want to do a modulus of 12 digits..
for example:
123456789012%34
i'm unable to convert it because there are always balance althought it shouldnt be.
i find that integer can only use max10 digit.
my assignment is
from a set of 12 characters.
convert to ASCII decimal value representation of the characters. (example: A=65, 1=49)
then each decimal value have to substract 32 (numerical value, example: A=6532=33, 1=4932=17)
after converting has to do this formula:
8pow11.numericalvalue1 + 8pow10.numericalvalue2 + 8pow9.numericalvalue3 +....+ 8.numericalvalue11 + numericalvalue12
in shot: value = pow(8,index1)*((int)tmpChar[i]32);
after the multiplication and addition, modulus the total value over 59, means (%59);
display the value.
i hope anyone can help me solve this problem as i'm a begineer in visual c++.
thank you very much in advance.





nonadoes wrote: 123456789012%34
maxint:
long long 9223372036854775807 7fffffffffffffff
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)





nonadoes wrote: ...there are always balance althought it shouldnt be.
Check again. 123456789012 is not evenly divisible by 34, so there will be a "balance."
"Approved Workmen Are Not Ashamed"  2 Timothy 2:15
"Judge not by the eye but by the heart."  Native American Proverb





Consider a string of decimal digits of arbitrary length. These digits are some arbitrarily large number. To find num%m ...
Temp = high order digit % m
Then for each succeeding digit compute...
Temp = (Temp*10+next digit) % m
But you seem to have a more basic problem that has nothing to do with C++ or any specific language. You are letting ASCII representation get in the way of the simple algorithm to perform modulus operations on large numbers. It could be that this exercise was more to teach you about ASCII representation than modulus arithmetic. All you need to do is to subtract 0x30 (48 decimal) from each byte as you take each digit into the large number modulus algorithm I gave above.
This looks like it might be homework. If you still a problem with this after 2.5 months then find something else to study.





Hi guys
I have been working on a project for several months now and it is almost finished all i need is some kind of security so that only the people that buy my software will be able to run it although when they first run it, it will display a key(which is their hardware drive serials, encrypted though) and then they will need to send that code to me so that i decrypt the data and send them a key that will work(any kind of key, for ex. when they send their key to me then i will use another proggy that i make and use that proggy to maybe add something to their serial like a few digits or a code at the end of their serial then send it back to them) what i need to know though is how to encrypt their hardware drive serial then make an algorith that can recognize the modified serial(that i will send to them once they send their serial to me) and make the program start up. I also need some kind of limit maker so that someone can only use it for a limited amount of time(1 year lets say) then after the time has expired it will display a message box saying they have to renew their serial.
Soething of this kind would be really good.
So could someone please direct me to such a tut or maybe reply with some useful info?
Thanks in advance
Cyclone



