<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=EN-US link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal>With git, we could add checking upon checkin, with a extra step (push) before sharing, I think.  They also enforce formatting rules before checking in.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I believe Travis CI (continuous integration) does this, but I’ve never experimented with it before.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I will look into it as a task.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>John</p><p class=MsoNormal>Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986">Mail</a> for Windows 10</p><p class=MsoNormal><o:p> </o:p></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='border:none;padding:0in'><b>From: </b><a href="mailto:brutzman@nps.edu">Brutzman, Donald (Don) (CIV)</a><br><b>Sent: </b>Sunday, May 12, 2019 9:23 PM<br><b>To: </b><a href="mailto:yottzumm@gmail.com">John Carlson</a><br><b>Cc: </b><a href="mailto:x3d-public@web3d.org">X3D Graphics public mailing list</a><br><b>Subject: </b>Re: X3DJSAIL updated; python pyjnius mapping, javascriptwarnings,cleaner .py export syntax</p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>On 5/12/2019 6:58 PM, John Carlson wrote:</p><p class=MsoNormal>>  1. Cleaned up printSubArray, fixed non-scoped v.    Fixed nested if (type === “boolean”) that would not run inside another if (type === “int”)</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I had already fixed that, checked in, reported, and run a rebuild on all examples.  Hope we haven't worked at cross purposes or conflicted subversion.  Please invoke svn refresh frequently, I do.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>>  2. Added braces for consistency. I always use braces in JS and Java.  I believe this is best practice inherited from C.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Not clear where you are referring to.  Example excerpt please.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>>  3. Replaced spaces with tabs.  I use tabs for indents. Your text editor should be able to handle this, that is, configure leading tabs to be the amount of whitespace you want, typically 4 virtual spaces in python I think.  Sugggest replaceing rest of left whitespace with tabs.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>As before, have set at two whitespace characters to match .java syntax for simplest comparability.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Tab settings differ widely so they are not a good default.  Single whitespace doesn't show scene graph structure well enough.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>>  4. If you are still getting const errors, upgrade to ES6 node.js.  If not possible, change const to var.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I get the const errors within Netbeans 8, will check on whether ES6 is upgraded in Netbeans 11.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Are we requiring ES6 node.js?  Seems like a good idea.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Why don't we add node.js verification checking of your .js files at the beginning of the build process?  Should be possible, do you know the invocation for that?  Probably could put jslint output in the logs too...</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>> I think if we can’t solve this problem in pyjnius, we’ll have to punt and use wrapping or new methods in X3DJSAIL.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I think I have added all of the constructor and set methods needed in X3DJSAIL yesterday.  Will check build logs and add double methods for float parameters if any  others look to be missing... should be good since autogeneration patterns were used, both spotchecks and unit tests looked good.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>> Adding casts will make the code look ugly, I think.  Wrapping is fairly clean and fixes most errors.  We’ll have to provide a good set of documentation for how to fix the other errors, like suggesting using a non-SAI setDEF method—no override, cast or additional, possibly programmer specialized wrapping.   We can look at how people are solving the problem, and adopt the best approach.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Rephrased (I think) is how I said it before: we need to continue verifying all of your pyjnius invocations, good progress has been made.  Don't want to have any hack workarounds way up in the user's python source. We are chasing cleanly pythonic duck typing here.  This latest is getting there, seems like we have far fewer errors and those that remain seem to be repetitive in nature.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>> StackOverflows are getting out of hand, please address.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>They are much reduced in latest build log (90MB -> 11MB) ... more improvements to follow.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The root problem is not repetitive diagnostic messages but inadequate memory reservation when invoking pyjnius.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>> I suggest talking to Oracle or other OpenJDK folks.</p><p class=MsoNormal>Will continue Reading The Manual and testing until stuck, onward we go.  Thanks for steady progress together.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Meanwhile wondering, is there any way to move these into one of the python infrastructure files?  That would reduce source complexity significantly.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>from org.web3d.x3d.jsail.Core.X3DObject import X3DObject as X3D</p><p class=MsoNormal>from org.web3d.x3d.jsail.fields.SFStringObject import SFStringObject as SFString</p><p class=MsoNormal>from org.web3d.x3d.jsail.Core.headObject import headObject as head</p><p class=MsoNormal>from org.web3d.x3d.jsail.Core.metaObject import metaObject as meta</p><p class=MsoNormal>from org.web3d.x3d.jsail.Core.SceneObject import SceneObject as Scene</p><p class=MsoNormal>from org.web3d.x3d.jsail.Grouping.GroupObject import GroupObject as Group</p><p class=MsoNormal>// etc.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>> John</p><p class=MsoNormal>> </p><p class=MsoNormal>> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10</p><p class=MsoNormal>> </p><p class=MsoNormal>> *From: *Brutzman, Donald (Don) (CIV) <mailto:brutzman@nps.edu></p><p class=MsoNormal>> *Sent: *Sunday, May 12, 2019 2:39 PM</p><p class=MsoNormal>> *To: *John Carlson <mailto:yottzumm@gmail.com></p><p class=MsoNormal>> *Cc: *X3D Graphics public mailing list <mailto:x3d-public@web3d.org></p><p class=MsoNormal>> *Subject: *Re: X3DJSAIL updated; python pyjnius mapping, javascript warnings,cleaner .py export syntax</p><p class=MsoNormal>> </p><p class=MsoNormal>> On 5/11/2019 6:46 PM, John Carlson wrote:</p><p class=MsoNormal>> </p><p class=MsoNormal>>  > Fixed, checked in.</p><p class=MsoNormal>> </p><p class=MsoNormal>> thank you.</p><p class=MsoNormal>> </p><p class=MsoNormal>> Found some issues with PythonPipeliningSerializer.js:</p><p class=MsoNormal>> </p><p class=MsoNormal>> - Netbeans provides a number of warnings, worked as follows to clear them.</p><p class=MsoNormal>> </p><p class=MsoNormal>> - semicolons added where indicated</p><p class=MsoNormal>> </p><p class=MsoNormal>> - printSubArray method had a number of issues</p><p class=MsoNormal>> </p><p class=MsoNormal>> -- nested variable v defined multiple times, renamed it to vv within nested scope</p><p class=MsoNormal>> </p><p class=MsoNormal>> -- irregular indentation led to variable v later being out of scope;</p><p class=MsoNormal>> </p><p class=MsoNormal>> -- reason was premature completion of integer "for (var v in values)" loop</p><p class=MsoNormal>> </p><p class=MsoNormal>> -- moved closing } to put everything appropriate within loop, please check</p><p class=MsoNormal>> </p><p class=MsoNormal>> - thanks for fixing "if (attrType.startsWith("SF"))"</p><p class=MsoNormal>> </p><p class=MsoNormal>> - changed some identity operators == to equality operators ===</p><p class=MsoNormal>> </p><p class=MsoNormal>>                  https://stackoverflow.com/questions/359494/which-equals-operator-vs-should-be-used-in-javascript-comparisons</p><p class=MsoNormal>> </p><p class=MsoNormal>> note that Douglas Crockford is quoted as</p><p class=MsoNormal>> </p><p class=MsoNormal>>                  "JavaScript has two sets of equality operators: === and !==, and their evil twins == and !=. The good ones work the way you would expect. [...] The lack of transitivity is alarming. My advice is to never use the evil twins. Instead, always use === and !==."</p><p class=MsoNormal>> </p><p class=MsoNormal>> - i worked on removing line-continuation characters completely by wrapping entire expression in one extra set of parentheses</p><p class=MsoNormal>> </p><p class=MsoNormal>> - comments now appear on a new line for readability</p><p class=MsoNormal>> </p><p class=MsoNormal>> - changed \r\n to \n for consistency throughout, seemed OK</p><p class=MsoNormal>> </p><p class=MsoNormal>> - output line breaks inserted between sections and otherwise minimized for readability</p><p class=MsoNormal>> </p><p class=MsoNormal>> Still getting an error: Unexpected 'const'</p><p class=MsoNormal>> </p><p class=MsoNormal>> const DOUBLE_SUFFIX = '';</p><p class=MsoNormal>> </p><p class=MsoNormal>> Checked in these changes to PythonPipeliningSerializer.js.</p><p class=MsoNormal>> </p><p class=MsoNormal>> Clean example attached - better and better.</p><p class=MsoNormal>> </p><p class=MsoNormal>>  > Do you have an example we can test with?</p><p class=MsoNormal>> </p><p class=MsoNormal>> I continue focusing on HelloWorld.x3d and corresponding HelloWorld.py</p><p class=MsoNormal>> </p><p class=MsoNormal>> Moving around and removing sections of .x3d source can push the error around...</p><p class=MsoNormal>> </p><p class=MsoNormal>> Each time, am only able to get errors in .py file of the form</p><p class=MsoNormal>> </p><p class=MsoNormal>>       .addChild(Viewpoint().setDEF("ViewUpClose").setCenterOfRotation(0,-1,0).setDescription("Hello world!").setPosition(0,-1,7))</p><p class=MsoNormal>> </p><p class=MsoNormal>>       AttributeError: 'org.web3d.x3d.sai.Navigation.X3DViewpointNode' object has no attribute 'setCenterOfRotation'</p><p class=MsoNormal>> </p><p class=MsoNormal>>       .setMaterial(Material().setDEF("MaterialLightBlue").setDiffuseColor(0.1,0.5,1))</p><p class=MsoNormal>> </p><p class=MsoNormal>>       AttributeError: 'org.web3d.x3d.sai.Shape.X3DMaterialNode' object has no attribute 'setDiffuseColor'</p><p class=MsoNormal>> </p><p class=MsoNormal>>       .setTexture(ImageTexture().setDEF("ImageCloudlessEarth").setUrl(["earth-topo.png","earth-topo.jpg","earth-topo-small.gif","http://www.web3d.org/x3d/content/examples/Basic/earth-topo.png","http://www.web3d.org/x3d/content/examples/Basic/earth-topo.jpg","http://www.web3d.org/x3d/content/examples/Basic/earth-topo-small.gif"]))))))))</p><p class=MsoNormal>> </p><p class=MsoNormal>>       AttributeError: 'org.web3d.x3d.sai.Texturing.X3DTextureNode' object has no attribute 'setUrl'</p><p class=MsoNormal>> </p><p class=MsoNormal>> so it sure looks like it has something to do with incorrect handling of direct methods, it seems OK when a method is found in abstract parent of an object class.</p><p class=MsoNormal>> </p><p class=MsoNormal>>  > Thanks,</p><p class=MsoNormal>> </p><p class=MsoNormal>>  ></p><p class=MsoNormal>> </p><p class=MsoNormal>>  > John</p><p class=MsoNormal>> </p><p class=MsoNormal>>  ></p><p class=MsoNormal>> </p><p class=MsoNormal>>  > Index: PythonPipeliningSerializer.js</p><p class=MsoNormal>> </p><p class=MsoNormal>>  ></p><p class=MsoNormal>> </p><p class=MsoNormal>>  > ===================================================================</p><p class=MsoNormal>> </p><p class=MsoNormal>>  ></p><p class=MsoNormal>> </p><p class=MsoNormal>>  > --- PythonPipeliningSerializer.js       (revision 28463)</p><p class=MsoNormal>> </p><p class=MsoNormal>>  ></p><p class=MsoNormal>> </p><p class=MsoNormal>>  > +++ PythonPipeliningSerializer.js       (working copy)</p><p class=MsoNormal>> </p><p class=MsoNormal>>  ></p><p class=MsoNormal>> </p><p class=MsoNormal>>  > @@ -82,7 +82,7 @@</p><p class=MsoNormal>> </p><p class=MsoNormal>>  ></p><p class=MsoNormal>> </p><p class=MsoNormal>>  >                          values.pop();</p><p class=MsoNormal>> </p><p class=MsoNormal>>  ></p><p class=MsoNormal>> </p><p class=MsoNormal>>  >                  }</p><p class=MsoNormal>> </p><p class=MsoNormal>>  ></p><p class=MsoNormal>> </p><p class=MsoNormal>>  > -               if (type.startsWith("SF")) // TODO fix this javascript, test is not working</p><p class=MsoNormal>> </p><p class=MsoNormal>>  ></p><p class=MsoNormal>> </p><p class=MsoNormal>>  > +               if (attrType.startsWith("SF"))</p><p class=MsoNormal>> </p><p class=MsoNormal>>  ></p><p class=MsoNormal>> </p><p class=MsoNormal>>  >               return     lead+values.join(j)+trail; // avoid array brackets on SF types</p><p class=MsoNormal>> </p><p class=MsoNormal>>  ></p><p class=MsoNormal>> </p><p class=MsoNormal>>  >           else</p><p class=MsoNormal>> </p><p class=MsoNormal>>  ></p><p class=MsoNormal>> </p><p class=MsoNormal>>  >               return '['+lead+values.join(j)+trail+']';</p><p class=MsoNormal>> </p><p class=MsoNormal>>  ></p><p class=MsoNormal>> </p><p class=MsoNormal>>  > Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10</p><p class=MsoNormal>> </p><p class=MsoNormal>>  ></p><p class=MsoNormal>> </p><p class=MsoNormal>>  > *From: *John Carlson <mailto:yottzumm@gmail.com></p><p class=MsoNormal>> </p><p class=MsoNormal>>  > *Sent: *Saturday, May 11, 2019 8:39 PM</p><p class=MsoNormal>> </p><p class=MsoNormal>>  > *To: *Brutzman, Donald (Don) (CIV) <mailto:brutzman@nps.edu></p><p class=MsoNormal>> </p><p class=MsoNormal>>  > *Cc: *X3D Graphics public mailing list <mailto:x3d-public@web3d.org></p><p class=MsoNormal>> </p><p class=MsoNormal>>  > *Subject: *RE: X3DJSAIL updated support for setting with doubles; pythonpyjniusmapping</p><p class=MsoNormal>> </p><p class=MsoNormal>>  ></p><p class=MsoNormal>> </p><p class=MsoNormal>>  > ==========================================</p><p class=MsoNormal>> </p><p class=MsoNormal>>  ></p><p class=MsoNormal>> </p><p class=MsoNormal>>  >  >2. Also tried to get PythonPipeliningSerializer.js to avoid brackets on simple and numeric types.</p><p class=MsoNormal>> </p><p class=MsoNormal>>  ></p><p class=MsoNormal>> </p><p class=MsoNormal>>  >  >Checked in block that didn't work, please fix and check back in:</p><p class=MsoNormal>> </p><p class=MsoNormal>>  ></p><p class=MsoNormal>> </p><p class=MsoNormal>>  >                                  if (type.startsWith("SF")) // TODO fix this javascript, test is not working</p><p class=MsoNormal>> </p><p class=MsoNormal>>  ></p><p class=MsoNormal>> </p><p class=MsoNormal>>  >               return     lead+values.join(j)+trail; // avoid array brackets on SF types</p><p class=MsoNormal>> </p><p class=MsoNormal>>  ></p><p class=MsoNormal>> </p><p class=MsoNormal>>  >           else</p><p class=MsoNormal>> </p><p class=MsoNormal>>  ></p><p class=MsoNormal>> </p><p class=MsoNormal>>  >               return '['+lead+values.join(j)+trail+']';</p><p class=MsoNormal>> </p><p class=MsoNormal>>  ></p><p class=MsoNormal>> </p><p class=MsoNormal>>  > ==========================================</p><p class=MsoNormal>> </p><p class=MsoNormal>>  ></p><p class=MsoNormal>> </p><p class=MsoNormal>>  > I logged type, and these appear to be Java types.  So we’ll have to change type to attrType or something. Will do.</p><p class=MsoNormal>> </p><p class=MsoNormal>>  ></p><p class=MsoNormal>> </p><p class=MsoNormal>>  > John</p><p class=MsoNormal>> </p><p class=MsoNormal>>  ></p><p class=MsoNormal>> </p><p class=MsoNormal>> all the best, Don</p><p class=MsoNormal>> </p><p class=MsoNormal>> -- </p><p class=MsoNormal>> </p><p class=MsoNormal>> Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman@nps.edu</p><p class=MsoNormal>> </p><p class=MsoNormal>> Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149</p><p class=MsoNormal>> </p><p class=MsoNormal>> X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman</p><p class=MsoNormal>> </p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>all the best, Don</p><p class=MsoNormal>-- </p><p class=MsoNormal>Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman@nps.edu</p><p class=MsoNormal>Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149</p><p class=MsoNormal>X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman</p><p class=MsoNormal><o:p> </o:p></p></div></body></html>