Re: [Jprogramming] jhs webgl array_buffer

2014-04-01 Thread Brian Schott
I have revised the JHS turtle graphics app, tgsjhs, and entered a new quicky intro video. Thanks to all who have helped with this effort. My greatest hope is that others find ways to use and adapt this system. http://youtu.be/YeLNbD0BpqA Although it is saved as a .png file, it is really a .zip f

Re: [Jprogramming] jhs webgl array_buffer

2014-03-25 Thread Brian Schott
Devon, You may be right, but I am unfamiliar with the sync/async terminology and practice, so I cannot comment intelligently. There is definitely the need to use a bundle-send-unbundle process. I just exhibited a blind spot, and the view was quite dark for a while, metaphorically. Ok? On Mon,

Re: [Jprogramming] jhs webgl array_buffer

2014-03-24 Thread Björn Helgason
I visualized this something like the pd. Not send each command to be shown. Collect them and then like pd 'show' execute the chain. Perhaps collect the moves into a boxed chain or lines in a matrix. Issuing more commands add to the chain until a new show or reset. The command chain could then

Re: [Jprogramming] jhs webgl array_buffer

2014-03-24 Thread Devon McCormick
I don't know the domain very well but it looks like part of your problem has to do with trying to work synchronously in an asynch medium - am I interpreting this corrrectly? On Mar 24, 2014 2:00 PM, "Raul Miller" wrote: > We (people) have a general problem where things seem simple when we > under

Re: [Jprogramming] jhs webgl array_buffer

2014-03-24 Thread Raul Miller
We (people) have a general problem where things seem simple when we understand them but they seem outrageously complex when we do not understand them. We have evolved a variety of mechanisms to deal with the transition between complex and simple, and there's something fascinating about all stages

Re: [Jprogramming] jhs webgl array_buffer

2014-03-24 Thread Brian Schott
Björn, The short answer is, yes, but ... I have been revising a turtle graphics app, tgsj, that employed opengl, a sort of precursor to webgl, calling the new version tgsjhs. tgsj was entirely a j app with dll calls to opengl and all of the turtle move/turn commands eventually use paint verb to a

Re: [Jprogramming] jhs webgl array_buffer

2014-03-23 Thread Björn Helgason
Trying to understand the issue. You want to start several batch jobs and you do not really know if some of them have finished yet? Right? - Björn Helgason gsm:6985532 skype:gosiminn On 23.3.2014 16:21, "Brian Schott" wrote: > Raul and Pascal, > > You are not understanding me. > > I don't think

Re: [Jprogramming] jhs webgl array_buffer

2014-03-23 Thread Brian Schott
By Jove, Raul, I think you've got it. I've got to move the jhrajax to inside the ev_command_entert. Brilliant. Thanks to all you folks. This was a struggle, any I can't overstate how awesome you are to figure this out. --- (B=) On Mar 23, 2014, at 8:24 PM, Raul Miller wrote: > After reading

Re: [Jprogramming] jhs webgl array_buffer

2014-03-23 Thread Joe Bogner
On Sun, Mar 23, 2014 at 8:24 PM, Raul Miller wrote: > After reading a bit more of you code, I need to change some of the details > of my suggestions. > > Immediately above your definition of 'paint' in tgsjhs.ijs you have: > > ev_command_enter=: 3 : 0 > ". s=. getv 'command' > ) > > At the bottom

Re: [Jprogramming] jhs webgl array_buffer

2014-03-23 Thread Raul Miller
After reading a bit more of you code, I need to change some of the details of my suggestions. Immediately above your definition of 'paint' in tgsjhs.ijs you have: ev_command_enter=: 3 : 0 ". s=. getv 'command' ) At the bottom of your 'paint' definition you have the line: jhrajax linecolors,

Re: [Jprogramming] jhs webgl array_buffer

2014-03-23 Thread Brian Schott
Raul, That demonstration of putting jdoajax(...) into the console was very clever and helpful. You may be on to something, but I am not sure because I don't quite follow your idea of "override ev_command_enter". Do you understand that in my app 'command' is my name of the event of entering a turtl

Re: [Jprogramming] jhs webgl array_buffer

2014-03-23 Thread Brian Schott
Your scheme of commands is close to what my app does, except that the system I have requires at some atomic level for the user or j to generate only a turn or only a move in one action. But that's not an issue, so let's assume your scheme is correct for now. The problem is that the user could say a

Re: [Jprogramming] jhs webgl array_buffer

2014-03-23 Thread Raul Miller
Oops, there's no 'command' argument to jdoajax. I'd have to look a bit more to determine where command comes from. Might be easiest to just override ev_command_enter in tgsj. I'm sure there's cleaner ways of approaching this, but I've other things occupying my attention right now so am not inclined

Re: [Jprogramming] jhs webgl array_buffer

2014-03-23 Thread Raul Miller
Here's jdoajax: function jdoajax(ids,data,sentence,async) { if(0!=rqstate) return; // previously - alert("busy - wait for previous request to finish"); async= (!async)?false:async; sentence=sentence||jevsentence; data=data||""; ids=ids||[]; rq= newrq(); if(async) rq.onreadystatechange= jdor

Re: [Jprogramming] jhs webgl array_buffer

2014-03-23 Thread Joe Bogner
On Sun, Mar 23, 2014 at 3:23 PM, Brian Schott wrote: > the client has to initiated the request > with a exactly one jdoajax(), right? So the client is not going to ever be > able to accept extra jhrajax's that were not expressly requested. Or, if > that is wrong, then I would like to be told about

Re: [Jprogramming] jhs webgl array_buffer

2014-03-23 Thread Brian Schott
I'll try to reply below. On Sun, Mar 23, 2014 at 2:31 PM, Raul Miller wrote: > Let's slow down a bit and try to think about what you are really trying to > do here. > > First, though, I have an issue here, with the concept of "in the server". > There is certainly a perspective where "only be one

Re: [Jprogramming] jhs webgl array_buffer

2014-03-23 Thread Raul Miller
Let's slow down a bit and try to think about what you are really trying to do here. First, though, I have an issue here, with the concept of "in the server". There is certainly a perspective where "only be one jhrajax in the server for any jdoajax() sent by the client" is valid. It's an approximat

Re: [Jprogramming] jhs webgl array_buffer

2014-03-23 Thread Brian Schott
Raul and Pascal, You are not understanding me. I don't think this is a question about browser being ready, Raul, because as I said inmy last post's beginning statement, the following. Is that a correct statement? "My understanding is that there can only be one jhrajax in the server for any jdoa

Re: [Jprogramming] jhs webgl array_buffer

2014-03-23 Thread Pascal Jasmin
;: i. 3 3 0 1 2 ; 3 4 5 ; 6 7 8    semijoin&>/ semijoin/ each (,:'jkl'); ": i. 3 3 jkl ; 0 1 2 ; 3 4 5 ; 6 7 8 - Original Message - From: Brian Schott To: Programming forum Cc: Sent: Sunday, March 23, 2014 8:43:52 AM Subject: Re: [Jprogramming] jhs webgl array_buffer

Re: [Jprogramming] jhs webgl array_buffer

2014-03-23 Thread Raul Miller
Technically speaking, this question is not well formed. If you are running a J sentence, then J is not idle, by definition. What you are really asking is: "will J be idle soon". And that's really a question about browser activity. In a sense you are asking "are there currently queued browser requ

Re: [Jprogramming] jhs webgl array_buffer

2014-03-23 Thread Brian Schott
[I am replying to an earlier message because it contains several details to which I would like to refer.] My understanding is that there can only be one jhrajax in the server for any jdoajax() sent by the client. If that is true, my problem is that the event which should produce the jhrajax is the

Re: [Jprogramming] jhs webgl array_buffer

2014-03-22 Thread Brian Schott
list), then that would also work. > > > - Original Message - > From: Brian Schott > To: Programming forum > Cc: > Sent: Saturday, March 22, 2014 5:48:07 PM > Subject: Re: [Jprogramming] jhs webgl array_buffer > > Joe, > > As it is, J processes all the p

Re: [Jprogramming] jhs webgl array_buffer

2014-03-22 Thread Pascal Jasmin
d the js list, and then called paint (which could have no args, and use a global js turtlecommand list), then that would also work. - Original Message - From: Brian Schott To: Programming forum Cc: Sent: Saturday, March 22, 2014 5:48:07 PM Subject: Re: [Jprogramming] jhs webgl array_b

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
--+ in terms of overall design, having js render the full list is an approach you could stick to for v1.0. - Original Message - From: Brian Schott To: Programming forum Cc: Sent: Saturday, March 22, 2014 2:06:54 PM Subject: Re: [Jprogramming] jhs webgl array_buffer Raul, Tho

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
, 2014 11:38:09 AM Subject: Re: [Jprogramming] jhs webgl array_buffer 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 .

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.

Re: [Jprogramming] jhs webgl array_buffer

2014-03-17 Thread Brian Schott
Joe, Your suggestion for adding a keydown handler works beautifully. My function ev_command_enter_ajax(ts) is quite complicated, but I think your idea will work well. I'll have to work on the details, though. Thanks for those great ideas. On Mon, Mar 17, 2014 at 9:13 PM, Joe Bogner wrote:

Re: [Jprogramming] jhs webgl array_buffer

2014-03-17 Thread Brian Schott
Raul, I have now created 2 similar files -- console.ijs and console.html -- to produce a 3-frame browser page. Both files are used in a similar way by the user. Both require that first the user creates a jijx window and in that window executes one of the following two commands (or uses menus to ac

Re: [Jprogramming] jhs webgl array_buffer

2014-03-17 Thread Raul Miller
Much cleaner than my earlier suggestion. Nice! Thanks, -- Raul On Mon, Mar 17, 2014 at 9:13 PM, Joe Bogner wrote: > On Mon, Mar 17, 2014 at 12:51 PM, Brian Schott > wrote: > > Hi Brian - I tried out the demo and it looks like a fun way to play > with webgl. I am looking forward to seeing

Re: [Jprogramming] jhs webgl array_buffer

2014-03-17 Thread Joe Bogner
On Mon, Mar 17, 2014 at 12:51 PM, Brian Schott wrote: Hi Brian - I tried out the demo and it looks like a fun way to play with webgl. I am looking forward to seeing where it goes > For example is there a way to ignore the arrow key that is used in the > graphic while the focus is in the text fie

Re: [Jprogramming] jhs webgl array_buffer

2014-03-17 Thread Raul Miller
I see two different "locale" issues here. There's cocurrent (which is independent of the browser window you are interacting with), and there's the locale being used to handle http requests from javascript (which is determined by the url - jijx urls will be handled by the jijx locale). I guess I am

Re: [Jprogramming] jhs webgl array_buffer

2014-03-17 Thread Brian Schott
Raul, Thank you for your thoughtful response, as always. Let's start with (1). I am pretty sure I do want to change the locale in jijx, unless there is a better way. At least changing the locale there has been my current practice: cocurrent'tgsj'. The reason I have needed to do that is that there

Re: [Jprogramming] jhs webgl array_buffer

2014-03-17 Thread Raul Miller
I would not worry about efficiency, preserveDrawingBuffer has warnings on it - that it is notoriously inefficient. (It's just an easy way of copying content forward from previous renders.) And I suspect that your vanishing turtles problem is also a result of misplaced concerns about efficiency. M

Re: [Jprogramming] jhs webgl array_buffer

2014-03-17 Thread Brian Schott
In this thread in its original post (to which I am replying here), I was not able to view old turtle path lines when new lines were added. Raul correctly pointed out a property of canvas, preserveDrawingBuffer (pDB), that preserves the old lines and shows the new lines, too. However, because ther

Re: [Jprogramming] jhs webgl array_buffer

2014-03-08 Thread Brian Schott
Raul, Perhaps, by mistake, I added the phrase `,{preserveDrawingBuffer: true}` in the `if (!gl)` clause instead of the original `gl=` clause, and the drawing worked correctly. I think on my computer the experimental-webgl is more important that the webgl, and that's why your clause really worked f

Re: [Jprogramming] jhs webgl array_buffer

2014-03-08 Thread Raul Miller
With function init() { try { var canvas = document.getElementById("glcanvas"); gl = canvas.getContext('webgl', {preserveDrawingBuffer: true}); if ( ! gl ) { throw "Could not create WebGL context."; } I cannot reproduce this. With function init() {

Re: [Jprogramming] jhs webgl array_buffer

2014-03-08 Thread Brian Schott
When I click enter on the text field and press enter, even with the phony text that is presently in it, the drawing disappears, instead of staying and a new line appearing. When there is real information in the text field, a turtle command moving the turtle forward by n steps, the drawing disappear

Re: [Jprogramming] jhs webgl array_buffer

2014-03-08 Thread Raul Miller
Can you tell me the steps you are using to get the behavior you do not want (and what you want to happen instead)? Thanks, -- Raul On Sat, Mar 8, 2014 at 8:28 PM, Brian Schott wrote: > Raul, > > With regard to changing the definition of gl, it did not seem to accomplish > anything. I never

Re: [Jprogramming] jhs webgl array_buffer

2014-03-08 Thread Brian Schott
Oops, I meant in the second paragraph, that I have *not* been able to reinstate ... On Sat, Mar 8, 2014 at 8:28 PM, Brian Schott wrote: > Raul, > > With regard to changing the definition of gl, it did not seem to > accomplish anything. I never heard of that option, though. Maybe I have > someth

Re: [Jprogramming] jhs webgl array_buffer

2014-03-08 Thread Brian Schott
Raul, With regard to changing the definition of gl, it did not seem to accomplish anything. I never heard of that option, though. Maybe I have something else tricked up to outsmart that option? I had to disable the keys because that feature was undermining my ability to read the user's inputs. I

Re: [Jprogramming] jhs webgl array_buffer

2014-03-08 Thread Raul Miller
First, the simplest way to do what I think you are asking is gl = canvas.getContext('webgl', {preserveDrawingBuffer: true}); Second, after visiting http://127.0.0.1:65001/tgsj I noticed that arrow keys were inert (and I did not explore the option of typing a command). Hopefully this just reflec

Re: [Jprogramming] jhs webgl array_buffer

2014-03-08 Thread Joe Bogner
Brian, it definitely looks like it's something with the webgl code instead of what you are doing with J. I am not familiar with webgl so I will need to read up on it. I can say it's webgl/javascript because I get the same behavior of wiping out the canvas if I just paste lines like this into the j

Re: [Jprogramming] jhs webgl array_buffer

2014-03-08 Thread Brian Schott
Joe, Thanks for the offer. I have put the code here. https://dpaste.de/qJge Believe it or not it is dumbed down, even though it is long. The main trick I used to trim it was to replace the usual user input, which is something like `fd 20`, with the suggested jhrajax input. Let me know if there is

Re: [Jprogramming] jhs webgl array_buffer

2014-03-08 Thread Joe Bogner
Hi Brian - It sounds like it should work if you are evaluating a drawLines call after each ajax request and not refreshing the whole page. Can you post the full code or at least the part that handles the ajax response to better diagnose? On Mar 8, 2014 2:18 PM, "Brian Schott" wrote: > I have suc

[Jprogramming] jhs webgl array_buffer

2014-03-08 Thread Brian Schott
I have successfully drawn gl.LINES in my adaptation of Eric's demogl1.ijs, but each time I draw a new line that the user's command produces (for example, say `forward 2` produces a line from 0,0,0 to 0,2,0) all of the graphics on the incumbent canvas are erased, and that line (from 0,0,0 to 0,2,0)