## Genetic Algorithm scripts

#### Convex hull and diameter of 2d point sets

... points represented as pairs (x,y). The convex hull algorithm is Graham's scan, using a coordinate-based sorted order ... commonly seen radial sorted order. A rotating calipers algorithm generates candidate pairs of vertices for the diameter calculation. Care was taken handling tricky cases such as pairs of points with the same x-coordinate ...
Python

#### Two pass Pairing Heap with Auxiliary List

This script allows you to manage data collections.For random data, this implementation still makes more comparisons than a sort using heapq or the builtin sort. For partially ordered data, it can perform better than the builtin sort. Because of the list of lists data structure, it always takes more memory than ...
Python

#### Rabin Miller probabilistic prime test

... prime) is at most 4**-k. Included is an algorithm for generating a number of b bits for which no composite witness was found after k trials. Removing mathematical rigor will suggest that the probability of the value being prime after k trials is at least 1-1/4**k. ...
Python

#### Pseudo random string to float conversion

Pseudo-random string to float conversion script converts strings to floats in the range [0, 1), using a hash function. ...
Python

#### Encoding A String

The main purpose of these functions are to allow encoding a string from base 256 to a special base 255. The function view the strings as numbers and simply change what base they are written in. This is not recommended for very long strings; otherwise, the encoding and decoding process can ...
Python

#### Merging sorted iterables

This script helps you to merge sorted iterables, preserving ordering,without consuming iterables (and computing time) unnecessarily. ...
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

#### Big file sorting

Big file sorting script allows you to sort big ASCII files. ...
Python

#### Splitting up a sequence

This script allows you to split up a sequence in same-size (if possible) parts. ...
Python

#### An interval mapping data structure

... O(log2 n) insert and lookup time. The insert algorithm tries to do "the right thing" when overlapping intervals are inserted. As a general rule, an inserted interval overrides every other mapping which was defined. ...
Python

#### Increment numbers in a string

... on your invoice is "XYZ-001", then let this algorithm figure out that the next one should be "XYZ-002" or that "dsc_010.jpg" should become "dsc_011.jpg" . ...
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

#### z crypt

This module show a way to simple data encryption. Characters are mapped to a key via replacement. Though simple, this is a good method for encrypting data if the data is compressed before or after the encryption process. The functions provided by this recipe are meant to be used in a ...
Python

#### Arrayterator

This class creates a buffered iterator for reading big arrays in small contiguous blocks. The class is useful for objects stored in the filesystem. It allows iteration over the object without reading everything in memory; instead, small blocks are read and iterated over. The class can be used with any object ...
Python

#### Length limited O 1 LRU Cache implementation

Length-limited O(1) LRU Cache implementation script is an implementation of a length-limited O(1ion scripue. ...
Python

#### Group and partition

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

#### All k subsets from an n set

This script yields each subset of size k from a super set of size n. There are two methods. The first operates on sets of integers of the form range(n). The seconds operates on arbitrary sets or lists. ...
Python

#### Filetail

... tweak the sleep interval calculations if the given algorithm doesn't work for you. The goal is to figure out how long you need to sleep before getting some input; ideally, you want to get to the state where you sleep, wake up, and have exactly one line waiting for you, ...
Python

#### RapidSpell Web

... good suggestions for words, including an exclusive 'sounds-like' algorithm.RapidSpell Web has a decoupled checker engine, which allows ... the server in one request. - Fast algorithms . - Supports Multilingual UI, available options ... server cluster support . - 2 suggestions algorithms. - SSL safe. - Modal/Nonmodal popup ...
ASP.NET