Skip to content

Instantly share code, notes, and snippets.

// 2013-4-toerrskodd-moetevirksomhet.cpp
#include <iostream>
#include <set>
#include <vector>
#include <sys/types.h>
#include <limits>
#include <algorithm>
#include <utility>
#include <stack>
@rHermes
rHermes / PyOverflow.py
Created November 3, 2013 15:30
This was an experiment, trying to parse the XML dump of stackoverflow into a mysql database. Unfortuently, the script failed once the XML dumps got large enough.
from lxml import etree
import pymysql
def fast_iter(context, func):
for event, elem in context:
func(elem)
elem.clear()
while elem.getprevious() is not None:
del elem.getparent()[0]
del context