My Recent Pastes (43 and counting)
Pastes by Valentino Volonghi (43 and counting)
Below are the 15 most recent pasties by Valentino Volonghi.
August 20, 2007
7:55AM EDT
by Valentino Volonghi
View all 65 lines
# -*- coding: utf-8 -*-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
August 17, 2007
11:10AM EDT
by Valentino Volonghi
View all 109 lines
@transact
def run(self):
"""
pulls the next task off the queue and runs it
"""
August 17, 2007
10:32AM EDT
by Valentino Volonghi
View all 106 lines
@transact
def run(self):
"""
pulls the next task off the queue and runs it
"""
August 11, 2007
10:57AM EDT
by Valentino Volonghi
View all 29 lines
CREATE OR REPLACE VIEW weighted_tags_view AS
SELECT num.name AS name, SUM(num.count_name)
FROM (
SELECT posts_subq.name AS name, posts_subq.count_name AS count_name
FROM (
August 11, 2007
10:29AM EDT
by Valentino Volonghi
View all 17 lines
mapper(Comment, comments_view, extension=sac.ext)
mapper(Post, posts_view, extension=sac.ext, properties={
'comments': relation(Comment, backref='post', passive_deletes=True),
'tags': relation(Tag, secondary=tags_to_posts_table, lazy=False),
})
August 11, 2007
10:29AM EDT
by Valentino Volonghi
View all 35 lines
posts_view = select([posts_table,
func.sum(posts_rating_table.c.vote).label('rating')],
from_obj=[outerjoin(posts_table, posts_rating_table)],
group_by=[c for c in posts_table.c]
).alias('posts_view')
August 11, 2007
9:14AM EDT
by Valentino Volonghi
View all 7 lines
def parseMultipartFormData(stream, boundary,
maxMem=100*1024, maxFields=1024, maxSize=10*1024*1024):
d = defer.Deferred()
mmp = MultipartMimeParser(boundary)
stream.bufferEmpty(mmp.dataReceived)
August 09, 2007
1:35PM EDT
by Valentino Volonghi
View all 86 lines
from twisted.internet import reactor, threads from sqlalchemy import * meta = MetaData()
August 03, 2007
7:34AM EDT
by Valentino Volonghi
View all 26 lines
SELECT num.name, sum(num.count_name)
FROM (
SELECT posts_subq.name AS name, posts_subq.count_name AS count_name
FROM (
SELECT tags.name AS name, count(tags.name) AS count_name
August 02, 2007
12:34PM EDT
by Valentino Volonghi
View all 33 lines
@property
def weight(self):
# All this because we want to run only one query in the database.
# This is VERY CRITICAL, it's a BIG BIG query and we should do
# something to avoid running this too frequently or at all
August 02, 2007
12:11PM EDT
by Valentino Volonghi
View all 25 lines
@property
def weight(self):
# All this because we want to run only one query in the database.
num = union_all(
select([debates_table, tags_to_debates_table, tags_table],
August 02, 2007
9:51AM EDT
by Valentino Volonghi
View all 85 lines
from twisted.internet import reactor, threads from sqlalchemy import * meta = MetaData()
July 27, 2007
5:37PM EDT
by Valentino Volonghi
View all 83 lines
HEADER_WRITE = 'head' COMPRESSED_WRITE = 'compressed' TAIL_WRITE = 'tail' class GZipStream(BaseStream):
July 27, 2007
5:25PM EDT
by Valentino Volonghi
View all 83 lines
HEADER_WRITE = 'head' COMPRESSED_WRITE = 'compressed' TAIL_WRITE = 'tail'
July 27, 2007
5:12PM EDT
by Valentino Volonghi
View all 74 lines
HEADER_WRITE = 'head' COMPRESSED_WRITE = 'compressed' TAIL_WRITE = 'tail'
