Popular recipes tagged "meta:loc=190"http://code.activestate.com/recipes/tags/meta:loc=190/2017-02-11T19:01:52-08:00ActiveState Code RecipesOrdered Listbox for Tkinter (Python) 2017-02-11T19:01:52-08:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580756-ordered-listbox-for-tkinter/ <p style="color: grey"> Python recipe 580756 by <a href="/recipes/users/4189907/">Miguel Martínez López</a> (<a href="/recipes/tags/listbox/">listbox</a>, <a href="/recipes/tags/ordered/">ordered</a>, <a href="/recipes/tags/sort/">sort</a>, <a href="/recipes/tags/sorted/">sorted</a>, <a href="/recipes/tags/tkinter/">tkinter</a>). Revision 6. </p> <p>Listbox megawidget showing ordered strings. It's possible to ignore case. I also provided an auto scrollbar option.</p> Hopfield Artificial Neural Network (C++) 2016-07-03T21:58:49-07:00Jay ballerhttp://code.activestate.com/recipes/users/4194368/http://code.activestate.com/recipes/580688-hopfield-artificial-neural-network/ <p style="color: grey"> C++ recipe 580688 by <a href="/recipes/users/4194368/">Jay baller</a> (<a href="/recipes/tags/ai/">ai</a>, <a href="/recipes/tags/algorithm/">algorithm</a>, <a href="/recipes/tags/algorithms/">algorithms</a>, <a href="/recipes/tags/artificial_intelligence/">artificial_intelligence</a>, <a href="/recipes/tags/neural_network/">neural_network</a>). </p> <p>(Discrete (Binary)) Hopfield Artificial Neural Network (ANN).</p> <p>For more info see:</p> <p><a href="http://en.wikipedia.org/wiki/Hopfield_net" rel="nofollow">http://en.wikipedia.org/wiki/Hopfield_net</a></p> <p><a href="http://www.scholarpedia.org/article/Hopfield_network" rel="nofollow">http://www.scholarpedia.org/article/Hopfield_network</a></p> Voxel Based Ray Tracing (Python) 2013-08-29T06:11:41-07:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/578652-voxel-based-ray-tracing/ <p style="color: grey"> Python recipe 578652 by <a href="/recipes/users/4172570/">FB36</a> (<a href="/recipes/tags/graphics/">graphics</a>, <a href="/recipes/tags/image/">image</a>, <a href="/recipes/tags/math/">math</a>, <a href="/recipes/tags/mathematics/">mathematics</a>). </p> <p>The standard ray tracing algorithm seems unnatural to me because everytime a ray reflects/refracts all (primitive) objects in the scene must be tested for intersection; no matter where they located!</p> <p>In this method there is no such thing. It just moves each ray voxel by voxel until it hits an opaque/reflective(/refractive) voxel.</p> <p>I made many simplifications so the image is crude.</p> easyjson.py - parsing JSON from buffer and from file (Python) 2013-05-27T05:32:07-07:00Thomas Lehmannhttp://code.activestate.com/recipes/users/4174477/http://code.activestate.com/recipes/578529-easyjsonpy-parsing-json-from-buffer-and-from-file/ <p style="color: grey"> Python recipe 578529 by <a href="/recipes/users/4174477/">Thomas Lehmann</a> (<a href="/recipes/tags/json/">json</a>, <a href="/recipes/tags/parser/">parser</a>). Revision 4. </p> <p><strong>JSON Parser</strong>:</p> <ul> <li>Refering to <a href="http://www.json.org/" rel="nofollow">http://www.json.org/</a></li> <li>Just one simple Python file you can integrate where you want to</li> <li>No imports (very important) -> no dependencies!!!</li> <li>Should work with really older versions of Python!!!</li> </ul> <p><strong>Todo's</strong>:</p> <ul> <li>Doesn't cover full number format</li> <li>...</li> </ul> <p><strong>Done</strong></p> <ul> <li>Allows string in string (revision 2)</li> <li>Covers objects in an array (revision 2)</li> <li>Provides a mechanism to allow other dictionaries (like collections.OrderedDict) (revision 3)</li> <li>Conversion of numbers to integer or float types (revision 4)</li> </ul> Hopfield Artificial Neural Network (C++) 2010-11-14T06:32:53-08:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/577461-hopfield-artificial-neural-network/ <p style="color: grey"> C++ recipe 577461 by <a href="/recipes/users/4172570/">FB36</a> (<a href="/recipes/tags/ai/">ai</a>, <a href="/recipes/tags/algorithm/">algorithm</a>, <a href="/recipes/tags/algorithms/">algorithms</a>, <a href="/recipes/tags/artificial_intelligence/">artificial_intelligence</a>, <a href="/recipes/tags/neural_network/">neural_network</a>). Revision 2. </p> <p>(Discrete (Binary)) Hopfield Artificial Neural Network (ANN).</p> <p>For more info see:</p> <p><a href="http://en.wikipedia.org/wiki/Hopfield_net" rel="nofollow">http://en.wikipedia.org/wiki/Hopfield_net</a></p> <p><a href="http://www.scholarpedia.org/article/Hopfield_network" rel="nofollow">http://www.scholarpedia.org/article/Hopfield_network</a></p> Simple Web Crawler (Python) 2011-01-31T21:57:58-08:00James Millshttp://code.activestate.com/recipes/users/4167757/http://code.activestate.com/recipes/576551-simple-web-crawler/ <p style="color: grey"> Python recipe 576551 by <a href="/recipes/users/4167757/">James Mills</a> (<a href="/recipes/tags/crawler/">crawler</a>, <a href="/recipes/tags/network/">network</a>, <a href="/recipes/tags/parsing/">parsing</a>, <a href="/recipes/tags/web/">web</a>). Revision 2. </p> <p>NOTE: This recipe has been updated with suggested improvements since the last revision.</p> <p>This is a simple web crawler I wrote to test websites and links. It will traverse all links found to any given depth.</p> <p>See --help for usage.</p> <p>I'm posting this recipe as this kind of problem has been asked on the Python Mailing List a number of times... I thought I'd share my simple little implementation based on the standard library and BeautifulSoup.</p> <p>--JamesMills</p> HTTP basic authentication (Python) 2004-10-05T14:05:47-07:00Michael Foordhttp://code.activestate.com/recipes/users/1565518/http://code.activestate.com/recipes/305288-http-basic-authentication/ <p style="color: grey"> Python recipe 305288 by <a href="/recipes/users/1565518/">Michael Foord</a> (<a href="/recipes/tags/web/">web</a>). Revision 3. </p> <p>A script demonstrating how to manually do basic authentication over http.</p> Numbers and plural words as spoken English (Python) 2005-05-18T11:07:20-07:00Christopher Dunnhttp://code.activestate.com/recipes/users/1683375/http://code.activestate.com/recipes/413172-numbers-and-plural-words-as-spoken-english/ <p style="color: grey"> Python recipe 413172 by <a href="/recipes/users/1683375/">Christopher Dunn</a> (<a href="/recipes/tags/text/">text</a>). Revision 3. </p> <p>Have you seen error reports that say "1 errors detected" or "2 error found" and thought there must be a better way?</p> <p>There is!</p>