Yo 'sup! I bring you another instalment of "The Bald and the Betelgeuse"! Those of you who frequent #flipcode will know me as Zeroping, Yo momma or 'Ack!'. Well I finally got a haircut, a laser-pointer and a bad case of the snivels. I decided to write another tech-file for all you tech-o-philes out there ;) I'm doing part II of the A+ exam on Monday (which will probably be the day before yesterday when you read this.) I wrote a program for my calculator that factors up-to degree five polynomials, which is pretty cool. Apart from that, I haven't done much coding lately (although I'm still bubbling with ideas)
Achilles and the tortoise; and immortality
Here's some calculus for those of you who find DirtyPunk's tech-files too challenging ;) If we look at the increase in life-expectancy in developed countries over the past thousand years, and we take into account the rate at which medical breakthroughs have been made in the past century, then we should be able to derive a function that models the average life-expectancy over time. L(x) = 0.001x^2 or something. We can also have a function that models our age over time A(x) = x. Now those individuals who are lucky enough to be born at the right time will notice that the slope of L(x) is greater than that of A(x), which means that as they get older, the average life expectancy will be pushed further and further so that they will never be able to catch up with it. As long as A(x) does not intersect L(x), they will always be younger than the average life expectancy. Voila!, Immortality. This only works in theory, so don't go cancelling your life insurance just yet.
GUI and other baby-words
My GUI hasn't really evolved to the point that I may brag about it. Just to update you, I've got the TGA loading almost perfect now (just need to find some decompression algos.) One problem that I'm encountering is the fact that while Windows takes care of most of my memory requirements as well as hardware interfacing, it leaves me with little room for optimisation. Each of my GUI elements have their own bitmap space to draw to, but as soon as they are resized, they require reallocation of memory. This will cause heavy fragmentation, which is hard to work around. I'm considering slapping together a compiler that reads in code that looks rather much like HTML, and exports it as assembly to NASM or something.
Synthetic division and 16-fingered Lilliputians
Well, I guess someone else already thought of my next idea, but I'll share it anyway. We've been using synthetic division in math quite a lot lately. Dividing (x2 + 2x + 3) by (x - 7) can be a pain sometimes. Using synthetic division:
In our example, we can set X = 10 and come up with:
(1x102 + 2x10 +3x1) / (10 - 7). In short, 123 / 3.
Our solution then becomes 10 + 9 + (66)/3 = 41.
123 / 3 = 41
Well, this isn't limited to X = 10. You can use this method for hexadecimal division, X = 16, or any other base numbering system. So remember, next time you are stranded on a deserted island and you find yourself teaching math to natives who have 16 fingers, use synthetic division!.
Well, I'm off to play with my laser-pointer, study or code.
May the source be with you,