This file contains 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
# a simple reverse-polish notation calculator | |
# | |
# shouldn't be too hard to extend this--variables seem like a natural progression | |
import operator | |
def error_string(token, values): | |
plural = '' | |
if values > 1: | |
plural = 's' |
This file contains 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
USCYBERCOM plans, coordinates, integrates, synchronizes and conducts activities to: direct the operations and defense of specified Department of Defense information networks and; prepare to, and when directed, conduct full spectrum military cyberspace operations in order to enable actions in all domains, ensure US/Allied freedom of action in cyberspace and deny the same to our adversaries. | |
From the md5 hash: 9ec4c12949a4f31474f299058ce2b22a | |
As detailed on: http://www.wired.com/dangerroom/2010/07/solve-the-mystery-code-in-cyber-commands-logo/ | |
Reverse lookup from: http://www.md5decrypter.com/ |
This file contains 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
# ghost | |
# see more at http://en.wikipedia.org/wiki/Ghost_(game) | |
import random | |
minimum_length = 5 | |
# create a list of the supplied word list | |
wordlist = '/usr/share/dict/words' | |
words = [word.rstrip().lower() for word in file(wordlist, 'r') if len(word.rstrip()) >= minimum_length] |
This file contains 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
def anagram_solve(letters, words): | |
solution = [word.lower() for word in words if len(word) == len(letters)] | |
for letter in letters: | |
solution = [word for word in solution if letter in word and letters.count(letter) == word.count(letter)] | |
return solution | |
if __name__ == "__main__": | |
import sys |