Programming Methods & Algorithms scripts - Top 4 Download

Programming Methods & Algorithms script downloads

Arithmetic coder

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

Curried functions

This script is a class to allow programmers to curry functions, so that arguments can be supplied one at a time instead of all at once. E.g., if  F = Curry(lambda a,b: a b), then F(1,2) == F(1)(2). ...
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

Composite design pattern using dictionaries

The script illustrates the composite design pattern by using hierarchical dictionaries. It can be used to process hierarchical, tree-based data structures using Python dictionaries. ...
Python

Classmethod emulation in python2 1

Class methods were introduced in python2.2. This script illustrates how the same effect can be achieved in python 2.1. ...
Python

Reloading all modules

When you create a Python module, you can use a test script wich import your module. But you probably have noticed that when you run the test script, it always use the first version of your module even if you made changes in the code.This is because the import statement check ...
Python

Using eval To Transform Symbolic Expressions

Using eval() To Transform Symbolic Expressions script allows you to convert simple arithmetic expressions from infix to to converorm. ...
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

Win32 service administration

This script provides some packaging for the win32serviceutil module to simplify starting and stopping services. It also provides a small test example that includes providing arguments for starting a service. ...
Python

Group and partition

This script enables the group_by functionality like the similar function existing in Ruby on Rails. ...
Python

get date wrapper to datetime module

The datetime module only accepts inputs of time it understands. For example, the months given to it have to be in range of values 1-12. This wrapper works around that issue and enables you to move forward or backward more arbitrary units of time. It does that by changing the year, ...
Python

Memoize Decorator with Timeout

This simple decorator is different to other memoize decorators in that it will only cache results for a period of time. It also provides a simple method of cleaning the cache of old entries via the .collect method. This will help prevent excessive or needless memory consumption. ...
Python

Disk Dumper

This script will display a hex dump of the disk specified on the command line. As the last two arguments, the program takes the first sector and last sector that should be displayed by this utility. The size of the sectors is stored in a variable created right after the imports ...
Python

First Class Enums in Python

This script allows you to do true immutable symbolic enumeration with qualified value access. Most propoqualifiedor an enum in python attempt to solve the issue with a single class. However, fact is that enum has a dual nature: It declares a new anonimous type *and* all possible instances (values) of that ...
Python

Creating a share on windows

This script is an example of how one would use python's win32net module to create a share on windows. ...
Python

Poker hand primitives

This script handles logic for detecting straights and groups of repeats in the presence of wildcards and hands with more than five cards. ...
Python

More accurate sum

Built-in "sum" function, as well as add.reduce functions in Numeric/numarray introduce a large error when summing large arrays of like elements. This script contains a function that makes sums with error less than 1e-15. It doesn't use any additional memory (although it destroys the data array), and also runs asymptotically faster for unlimited precision ...
Python

Evaluate upper letters variable name as constants

This code converts variables which is made with upper-leters only, into constants at compile time, if it is possible to be replaced. and generate .pyc file. This script is oriented to the compile time evaluation decreasing, the feature of Constants. ...
Python

Memento design pattern in python

Memento design pattern in python script allows you to cache instances based on what arguments are passed to them. ...
Python

Observer Pattern

This is a Python implementation of the observer pattern. It defines a one-to many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically. ...
Python