Programming Methods & Algorithms scripts - Top 4 Download

Programming Methods & Algorithms script downloads

SQL like ORDER BY function for lists

This script contains a function that allows you to easily sort a list by multiple columns in ascending and descending order similar in function to the ORDER BY clause in SQL. ...
Python

An interval mapping data structure

This structure is a kind of dictionary which allows you to map data intervals to values. You can then query the structure for a given point, and it returns the value associated to the interval which contains the point.Boundary values don't need to be an integer ; in the test unit ...
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

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

Binary floating point summation

This script eliminates completely  rounding errors and loss of significance due to catastrophic cancellation during summation. It  achieves exactness by keeping full precision intermediate subtotals. Offers three alternative approaches, each using a different technique to store exact subtotals. ach >using/ ...
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

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

A basic time profiler

A basic time profiler script provides a very simple time profiling module which helps you to measure actual execution time for blocks of Python 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

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

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

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

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

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

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

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

Group and partition

This script enables the group_by functionality like the similar function existing in Ruby on Rails. ...
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

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

pykill

This is a python script very loosely approximating pkill that is a Linux command: will send the specified signal (by default SIGTERM) to each process instead of listing them on stdout. ...
Python