Hi John,
Looks very interesting !! Japi has some strongpoints like "appendtext" on textarea's , and the image related functions are extremely fast (though for setting up an rgb matrix (array) int32's are used and not byte (char) - i imported these functions in Lisp , but oxygen has to set up the flat memory model ... (and give back the addresses to lisp , because a few Japi functions need int* like :
extern void j_getimagesource ( int , int , int , int , int , int* , int* , int* )
(char* is not problem in Lisp , it has something as c-string , zstring etc ....).
I think it can be done with the Common Lisp CFFI package, however I have severe problems making stand-alone executables when using this interface.
So, looking inside your dll code (I used Dependency Walker (another good tip .. from Mike this time .. I had some problems with name-mangling when creating DLL with freebasic -- ... in the end Charles showed the correct way .. )
.. but in your japi.bas(?) , i do not see any return value declarations when importing the functions (__j_ascriba_..... ) , i'm of course very interested in this ... (downloaded ScriptBasic now
Hi Charles, yes of course ...
The idea behind all this is a kind of question why something as the harmonic series (Zeta(1) ) goes to infinity 1+1/2+1/3.... (even the recipr. of the primes do this 1/2+1/3+1/5+1/7 ... while something as S=1/2+1/4+1/8 .. only delivers 1 as sum.
This is in mind the "fractal method" came up :
Start with a square
Make a new square from the mid points of sides
iterate
this delivers the above mentioned S series (easy to see the new square is half of its previous)
write this analytic and expand it
f(x)=2x(x-1)+1 where x is the location of the new corner point (if this is correct English) between 0 en 1
easy to see it is symmetrical around x=1/2 and has it maxima at 0 and 1 (logical because there is no rotation and the square generates itself .. the sum is then 1+1+1+ ................
Remarkable is that is formula (obtaining by squaring the hypothenusa of one of the triangles inside the square ) is almost identical to the logistic function which IIRC was used by Feigenbaum to get his two constants which describe chaotic processes.
... it seems everything is related with everything in a way ....
but it goes further, ... very interesting series can be build form this starting point -- p.e. a side of the square x -> sqrt(x).
.. (well, some people like crossword puzzles , .. I prefer these kind of puzzles
I final word about the underflow error in Common Lisp -- it's not that absurd (one can reason , ok if the number is that small we can make it equal with zero , not
... yes, but the problem is we do not have -0 and +0 , and this may be a huge difference in a calculation / process ...
best, Rob