Programming Methods & Algorithms scripts - Top 4 Download

Programming Methods & Algorithms script downloads

A basic undo mechanism

This script provides a basic undo mechanism. The undo mechanism is build on top of the observer pattern. The basic undoer records all parameters needed to undo the change of attributes. ...
Python

List and dictionary observer

This script implements an observer pattern for dictionaries and lists. It does not support a one-many relation. The observer is sent enough information so that the change can be undone. ...
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

Simple lockfile to detect previous instances

Simple lockfile to detect previous instances script implements a simple lockfile to ensure that only one instance of an application is alive at any given time. ...
Python

Logging to a Jabber account

This script contains a handler class which sends a Jabber message for each logging event. If you have long-running scripts on many remote machines and you want to be alarmed if one of them crashes, use the JabberHandler to log it to your account. ...
Python

Finding the value passed to a function by name

Sometimes inside a decorator that creates a function with a generic (*args, **kwargs) signature, you want to access a value passed for a particular parameter name to a wrapped function, but don't know whether that value will be passed as a positional or keyword argument, or whether the wrapped function defines ...
Python

Tabify

This script introduces a function that converts the indentation with spaces to tabs. ...
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

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

Coding Standard Adaptor

This script contains a function, "rename_members", which takes an object, and two strings describing variable naming conventions (e.g. "allcamel", "underscores", etc). It translates attribute names on the given object from the first naming convention to the second (it doesn't delete the original attributes). The function also takes an optional acceptance function, which ...
Python

split and join

This script will split a file into several smaller files while at the same time hiding the original formatting of the file. The program has a primitive GUI design, allowing a small amount of interaction with the program. ...
Python

Simple multiline interactive interpreter

This script is a simple embedded multiline python interpreter built around raw_input(). It interrupts the control flow at any given location with 'exec prompt' and gives control to the user. Allways runs in the current scope and can even be started from the pdb prompt in debugging mode.It was tested with python, jython ...
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

Variant assertion

Variant assertion script is Eiffel like loop variant assertion. ...
Python

Automatic indentation of output

This script is an output stream wrapper; possibly useful for debugging code with print statements. When write() is called, it makes a note of the calling frame. The indentation level is equal to the number of frames in the call stack which have been previously noted. ...
Python

Integrating Twisted reactor with IPython

This script allows you to run the Twisted reactor event loop in a thread alongside an IPython shell, for introspecting a running Twisted process. ...
Python

Trace expressions and comments in debug mode

This script acts like a stepping debugger to diagnose and fix your programs. It contains functions for log state and execution flow. ...
Python

Force verbose mode for unittests in an IDE

When running unit tests, using the verbose flag often provides an extra level of protection against mistakes. When running from the command line, this simply means adding the -v option. If you use an IDE, matters become more complicated. While you can often set your IDE to pass in the -v ...
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

Null Object Design Pattern

This script is a sample implementation of the 'Null Object' design pattern. Roughly, the goal with Null objects is to provide an 'intelligent' replacement for the often used primitive data type None in Python or Null (or Null pointers) in other languages. These are used for many purposes including the important case ...
Python