Skip to content

Instantly share code, notes, and snippets.

# -*- coding: utf-8 -*-
"""
FIXME
"""
import logging
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
def _main():
"""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()
'''
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].
'''
"""
=============
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
@e-yes
e-yes / urlnorm.py
Created February 2, 2010 17:33 — forked from mnot/urlnorm.py
urlnorm.py - URL normalisation routines
#!/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 '.'
//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. */