万年素人からHackerへの道

万年素人がHackerになれるまで殴り書きするぜ。

  • ・資産運用おすすめ
    10万円は1000円くらい利益
    資産運用ブログ アセマネ
    • ・寄付お願いします
      YENTEN:YYzNPzdsZWqr5THWAdMrKDj7GT8ietDc2W
      BitZenny:ZfpUbVya8MWQkjjGJMjA7P9pPkqaLnwPWH
      c0ban:8KG95GXdEquNpPW8xJAJf7nn5kbimQ5wj1
      Skycoin:KMqcn7x8REwwzMHPi9fV9fbNwdofYAWKRo

    第10回「入門 ソーシャルデータ」真面目に勉強する会 @神泉(渋谷)

    http://atnd.org/events/25514

    facebook__graph__query.py
    →うごかない

    facebook__fql_query.pyの実行(P309)

    python facebook__fql_query.py 'select name,sex, relationship_status from user where uid in (select target_id from connection where source_id = me())'


    sqlalchemyのバグ

    同じ現象
    https://groups.google.com/forum/?fromgroups#!topic/sqlalchemy/mMKAwKWSeus

    http://docs.python.org/py3k/howto/pyporting.html
    あとで読む
    https://github.com/taky/fboauth-pyramid/tree/master/fboauth

    今更だが・・・ Python

    __main__.pyの名前でカレントディレクトリへ保存し、カレントディレクトリで、

    python .

    で実行できる。

    ・__main__.py

    from sys import argv
    
    def a():
        """
        a's __doc__
        --------------------
        """
        print("a")
    
    def b():
        """
        b's __doc__
        --------------------
        """
        print("b")
    
    def c():
        """
        c's __doc__
        --------------------
        """
        print("c")
    
    def d():
        """
        d's __doc__
        --------------------
        """
        print("d")
    
    options = ['a', 'b', 'c', 'd']
    
    if len(argv) == 1 or argv[1] not in options:
        print('')
        for option in options: print('  ->\t%s\t%s'%(option, eval(option).__doc__.split('\n')[1]))
    else: eval(argv[1])()
    

    こうすると

    python . a
    

    python . b
    

    がいける。


    Tespoon + Tornado + Python2.7 on Windows

    teaspoonでハマってしまってる
    https://github.com/marxus85/teaspoon

    Python2.7だとすんなりいけた。
    sqliteではとりあえず問題はなかった。

    engine = create_engine('sqlite+pysqlite:///file.db')
    

    localhostをUserテーブルに保存しないとlocalhostでは繋がらないらしい
    http://dev.mysql.com/doc/refman/5.0/en/connection-access.html

    ・しかしこのようにlocalhostをオミットしてもダメだった

    engine = create_engine('mysql+pymysql://teaspoon:teaspoon@/teaspoon')
    

    Tespoon on Python3

    ■Python3において修正すべき
    ・libs\controller.py

    #from urllib import urlencode #Python2
    #from urlparse import urlsplit #Python2
    from urllib.parse import urlencode #Python3
    from urllib.parse import urlsplit #Python3
    

    ・libs\form_xcode.py

    #from urllib import quote_plus #Python2
    #from urlparse import parse_qsl #Python2
    from urllib.parse import quote_plus #Python3
    from urllib.parse import parse_qsl #Python3