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
from __future__ import unicode_literals | |
import sys | |
def entry_point(argv): | |
bytes_seq = b"abcdef1234!" | |
for byte in bytes_seq: | |
print byte.decode('utf-8') |
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
[translation:info] Error: | |
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/translator/goal/translate.py", line 318, in main | |
[translation:info] drv.proceed(goals) | |
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/translator/driver.py", line 534, in proceed | |
[translation:info] return self._execute(goals, task_skip = self._maybe_skip()) | |
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/translator/tool/taskengine.py", line 114, in _execute | |
[translation:info] res = self._do(goal, taskcallable, *args, **kwds) | |
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/translator/driver.py", line 283, in _do | |
[translation:info] res = func() | |
[translation:info] File "/home/wilfred/projects/trifle/src/pypy/rpython/translator/driver.py", line 320, in task_annotate |
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
;;; llvm-mode.el --- Major mode for the LLVM assembler language. | |
;; Maintainer: The LLVM team, http://llvm.org/ | |
;; Description: Major mode for the LLVM assembler language. | |
;; Updated: 2007-09-19 | |
;;; Code: | |
;; Create mode-specific tables. | |
(defvar llvm-mode-syntax-table nil |
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
from django.test import TestCase | |
from django.test.utils import override_settings | |
from mock import patch | |
# If we're sending emails asynchronously with Sentry, make it | |
# synchronous during tests: | |
@override_settings(CELERY_ALWAYS_EAGER=True) | |
class EmailTestCase(TestCase): |
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
/* | |
* Placeholder plugin for jQuery | |
* @author Daniel Stocks (http://webcloud.se) | |
*/ | |
(function($) { | |
function Placeholder(input) { | |
this.input = input; | |
if (input.attr('type') == 'password') { | |
this.handlePassword(); | |
} |
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
from copy import deepcopy | |
def flatten_list(nested_list): | |
"""Flatten an arbitrarily nested list, without recursion (to avoid | |
stack overflows). Returns a new list, the original list is unchanged. | |
>> list(flatten_list([1, 2, 3, [4], [], [[[[[[[[[5]]]]]]]]]])) | |
[1, 2, 3, 4, 5] | |
>> list(flatten_list([[1, 2], 3])) | |
[1, 2, 3] |
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
$ PYTHONPATH=pypy python2 read_input_rpython_import.py | |
[platform:execute] gcc -c -O3 -pthread -fomit-frame-pointer -Wall -Wno-unused /tmp/usession-release-2.2.x-41/platcheck_0.c -o /tmp/usession-release-2.2.x-41/platcheck_0.o | |
[platform:execute] gcc /tmp/usession-release-2.2.x-41/platcheck_0.o -pthread -lintl -lrt -o /tmp/usession-release-2.2.x-41/platcheck_0 | |
> ^C | |
Traceback (most recent call last): | |
caught keyboard interrupt | |
File "/home/wilfred/projects/baobob/pypy/rpython/tool/runsubprocess.py", line 39, in <module> | |
> operation = sys.stdin.readline() | |
KeyboardInterrupt | |
^C |
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
import sys | |
import re | |
WHITESPACE = 'whitespace' | |
OPEN_PAREN = 'open-paren' | |
CLOSE_PAREN = 'close-paren' | |
INTEGER = 'integer' | |
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
ln -sv /usr/lib/python2.6/dist-packages/xapian $VENV_HOME/lib/python2.6/site-packages |
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
import copy | |
def make_hash(obj): | |
"""Make a hash from an arbitrary nested dictionary, list, tuple or | |
set. | |
""" | |
if isinstance(obj, set) or isinstance(obj, tuple) or isinstance(obj, list): | |
return hash(tuple([make_hash(e) for e in obj])) |