Skip to content

Instantly share code, notes, and snippets.

@dicato
dicato / bungie.py
Created September 8, 2012 03:26
Bungie challenge decoder
import binascii
# This is the original puzzle from the mail sack!
puzzle = """
9B3E9D48B3A3C99D162D2A75E44FA14A0C3A9261C5873E6D0AB522D2A7
0E4C59D0E2D0A5063CD83524C38332659A51684583522C499663CFAF26A
48A9222C39F366CF9D4294187524C38B067449916B45A5063C59F3A2D38
33A25A8B4A7C5A7527D08B3AA488B26950A53E3D283369AE8F16745A506A
499D1E1CF89166499716A48934E3C59D169419932CC9A7068528B52A59A
F1664C5B1A7D59D122C4A106A548B4A7549F166D0993ECAE9F3AA488B1A
@staticmethod
def local_file_uri(file_path):
'''
Helper/Utility method to take file system paths and return a file URI for use
with learn, and learn_policy methods
Args:
file_path: The file path to the policy
Returns:
@staticmethod
def local_file_uri(file_path):
'''
Helper/Utility method to take file system paths and return a file URI for use
with learn, and learn_policy methods
Args:
file_path: The file path to the policy
Returns:
@dicato
dicato / intellect_test.py
Created July 31, 2012 21:25
Illustrate exception fix for Intellect
from intellect.Intellect import Intellect
if __name__ == '__main__':
test_intellect = Intellect()
# This should throw a generic exception
try:
test_intellect.learn('/path/to/bad/file.policy')
except Exception:
@dicato
dicato / Example.py
Created April 24, 2012 21:54
Test for Intellect
#!/usr/bin/env python
import pdb
from intellect.Intellect import Intellect
from wobbit import ColoredWobbit
if __name__ == '__main__':
print 'Running...'
intel = Intellect()
pdb.set_trace()