This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PyQt4.QtCore import * | |
from PyQt4.QtGui import * | |
import time | |
class Form(QDialog): | |
""" Just a simple dialog with a couple of widgets | |
""" | |
def __init__(self, parent=None): | |
super(Form, self).__init__(parent) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""CONVENTIONS: | |
positions are done row-column from the bottom left and are both numbers. This corresponds to the alpha-number system in traditional chess while being computationally useful. they are specified as tuples | |
""" | |
import itertools | |
WHITE = "white" | |
BLACK = "black" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chars = %w{ | / - \\ } | |
def find_all_email_addresses_in(base_folder) | |
# Bash goodness :P | |
a=`find #{base_folder} -type d -name cur`.split("\n") +`find #{base_folder} -type d -name new`.split("\n") | |
@emails=[] | |
# http://stackoverflow.com/questions/535644/find-email-addresses-in-large-data-stream | |
a.each do |folder| | |
Dir[folder+"/*"].each do |email| | |
content = File.read(email) | |
r1 = Regexp.new(/(((From|^To|Cc):.*<)\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}\b(>))/) |