<?xml version="1.0"?>
<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd" >  
<rss version="0.91">

  <channel>
    <title>Recipes from the Python Cookbook</title>
    <language>en-us</language>
    <link>http://www.ActiveState.com/ASPN</link>
    <copyright>Copyright 2001, ActiveState SRL.</copyright>
    <webMaster>aspn-feedback@ActiveState.com</webMaster>

  <image>
    <title>ASPN: ActiveState Programmers Network</title>
    <url>http://www.activestate.com/img/logo_115x35.gif</url>
    <link>http://www.ActiveState.com/ASPN</link>
    <width>115</width>
    <height>35</height>
  </image>

  
  

    <item><title>helpful 5-liner version of os.makedirs </title>
<description>&quot;makepath(path)&quot; creates missing directories for path and
returns a normalized absolute version of the path. As often
the case with python, the documentation is more important than the 
code.</description>
<link>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/117243</link>
</item>
<item><title>SMAWK totally monotone matrix searching algorithm</title>
<description>This algorithm takes as input a function for computing matrix values, and searches for the position of maximum value in each row.  The matrix must satisfy the &quot;totally monotone&quot; property: in each submatrix (in particular each 2x2 submatrix) the positions of the maxima must move leftward as you go down the rows.  The algorithm uses this property to greatly reduce the number of matrix elements evaluated, compared to a naive algorithm that explicitly constructs the matrix.

As a simple example, we apply the algorithm to finding nearest neighbors in B for each point in A, where B may be distributed arbitrarily in space but the points of A lie along a single line.  Using SMAWK for this problem takes only linear time if the input is already sorted.</description>
<link>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/117244</link>
</item>
<item><title>Simple JSP Custom Tag in Jython</title>
<description>A simple example which shows how to implement your own JSP custom tag with the help of Jython.</description>
<link>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/117239</link>
</item>
<item><title>windex.py</title>
<description>weighted choice from list</description>
<link>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/117241</link>
</item>
<item><title>lace</title>
<description>lace: forms a list of tuples by interlacing elements from several lists.
</description>
<link>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/117240</link>
</item>
<item><title>Anagram Fetcher</title>
<description>Code for fetching Anagrams out of any given file that contains words seperated
by new lines.</description>
<link>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/117237</link>
</item>
<item><title>Dictionary Mixin / Framework</title>
<description>This mixin makes it easy to provide a full dictionary interface to a class defining only a few mapping methods for getting, setting, deleting, and listing keys.  Also, a function is provided to incorporate the mixin at runtime so that code for existing modules need not be modified.
</description>
<link>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/117236</link>
</item>
<item><title>spell checking</title>
<description>use popen2 module to drive the ispell typo checker 
</description>
<link>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/117221</link>
</item>
<item><title>LZ77 compression</title>
<description>LZ77 is a compression algorithm upon which most popular compression formats are based; PKZIP, GZIP, LHA, RAR, etc.</description>
<link>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/117226</link>
</item>
<item><title>Priority dictionary</title>
<description>This data structure acts almost like a dictionary, with two modifications: First, D.smallest() returns the value x minimizing D[x].  For this to work correctly, all values D[x] stored in the dictionary must be comparable. Second, iterating &quot;for x in D&quot; finds and removes the items from D in sorted order. Each item is not removed until the next item is requested, so D[x] will still return a useful value until the next iteration of the for-loop.</description>
<link>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/117228</link>
</item>
<item><title>PyHeartBeat - detecting inactive computers</title>
<description>PyHeartBeat is two files: PyHBClient.py sends UDP packets, while PyHBServer.py listens to them, and detects inactive clients.</description>
<link>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52302</link>
</item>
<item><title>Convex hull and diameter of 2d point sets</title>
<description>Returns the convex hull (separated into upper and lower chains of vertices) and the diameter (farthest pair of points), given input consisting of a list of 2d points represented as pairs (x,y).  The convex hull algorithm is Graham's scan, using a coordinate-based sorted order rather than the more commonly seen radial sorted order.  A rotating calipers algorithm generates candidate pairs of vertices for the diameter calculation.  Care was taken handling tricky cases such as pairs of points with the same x-coordinate and colinear triples of points.</description>
<link>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/117225</link>
</item>
<item><title>Boyer-Moore-Horspool string searching</title>
<description>A string searching algorithm based upon Boyer-Moore string searching, which is considered one of the most efficient string searching algorithms. Boyer-Moore-Horspool only uses the bad-suffix window for matching and is therefore simpler to implement and faster than normal BM.</description>
<link>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/117223</link>
</item>
<item><title>A Date module.</title>
<description>This pure Python module defines a class Date and several methods
to deal with it, including conversions to some other formats.

Needs Python 2.2</description>
<link>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/117215</link>
</item>
<item><title>driving gnuplot with the popen function</title>
<description>os.popen is really great when you need to drive a text based software.
Here is a sample of use which create animated graphics using the free software gnuplot.</description>
<link>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/108287</link>
</item>
<item><title>Using windll to extract version information from Windows files</title>
<description>This is a recipe for extracting file version information from Windows files, using the Win32 API.</description>
<link>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/117219</link>
</item>
<item><title>Simple (very) SNTP client</title>
<description>Uses the SNTP protocol (as specified in RFC 2030)
to contact the server specified in the command line
and report the time as returned by that server.  This
is about the simplest (and dumbest) client I could
manage.</description>
<link>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/117211</link>
</item>
<item><title>Knuth-Morris-Pratt string matching</title>
<description>This is an implementation of the Knuth-Morris-Pratt algorithm for finding copies of a given pattern as a contiguous subsequence of a larger text.  Since KMP accesses the text only sequentially, it is natural to implement it in a way that allows the text to be an arbitrary iterator.  After a preprocessing stage which takes time linear in the length of the pattern, each text symbol is processed in constant amortized time.</description>
<link>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/117214</link>
</item>
<item><title>Sieve of Eratosthenes</title>
<description>Computes an infinite sequence of primes using simple generators.  A Python dictionary is used to mark multiples of the generated primes, according to the Sieve of Eratosthenes.</description>
<link>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/117119</link>
</item>

  
</channel>
</rss>