Programming Methods & Algorithms scripts - Top 4 Download

Programming Methods & Algorithms script downloads

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

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

Obtaining the name of a function method

This scripts shows you how to obtain the name of a method or a function from within the running method/function. ...
Python

Easy binary2decimal and decimal2binary

This script allows you to convert binary numbers to decimal and vice-versa in the most straightforward way. ...
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

AbstractFactory

This script has a base Factory class that is meant to be subclassed and then define a default implementation to return, as well as module's to search for the class implementation. ...
Python

Grouping objects into disjoint sets

This class provides a lightweight way to group arbitrary objects together into disjoint sets when a full-blown graph data structure would be overkill. Objects can be joined using .join(), tested for connectedness using joined(), and all disjoint sets can be retreived using get(). The objects being joined must be hashable. ...
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

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

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

z sync

This script gives access to the Sync class. Objects created by the Sync class are meant to be used when trying to syncronize the execution of two or more threads. ...
Python

Dictionary Tools

Dictionary Tools script shows you a collection of some dictionary tools. ...
Python

kexec the newest linux kernel

Kexec is a mechanism to use linux itself to load a new kernel without going through the BIOS thus minimizing down time. This script kexecs the newest kernel on the system managed by rpm (assumes a Redhat like system). ...
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

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

Metaclass Class Policies

This code implements the policy design pattern in Python by using metaclasses and multiple inheritance. ...
Python

Format number function

For many languages it is possible to use the locale module to format numbers. But there are at least three languages for which the locale.localeconv()['thousands_sep'] is empty: brazilian portuguese - 'pt_br', portuguese - 'pt' and spanish - 'es'. The first function, format_positive_integer() will return the passed integer number as a string ...
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

Watching a directory tree under Linux

This script contains a class named DirectoryNotifier that encapsulates the code required for watching directory entry contents. ...
Python

Example For winreg

This script is an example of how to use the winreg module. The code had the first purpose of demonstrating the concept of a graphical shell built in Python. The shell was easily modified to make use of the Window's registry but retains traces of its original method of operation. ...
Python