Re: [Jprogramming] jhs webgl array_buffer

2014-03-22 Thread Brian Schott
Pascal, Paint is not a js function, paint is the j verb. Does that clarify my problem? --- (B=) On Mar 22, 2014, at 7:51 PM, Pascal Jasmin wrote: > appologies if I misunderstand, > > If your js paint event took the full list of commands, then you wouldn't have > these problems, IMO, and woul

Re: [Jprogramming] jhs webgl array_buffer

2014-03-22 Thread Pascal Jasmin
appologies if I misunderstand, If your js paint event took the full list of commands, then you wouldn't have these problems, IMO, and would solve the issue of general repaints being sometimes required for other reasons. If I understand your design, if the jhrajax received a list, updated the js

Re: [Jprogramming] jhs webgl array_buffer

2014-03-22 Thread Brian Schott
Joe, As it is, J processes all the paints, but the client JS only gets the **first** paint -- the only paint JS expects --because that first paint contains the jhrajax, like all paints do. J produces a paint for every simulated move, but does not know how to batch them together. I am assuming tha

Re: [Jprogramming] jhs webgl array_buffer

2014-03-22 Thread Joe Bogner
On Sat, Mar 22, 2014 at 4:53 PM, Brian Schott wrote: > > The big question is, how does J know that the last paint operation has been > completed? For example, is there some way to detect an idle status in J? I > seem to recall something like sysevent that could do that. No luck with > this search:

Re: [Jprogramming] jhs webgl array_buffer

2014-03-22 Thread Brian Schott
Joe, (et al) Yes. I sort of follow your example. Btw, I perhaps used the word stack when I should have said queue, because I believe a queue is first-in-first-out, which is what I want. So, I imagine the command event at the jhs side sending a command and the jhs responding by emptying the queue

Re: [Jprogramming] jhs webgl array_buffer

2014-03-22 Thread Brian Schott
Raul, et al, Console.html in now attached, but named console.txt. The jwiki told me it was attached, but when I left and came back, it was not attached, presumably because of jwiki disallowing an html file attachment, as someone said. Apologies, again. -- (B=) -

Re: [Jprogramming] jhs webgl array_buffer

2014-03-22 Thread Joe Bogner
On Sat, Mar 22, 2014 at 2:06 PM, Brian Schott wrote: > Actually I guess J could > assume all commands are multiple commands and then save up the multiple > results in a stack to finally be sent to JS. This is the only option I can think of too. Let me restate the problem in more general terms:

Re: [Jprogramming] jhs webgl array_buffer

2014-03-22 Thread Raul Miller
Hmm... I found http://jsoftware.com/pipermail/programming/2014-March/036154.htmlwhich contains console.html (it's not attached at http://www.jsoftware.com/jwiki/BrianSchott/code/turtleGraphics/tgsjhspresumably because you would need to rename it to use a different extension - perhaps .txt instead

Re: [Jprogramming] jhs webgl array_buffer

2014-03-22 Thread Brian Schott
I have found the problem, but cannot fix it in console.ijs because my mind is frozen. It can be fixed manually by entering the following in the jijx window. At one time I new how to add this to the console.ijs, but not now. load'~Projects/tgsjhs/tgsjhs.ijs' I apologize. I have been using console

Re: [Jprogramming] jhs webgl array_buffer

2014-03-22 Thread Raul Miller
$ ls j64-801-user/projects/tgsjhs/ console.ijs tgsjhs.ijs tgsjhsutil.ijs Here's what I did to reproduce this problem: (1) stop and restart jhs (so I have a clean session). (2) reload my ijx window (3) in my now clean ijx window, enter the command: load'~Projects/tgsjhs/console.ijs' (4) reloa

Re: [Jprogramming] jhs webgl array_buffer

2014-03-22 Thread Brian Schott
Raul, I think you are referring to the ijx window collecting the log of inputs. Yes, that is definitely worth looking into. I can almost see a light at the end of the tunnel. I need to think more about how the multiple results would be collected by js. I think there is an example in the demos for

Re: [Jprogramming] jhs webgl array_buffer

2014-03-22 Thread Brian Schott
Pascal, I am thinking the user would just supply 1 command, but it could be a command that contains multiple commands, like the repeats conjunction produces. Below I have copied the example I suggested in my first post today. I may have forgotten to give the example of its use: (3 repeats fd)10 .

Re: [Jprogramming] jhs webgl array_buffer

2014-03-22 Thread Pascal Jasmin
> how would J know how to parse the multiplecommands differently from the way >it is presently you could have a ; separator for commands?    ';' cut 'fd 20 ;rt 55' +--+-+ |fd 20 |rt 55| +--+-+ ';' cut 'fd 20 ' +--+ |fd 20 | +--+ in terms of overall design, having js rend

Re: [Jprogramming] jhs webgl array_buffer

2014-03-22 Thread Brian Schott
Raul, I just diff'ed the wjiki files with the one I am using and do not get such an error. Did you download both tgsjhs.ijs and tgsjhsutil.ijs? They are both required and must be in the same projects directory. I suspect you did not download the tgsjhsutil.ijs file. I am using both Safari and Chr

Re: [Jprogramming] jhs webgl array_buffer

2014-03-22 Thread Raul Miller
I understand your dilemma, but I've got some other things I'm working on, so I can't put too much time into this. Do you have charles proxy installed, so you can inspect the ajax requests in flight? Note also that the way the ijx window works is it builds up a complete history which can be sent i

Re: [Jprogramming] jhs webgl array_buffer

2014-03-22 Thread Brian Schott
Raul, Those were great instructions. I have been to the console before, but only saw output, for example. I did not know you could enter commands there. And entering console.log(gl) I got lots of output including expandable lines with arrows/triangles pointing to the right. That queueing business

Re: [Jprogramming] jhs webgl array_buffer

2014-03-22 Thread Raul Miller
I have your code up and running, and am able to change the background color. I get an error, though, when I select the text field containing 'fd 20' and hit enter. That error looks like this in the ijx window: *** event handler error ev_command_enter 0 |value error: State | y=.0 Eye}yxs&Sta

Re: [Jprogramming] jhs webgl array_buffer

2014-03-22 Thread Raul Miller
I think I see the problem. If you really want multiple calls to jhs then what you need to do with entered commands is have them add themselves to a queue and then have each of them send the first entry in the queue to jhs (and have the handler then send the next entry on to jhs). But that strikes

Re: [Jprogramming] jhs webgl array_buffer

2014-03-22 Thread Brian Schott
Raul, I am not sure console.log's would help me here, but I am willing to insert them if I can learn now. Perhaps my reply to Pascal can explain better my conundrum. The problem is not that jhs and webgl are surprising me; my problem is that I have no idea how to accomplish the multiple command fe

Re: [Jprogramming] jhs webgl array_buffer

2014-03-22 Thread Brian Schott
J sees 'fd 10` for 1 command, or it can see `(5 repeats fd) 10` for "multiple" commands. If there were not the problem of communicating between jhs and js, that is if only j were involved, then the paint verb would be called 5 separate times by something like opengl. But now the first `fd 10` comma

Re: [Jprogramming] jhs webgl array_buffer

2014-03-22 Thread Raul Miller
I'm not sure if I can get to this today, but what you are doing here is closely related to my own interests, so I really would like to help you solve it. >From your description, I suspect the problem is in step 5. Without looking at your code, though, I can only speculate about what's gone wrong.

Re: [Jprogramming] jhs webgl array_buffer

2014-03-22 Thread Pascal Jasmin
in step 2, can you tell us what J sees as the y argument for 1 command and 2+ commands? it sounds like the output of that function the full sequence of moves? (using cached previous moves)? - Original Message - From: Brian Schott To: Programming forum Cc: Sent: Saturday, March 22, 2

Re: [Jprogramming] jhs webgl array_buffer

2014-03-22 Thread Brian Schott
First the good news. Joe's idea to use alldata.push(row); to '...push the single row to a javascript array...' works fine, except that only after much head scratching I discovered I needed .concat in addition to .push for turtle paths, (not for turtle avatars). The bad news is pretty devastating.