CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Thu, 24 Jul 2025 23:20:25 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20100212195516
location: https://web.archive.org/web/20100212195516/https://code.activestate.com/feeds/langs/python/
server-timing: captures_list;dur=0.750439, exclusion.robots;dur=0.025552, exclusion.robots.policy;dur=0.011569, esindex;dur=0.015600, cdx.remote;dur=21.189015, LoadShardBlock;dur=189.508714, PetaboxLoader3.datanode;dur=94.661204, PetaboxLoader3.resolve;dur=54.199032
x-app-server: wwwb-app211
x-ts: 302
x-tr: 237
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: SERVER=wwwb-app211; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Thu, 24 Jul 2025 23:20:26 GMT
content-type: application/atom+xml
content-length: 22446
x-archive-orig-date: Fri, 12 Feb 2010 19:53:54 GMT
x-archive-orig-server: Apache/2.2.3 (CentOS)
x-archive-orig-content-length: 22446
x-archive-orig-expires: Fri, 12 Feb 2010 19:59:35 GMT
x-archive-orig-vary: Cookie
x-archive-orig-last-modified: Fri, 12 Feb 2010 19:49:35 GMT
x-archive-orig-etag: eb88f2efd734ea5cdb3cdab83c033755
x-archive-orig-cache-control: max-age=600
x-archive-orig-age: 82
x-archive-orig-via: 1.0 box19.activestate.com:3129 (squid/2.6.STABLE21)
x-archive-orig-connection: close
cache-control: max-age=1800
x-archive-guessed-content-type: text/xml
x-archive-guessed-charset: utf-8
memento-datetime: Fri, 12 Feb 2010 19:55:16 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Wed, 13 Aug 2008 15:40:56 GMT", ; rel="prev memento"; datetime="Tue, 22 Dec 2009 22:43:06 GMT", ; rel="memento"; datetime="Fri, 12 Feb 2010 19:55:16 GMT", ; rel="next memento"; datetime="Tue, 16 Feb 2010 03:55:32 GMT", ; rel="last memento"; datetime="Fri, 28 Jun 2024 22:06:13 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: ARCHIVEIT-5763-CDL-20100212-00000/ARCHIVEIT-5763-CDL-20100212194635-00002-oriole.ucop.edu-00124634.arc.gz
server-timing: captures_list;dur=0.810927, exclusion.robots;dur=0.026973, exclusion.robots.policy;dur=0.013687, esindex;dur=0.019694, cdx.remote;dur=23.152584, LoadShardBlock;dur=211.296417, PetaboxLoader3.datanode;dur=278.547274, PetaboxLoader3.resolve;dur=184.730604, load_resource;dur=286.692945
x-app-server: wwwb-app211
x-ts: 200
x-tr: 556
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
accept-ranges: bytes
ActiveState Code: Python recipes https://code.activestate.com/recipes/langs/python/ 2010-02-12T09:51:09Z Recently added Python recipes "Comma float" to float (Python)
2010-02-11T22:19:41Z Lesko https://ActiveState%20Code/recipes/users/4173032/ https://code.activestate.com/recipes/577054/
<p style="color: grey">
Python
recipe 577054
by <a href="/recipes/users/4173032/">Lesko</a>
(<a href="/recipes/tags/comma/">comma</a>, <a href="/recipes/tags/float/">float</a>, <a href="/recipes/tags/numbers/">numbers</a>, <a href="/recipes/tags/string/">string</a>).
Revision 2.
</p>
<p>Convert comma separated floating point number (12,3456) to float.</p>
Bible Verse Quiz - compare.py (Python)
2010-02-12T04:23:14Z Stephen Chappell https://ActiveState%20Code/recipes/users/2608421/ https://code.activestate.com/recipes/577053/
<p style="color: grey">
Python
recipe 577053
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/(VerseMatch)/">(VerseMatch)</a>, <a href="/recipes/tags/bible/">bible</a>, <a href="/recipes/tags/Quiz/">Quiz</a>, <a href="/recipes/tags/Verse/">Verse</a>).
Revision 2.
</p>
<p>Give a string-oriented API to the generic "diff" module.</p>
<p>The "diff" module is very powerful but practically useless on its own.
The "search" and "empty_master" functions below resolve this problem.</p>
Bible Verse Quiz - database.py (Python)
2010-02-12T04:22:59Z Stephen Chappell https://ActiveState%20Code/recipes/users/2608421/ https://code.activestate.com/recipes/577052/
<p style="color: grey">
Python
recipe 577052
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/(VerseMatch)/">(VerseMatch)</a>, <a href="/recipes/tags/bible/">bible</a>, <a href="/recipes/tags/Quiz/">Quiz</a>, <a href="/recipes/tags/Verse/">Verse</a>).
Revision 2.
</p>
<p>Serve verses from the Bible in response to SQL queries.</p>
<p>Pulling Bible verses out of a database allows query details to be
abstracted away and powerful Verse objects returned to the caller.</p>
Bible Verse Quiz - diff.py (Python)
2010-02-12T04:22:40Z Stephen Chappell https://ActiveState%20Code/recipes/users/2608421/ https://code.activestate.com/recipes/577051/
<p style="color: grey">
Python
recipe 577051
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/(VerseMatch)/">(VerseMatch)</a>, <a href="/recipes/tags/bible/">bible</a>, <a href="/recipes/tags/Quiz/">Quiz</a>, <a href="/recipes/tags/Verse/">Verse</a>).
Revision 2.
</p>
<p>Compute differences and similarities between a pair of sequences.</p>
<p>After finding the "difflib.SequenceMatcher" class unsuitable, this module
was written and re-written several times into the polished version below.</p>
Bible Verse Quiz - html.py (Python)
2010-02-12T04:22:31Z Stephen Chappell https://ActiveState%20Code/recipes/users/2608421/ https://code.activestate.com/recipes/577050/
<p style="color: grey">
Python
recipe 577050
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/(VerseMatch)/">(VerseMatch)</a>, <a href="/recipes/tags/bible/">bible</a>, <a href="/recipes/tags/Quiz/">Quiz</a>, <a href="/recipes/tags/Verse/">Verse</a>).
Revision 2.
</p>
<p>Define several XHTML document strings to be used in VerseMatch.</p>
<p>Unlike the original program written in Java, a large portion of the
XHTML code is defined separately here to be used as format strings.</p>
Bible Verse Quiz - library.py (Python)
2010-02-12T04:22:19Z Stephen Chappell https://ActiveState%20Code/recipes/users/2608421/ https://code.activestate.com/recipes/577049/
<p style="color: grey">
Python
recipe 577049
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/(VerseMatch)/">(VerseMatch)</a>, <a href="/recipes/tags/bible/">bible</a>, <a href="/recipes/tags/Quiz/">Quiz</a>, <a href="/recipes/tags/Verse/">Verse</a>).
Revision 2.
</p>
<p>Automate the indexing and processing of the verse library.</p>
<p>These three classes allow a library directory to automatically be
parsed and prepared for use in a categorized reference database.</p>
Bible Verse Quiz - manager.py (Python)
2010-02-12T04:22:07Z Stephen Chappell https://ActiveState%20Code/recipes/users/2608421/ https://code.activestate.com/recipes/577048/
<p style="color: grey">
Python
recipe 577048
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/(VerseMatch)/">(VerseMatch)</a>, <a href="/recipes/tags/bible/">bible</a>, <a href="/recipes/tags/Quiz/">Quiz</a>, <a href="/recipes/tags/Verse/">Verse</a>).
Revision 2.
</p>
<p>Oversee the timely destruction of unused sessions.</p>
<p>The two classes in this module allow automated memory cleanup to be regularly
performed and timed actions to be executed within reasonable time periods.</p>
Bible Verse Quiz - servlet.py (Python)
2010-02-12T04:21:49Z Stephen Chappell https://ActiveState%20Code/recipes/users/2608421/ https://code.activestate.com/recipes/577047/
<p style="color: grey">
Python
recipe 577047
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/(VerseMatch)/">(VerseMatch)</a>, <a href="/recipes/tags/bible/">bible</a>, <a href="/recipes/tags/Quiz/">Quiz</a>, <a href="/recipes/tags/Verse/">Verse</a>).
Revision 2.
</p>
<p>Provide simple support for Java-style servlets.</p>
<p>The code in this module provides an incomplete port of Java's API for
servlets. Only essential classes and methods are implemented here.</p>
Bible Verse Quiz - state.py (Python)
2010-02-12T04:20:20Z Stephen Chappell https://ActiveState%20Code/recipes/users/2608421/ https://code.activestate.com/recipes/577046/
<p style="color: grey">
Python
recipe 577046
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/(VerseMatch)/">(VerseMatch)</a>, <a href="/recipes/tags/bible/">bible</a>, <a href="/recipes/tags/Quiz/">Quiz</a>, <a href="/recipes/tags/Verse/">Verse</a>).
Revision 2.
</p>
<p>Manage the state of a VerseMatch session.</p>
<p>If VerseMatch is the heart of the program, then state is the brain.
All user interactions are processed by the State class listed below.</p>
Bible Verse Quiz - timeout.py (Python)
2010-02-12T04:19:59Z Stephen Chappell https://ActiveState%20Code/recipes/users/2608421/ https://code.activestate.com/recipes/577045/
<p style="color: grey">
Python
recipe 577045
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/(VerseMatch)/">(VerseMatch)</a>, <a href="/recipes/tags/bible/">bible</a>, <a href="/recipes/tags/Quiz/">Quiz</a>, <a href="/recipes/tags/Verse/">Verse</a>).
Revision 2.
</p>
<p>Provide way to add timeout specifications to arbitrary functions.</p>
<p>There are many ways to add a timeout to a function, but no solution
is both cross-platform and capable of terminating the procedure. This
module use the multiprocessing module to solve both of those problems.</p>
Bible Verse Quiz - verse.py (Python)
2010-02-12T04:19:44Z Stephen Chappell https://ActiveState%20Code/recipes/users/2608421/ https://code.activestate.com/recipes/577044/
<p style="color: grey">
Python
recipe 577044
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/(VerseMatch)/">(VerseMatch)</a>, <a href="/recipes/tags/bible/">bible</a>, <a href="/recipes/tags/Quiz/">Quiz</a>, <a href="/recipes/tags/Verse/">Verse</a>).
Revision 3.
</p>
<p>Encapsulate verses from the Bible and support quizzing over them.</p>
<p>The Verse class in this module is far superior to the one implemented in
Java. All quizzing/testing capabilities are imported from another module.</p>
Bible Verse Quiz - VerseMatch.py (Python)
2010-02-12T09:51:09Z Stephen Chappell https://ActiveState%20Code/recipes/users/2608421/ https://code.activestate.com/recipes/577043/
<p style="color: grey">
Python
recipe 577043
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/(VerseMatch)/">(VerseMatch)</a>, <a href="/recipes/tags/bible/">bible</a>, <a href="/recipes/tags/Quiz/">Quiz</a>, <a href="/recipes/tags/Verse/">Verse</a>).
Revision 3.
</p>
<p>Run a Bible-verse-matching servlet on the network.</p>
<p>This program is a port of the VerseMatch program written
in CPS 110 at BJU during the Autumn Semester of 2003.</p>
ZipScript: Build a directly executable zipped Python script set (Python)
2010-02-11T15:32:38Z Glenn https://ActiveState%20Code/recipes/users/4171639/ https://code.activestate.com/recipes/577042/
<p style="color: grey">
Python
recipe 577042
by <a href="/recipes/users/4171639/">Glenn</a>
(<a href="/recipes/tags/package/">package</a>, <a href="/recipes/tags/script/">script</a>, <a href="/recipes/tags/zip/">zip</a>).
Revision 2.
</p>
<p>This function will package a python script and additional python modules, in either source or compiled form. Either are directly executable by Python 2.7/3.1 or newer.</p>
<p>Uses make-like logic to only rebuild if something is newer than the previous build.</p>
Merge multiple (potentially infinite) sorted inputs into a single sorted output (Python)
2010-02-11T02:44:36Z Gabriel Genellina https://ActiveState%20Code/recipes/users/924636/ https://code.activestate.com/recipes/577041/
<p style="color: grey">
Python
recipe 577041
by <a href="/recipes/users/924636/">Gabriel Genellina</a>
(<a href="/recipes/tags/algorithm/">algorithm</a>, <a href="/recipes/tags/merge/">merge</a>, <a href="/recipes/tags/sort/">sort</a>).
Revision 3.
</p>
<p>Similar to heapq.merge and sorted(itertools.chain(*iterables)).</p>
<p>Like heapq.merge, returns a generator, does not pull the data into memory all at once, and assumes that each of the input iterables is already sorted (smallest to largest).</p>
<p>Unlike heapq.merge, accepts an infinite number of input iterables, but requires all of them to come in ascending order (that is, their starting point must be in ascending order each).</p>
<p>Also, accepts a <em>key</em> function (like <code>sorted</code>, <code>min</code>, <code>max</code>, etc.)</p>
Use DebugView utility with standard python logging (Python)
2010-02-10T10:35:59Z Christopher Prinos https://ActiveState%20Code/recipes/users/481494/ https://code.activestate.com/recipes/577040/
<p style="color: grey">
Python
recipe 577040
by <a href="/recipes/users/481494/">Christopher Prinos</a>
(<a href="/recipes/tags/debugging/">debugging</a>, <a href="/recipes/tags/DebugView/">DebugView</a>, <a href="/recipes/tags/logging/">logging</a>, <a href="/recipes/tags/SysInternals/">SysInternals</a>, <a href="/recipes/tags/windows/">windows</a>).
</p>
<p>This is a custom logging.Handler class that lets you use standard logging calls to output messages to SysInternals' DebugView utility.</p>
A Moderately Simple Buttonbar Program (Python)
2010-02-10T02:08:37Z Phil Rist https://ActiveState%20Code/recipes/users/4171119/ https://code.activestate.com/recipes/577039/
<p style="color: grey">
Python
recipe 577039
by <a href="/recipes/users/4171119/">Phil Rist</a>
(<a href="/recipes/tags/command execution/">command execution</a>, <a href="/recipes/tags/user interface/">user interface</a>).
</p>
<p>This buttonbar program is similar to my ButtonBarV1 <a href="https://code.activestate.com/recipes/577038/">recipe 577038</a> except a file pattern such as c:\source\python\new*.py can be entered instead of a single file. This will allow you to scroll through a list of matching files selecting the files you want to process. You must still select the command separately for each file. Besides the file pattern or file a menu file and an optional list of section names are specified on the command line.</p>
Simple Buttonbar Utility Version 1 (Python)
2010-02-09T23:02:40Z Phil Rist https://ActiveState%20Code/recipes/users/4171119/ https://code.activestate.com/recipes/577038/
<p style="color: grey">
Python
recipe 577038
by <a href="/recipes/users/4171119/">Phil Rist</a>
(<a href="/recipes/tags/command execution/">command execution</a>, <a href="/recipes/tags/user interface/">user interface</a>).
Revision 4.
</p>
<p>Display buttonbar generated from .ini style file of command templates. Commandline contains path used to generate commands. Templates can contain macros which will be replaced by parts of the file path. Template 'copy {a} {u}\{f}' could copy selected file {a} to backup directory {u} with same file name {f}. Command line specifies name of .ini file and which sections to include in buttonbar. Not all need be used.</p>
Pollard Rho Prime Factorization (Python)
2010-02-10T10:02:51Z mukeshtiwari.iiitm https://ActiveState%20Code/recipes/users/4172899/ https://code.activestate.com/recipes/577037/
<p style="color: grey">
Python
recipe 577037
by <a href="/recipes/users/4172899/">mukeshtiwari.iiitm</a>
(<a href="/recipes/tags/algorithm/">algorithm</a>, <a href="/recipes/tags/algorithms/">algorithms</a>, <a href="/recipes/tags/python/">python</a>).
Revision 4.
</p>
<p>This code is implementation of Pollard Rho prime factorization. As i am a bit new in python so further improvement is appreciated.Also added Brent variant.</p>
SPOJ backup script (Python)
2010-02-09T08:50:44Z Shashwat Anand https://ActiveState%20Code/recipes/users/4172995/ https://code.activestate.com/recipes/577036/
<p style="color: grey">
Python
recipe 577036
by <a href="/recipes/users/4172995/">Shashwat Anand</a>
(<a href="/recipes/tags/algorithm/">algorithm</a>, <a href="/recipes/tags/algorithms/">algorithms</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/spoj/">spoj</a>, <a href="/recipes/tags/tools/">tools</a>).
Revision 3.
</p>
<h4>Introduction</h4>
<p>At Sphere Online Judge (<a href="https://www.spoj.pl" rel="nofollow">https://www.spoj.pl</a>) you are given the capability of trying out the
challenging problems given. It also gives you the capability of viewing
and downloading your own solution.</p>
<p>The tool spojbackup tends to automatically backup all your Accepted
submissions and save them on the desired location of your computer. The
basic idea is to automate the process which can be used as a backup and
an offline reference tool of your own codes.</p>
<h4>Features</h4>
<ul>
<li><p>Resume downloads.
spojbackup currently supports resuming of the solutions if internet
connection is disrupted</p></li>
<li><p>Incremental backup facility
it'll not download the code already present on your machine. Only newer
code added in your signedlist will be downloaded</p></li>
<li><p>User-defined destination
all codes are saved at user-defined destination
if no option is given by user it saves in the folder from where command is
run</p></li>
<li><p>Proxy support
Proxy support is provided as SPOJ users are generally university students
and they are generally behind a proxy and university firewall.</p></li>
</ul>
<h4>Bugs</h4>
<p>In case of finding a bug please drop a mail to the authors. We will try to sort
out the problems.</p>
Singleton Logger (logging) (Python)
2010-02-09T12:31:59Z Rafa Muñoz Cárdenas https://ActiveState%20Code/recipes/users/4172994/ https://code.activestate.com/recipes/577035/
<p style="color: grey">
Python
recipe 577035
by <a href="/recipes/users/4172994/">Rafa Muñoz Cárdenas</a>
(<a href="/recipes/tags/logger/">logger</a>, <a href="/recipes/tags/loggermanager/">loggermanager</a>, <a href="/recipes/tags/logging/">logging</a>, <a href="/recipes/tags/singleton/">singleton</a>).
Revision 4.
</p>
<p>Just a Singleton Logger class. <br />
To use it, change PATH and LOG_FILENAME in the source so that you save your .log file wherever you want.</p>
<p>Then, to test it do:</p>
<p>foo = Logger("foo") <br />
bar = Logger("bar") <br />
foo.debug("debugging foo :D") <br />
bar.info("informing bar :P")</p>