The following transcripts were recorded during human - computer interaction.
Programmer: okay, give me the numbers one by one.
Computer: I don't know how to "by" "one" and "one".
P: what? Just... is there a number at the top left of the page?
def test(): | |
print "testing code highlight" |
import sys | |
from xiter import xiter | |
from collections import defaultdict | |
from random import random, choice | |
def grouped(it, group_size = 2): | |
buffer = [it.next() for i in xrange(group_size - 1)] | |
for i in it: | |
buffer.append(i) |
class Order(object): | |
__lt__ = lambda self, other: other > self | |
__gt__ = lambda self, other: not self <= other | |
__le__ = lambda self, other: other >= self | |
__ge__ = lambda self, other: not self < other | |
__ne__ = lambda self, other: self < other or other < self | |
__eq__ = lambda self, other: not self != other |
class Order(object): | |
__lt__ = lambda self, other: other > self | |
__gt__ = lambda self, other: not self <= other | |
__le__ = lambda self, other: other >= self | |
__ge__ = lambda self, other: not self < other | |
__ne__ = lambda self, other: self < other or other < self | |
__eq__ = lambda self, other: not self != other |
var real_docwrite = document.write, | |
body = $('body'); | |
(function insertGists(a_tags) { | |
if (a_tags.length > 0) { | |
a_tag = a_tags.shift() | |
document.write = function(stylesheet) { | |
$('head').append(stylesheet); | |
// Asssignment: | |
a = b = c; | |
if (status = result()); | |
// Standard setters: | |
setA(setB(c)); // No. Setters return void. | |
if (setStatus(result()); // And again. Impossible. |
# ============================================================================ # | |
# Bienvenido al país de Python! Acá todos hablan python, idioma del que vos por | |
# ahí no sabés nada. Pero no te preocupes: con esta guía vas a dominar las | |
# frases más comunes en un toque. | |
# Lo primero que tenés que entender es que las frases que empiezan con un '#' | |
# (numeral) son totalmente ignoradas en python. O sea que esta conversación que | |
# estamos teniendo es completamente privada: nadie en Python se está enterando. |
class OrderFilterForm(Form): | |
name = CharField(required = False) | |
email = CharField(required = False) | |
aec = CharField(required = False) | |
date_created_from = DateField(required = False) | |
date_created_to = DateField(required = False) | |
def process(self): | |
data = lambda key: self.cleaned_data.get(key, '') |
# Dummy | |
class Redis: | |
def send(self, method, key, args, f): | |
print method, key, args, f | |
class Nest(str): | |
def __init__(self, key, redis = Redis()): | |
super(Nest, self).__init__(key) |