Skip to content

Instantly share code, notes, and snippets.

View shomah4a's full-sized avatar

shoma shomah4a

  • 17:23 (UTC +09:00)
View GitHub Profile
@shomah4a
shomah4a / part2.rst
Created February 4, 2012 15:41
A Simple Tracer for the Flow Graph Language

FlowGraph 言語のための単純なトレーサ

Part2 トレーシングと部分評価の比較

@shomah4a
shomah4a / flowgraph-part3.rst
Created February 9, 2012 05:34
FlowGraph 言語のトレースの最適化

FlowGraph 言語のトレースの最適化

トレーシングと部分評価の比較 Part3

@shomah4a
shomah4a / partial-evaluation-and-trace-part4.rst
Created February 24, 2012 03:14
より大きなフローグラフ言語の例

より大きなフローグラフ言語の例

トレーシングと部分評価の比較 Part4

@shomah4a
shomah4a / test.py
Created March 13, 2012 11:08
よくはまる例
class Base(object):
def __init__(self, arg):
self.arg = arg
class BaseL(object):
@shomah4a
shomah4a / multipleinherit.py
Created March 14, 2012 02:13
多重継承を制限してみる in Python
#-*- coding:utf-8 -*-
u'''
多重継承を制限するクラスを作って、そのクラスから導出されたクラスが多重継承していたらエラーを吐くメタクラス
'''
class MultipleInheritanceLimitedError(TypeError):
pass
def get_limitation_class(cls):
@shomah4a
shomah4a / classtest.py
Created March 16, 2012 00:51
クラスを調べるときに試したコード
#-*- coding:utf-8 -*-
import traceback
def aaa(cls):
__class__ = cls
def bbb(y):
@shomah4a
shomah4a / pythonista.hpp
Created March 19, 2012 14:09
useful defines for pythonista
#define self (*this)
#define except catch
#define elif else if
@shomah4a
shomah4a / metameta.py
Created March 19, 2012 14:56
メタクラスと継承ツリーの検証
import traceback
class MetaClassA(type):
pass
class MetaClassAA(MetaClassA):
pass
@shomah4a
shomah4a / test.cpp
Created March 26, 2012 04:45
変数を使わないで 0 から 100 まで
#include <iostream>
template <int start, int end>
class Sum
{
template <int _start, int _end, int _result>
class Internal
{
public:
@shomah4a
shomah4a / zen.py
Created April 10, 2012 15:30
zen of python classs and type
>>> isinstance(type, object)
True
>>> isinstance(object, type)
True
>>> type(object)
<type 'type'>
>>> type(type)
<type 'type'>
>>> issubclass(type, object)
True