Most viewed recipes by FB36 http://code.activestate.com/recipes/users/4172570/views/2016-09-19T18:03:09-07:00ActiveState Code RecipesA-star Shortest Path Algorithm (C++) 2010-12-25T23:36:35-08:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/577457-a-star-shortest-path-algorithm/ <p style="color: grey"> C++ recipe 577457 by <a href="/recipes/users/4172570/">FB36</a> (<a href="/recipes/tags/algorithm/">algorithm</a>, <a href="/recipes/tags/algorithms/">algorithms</a>, <a href="/recipes/tags/game/">game</a>, <a href="/recipes/tags/graph/">graph</a>, <a href="/recipes/tags/graphs/">graphs</a>, <a href="/recipes/tags/routes/">routes</a>). Revision 4. </p> <p>A-star (A*) is a shortest path algorithm widely used for RTS games, GPS navigation etc.</p> Convert CSV to XML (Python) 2010-10-11T06:20:19-07:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/577423-convert-csv-to-xml/ <p style="color: grey"> Python recipe 577423 by <a href="/recipes/users/4172570/">FB36</a> (<a href="/recipes/tags/csv/">csv</a>, <a href="/recipes/tags/xml/">xml</a>). </p> <p>Convert CSV to XML.</p> Send messages between computers (Python) 2014-01-01T22:11:30-08:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/578802-send-messages-between-computers/ <p style="color: grey"> Python recipe 578802 by <a href="/recipes/users/4172570/">FB36</a> (<a href="/recipes/tags/chat/">chat</a>, <a href="/recipes/tags/port/">port</a>, <a href="/recipes/tags/socket/">socket</a>). </p> <p>Simple scripts to chat between computers in the same network.</p> <p>Both computers must be running both of these scripts and target ip addresses must be set correctly.</p> <p>(IP address of a computer can be found using ipconfig command.)</p> A-star Shortest Path Algorithm (Python) 2010-12-26T08:31:16-08:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/577519-a-star-shortest-path-algorithm/ <p style="color: grey"> Python recipe 577519 by <a href="/recipes/users/4172570/">FB36</a> (<a href="/recipes/tags/algorithm/">algorithm</a>, <a href="/recipes/tags/algorithms/">algorithms</a>, <a href="/recipes/tags/graph/">graph</a>, <a href="/recipes/tags/routes/">routes</a>). Revision 3. </p> <p>A-star (A*) Shortest Path Algorithm</p> Shannon Entropy Calculation (Python) 2010-11-29T08:37:34-08:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/577476-shannon-entropy-calculation/ <p style="color: grey"> Python recipe 577476 by <a href="/recipes/users/4172570/">FB36</a> (<a href="/recipes/tags/math/">math</a>, <a href="/recipes/tags/mathematics/">mathematics</a>). </p> <p>Shannon entropy of a string indicates minimum average number of bits per symbol required for encoding (compressing) the string.</p> ODE Solver using Euler Method (Python) 2011-04-10T00:30:58-07:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/577647-ode-solver-using-euler-method/ <p style="color: grey"> Python recipe 577647 by <a href="/recipes/users/4172570/">FB36</a> (<a href="/recipes/tags/math/">math</a>, <a href="/recipes/tags/mathematics/">mathematics</a>). </p> <p>First and Second Order Ordinary Differential Equation (ODE) Solver using Euler Method.</p> Random Maze Generator (Python) 2012-12-14T09:09:22-08:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/578356-random-maze-generator/ <p style="color: grey"> Python recipe 578356 by <a href="/recipes/users/4172570/">FB36</a> (<a href="/recipes/tags/ai/">ai</a>, <a href="/recipes/tags/game/">game</a>, <a href="/recipes/tags/graphics/">graphics</a>, <a href="/recipes/tags/pil/">pil</a>). Revision 2. </p> <p>Random maze generator using depth-first search.</p> <p>It starts the maze path from a random cell and there is no exit defined but actually any 2 cells on the path (white cells) can be assigned to be entry and exit locations. (I could just add code to randomly select 2 white cells and change their colors to something else but I thought it looks better this way.)</p> Binary Search Tree (C++) 2011-01-26T22:48:06-08:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/577552-binary-search-tree/ <p style="color: grey"> C++ recipe 577552 by <a href="/recipes/users/4172570/">FB36</a> (<a href="/recipes/tags/algorithm/">algorithm</a>, <a href="/recipes/tags/algorithms/">algorithms</a>, <a href="/recipes/tags/datastructures/">datastructures</a>). </p> <p>Binary Search Tree.</p> Export Oracle Database to CSV using cx_Oracle (Python) 2010-07-11T19:49:42-07:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/577304-export-oracle-database-to-csv-using-cx_oracle/ <p style="color: grey"> Python recipe 577304 by <a href="/recipes/users/4172570/">FB36</a> (<a href="/recipes/tags/csv/">csv</a>, <a href="/recipes/tags/database/">database</a>). </p> <p>Creates a CSV file for each table in the target Oracle database.</p> Numerical Integration using Monte Carlo method (Python) 2010-06-16T19:31:17-07:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/577263-numerical-integration-using-monte-carlo-method/ <p style="color: grey"> Python recipe 577263 by <a href="/recipes/users/4172570/">FB36</a> (<a href="/recipes/tags/function/">function</a>, <a href="/recipes/tags/math/">math</a>, <a href="/recipes/tags/random/">random</a>). Revision 2. </p> <p>Numerical Integration using Monte Carlo method.</p> Huffman Data Compression (C++) 2010-12-01T02:47:09-08:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/577480-huffman-data-compression/ <p style="color: grey"> C++ recipe 577480 by <a href="/recipes/users/4172570/">FB36</a> (<a href="/recipes/tags/algorithm/">algorithm</a>, <a href="/recipes/tags/algorithms/">algorithms</a>, <a href="/recipes/tags/datastructures/">datastructures</a>, <a href="/recipes/tags/data_compression/">data_compression</a>). Revision 2. </p> <p>Huffman encoding (data compression). Usage: huffman -i [input file name] -o [output file name] [-e|d]</p> Image Downloader (Python) 2014-02-24T03:49:51-08:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/577385-image-downloader/ <p style="color: grey"> Python recipe 577385 by <a href="/recipes/users/4172570/">FB36</a> (<a href="/recipes/tags/html/">html</a>, <a href="/recipes/tags/http/">http</a>, <a href="/recipes/tags/url/">url</a>, <a href="/recipes/tags/urllib2/">urllib2</a>, <a href="/recipes/tags/web/">web</a>). Revision 4. </p> <p>Finds and downloads all images from any given URL.</p> <p>Important note:</p> <p>If your download location path has spaces then put quotes around it!</p> Discrete Fourier Transform (Python) 2014-12-27T21:43:53-08:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/578994-discrete-fourier-transform/ <p style="color: grey"> Python recipe 578994 by <a href="/recipes/users/4172570/">FB36</a> (<a href="/recipes/tags/math/">math</a>, <a href="/recipes/tags/mathematics/">mathematics</a>, <a href="/recipes/tags/signal/">signal</a>, <a href="/recipes/tags/signal_processing/">signal_processing</a>). </p> <p>Discrete Fourier Transform and Inverse Discrete Fourier Transform</p> <p>To test, it creates an input signal using a Sine wave that has known frequency, amplitude, phase. Later it calculates DFT of the input signal and finds its frequency, amplitude, phase to compare.</p> Reversi Othello (Python) 2016-09-19T18:03:09-07:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/580698-reversi-othello/ <p style="color: grey"> Python recipe 580698 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/game/">game</a>, <a href="/recipes/tags/games/">games</a>). </p> <p>Reversi/Othello Board Game using Minimax, Alpha-Beta Pruning, Negamax, Negascout algorithms.</p> Website Text Search (Python) 2010-09-11T17:32:01-07:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/577388-website-text-search/ <p style="color: grey"> Python recipe 577388 by <a href="/recipes/users/4172570/">FB36</a> (<a href="/recipes/tags/html/">html</a>, <a href="/recipes/tags/http/">http</a>, <a href="/recipes/tags/url/">url</a>, <a href="/recipes/tags/urllib2/">urllib2</a>, <a href="/recipes/tags/web/">web</a>). Revision 2. </p> <p>Searches a website recursively for the given text string and prints all URLs containing it.</p> Draw Text To Image (Python) 2015-07-13T18:04:30-07:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/579013-draw-text-to-image/ <p style="color: grey"> Python recipe 579013 by <a href="/recipes/users/4172570/">FB36</a> (<a href="/recipes/tags/image/">image</a>, <a href="/recipes/tags/images/">images</a>, <a href="/recipes/tags/pil/">pil</a>). Revision 2. </p> <p>PIL does not allow resizing default bitmap font. This code resizes it by itself.</p> <p>The disadvantage is slow speed but the advantage is it becomes possible to set color of each pixel of text foreground and background.</p> <p>As an example I set foreground to reverse colors and background to grayscale.</p> IFrame Example (HTML) 2011-04-21T02:11:57-07:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/577671-iframe-example/ <p style="color: grey"> HTML recipe 577671 by <a href="/recipes/users/4172570/">FB36</a> (<a href="/recipes/tags/html/">html</a>, <a href="/recipes/tags/iframe/">iframe</a>). </p> <p>IFrame demo. It opens 4 sub-browser windows inside the webpage.</p> Query CSV file (Python) 2010-10-12T00:08:22-07:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/577419-query-csv-file/ <p style="color: grey"> Python recipe 577419 by <a href="/recipes/users/4172570/">FB36</a> (<a href="/recipes/tags/csv/">csv</a>, <a href="/recipes/tags/database/">database</a>). Revision 4. </p> <p>The user can define a query expression for (almost) any CSV file. (The first row assumed to contain column headers.) Then the code outputs all data rows matching to the given query expression.</p> Windows Event Log Viewer (Python) 2010-12-12T06:40:35-08:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/577499-windows-event-log-viewer/ <p style="color: grey"> Python recipe 577499 by <a href="/recipes/users/4172570/">FB36</a> (<a href="/recipes/tags/system/">system</a>, <a href="/recipes/tags/windows/">windows</a>). </p> <p>Windows Event Log Viewer</p> Dijkstra Shortest Path Algorithm (Python) 2011-10-29T18:46:53-07:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/577506-dijkstra-shortest-path-algorithm/ <p style="color: grey"> Python recipe 577506 by <a href="/recipes/users/4172570/">FB36</a> (<a href="/recipes/tags/algorithm/">algorithm</a>, <a href="/recipes/tags/algorithms/">algorithms</a>, <a href="/recipes/tags/graph/">graph</a>, <a href="/recipes/tags/routes/">routes</a>). Revision 5. </p> <p>Dijkstra shortest path algorithm.</p>