This function takes a range in form of "a-b" and generate a list of numbers between a and b inclusive.
Also accepts comma separated ranges like "a-b,c-d,f" will build a list which will include numbers from a to b, a to d and f
Here is a quick and dirty way to sort a list of dictionary based on a key value.
Generates a list of links used in a post. This can be used to create a list of references like those in scientific publications. Add [lor] at the end of your post (or wherever you want the list of references) and add a title attribute to all links...
One of the most frequently asked questions is how to efficiently get a list of Python dictionaries from a database query rather than the difficult-to-use list of tuples.
Group a list of items according to the starting character(s) of items.
This is based on Raymond Hettinger's groupby class:
Sometimes you get a list of lists and want to swap rows and columns, i.e. transpose the list. Yet, what if the rows have different lengths? Here is some advice you might find useful in such situations.
I often return result sets from a database call using a list of dictionary objects. When transmitting the pickled list object over the wire, the size of the pickle greatly effects the speed of the transmission.
I wrote this small class...
This module takes a list of equal length lists and converts it into XML.
If the first sublist is a list of headings, these are used to form the element names of the rest of the data, or these can be defined in the function call. Root...
List of Posts from each Category plugin for WordPress
This plugin displays a list of the posts from each category of your WordPress installation. It can be added to a post or page, or used directly in a template file. In the...
A simple widget that will display a list of your sticky posts.
1. Download and unzip the most recent version of this plugin
2. Upload the sticky-posts-widget folder to...
LJ Longtail SEO is a tool that detects search engine visits and uses this information to display a list of links based on second page search results.
The results in the database are aged off based on customizable settings so that once...
List of Hex Codes within the corresponding table cell color.
This is an evolutionary algorithm that returns a random list of prime numbers. This code is highly inefficient for a reason. This algorithm is more of a proof of concept that if a prime was a heritable trait, it would not be a desired one.
Given an arbitrary list (of length >= 1) of positive integers, return the greatest common divisor (gcd) of the list.
The Program to test the girth 4 of Gallager LDPC codes
Copyright (C) Yang XIAO, BJTU, July 26, 2007, E-Mail: firstname.lastname@example.org,
The program analyzes the girth 4 for Gallager LDPC codes. The figures show
the parity check matrix H and...
Tool written in C to generate a list of codes with symbolic names (such as #define's in C) from a description file, along with a file that allows lookup of codes to get the symbolic name.
Utility to store list of files and directories for removable media. Doesn't require additional DLLs, ActiveX or Database Engine to be installed. Keywords search supported.
What if you had a list like this: [1, -10, [1,2,[3,4]], xrange(200)], and you just wanted to go through each element in order (wanted it to return a simple list of [1,-10,1,2,3,4,1,2,3,4...199])
I've seen a couple of attempts to flatten...
This recipe returns a list of size n such that the contents of the returned list are random 0s and 1s. It returns a random binary list of size n.
This module/function lets you find a 2 dimensional list of indices for elements you are looking for in a super list.
returns: [[0, 1, 2, 4], [3, 5], [6, 7]]