Programming Methods & Algorithms scripts - Top 4 Download

Programming Methods & Algorithms script downloads

Scramble Word

Scramble word script re-arrange characters of word by using simple string manipulation and Random module. ...
Python

Arithmetic coder

Arithmetic coder script is a simple but slow way of compression using arithmetic coding. ...
Python

Encoding A String

The main purpose of these functions are to allow encoding a string from base 256 to a special base 255. The function view the strings as numbers and simply change what base they are written in. This is not recommended for very long strings; otherwise, the encoding and decoding process can ...
Python

Merging sorted iterables

This script helps you to merge sorted iterables, preserving ordering,without consuming iterables (and computing time) unnecessarily. ...
Python

List Generator Monad Combinators

The List monad in Haskell has many uses, including parsing and nondeterministic algorithms. This code implements the Monad combinators "bind", "return" and "fail", and the MonadPlus combinators "plus" and "zero". It works with all iterables, and returns a generator rather than a list in order to preserve a lazy semantics. ...
Python

base64 encoding prototype

This script takes a decimal number, converts it into binary, takes the first six numbers in that, converts that into a decimal number, and from there makes it a letter("m") according to the base64 code. ...
Python

Big file sorting

Big file sorting script allows you to sort big ASCII files. ...
Python

Splitting up a sequence

This script allows you to split up a sequence in same-size (if possible) parts. ...
Python

IPv4 address set type

IPv4 address set type script initializes an ip4range class.The constructor accepts an unlimited number of arguments that may either be tuples in the form (start,stop), integers, longs or strings, where start and stop in a tuple may also be of the form integer, long or string. Passing an integer or long ...
Python

Graph Script

This script allows you to create a directed Graph container that can be useful for the collections module. To show its basic API, a complete implementation is available. Many different graph implementations are possible, but this is flexible, fast and simple enough. ...
Python

Fast select

This script allows you to quickly select the n-th rank ordered element of a given sequence. It modifies the ordering of the given sequence. ...
Python

An interval mapping data structure

This structure is a kind of dictionary which allows you to map data intervals to values. You can then query the structure for a given point, and it returns the value associated to the interval which contains the point.Boundary values don't need to be an integer ; in the test unit ...
Python

Network Of Linked Dictionaries

Linked dictionaries are dictionaries that can refer to other dictionaries (its bases), similar to class hierarchies, but built at runtime. In this script  a linked dictionary shows all the key/value pairs that are defined locally (in the very instance) and globally (in other linked bases). ...
Python

Caching decorator with timeout invalidation

This script is a caching decorator that  collects garbage in a separate thread (for performance).It allows each cached function to (optionally) set a custom maximum age for entries, and allows individual cache entries to be selectiries, andlidated.This kind of caching decorator is often useful in web development, when your pages are ...
Python

TryFinally

This script is a convenient way to deeply nest try/finally statements. It is appropriate for complicated resource initialization and destruction. For instance, if you have a list of 50 things that need to get intialized and later destructed via using try/finally (especially if you need to create the list dynamically) this function ...
Python

Tail Call Optimization Decorator

This function decorates a function with tail call optimization. It does this by throwing an exception if it is it's own grandparent, and catching such exceptions to fake the tail call optimization. This function fails if the decorated function recurses in a non-tail contexif the de >/ ...
Python

Constraint based Sudoku Solver

This code uses the constraint package to solve sudoku puzzles. It's designed to be flexible and tested with 9x9 puzzles with 1-9 as possible values. In theory it should be able to solve puzzles of different sizes comprised of letters or symbols instead of numbers. Requirements: · constraint package ...
Python

min max peaks with Numeric

Given a large one-dimensional array, this script breaks it into blocks of contstant length and compute min and max for each block, the so-called "peaks data". ...
Python

Splicing of lists

This script splices any number of nonempty lists as one list. Each input list may be of different length.Elements of shorter lists may be recycled when the keyword argument recycle is set to True. Any error result in an empty output list. ...
Python

z crypt

This module show a way to simple data encryption. Characters are mapped to a key via replacement. Though simple, this is a good method for encrypting data if the data is compressed before or after the encryption process. The functions provided by this recipe are meant to be used in a ...
Python