This algorithm converts a base c number into a base b number. Parameters c and b are arbitrary are not constrained by any bounds. The input n is a list and the output is a list.
This is a pure Python implementation of the rsync algorithm. 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)...
Please refer to wikipedia: http://en.wikipedia.org/wiki/Huffman_coding
Huffman coding is an entropy encoding algorithm used for lossless data compression. The term refers to the use of a variable-length code table for encoding a source...
The recipe illustrates a Python implementation of the bitsort algorithm. This algorithm is illustrated in the book "Programming Pearls" by Jon Bentley. The bitsort algorithm provides a very efficient way to sort large numbers in disk files.
An implementation of the token bucket algorithm in Python.
This is a simple python implementation of the XTEA block encryption algorithm (http://www.cix.co.uk/~klockstone/xtea.pdf). For details please see docstrings in the code.
This is an industry standard algorithm I ported to python. It works on all major credit cards. You pass in the credit card number as a string and it returns 1 for a valid card or 0 for an invalid card
FriBidi Python bindings:
FriBiDi is a BiDi algorithm implementation for Hebrew and/or Arabic languages.
This package include python module for the FriBidi C library.
An incremental PCA algorithm in python.
Incremental PCA allows computing an approximation of the principal components on large data sets as observations are given sequentially.
A Minimum Cut Solver
This python script is for solving the ACM problem Q2914: Minimum Cut.
Instead of using Ford-Fulkerson method, I use Stoer and Wagner's Min cut...
This recipe implements in pure Python the algorithm used by the interpreter for binding the values passed as parameters in a function call to the formal arguments of the function.
This is useful for decorators that want to take into...
This is a Python progam that lets you practice determining the day of week for any date. This program assumes that you know how to use the Doomsday Algorithm.
This is an example of how to implement the split step propagation algorithm using python and numpy. Click here to see the results http://www.alexfb.com/cgi-bin/twiki/view/PtPhysics/VortexLattice
Vibterbi algorithm for HMM inference
Viterbi algorithm based on the Python code found at: http://en.wikipedia.org/wiki/Viterbi_algorithm
Also included is an example based on the one from the Wikipedia page.
The code is...
This is a simple code that lets a user control the mouse and left-click using the Microsoft Kinect, Python, and OpenKinect.
-Python Wrapper for OpenKinect
-A Linux machine using...
A simple Python wrapper that makes it easier to mount virtual machine disk images to a local machine.
Requires qemu-nbd package installed.
This middle sized python class will populate himself from any xml with reasonable restrictions.
This is an evolutionary algorithm that returns a random list of prime numbers. This code is highly inefficient for a reason. This algorithm is more of a proof of concept that if a prime was a heritable trait, it would not be a desired one.
This will create a header for a Python script. It is a nice way keep a track of what your script does and when it was created, the author of the script, etc..
Update: Now, it will automatically open with one of the two most popular...
This dual-mode script is both a Posix shell script and a python script. The shell part looks like a triple-quoted string to the Python interpreter. The shell does not reach anything after the exec statement.