<div>Some tips and resources for learning about Python and JS:</div><div><br></div>mpld3 brings together Python and d3 Javascript data visualization library:<div>Docs: <a href="http://mpld3.github.io">http://mpld3.github.io</a></div><div>Src: <a href="https://github.com/mpld3/mpld3">https://github.com/mpld3/mpld3</a></div><div><br></div><div><br></div><div>I haven't reviewed these sources for Code Injection bugs that do occur when e.g. generating JS with another language. ("XSS": "Cross-site scripting").</div><div>- <a href="http://cwe.mitre.org/top25/#CWE-79">http://cwe.mitre.org/top25/#CWE-79</a></div><div> <b style="font-family:Verdana,Arial,Helvetica,Geneva,sans-serif;font-size:large;background-color:rgb(238,238,238)">Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')</b></div><div><br></div><div>About JSON:</div><div><br></div><div>- JSON should be parsed.</div><div>  - <a href="http://seriot.ch/parsing_json.php">http://seriot.ch/parsing_json.php</a></div><div>- JSON should not be eval()'d; because it could contain code.</div><div>- While it's possible to template JSON into an HTML page, we usually like to retrieve the data separately from the code (because then we can cache the code and data separately); so REST or RPC API.</div><div>  - <a href="https://github.com/mgonto/restangular/blob/master/README.md#differences-with-resource">https://github.com/mgonto/restangular/blob/master/README.md#differences-with-resource</a></div><div> - <a href="https://www.quora.com/Is-it-possible-to-consume-a-RESTful-API-with-React-js-alone-i-e-without-any-server-side-language-provided-the-API">https://www.quora.com/Is-it-possible-to-consume-a-RESTful-API-with-React-js-alone-i-e-without-any-server-side-language-provided-the-API</a></div><div><br></div><div><br></div><div>- JSONLD is a spec for Linked Data in JSON. There's a @context which defines URI namespaces for schema. JSON object {attributes:}, then, map to URIs. <a href="http://json-ld.org/playground/">http://json-ld.org/playground/</a></div><div>- RDFJS apps can work with JSONLD.</div><div>- There are other data interchange specs with JS support (Protocol Buffers, Thrift, Avro, Arrow, ).<br><br><br>PyJS contains a Python to JS compiler</div><div>Docs: <a href="http://pyjs.org">http://pyjs.org</a></div><div>Src: <a href="https://github.com/pyjs/pyjs">https://github.com/pyjs/pyjs</a></div><div><br></div><div><br></div><div>Brython includes a Python interpreter written in JS; for use of Python as a HTML5 script language:</div><div>Docs: <a href="https://brython.info">https://brython.info</a></div><div>Src: <a href="https://github.com/brython-dev/brython">https://github.com/brython-dev/brython</a><br><br>- Like Javascript, Brython has a DOM (Document Object Model) API: <a href="https://brython.info/static_doc/en/dom_api.html">https://brython.info/static_doc/en/dom_api.html</a><br><br><br>Folium integrates Python data and a JS data visualization library called leaflet.js: </div><div>Src: <a href="https://github.com/python-visualization/folium">https://github.com/python-visualization/folium</a><br><br>Btw, (e.g. for a flipped classroom) these are great:</div><div>- <a href="https://www.codecademy.com/courses/learn-git">https://www.codecademy.com/courses/learn-git</a></div><div>- <a href="https://www.codecademy.com/courses/learn-javascript">https://www.codecademy.com/courses/learn-javascript</a> (... jQuery, Angular, React)</div><div>- <a href="https://www.codecademy.com/tracks/python">https://www.codecademy.com/tracks/python</a> (...</div><div>-  <a href="https://www.codecademy.com/apis">https://www.codecademy.com/apis</a> (APIs! have request limits)</div><div><br><br>On Monday, November 21, 2016, kirby urner <<a href="mailto:kirby.urner@gmail.com">kirby.urner@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div>I'm continuing to advance the notion, in </div><div>Medium comments and elsewhere, that </div><div>learning one computer language at a </div><div>time may be less efficient than tackling </div><div>two or more, but with a "main one" front </div><div>burner. [1]</div><div><br></div><div>I credit the LEX Institute for this idea.[2]</div><div><br></div><div>The theory being: contrasts and comparisons</div><div>help concepts stick, whereas just one example</div><div>(of a language, human or computer) provides </div><div>less traction, a slipperier slope. </div><div><br></div><div>Like learning the J language (<a href="http://jsoftware.com" target="_blank">jsoftware.com</a>)</div><div>even a little helps one realize how different </div><div>languages can be, bringing Python into sharper </div><div>relief against a background.</div><div><br></div><div>But J (of APL heritage) might be too exotic </div><div>as a #2, why not do JavaScript?  Python + JS</div><div>could be as common as HTML + CSS.</div><div><br></div><div>That's a little self serving as a common bootcamp </div><div>design if JS front end, Python back end. Our </div><div>PDX Code Guild in Portland takes that tack.</div><div><br></div><div>The curriculum, then, would continually bring </div><div>them together to discuss their similarities and</div><div>differences.  Either one could be foreground</div><div>first, with the other as background, but we'd </div><div>do a lot of jumping back and forth (and not </div><div>just with JSON :-D).</div><div><br></div><div>A breakthrough realization I had earlier today </div><div>was that Jupyter Notebooks already gives me </div><div>a JavaScript interpreter, even when my main </div><div>kernel is Python 3.  </div><div><br></div><div>%%javascript at the top of any cell creates a </div><div>node-like experience, and I'm able to write </div><div>ES6 (JavaScript) with classes, arrow functions </div><div>and everything.  It feels a lot like using </div><div>node --harmony testfile.js on cloud9 (another</div><div>learning platform I visit).</div><div><br></div><div>Here's an example, of a Jupyter Notebook</div><div>running through nbviewer, with both Python</div><div>and JS code cells.  The point is to show off</div><div>the similarities.</div><div><br></div><div><span style="color:rgb(68,68,68);font-family:roboto,helvetica,arial,sans-serif;font-size:13px"><a href="https://goo.gl/nj9RPO" target="_blank">https://goo.gl/nj9RPO</a></span><br></div><div><br></div><div>Kirby</div><div><br></div><div>Useful tools:</div><div><a href="http://codepen.io/" target="_blank">http://codepen.io/</a><br></div><div><a href="http://jsbin.com/" target="_blank">http://jsbin.com/</a><br></div><div><br></div><div>[1] <span style="color:rgb(68,68,68);font-family:roboto,helvetica,arial,sans-serif;font-size:13px"><a href="https://goo.gl/U4Yx6l" target="_blank">https://goo.gl/U4Yx6l</a> (comment on one</span></div><div><span style="color:rgb(68,68,68);font-family:roboto,helvetica,arial,sans-serif;font-size:13px">of Quincy Larson's, about which language </span></div><div><span style="color:rgb(68,68,68);font-family:roboto,helvetica,arial,sans-serif;font-size:13px">to learn first)</span></div><div><span style="color:rgb(68,68,68);font-family:roboto,helvetica,arial,sans-serif;font-size:13px"><br></span></div><div><div>[2] 'Who Is Fourier?' (one of its pubs) appears </div><div>way back in edu-sig.  Jason Cunliff and I </div><div>met and talked about it in New York that</div><div>time.</div><div><br></div><div>Here's one of Jason's from 2002:</div><div><br></div><div><a href="https://mail.python.org/pipermail/edu-sig/2002-September/002255.html" target="_blank">https://mail.python.org/<wbr>pipermail/edu-sig/2002-<wbr>September/002255.html</a><br></div></div><div><br></div></div>
</blockquote></div>