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
# -*- coding: utf-8 -*- | |
""" | |
FIXME | |
""" | |
import logging | |
log = logging.getLogger(__name__) | |
log.setLevel(logging.DEBUG) | |
def _main(): |
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
"""Stack tracer for multi-threaded applications. | |
Usage: | |
import stacktracer | |
stacktracer.start_trace("trace.html",interval=5,auto=True) # Set auto flag to always update file! | |
.... | |
stacktracer.stop_trace() |
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
''' | |
Many Time Pad | |
Let us see what goes wrong when a stream cipher key is used more than once. | |
Below are eleven hex-encoded ciphertexts that are the result of encrypting eleven plaintexts with a stream cipher, | |
all with the same stream cipher key. | |
Your goal is to decrypt the last ciphertext, and submit the secret message within it as solution. | |
Hint: XOR the ciphertexts together, and consider what happens when a space is XORed with a character in [a-zA-Z]. | |
''' |
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
""" | |
============= | |
stringmethods | |
============= | |
Make possible to use all Python string methods as Django template filters. Also | |
provide custom template tag ``{% stringmethod %}`` to use methods with more | |
than one argument, like ``format``, ``count`` and other. | |
Restrictions |
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
#!/usr/bin/env python | |
""" | |
urlnorm.py - URL normalisation routines | |
urlnorm normalises a URL by; | |
* lowercasing the scheme and hostname | |
* taking out default port if present (e.g., http://www.foo.com:80/) | |
* collapsing the path (./, ../, etc) | |
* removing the last character in the hostname if it is '.' |
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
//http://stackoverflow.com/questions/1861294/how-to-calculate-execution-time-of-a-code-snippet-in-c | |
#ifdef WIN32 | |
#include <Windows.h> | |
#else | |
#include <sys/time.h> | |
#include <ctime> | |
#endif | |
/* Returns the amount of milliseconds elapsed since the UNIX epoch. Works on both | |
* windows and linux. */ |