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
# -*- coding: utf-8 -*- | |
__doc__ = """ | |
usage: | |
python lineon.py somefile.py | |
or | |
# write your top of source. | |
lineon.apply(sys) |
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
--- html_fibo.orig 2011-08-01 12:51:29.063696436 +0900 | |
+++ html_fibo.py 2011-08-01 12:50:58.703267469 +0900 | |
@@ -2,6 +2,8 @@ | |
The most complicate ever way to produce an HTML list of fibonacci numbers | |
""" | |
+import gc | |
+ | |
def fibo(): | |
a, b = 1, 1 |
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
# -*- coding: utf-8 -*- | |
from timeit import Timer | |
import random | |
import string | |
import sys | |
def redef_builtin_filter(pred, iterable): | |
"""redefined builtin filter function""" | |
ret = [x for x in iterable if pred(x)] |
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
#!/bin/bash | |
hg clone https://bitbucket.org/wkornewald/django-nonrel | |
hg clone https://bitbucket.org/wkornewald/djangoappengine | |
hg clone https://bitbucket.org/wkornewald/djangotoolbox | |
hg clone https://bitbucket.org/twanschik/django-autoload | |
hg clone https://bitbucket.org/wkornewald/django-dbindexer | |
hg clone https://bitbucket.org/wkornewald/django-testapp | |
mkdir $1 |
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
;;; | |
;;; キーバインド | |
;;; | |
;;; undo | |
(define-key global-map (kbd "C-z") 'undo) | |
;;; コメント切り替え | |
(define-key global-map (kbd "C-c ;") 'comment-or-uncomment-region) | |
;;; |
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
diff -r c62cca56f289 pypy/interpreter/pyparser/pytokenizer.py | |
--- a/pypy/interpreter/pyparser/pytokenizer.py Tue Dec 06 18:47:03 2011 +0900 | |
+++ b/pypy/interpreter/pyparser/pytokenizer.py Thu Dec 08 13:30:38 2011 +0900 | |
@@ -169,7 +169,7 @@ | |
if start == end: | |
raise TokenError("Unknown character", line, | |
lnum, start + 1, token_list) | |
- | |
+ bpos = pos | |
pos = end |
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
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
def main(maxnum): | |
for idx in xrange(1, maxnum+1): | |
val = idx | |
if idx % 3 == 0: |
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
""" libpcre wrapping""" | |
from pypy.rpython.tool import rffi_platform | |
from pypy.rpython.lltypesystem import lltype, rffi | |
from pypy.translator.tool.cbuild import ExternalCompilationInfo | |
from pypy.translator.platform import platform | |
from pypy.tool.ansi_print import ansi_log | |
import py | |
import os |
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
Python2.7.1 | |
================== | |
In [1]: import sys | |
In [2]: sys.version | |
Out[2]: '2.7.1+ (r271:86832, Apr 11 2011, 18:05:24) \n[GCC 4.5.2]' | |
In [3]: import p002, p002_functional | |
In [4]: timeit p002.sumevenfibo(4000000) |
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
# -*- coding: utf-8 -*- | |
import operator | |
def guard(*guardArgs, **guardKw): | |
def _argGuard(f): | |
def _inner(*args, **kw): | |
argTypes = map(lambda x: type(x), args) | |
if not all(map(operator.eq, guardArgs, argTypes)): | |
raise Exception("Type Error: not match type {0}, {1}".format(guardArgs, argTypes)) |
OlderNewer