Programming Methods & Algorithms scripts - Top 4 Download

Programming Methods & Algorithms script downloads

Clean implementation for Ordered Dictionary

This script allows you to record the order in which items are added. This implementation uses much less code than the others by extending not well-known class DictMixin. ...
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

Computing permutations with duplicates

This script handles duplicate values in a list. It could easily be made a generator, and it does not require recursion. ...
Python

Constant Object Passing

This script shows you how to pass objects as "constant" (immutable) in python. ...
Python

Constellation Finder

The script demonstrates the use of SETs in Python. There is a key object that has constellations already identified and a stars object that contains the stars in the sky. Keys are used to unlocks the stars and the results are printed out for the user of the program. ...
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

Controlling Windows Services

This script is a module for manipulating WinNT, Win2k & WinXP services. It contains the WService Class. The WService Class is used for controlling WinNT, Win2k & WinXP like services. Just pass the name of the service you wish to control to the class instance and go from there. For example, ...
Python

Converting windows 64 bit time

In Win32 often you'll find time stored in 100-nanosecond intervals since January 1, 1600 UTC. It is stored in a 64-bit value which uses 2 32 bit parts to store the time. The following script is a function that returns the time in the typical format the python time libraries use (seconds ...
Python

Convex hull and diameter of 2d point sets

This script returns the convex hull (separated into upper and lower chains of vertices) and the diameter (farthest pair of points), given input consisting of a list of 2d points represented as pairs (x,y). The convex hull algorithm is Graham's scan, using a coordinate-based sorted order rather than the more commonly ...
Python

CookieInfo

The "CookieInfo" and "Cookie" classes provide developers with an read-only interface to the "cookies.txt" that most browsers store. The CookieInfo class makes Cookie objects from the cookie file. It also provides methods to operate on the whole set of Cookies. The Cookie object provides methods to convert a cookie into both ...
Python

Create an account in MS active directory

This script contains the basic code to create an account in active directory that shows how to do things like set your own exension attributes, force a reset of the password when the user logs in, and set the home directory. It makes used of python's excellent COM support in win32com. ...
Python

Create objects from variable class names

Sometimes you would want to create objects from various classes based on some condition (without using eval()). For example when parsing X(HT)ML files you want to handle some tags using specific classes. This script is an example in this sense. ...
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

Credit card validation

This script implements in python an industry standard algorithm for credit card validation. 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 ...
Python

Criteria based cascading priority queue

This module provides a simple criteria-based priority queue with "priority cascading".The criteria argument should be a sequence of callables that return boolean values. There is no need to add an "all pass" criterion at the end; the queue will add all non-matching items with the least priority.ill add >a ...
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

Debug runtime objects using gc get objects

Since Python 2.2 there is a handy function in the Garbage Collection Module called get_objects(). It gives back a list of all objects that are under control of the Garbeage Collector. This script implements a way you can extract informations of your application in runtime.The example dumps a list of all ...
Python

Debug statements include function name

This script allows a user to place debug messages, error messages and standard messages throughout a program. The function name and line number will be added to each debug and error message before it is printed out. In addition, each of these messages can be passed to multiple handler objects that can ...
Python

Debuging of object instantiation

If you are debugging a program, this script will help you to know if some special objects exist and where they came from. ...
Python

Deque collection class

This script is a pure python drop in replacement for collections.deque(). It uses a dictionary as the underlying data structure for the deque (pronounced "deck", short for "double-ended queue", a generalization of stacks and queues) which provides O(1) performance for appends and pops from either end.   ...
Python