
CPLua 0.8 RC2 fixes all the bugs you reported, and some other ones (the interactive mode for example was completely unusable

Thanks again for your help

Posted 27 February 2006 - 09:15 PM
Posted 28 February 2006 - 02:47 PM
Seems to be ok nowOkay, let's try again
DLMfit has two examples for curve fitting. It defines and uses rather large matrices, and it requires several library chunks, so it is currently a "memory devourer". Loading library chunks is unavoidable, if you want to write well-structured programs, so I'm afraid that DLMfit's memory demands cannot be reduced. Glad to know that it also helps as a check program.Actually I used DLMFit as benchmark to check the gain in performances concerning the memory usage
Note that the problem with those programs don't really come from the garbage collection; it's just that LuaNumAn is rather large, and each chunk loaded in Lua requires a lot of memory (3 to 5 times its size as source code!).
I have thought about this several times, but I think that loading all the chunks from the beginning helps the user to easily find the dependencies of the program. Loading each chunk just where it is needed is also a good programming habit; for example require("LuaPlot/PlotFunc") can be placed just before the first call of PlotFunc function. However, the user will need to search the whole program just to find the dependencies (and, currently, there is no a "Find" capabilityBtw, I noticed that you allways load the libraries at the beginning of each chunk. That means that even if you use a function at the very end of the program (LuaPlot for example), you reserve a lot of memory for it at the beginning, hence the memory crashes. Maybe you should consider using doscript() instead of require() for functions like LuaPlot: you may also pass some arguments to the called script, and return some value, but the advantage is that you only load the chunk when you really need it
require() could also be used near the end of a program, not only at the beggining.
As I suspected. No problem for me. Better than setting your preferences each time you open CPLua.It's just a file containing your preferences: the keyboard and the font you choosed (there will certainly be more options later). It is saved each time you close CPLua. I'm sorry about this, but I didn't have many choices
Aaargh! Can you believe this? I didn't knew that you can mark, copy and paste text directly from the emulatorIf you just want to exchange Lua programs with text files on the computer, you can copy/paste the code from the emulator...
Note there will never be a "magic tool" to transform a MCS files with Lua programs (even saved as TEXT variables) into a simple txt file on the computer...
You will allways have to deal through the emulator. I agree it could be convenient to be able to save the output of a program however.
Posted 28 February 2006 - 02:59 PM
Posted 28 February 2006 - 04:07 PM
Kilburn noticed some other bugs in RC2, and I fixed it. There should be a new RC3 version soon, but I will wait a little to see if someone else encoutered problems with the RC2Seems to be ok now
.
Well, I was suspecting itAaargh! Can you believe this? I didn't knew that you can mark, copy and paste text directly from the emulator
. To be honest, I don't use the emulator much (just to take screenshots).
I suppose the goal is to save the output of programs running on the classpad, more than on the emulator...If I understand, you want to save the output of a program in a .TXT file. In that case, why don't you use Windows functions from fstream in the add-in
Posted 01 March 2006 - 12:39 PM
Posted 01 March 2006 - 01:44 PM
"Release Candidate". It's a very common abbreviation in version numbering schemesWhat does "RC" mean?
Posted 01 March 2006 - 07:02 PM
Posted 07 March 2006 - 07:40 AM
Posted 07 March 2006 - 02:11 PM
Posted 07 March 2006 - 02:47 PM
Although I'm not Orwell, I think I have something to say:Some suggestions (if you won't become unhappy):
I'm afraid that I don't understand, or you are confused a little bit... You can "write your calcs" in the input window, which is enabled by the "input" function. Currently, the input window is restricted to one-line, at the bottom of the screen.1. Did you add a function for calling Main, orwell? (e.g ShowMainWindow). It is useful... We can create a math program that at the top section Lua's output says what to do, and we write our calcs in the bottom part that is the Main window.
Sounds useful. Note, that this is for user's information only; CPLua has full access to user (or system) variables, via the "cas" function.2. Please enable lua to access the Variable Manager... The open and save dialogs are good, but they don't show the file's size.
This subject has been discussed several months ago. Orwell said that he will not upload CPLua to classpad.org until it reaches version 1.4. (The most important one) Why don't you upload CPLua to classpad.org? It can be a good advertisement for Lua (and for the ClassPad forums).
Posted 07 March 2006 - 04:59 PM
Posted 07 March 2006 - 06:10 PM
I see what you want, but it is very difficult to do...1. Did you add a function for calling Main, orwell? (e.g ShowMainWindow). It is useful... We can create a math program that at the top section Lua's output says what to do, and we write our calcs in the bottom part that is the Main window.
It's already done since CPLua 0.8 RC1 ... Look in the "Settings" menu, there is an option to open the Variable manager2. Please enable lua to access the Variable Manager... The open and save dialogs are good, but they don't show the file's size.
It is possible to create a debugger, and there 2 ways to do that.3. Step-by-step debugging.
Like PAP said, I would like to wait the first official version. I don't want too many people to start some big projects, and be forced to modify it between each major release because of some new incompatibilities.4. (The most important one) Why don't you upload CPLua to classpad.org? It can be a good advertisement for Lua (and for the ClassPad forums).
Whoops, it seems like there are still some functions in this package waiting to be implemented.Hi! My problem is concerning IO package... its cannot make a list of directories in Root Directory... what I need is fold:content() which lists folders. Is it possible to do it? (options are: list of folders or access to variables manager)
Posted 07 March 2006 - 06:33 PM
I would like to insist on this a little bit more: If you think that something could be made in another, more comfortable way (for example, you have a better idea for the menu that appears when you open CPLuaLike PAP said, I would like to wait the first official version. I don't want too many people to start some big projects, and be forced to modify it between each major release because of some new incompatibilities.
But don't worry, CPlua 1.0 should come soon; I don't think that there will be many structural changes after CPLua 0.8 (but if you think about some large improvements or important modifications, say it NOW! )
Posted 07 March 2006 - 08:06 PM
Posted 07 March 2006 - 08:28 PM
Was You thinking about this My Lua Programs (for faster programs launching) ?
Posted 07 March 2006 - 09:16 PM
Many people here (like the two of us too) have a native language which is different from English. We are all doing our best to be understood by the others, but some people may have more difficulties than the others. I think that such comments should be avoided, if possible.Were you thinking.... no?
Posted 07 March 2006 - 11:21 PM
I think that a "pause" command will be sufficient. We can use it to temporarily suspend program execution, and enter the "interactive" mode. Note that this should be a "dedicated" interactive mode, able to access variables of the chunk being run. This way we will be able to inspect the values of variables, by using standard CPLua functions in the interactive mode (such as print or table.foreach), or to assign new values to the variables. Then a "resume" command will return CPLua to normal program execution, until another "pause" command is reached. This functionality is similar to the "breakpoints" used in all developement packages. It will not be a "real" debugger, but it will be very useful, and it seems easier to implement.It is possible to create a debugger, and there 2 ways to do that.
1) convert the standard "debug" package to CPLua; it is currently disabled, but I hope that it won't be too hard due to CPlua's specifications (like chunk isolation etc)... I will take a look.
2) use some hacks to break the execution between each line, or between each instructions etc, and display information about the current existing variables, the environment... This would be a real debugger. I shouldn't be too hard (Lua allows that); however, the screen of the ClassPad isn't very large and I don't know how I should display all these informations![]()
I need your ideas and opinions about this
IMHO, this should be considered as the first thing in the "to do" list. However, I'm afraid that it is not as easy as it looks. Orwell, what do you think?searching/replacing ability should be developed in editor.
I noticed this problem only recently, since I don't use thick lines often. When I implemented LuaPlot (4 months ago), it was possible to use line thicknesses of 3 or more pixels. Now, such thick lines are not drawn correctly. This is probably a bug in the "draw" package.And there is a strange problem about the draw.line function that was here since CPLua 0.6. In the Scribble example program, il you set the drawing thickness to 3 or higher, the lines doesn't draw correctly....
I totally agree. English is not a very rich language, anyway.Many people here (like the two of us too) have a native language which is different from English. We are all doing our best to be understood by the others, but some people may have more difficulties than the others. I think that such comments should be avoided, if possible.
Posted 08 March 2006 - 08:39 AM
Accessing Variable Manager is already done since CPLua 0.8 RC1
Maybe:It is possible to create a debugger, and there 2 ways to do that:
...
However, the screen of the ClassPad isn't very large and I don't know how I should display all these informations.
I need your ideas and opinions about this
Again thanks.I will take a look.
Posted 08 March 2006 - 08:12 PM
Is there a Wait function in Lua? Or I still must use "for x=0,1000 do end" for wait?
Posted 09 March 2006 - 09:28 AM
I think that a "pause" command will be sufficient. We can use it to temporarily suspend program execution, and enter the "interactive" mode. Note that this should be a "dedicated" interactive mode, able to access variables of the chunk being run. This way we will be able to inspect the values of variables, by using standard CPLua functions in the interactive mode (such as print or table.foreach), or to assign new values to the variables. Then a "resume" command will return CPLua to normal program execution, until another "pause" command is reached.
Okay I will first try to convert the standard "debug" package thenAnd for the debugger, you could make a simple function debug() that displays a big dialog window with all the variables used and their values. Is that possible? And assign a "debug" key that will be never used in the program, so if you define EXE as the debug key, when you press EXE, the executions breaks and the dialog window appears.
What do I think? I think that it's a real nightmareIMHO, this should be considered as the first thing in the "to do" list. However, I'm afraid that it is not as easy as it looks. Orwell, what do you think?
It is certainly useful, not only for debugging; but this should be a part of a future "UI" packageShowMsg("Var1:"..FirstVar.."\nVar2:"..SecondVar)
It shows a message box. How do you think about it?
I can't implement such a function with the SDK (at least for now)...Is there a Wait function in Lua? Or I still must use "for x=0,1000 do end" for wait?
Posted 09 March 2006 - 12:27 PM
The idea concerning a "debug key" sounds interesting, but which key would you suggest?
Posted 09 March 2006 - 12:54 PM
I don't have currently any way to measure time with a better precision.
Posted 19 March 2006 - 05:04 PM
for a = 0, 10, 0.1 do if a == 1 then print("found") end endNever prints "found" although it should. I think it's a problem with float numbers.
Posted 19 March 2006 - 05:09 PM
This is not a bug, actually. It's a common problem with computer arithmetics: 0.9+0.1 is not necessarily equal to 1. It may be 0.9999999999 or 1.000000000001, due to the way float numbers are stored in memory. You should never compare float numbers this way. Just replace a==1 with math.abs(a-1)<tiny, where tiny is a small number, e.g., 1e-7. Note that the same problem is present in every computer system.I've found a bug:
for a = 0, 10, 0.1 do if a == 1 then print("found") end endNever prints "found" although it should. I think it's a problem with float numbers.
Posted 19 March 2006 - 05:32 PM
Posted 19 March 2006 - 06:16 PM
Posted 19 March 2006 - 08:43 PM
require "dane"
function wydruk(wiersz,kol)
for i=wiersz,wiersz+8 do
print(tab1[i][kol])
end
end
a=5.2
b=-3
wydruk(a-0.2,b+6)
require "dane"
function wydruk(wiersz,kol)
for i=wiersz,wiersz+8 do
print(tab1[i][kol])
end
end
a=input()
b=-3
wydruk(a-0.2,b+6)
Posted 19 March 2006 - 08:58 PM
require "dane" function wydruk(wiersz,kol) for i=wiersz,wiersz+8 do print(tab1[i][kol]) end end a=input() b=-3 a=tonumber(a) wydruk(a-0.2,b+6)
Posted 19 March 2006 - 09:08 PM
Posted 19 March 2006 - 09:22 PM
require "dane"
function wydruk(wiersz,kol)
for i=wiersz,wiersz+8 do
print(tab1[i][kol])
end
end
a=input()
b=-3
a=tonumber(a)
wydruk((a-5)/0.2,b+6)
Posted 19 March 2006 - 10:08 PM
Try to run your library "dane", and be sure that the only error you have then is "Scripts are not authorized to export symbols" at the end. There may be a problem in this script, and your table "tab1" won't be exported correctly in that case...This rises error.
As much as the ClassPad's memory can handleAnd I have still another question: what is biggest size of table Lua can handle?
Posted 19 March 2006 - 11:31 PM
Try to run your library "dane", and be sure that the only error you have then is "Scripts are not authorized to export symbols" at the end. There may be a problem in this script, and your table "tab1" won't be exported correctly in that case...
I prepared a table in file and I wanted to use it as a library ( require "dane"). File size is 10KB and it seems to be too much... I think I will have to divide it in smaller parts, and call only this part which is currently neededAs much as the ClassPad's memory can handle
You could write a small script that fills a table until you get a message saying "not enough memory"
Posted 21 March 2006 - 08:24 PM
Posted 21 March 2006 - 08:31 PM
Posted 25 March 2006 - 12:47 PM
Posted 25 March 2006 - 06:49 PM
Posted 25 March 2006 - 06:54 PM
Posted 26 March 2006 - 08:22 AM
It shouldn't be too hard to implement... I'll think about itAnd functions like draw.cptext and draw.luatext might be useful
The only files that CPLua's editor can edit are the files containing Lua programs... I don't exactly see what you would mean by "open images or MEM files"And another idea: It would be handy that we could "compile" all source codes and resources (packages, images, MEM files...) into one single project file. So, when you open the project, all the source files will be opened. I think about a "Project Manager" option, where you add or remove files and pictures from the project.
Lately I often get error informing that I used all memory... how much memory Lua can accomodate for its variables? Is it possbile to build-in something like swap file? Currently memory allowed to use is not enough, and Im sure that many of us met with such error before...
Yes I also noticed this. When I try to write 40 5*5*4 matrices in a file, I have the error "Not enough memory", although I still have 400 KB free. (40 5*5*4 matrices should create a file of size 40000 bytes)
This is becoming a real problemFrom my experience: more than 10KB crashes execution... ok.. I can do it other way, this time.. but soon maybe not and then it will be problem... build in data swapping would be good way. There could be one file for this in this new Lua folder
Posted 26 March 2006 - 09:02 AM
Posted 26 March 2006 - 11:11 AM
0 members, 4 guests, 0 anonymous users