This file contains hidden or 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
同期フロー | |
だいぶ複雑になってしまうけど... | |
=> 同期って...例えば、何が、どこで、どう当たり判定とって、どう共有して、 | |
共有どうしてる? | |
フロー図、シーケンス図の類書いてる? | |
コードベース? | |
サーバサイド | |
クライアントの担当者がデバッグしやすいような施策がある? |
This file contains hidden or 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
TinySegmenter.pyを速度改善してみる。 | |
手抜きで、Cythonでコンパイルするだけでいいかなー。と。 | |
TinySegmenter.pyをPurePythonとCython(型情報なし、PurePythonコードをCythonでコンパイルしただけ)の速度比較した。 | |
結論Cythonでコンパイルするだけで速度改善できた。 | |
更に速度したいなら、 | |
1. Cythonで型情報を付与。 | |
2. Cに持ってく。 |
This file contains hidden or 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
# http://imagingsolution.blog107.fc2.com/blog-entry-137.html | |
def x(p1, p2, p3, p4): | |
s1 = (p4.x - p2.x) * (p1.y - p2.y) - (p4.y - p2.y) * (p1.x - p2.x) | |
s2 = (p4.x - p2.x) * (p2.y - p3.y) - (p4.y - p2.y) * (p3.x - p3.x) | |
(x,y) = p1.x + (p3.x - p1.x) * s1 / (s1 + s2), p1.y + (p3.y - p1.y) * s1 / (s1 + s2) | |
return (x,y) |
This file contains hidden or 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
text = "ab[ffffff]cd[-]ef" | |
print("length: {0}".format(len(text))) | |
#print(text[2]) | |
indexes = [0,2,10,12,15,17] | |
for i in range(0, len(indexes) / 2): | |
sindex = indexes[i*2] | |
eindex = indexes[i*2+1] | |
print("s: {0}".format(sindex)) | |
print("e: {0}".format(eindex)) |
This file contains hidden or 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
/* Generated by Cython 0.22 */ | |
/* BEGIN: Cython Metadata | |
{ | |
"distutils": {} | |
} | |
END: Cython Metadata */ | |
#define PY_SSIZE_T_CLEAN | |
#ifndef CYTHON_USE_PYLONG_INTERNALS |
This file contains hidden or 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
#https://github.com/gevent/gevent/issues/477#issuecomment-56292848 | |
# # Re-add sslwrap to Python 2.7.9 | |
import inspect | |
__ssl__ = __import__('ssl') | |
try: | |
_ssl = __ssl__._ssl | |
except AttributeError: | |
_ssl = __ssl__._ssl2 |
This file contains hidden or 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
def http_connection_send(): | |
import httplib | |
def patch_send(): | |
old_send= httplib.HTTPConnection.send | |
def new_send(self, data, *args, **kwargs): | |
print(data) | |
body = old_send(self, data, *args, **kwargs) | |
return body | |
httplib.HTTPConnection.send = new_send | |
patch_send() |
This file contains hidden or 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 pandas | |
import argparse | |
parser = argparse.ArgumentParser(description='xxx') | |
parser.add_argument('csv', type=argparse.FileType('r')) | |
args = parser.parse_args() | |
csv = args.csv |
This file contains hidden or 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
while true; do date; curl "http://stocks.finance.yahoo.co.jp/stocks/detail/?code=3632.t" 2>/dev/null | grep 'class="stoksPrice"' | awk 'match($0, /[0-9,]+/) {print substr($0, RSTART, RLENGTH)}'; sleep 60; done; |
This file contains hidden or 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 python2 | |
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected]) | |
# The author disclaims copyright to this source code. | |
import sys | |
import struct | |
import socket | |
import time | |
import select |