Programming Methods & Algorithms Python scripts - Top 4 Download

Programming Methods & Algorithms Python script downloads

Matrix vector multiplication

Using 'reduce' and 'map', this code shows how a matrix vector multiplication can be reduced to a single loop. ...
Python

Case insensitive Dictionary

Case-insensitive Dictionary script is a dictionary that has case-insensitive keys. An internal dictionary maps lowercase keys to (key,value) pairs. All key lookups are done against the lowercase keys, but all methods that expose keys to the user retrieve e lowercanal keys. ...
Python

Finding the convex hull of a set of 2D points

This simple code calculates the convex hull of a set of 2D points and generates EPS files to visualise them. ...
Python

Finite State Machine FSM

This script shows a Finite State Machine (FSM) that can be used for small parsing tasks. The code is quite simple. The bulk of it is comments. In addition to state this FSM also maintains a user defined "something". This "something" is effectively memory, so this FSM could be considered a ...
Python

Generator for integer partitions

Generator for integer partitions script uses an iterative procedure to deal with integer partitions. ...
Python

Quick and easy FIFO queue class

Quick and easy FIFO queue class is an easy First-In-First-Out queue class based on Python's List data structure. ...
Python

Merging two sorted iterators

Merging two sorted iterators script provides a mergeiter() function that can merge two iterators into a single iterator. It uses generators, and guarantees constant memory use. ...
Python

Basic Linear Algebra Matrix

This script defines the Matrix class, an implementation of a linear algebra matrix. Arithmetic operations, trace, determinant, and minors are defined for it. This is a lightweight alternative to a numerical Python package for people who need to do basic linear algebra. Vectors are implemented as 1xN and Nx1 matricies. There is ...
Python

Symmetric data obfuscation using xor

This script can be conveniently used to obfuscate a string of data using simple xor without using any key. ...
Python

Manipulating infinite lists

This script contains some useful functions which work on infinite lists, including generalized versions of map, filter, zip on gLists. ...
Python

Functional dictionary and list types

The purpose of this module is to provide a dictionary and list type that can aid in relational algebra, functional programming, list-oriented programming, and perhaps even code obfuscation. ...
Python

Octal Encryption

This script helps you to get the octal representation of text. ...
Python

List iterator with advance and regress

The basic iterator for a list doesn't allow one to skip forward (except with "continue"), or backward (at all), nor does it behave well if the list is modified while it is being traversed. This script is NOT the be-all and end-all of improved iterators, but it gives a few ideas of how a ...
Python

Binary search in one line

This is an implementation of the binary search algorithm in (almost) one line. Given a number 'n' and a list 'L', the function returns the index of the number on the list, or -1. ...
Python

Rating class with mapping interface

Rating class with mapping interface script deals with items sorted by value and accessed by key or rating index. ...
Python

Improved Gray Scale Quantization

Improved Gray Scale (IGS) codes are used for the elimination of false contouring in images, and image compression. This Python program generates the IGS codes for a set of input gray level values. ...
Python

Turing Machine Simulator

Turing Machine Simulator allows an arbitrary machine to be loaded. Words (represented as strings) can be ran against the simulator producing a response: Accept or Crash. ...
Python

Quantum Superposition

This script lets you treat  python sets.The constructor takes any number of scalars and/or Superposition instances. These items are the possible states. When doing scalar operations on such objects, the operation is delegated to its possible statbjects, tr >/ ...
Python

Implementation of sets using sorted lists

This script implements set operations using sorted lists as the underlying data structure. Advantages: - Space savings -- lists are much more compact than a dictionary based implementation. - Flexibility -- elements do not need to be hashable, only __cmp__ is required. - Fast operations depending on the ...
Python

High performance currying with instance method

This script implements the instance method for performing currying. Instance method provides a way to perform currying such that the curried function runs much faster than one produced by closure. Currying is an important technique to build callables on the fly and is well covered in other recipes. If the callables ...
Python