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 | |
access_key_id='' | |
secret_key='' | |
associate_tag='-22' | |
region='JP' | |
comic=u'ONE PIECE' | |
xmlns='{http://webservices.amazon.com/AWSECommerceService/2011-08-01}' | |
node=2278488051#本>漫画・アニメ・BL>コミック | |
zassi_node=13384021#本>雑誌 | |
import bottlenose |
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 | |
access_key_id='' | |
secret_key='' | |
associate_tag='-22' | |
region='JP' | |
xmlns='{http://webservices.amazon.com/AWSECommerceService/2011-08-01}' | |
import bottlenose | |
from xml.etree.ElementTree import fromstring | |
def getASIN(): | |
amazon=bottlenose.Amazon(access_key_id,secret_key,associate_tag,Region=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
! unusing en-mark key next to BackSpace -> backslash (bar when push shift) | |
keycode 132 = backslash bar | |
! unusing right bracket next to enter -> return | |
keycode 51 = Return | |
! unusing muhenkan and henkan next to space -> space | |
keycode 102 = space | |
keycode 100 = space |
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 -*- | |
""" | |
this is error program | |
これは間違いを示すためのプログラムです。 | |
(1)と(2)のforループはmodels.pyに記述された | |
doctestを複数回テストスイーツに追加してしまいます。 | |
その結果、予期しないテストが実行されてしまいます。 | |
例えば、doctest内でデータベースに値を追加するコードがあったとすると、 | |
複数回同じ値を追加することになります。 | |
""" |
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 django.utils import unittest | |
from django.db.models import get_app, get_apps | |
from django.test import _doctest as doctest | |
from django.test.simple import DjangoTestSuiteRunner,build_suite,doctestOutputChecker,build_test,DocTestRunner,reorder_suite,TestCase,get_tests | |
from django.test import simple | |
my_test_modules=['mytest','awesome'] |
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
# Configuration file for ipython. | |
c = get_config() | |
#------------------------------------------------------------------------------ | |
# InteractiveShellApp configuration | |
#------------------------------------------------------------------------------ | |
# A Mixin for applications that start InteractiveShell instances. | |
# |
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
unless := method( | |
(call sender doMessage(call message argAt(0))) ifFalse( | |
call sender doMessage(call message argAt(1))) ifTrue( | |
call sender doMessage(call message argAt(2))) | |
) | |
westley := Object clone | |
westley trueLove := true | |
princessButtercup := Object clone | |
westley sendMessage := method(princessButtercup unless(trueLove, | |
("It is false" println), ("It is true" println))) |
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
// Seven language "Io" day2 Q1 | |
// fib | |
fib_recur := method(if((call sender doMessage(call message argAt(0))) == 1, 1, | |
if((call sender doMessage(call message argAt(0))) == 2, 1, | |
fib_recur( (call sender doMessage(call message argAt(0))) -1) + | |
fib_recur( (call sender doMessage(call message argAt(0))) -2)))) | |
(fib_recur(1) == 1 and | |
fib_recur(2) == 1 and |
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
% Seven languages "Prolog" day2 | |
fib(1, [1]). | |
fib(2, [1, 1]). | |
fib(N, [Head|[X|[Y|Tail]]]) :- fib(M, [X|[Y|Tail]]), N is M + 1, Head is X + Y. |
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 Image | |
def getpix(img, r, g=0, b=0): | |
ret = [] | |
sizex, sizey = img.size | |
for x in range(sizex): | |
for y in range(sizey): | |
_r, _g, _b, _a = img.getpixel((x, y)) | |
if _r == r and _g == g and _b == b: |
OlderNewer