def space_out_camel_case(s):
    """Adds spaces to a camel case string.  Failure to space out string returns the original string.
    >>> space_out_camel_case('DMLSServicesOtherBSTextLLC')
...

Python On CamelCase to Camel Case (Py...

by onk, March 07, 2010 19:38

Positional regex.

931ae7bf5fe3d90dc7016c7e8058e734 Talk
def permiter(ni):
    if not ni:
        yield []
...

Python On Permutation of values

by Hugh Brown, March 05, 2010 22:38

Simple code using generator...

Bbcac97b68f9e9cabd25a3f0f0bdbe49 Talk
from django.db import models

# Create your models here.
...

Python On Create a Dict from a Model

by Sam Thomson, March 02, 2010 18:48 Star_fullStar_fullStar_fullStar_fullStar_full

This uses list comprehensio...

1c014f0c48fc85edb8e8e28a1e8bb8ae Talk
Train Danger,capable used express turn pleasure official brief case neck when map end ready follow population academic intention policy drive vision edge rely photograph separate demand favour mechanism relation arise property most employ partner scientific lot signal domestic commission grant better provision forget appeal investment citizen somewhat sound range all feeling complex extremely population factory improvement play suggest feel background action understand until unfortunately corporate begin literature present quite example forget inside stuff achieve credit whom face anybody pleasure them upper goal discuss doctor fresh week environmental relatively

Python On Reformat svn log output

by gunstiges hotel, February 25, 2010 12:16

Train Danger,capable used e...

17a547c8fa25d4d610c9c881e1a63b15 Talk
from django.db import models

# Create your models here.
...

Python On Create a Dict from a Model

by Matthew Schinckel, February 22, 2010 11:09 Star_fullStar_fullStar_fullStar_fullStar_full

This should really be in a ...

833bfbcc9940cfcf0af6def751c23b05 Talk

Python On Return the indexes of speci...

by bob, February 14, 2010 18:58

Since the array is sorted, ...

D41d8cd98f00b204e9800998ecf8427e Talk
def __str__(self):
		return '[{0}]'.format(', '.join( [str(node) for node in self] ))

Python On Linked List

by Sean B., February 13, 2010 00:30

Modified __str__ implementa...

98f46668d0ec395baf6f848bf8509cec Talk

Python On Return the indexes of speci...

by Ants, January 31, 2010 07:01

It looks a bit frightening ...

F9a9ba6663645458aa8630157ed5e71e Talk
def get_pos(rel_dates):
	"""returns the positions of the dates closest to 25%, 50%, and 75%"""
	dates25 = [abs(date-25) for date in rel_dates]
...

Python On Return the indexes of speci...

by Kevin Baribeau, January 30, 2010 20:39

You may or may not like thi...

F571a96564c78a854662a00358c33160 Talk
# This function returns a list of the primes
# between 2 and n inclusively. It is given
# an integer n and prints the list.
...

Python On Sieve of Eratosthenes

by Nick, January 28, 2010 19:33

This is what I came up with...

D41d8cd98f00b204e9800998ecf8427e Talk
def scale_dates(dates):
    d = float(dates[-1] - dates[0])
    return [(date-dates[0])/d for date in dates]

Python On Scale data points with the ...

by x-way, January 23, 2010 22:19
5023923d5d5ce3d95d0f73b5dd8afc88 Talk
def scale_dates(dates):
    d = float(dates[-1] - dates[0])
    return [(date-dates[0])/d for date in dates]

Python On Scale data points with the ...

by x-way, January 23, 2010 22:18 Star_fullStar_fullStar_fullStar_fullStar_full
5023923d5d5ce3d95d0f73b5dd8afc88 Talk
i wanted the code to count the no of occurences of each word in a text using java script .!! pls anyone help !!!

Python On Count word occurrences in a...

by Suganya, January 19, 2010 09:23
Eead9f6e9e61907ec68459cbed598454 Talk
def gen_primes():
    """ Generate an infinite sequence of prime numbers.
    """
...

Python On Sieve of Eratosthenes

by Eli, December 26, 2009 06:33
Fc761ccaf6c0d7d977e2959f9bfebd06 Talk
def gen_primes():
    """ Generate an infinite sequence of prime numbers.
    """
...

Python On Sieve of Eratosthenes

by Eli, December 26, 2009 06:24
Fc761ccaf6c0d7d977e2959f9bfebd06 Talk

Python On Sieve of Eratosthenes

by bob, December 18, 2009 01:23

What about multiples of thi...

D41d8cd98f00b204e9800998ecf8427e Talk

Python On LUA 4.0 Date check

by Ants, December 07, 2009 20:56

I'm not fluent with LUA, bu...

F9a9ba6663645458aa8630157ed5e71e Talk
ub =    float(((B.x-A.x)*(A.y-C.y))-((B.y-A.y)*(A.x-C.y)))/ \
                float(((D.y-C.y)*(B.x-A.x))-((D.x-C.x)*(B.y-A.y)))

Python On Line-line intersection test

by Aneel, December 02, 2009 21:40

ub is calculated, but never...

D41d8cd98f00b204e9800998ecf8427e Talk

Python On fixcase.py

by Ants, November 16, 2009 23:24

Have you checked out Sharpe...

F9a9ba6663645458aa8630157ed5e71e Talk

Python On Base64 image encoding and i...

by qwd, November 09, 2009 15:55

qwc

02fcdc687ea469de024bc922f68926ef Talk
def get_conn():
    host="myhost"
    user="myuser"
...

Python On MySQLdb database access code

by Seun Osewa, October 29, 2009 05:57 Star_fullStar_fullStar_fullStar_full

Use the 'with' statement:

14d31365b5aa707c17590218afcecc65 Talk
#!/usr/bin/python
# encoding: utf-8

...

Python On equação do segundo grau

by frangossauro, October 28, 2009 18:02

Please, post in english, si...

0d4060f81e5df29943e400a6d191fe26 Talk
import random
while 1:
    print random.randrange(0,100)

Python On Random number generator

by Marc, October 28, 2009 14:41

Yes, definitely.

D41d8cd98f00b204e9800998ecf8427e Talk

Python On Parse XML from Yahoo weathe...

by shmai, October 28, 2009 12:47

This is classic asp script ...

F635307583b9a832f1558add6a5153ed Talk

Python On Parse XML from Yahoo weathe...

by Shmai, October 16, 2009 10:40

This is classic asp script ...

F635307583b9a832f1558add6a5153ed Talk