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 | |
# Mkxtemp - a temporary file context manager for use by external processes | |
# Placed in the Public Domain by Santtu Pajukanta <[email protected]> 2012 | |
from contextlib import contextmanager | |
from tempfile import NamedTemporaryFile | |
import os | |
import unittest |
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 collections import defaultdict2 | |
from unittest import TestCase | |
class defaultdict2(defaultdict): | |
def __missing__(self, key): | |
value = self.default_factory(key) | |
self[key] = value | |
return value | |
class TestDefaultdict2(TestCase): |
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
japsu@eris ~ $ cat foo.py | |
#!/usr/bin/env python | |
# encoding: utf-8 | |
import sys | |
sys.stdout.write(u"åöä\n") | |
japsu@eris ~ $ python foo.py | |
åöä | |
japsu@eris ~ $ python foo.py | cat | |
Traceback (most recent call last): |
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 | |
def python_to_java(s): | |
t = list(s) | |
try: | |
i = 0 | |
while True: | |
if t[i] == '_': | |
del t[i] | |
t[i] = t[i].upper() |
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
Traceback (most recent call last): | |
File "finphone.py", line 73, in <module> | |
assert verify.check(), verify.report() | |
AssertionError: FAILURE (passed 10, failed 15, total 25) | |
FAIL #1: split_area_code | |
INPUT: '035551234' | |
OUTPUT: ['', '035551234'] | |
EXPECTED: ('03', '5551234') |
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
class errors_wrapped(object): | |
""" | |
A function decorator to wrap all exceptions in an exception class of | |
your choosing. | |
Usage: | |
@errors_wrapped(MyExceptionClass) | |
def my_function(... | |
MyExceptionClass should accept this: |
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
To Zanarkand | |
Final Fantasy X | |
säv. Nobuo Uematsu | |
sov. Masashi Hamauzu | |
Aerith's Theme | |
Final Fantasy 7 | |
säv. Nobuo Uematsu | |
sov. Shiro Hamaguchi |
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
/* | |
* fixavi.c - fix a broken Sony AnyCast DVPRO/PCM AVI file | |
* Written by Matti "Lumpio-" Virkkunen | |
* | |
* Compile with: cc -o fixavi fixavi.c (or just make fixavi) | |
*/ | |
#define _FILE_OFFSET_BITS 64 | |
#include <stdio.h> |
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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: gunicorn_django | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the gunicorn server | |
# Description: starts gunicorn using start-stop-daemon |
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
KÄYTÖSSÄ | |
======== | |
astarte - Samsung Galaxy Y Pro -kännykkä | |
celestis - Samsung Galaxy Tab 8.9 | |
opux - verkkotulostin | |
enyo - imicuksen seuraaja, tiedostopalvelin isän nurkissa | |
eris - virtuaalikone primellä | |
helios - kotipalvelin | |
iteron - kytkin |
OlderNewer