Popular recipes tagged "meta:loc=135"http://code.activestate.com/recipes/tags/meta:loc=135/2016-02-11T17:31:39-08:00ActiveState Code RecipesKomodo Macro: stop leaving indented blank lines when you press enter (JavaScript) 2012-03-09T19:28:31-08:00Raymond Butcherhttp://code.activestate.com/recipes/users/4181141/http://code.activestate.com/recipes/578068-komodo-macro-stop-leaving-indented-blank-lines-whe/ <p style="color: grey"> JavaScript recipe 578068 by <a href="/recipes/users/4181141/">Raymond Butcher</a> (<a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/macro/">macro</a>). </p> <p>When your cursor is at the end of an indented blank line, and you press the enter key, this macro will catch that keypress and insert an empty new line above the current line. This pushes your indented line down, and you can keep coding as normal. It is quite seamless; the only difference is that you have not left any whitespace in your wake.</p> <p>This makes it easier to follow the Python PEP-8 style guide, but it's not limited to Python code.</p> Macro to Quick find (ctrl+f3) on double click (JavaScript) 2011-07-22T07:46:26-07:00Adamhttp://code.activestate.com/recipes/users/4173315/http://code.activestate.com/recipes/577801-macro-to-quick-find-ctrlf3-on-double-click/ <p style="color: grey"> JavaScript recipe 577801 by <a href="/recipes/users/4173315/">Adam</a> (<a href="/recipes/tags/editor/">editor</a>, <a href="/recipes/tags/javascript/">javascript</a>, <a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/macro/">macro</a>, <a href="/recipes/tags/scintilla/">scintilla</a>). Revision 3. </p> <p>This does a search for the selected word when you double click it. Functionality similar to Notepad++. Faster that ctrl-f3.</p> Arduino Diecimila Board Access Inside Windows 32 Bit DEMO. (Python) 2011-04-10T11:02:37-07:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/577648-arduino-diecimila-board-access-inside-windows-32-b/ <p style="color: grey"> Python recipe 577648 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/access/">access</a>, <a href="/recipes/tags/arduino/">arduino</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/windows/">windows</a>). </p> <p>Arduino-Windows2x.py</p> <p>Finally the Windows 32 bit version of the other recipes of similar design. (The AMIGA/WinUAE and Linux versions are already on this site.)</p> <p>To get more recognisable characters displayed it is best to use a potentiometer wired as one end to +5V, the other end to Gnd and the wiper to ANALOG IN 0. This has been tested on various Linux Distros and kept as simple as possible so that anyone can understand it.</p> <p>The required ?.pde file for the Arduino Board can be found here:-</p> <p><a href="http://code.activestate.com/recipes/577625-arduino-diecimila-board-access-inside-winuae-demo/?in=lang-python" rel="nofollow">http://code.activestate.com/recipes/577625-arduino-diecimila-board-access-inside-winuae-demo/?in=lang-python</a></p> <p>Similar assumptions are made as in the URL above.</p> <p>Enjoy finding simple solutions to often very difficult problems... ;o)</p> <p>Bazza, G0LCU.</p> Roman numeral class with overloaded int methods (Python) 2011-04-06T14:52:06-07:00thom nealehttp://code.activestate.com/recipes/users/4176069/http://code.activestate.com/recipes/577640-roman-numeral-class-with-overloaded-int-methods/ <p style="color: grey"> Python recipe 577640 by <a href="/recipes/users/4176069/">thom neale</a> (<a href="/recipes/tags/homework/">homework</a>, <a href="/recipes/tags/int/">int</a>, <a href="/recipes/tags/overloading/">overloading</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/roman/">roman</a>). </p> <p>This Roman class is a subclass of int and supports the same methods int does, but any special methods that would normally return ints are return a new instance of Roman. You can use instances of this class in math expressions and a Roman instance will be returned, for example. </p> <p>The class decorator used to achieve this was suggested by Alex Martelli '<a href="http://stackoverflow.com/questions/1242589/subclassing-int-to-attain-a-hex-representation/1243045#1243045">here</a> on stackoverlow.com.</p> OSPF Multicast Sniffer (Python) 2009-02-24T01:49:16-08:00Ferdy Riphagenhttp://code.activestate.com/recipes/users/4169284/http://code.activestate.com/recipes/576664-ospf-multicast-sniffer/ <p style="color: grey"> Python recipe 576664 by <a href="/recipes/users/4169284/">Ferdy Riphagen</a> (<a href="/recipes/tags/multicast/">multicast</a>, <a href="/recipes/tags/network/">network</a>, <a href="/recipes/tags/ospf/">ospf</a>). Revision 2. </p> <p>Add's a listener to multicast group 224.0.0.5 (AllSPFRouters), waits for an OSPF hello packet and extract the most important info. Won't work on Win32...</p> Compare MySQL DB (Python) 2016-02-11T17:31:39-08:00Jice Clavierhttp://code.activestate.com/recipes/users/4089467/http://code.activestate.com/recipes/576589-compare-mysql-db/ <p style="color: grey"> Python recipe 576589 by <a href="/recipes/users/4089467/">Jice Clavier</a> (<a href="/recipes/tags/compare/">compare</a>, <a href="/recipes/tags/comparison/">comparison</a>, <a href="/recipes/tags/database/">database</a>, <a href="/recipes/tags/mysql/">mysql</a>). Revision 3. </p> <p>Small module to and check for differences between 2 DB.</p> <p>It will compare the table list, the tables structure and their content.</p> <p>When you run the program, you are ask if you want a detailed comparison. As global comparison will list all the different tables, detailed comparison will output every different record (and will take longer to run)</p> Iterator merge 2 (Python) 2007-12-07T22:16:05-08:00Jonathan Croninhttp://code.activestate.com/recipes/users/4107146/http://code.activestate.com/recipes/535160-iterator-merge-2/ <p style="color: grey"> Python recipe 535160 by <a href="/recipes/users/4107146/">Jonathan Cronin</a> (<a href="/recipes/tags/algorithms/">algorithms</a>). Revision 2. </p> <p>Memory efficient multi-way iterator merge, without using heapq</p> Physics (Python) 2007-02-23T17:18:03-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/502252-physics/ <p style="color: grey"> Python recipe 502252 by <a href="/recipes/users/2608421/">Stephen Chappell</a> (<a href="/recipes/tags/algorithms/">algorithms</a>). </p> <p>Module for physics simulation.</p> <p>This module provides two classes that allow the approximation of physics behind bouncing balls.</p> dumpThreads (Tcl) 2007-02-05T18:24:13-08:00Patrick Finneganhttp://code.activestate.com/recipes/users/475144/http://code.activestate.com/recipes/502208-dumpthreads/ <p style="color: grey"> Tcl recipe 502208 by <a href="/recipes/users/475144/">Patrick Finnegan</a> (<a href="/recipes/tags/websphere/">websphere</a>). Revision 2. </p> <p>Take a java core dump from a running server. Identify the working directory where the file will be placed.</p> Sorting big files the Python 2.4 way (Python) 2006-04-13T10:43:13-07:00Nicolas Lehuenhttp://code.activestate.com/recipes/users/1599156/http://code.activestate.com/recipes/466302-sorting-big-files-the-python-24-way/ <p style="color: grey"> Python recipe 466302 by <a href="/recipes/users/1599156/">Nicolas Lehuen</a> (<a href="/recipes/tags/files/">files</a>). Revision 6. </p> <p>This recipe can be used to sort big files (much bigger than the available RAM) according to a key. The sort is guaranteed to be stable on Python 2.3.</p> DB2JDBC.tcl (Tcl) 2005-10-17T03:26:56-07:00Patrick Finneganhttp://code.activestate.com/recipes/users/1220635/http://code.activestate.com/recipes/442319-db2jdbctcl/ <p style="color: grey"> Tcl recipe 442319 by <a href="/recipes/users/1220635/">Patrick Finnegan</a> (<a href="/recipes/tags/tclblend/">tclblend</a>). </p> <p>This script uses pure java type 4 drivers to connect to a remote DB2 database, execute a select query and display the results.</p> Active Objects (Python) 2005-02-03T20:09:13-08:00Dominic Foxhttp://code.activestate.com/recipes/users/1951506/http://code.activestate.com/recipes/365292-active-objects/ <p style="color: grey"> Python recipe 365292 by <a href="/recipes/users/1951506/">Dominic Fox</a> (<a href="/recipes/tags/threads/">threads</a>). Revision 2. </p> <p>Based on the recipe for active objects given in "Concepts, Techniques, and Models of Computer Programming", by Peter van Roy and Seif Haridi, the ActiveObject class wraps an instance of a passive object and forwards messages to this object via a thread-safe message queue. The passive object processes the messages on its own thread, and returns the results to the caller via an AsynchResult object that can be used to block whilst waiting for a result, or to register callbacks to be called when a result is available.</p> Quick implementation of DIP (Dynamic IP) protocol using Twisted (Python) 2004-07-26T11:25:23-07:00Nicola Paoluccihttp://code.activestate.com/recipes/users/758282/http://code.activestate.com/recipes/286257-quick-implementation-of-dip-dynamic-ip-protocol-us/ <p style="color: grey"> Python recipe 286257 by <a href="/recipes/users/758282/">Nicola Paolucci</a> (<a href="/recipes/tags/network/">network</a>). Revision 5. </p> <p>Command line prototype to update a Dynamic DNS Service that accepts the GnuDIP protocol (like yi.org):</p> <p>pydyp.py [-u uname] -w password [-s dipserver] [-p dipserverport] [-d domain]</p> <p>It shows the power of Twisted framework.</p> Using Python for ClearCase triggers (Python) 2003-06-03T16:24:16-07:00Magnus Lyckåhttp://code.activestate.com/recipes/users/729822/http://code.activestate.com/recipes/203611-using-python-for-clearcase-triggers/ <p style="color: grey"> Python recipe 203611 by <a href="/recipes/users/729822/">Magnus Lyckå</a> . </p> <p>Here is one example each of a pre-checkin and a post-checkin trigger, as well as a program that can register your triggers in ClearCase.</p> <p>ClearCase is a software configuration management tool similar to CVS, but slightly more advanced and not free.</p> Dragon Curve (Tcl) 2002-06-11T15:39:26-07:00andreas kuprieshttp://code.activestate.com/recipes/users/117230/http://code.activestate.com/recipes/132605-dragon-curve/ <p style="color: grey"> Tcl recipe 132605 by <a href="/recipes/users/117230/">andreas kupries</a> (<a href="/recipes/tags/graphics/">graphics</a>, <a href="/recipes/tags/math/">math</a>). </p> <p>Origin: <a href="http://wiki.tcl.tk/3349" rel="nofollow">http://wiki.tcl.tk/3349</a> Author: Keith Vetter</p> <p>Here's a quick and dirty rendering of the Dragon Curve or Paper Folding fractal. What happens if you repeatedly fold a piece of paper in half numerous times then unfold it once 90 degrees, then again 90 degrees and so on. You get a fractal curve which has several interesting properties. For example, you can combine 4 of these curves and not only will they not overlap but they fill the plane. For more details see <a href="http://www.math.okstate.edu/mathdept/dynamics/lecnotes/node17.html" rel="nofollow">http://www.math.okstate.edu/mathdept/dynamics/lecnotes/node17.html</a></p>