Popular recipes tagged "meta:score=8"http://code.activestate.com/recipes/tags/meta:score=8/2014-09-06T10:35:54-07:00ActiveState Code RecipesRsync Algorithm (Python) 2011-01-09T16:32:22-08:00Eric Pruitthttp://code.activestate.com/recipes/users/4170757/http://code.activestate.com/recipes/577518-rsync-algorithm/ <p style="color: grey"> Python recipe 577518 by <a href="/recipes/users/4170757/">Eric Pruitt</a> (<a href="/recipes/tags/algorithm/">algorithm</a>, <a href="/recipes/tags/delta/">delta</a>, <a href="/recipes/tags/diff/">diff</a>, <a href="/recipes/tags/patch/">patch</a>, <a href="/recipes/tags/python3/">python3</a>, <a href="/recipes/tags/rsync/">rsync</a>). Revision 4. </p> <p>This is a pure Python implementation of the <a href="http://samba.anu.edu.au/rsync/">rsync algorithm</a>. On my desktop (3.0GHz dual core, 7200RPM), best case throughput for target file hash generation and delta generation is around 2.9MB/s. Absolute worst case scenario (no blocks in common) throughput for delta generation is 200KB/s to 300KB/s on the same system.</p> <p>Tested in Python 2.5, 2.6, and 3.1. In 2.7, io.BufferedReader should yield the best throughput. On all other versions use __builtin__.open.</p> Yet another 'enum' for Python (Python) 2010-01-28T18:23:11-08:00Gabriel Genellinahttp://code.activestate.com/recipes/users/924636/http://code.activestate.com/recipes/577024-yet-another-enum-for-python/ <p style="color: grey"> Python recipe 577024 by <a href="/recipes/users/924636/">Gabriel Genellina</a> (<a href="/recipes/tags/enum/">enum</a>). Revision 5. </p> <p>There are quite a few 'enum' recipes already here. This one is short, cheap, and has neither bells nor whistles :)</p> Win Services helper (Python) 2014-09-06T10:35:54-07:00Louis RIVIEREhttp://code.activestate.com/recipes/users/4035877/http://code.activestate.com/recipes/551780-win-services-helper/ <p style="color: grey"> Python recipe 551780 by <a href="/recipes/users/4035877/">Louis RIVIERE</a> (<a href="/recipes/tags/services/">services</a>, <a href="/recipes/tags/system/">system</a>, <a href="/recipes/tags/windows/">windows</a>). Revision 4. </p> <p>A simple way to implement Windows Service.</p> Eight queens. Six lines. (Python) 2009-02-10T14:59:07-08:00Raymond Hettingerhttp://code.activestate.com/recipes/users/178123/http://code.activestate.com/recipes/576647-eight-queens-six-lines/ <p style="color: grey"> Python recipe 576647 by <a href="/recipes/users/178123/">Raymond Hettinger</a> . Revision 3. </p> <p>What six lines of Python can do</p> Using terminfo for portable color output & cursor control (Python) 2006-03-27T19:20:16-08:00Edward Loperhttp://code.activestate.com/recipes/users/2637812/http://code.activestate.com/recipes/475116-using-terminfo-for-portable-color-output-cursor-co/ <p style="color: grey"> Python recipe 475116 by <a href="/recipes/users/2637812/">Edward Loper</a> (<a href="/recipes/tags/text/">text</a>). Revision 3. </p> <p>The curses module defines several functions (based on terminfo) that can be used to perform lightweight cursor control &amp; output formatting (color, bold, etc). These can be used without invoking curses mode (curses.initwin) or using any of the more heavy-weight curses functionality. This recipe defines a TerminalController class, which can make portable output formatting very simple. Formatting modes that are not supported by the terminal are simply omitted.</p> Iterator Merge (Python) 2007-02-09T18:01:54-08:00Raymond Hettingerhttp://code.activestate.com/recipes/users/178123/http://code.activestate.com/recipes/491285-iterator-merge/ <p style="color: grey"> Python recipe 491285 by <a href="/recipes/users/178123/">Raymond Hettinger</a> (<a href="/recipes/tags/algorithms/">algorithms</a>). Revision 3. </p> <p>Memory efficient multi-way iterator merge.</p> Terminating a subprocess on Windows (Python) 2004-11-24T12:52:28-08:00Jimmy Retzlaffhttp://code.activestate.com/recipes/users/98735/http://code.activestate.com/recipes/347462-terminating-a-subprocess-on-windows/ <p style="color: grey"> Python recipe 347462 by <a href="/recipes/users/98735/">Jimmy Retzlaff</a> (<a href="/recipes/tags/sysadmin/">sysadmin</a>). </p> <p>The new subprocess module in Python 2.4 (also available for 2.2 and 2.3 at <a href="http://effbot.org/downloads/#subprocess" rel="nofollow">http://effbot.org/downloads/#subprocess</a>) allows access to the handle of any newly created subprocess. You can use this handle to terminate subprocesses using either ctypes or the pywin32 extensions.</p> Watermark with PIL (Python) 2005-01-12T11:07:01-08:00Shane Hathawayhttp://code.activestate.com/recipes/users/2257010/http://code.activestate.com/recipes/362879-watermark-with-pil/ <p style="color: grey"> Python recipe 362879 by <a href="/recipes/users/2257010/">Shane Hathaway</a> (<a href="/recipes/tags/graphics/">graphics</a>). </p> <p>Apply a watermark to an image using the Python Imaging Library. Supports color, tiling, scaling, and opacity reduction.</p> A tidy property idiom (Python) 2003-08-01T14:57:43-07:00Sean Rosshttp://code.activestate.com/recipes/users/761068/http://code.activestate.com/recipes/205183-a-tidy-property-idiom/ <p style="color: grey"> Python recipe 205183 by <a href="/recipes/users/761068/">Sean Ross</a> (<a href="/recipes/tags/oop/">oop</a>). Revision 5. </p> <p>This recipe suggests an idiom for property creation that avoids cluttering the class space with get/set/del methods that will not be used directly.</p> Http client to POST using multipart/form-data (Python) 2002-08-23T07:56:39-07:00Wade Leftwichhttp://code.activestate.com/recipes/users/98656/http://code.activestate.com/recipes/146306-http-client-to-post-using-multipartform-data/ <p style="color: grey"> Python recipe 146306 by <a href="/recipes/users/98656/">Wade Leftwich</a> (<a href="/recipes/tags/web/">web</a>). </p> <p>A scripted web client that will post data to a site as if from a form using ENCTYPE="multipart/form-data". This is typically used to upload files, but also gets around a server's (e.g. ASP's) limitation on the amount of data that can be accepted via a standard POST (application/x-www-form-urlencoded).</p>