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
# 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
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
同期フロー | |
だいぶ複雑になってしまうけど... | |
=> 同期って...例えば、何が、どこで、どう当たり判定とって、どう共有して、 | |
共有どうしてる? | |
フロー図、シーケンス図の類書いてる? | |
コードベース? | |
サーバサイド | |
クライアントの担当者がデバッグしやすいような施策がある? |
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
FROM centos:centos7 | |
MAINTAINER Ike Tohru "[email protected]" | |
RUN yum -y update; yum clean all | |
RUN yum -y install epel-release; yum clean all | |
RUN yum -y install python-pip; yum clean all | |
RUN yum groupinstall -y development && \ | |
yum install -y bzip2-devel git hostname openssl openssl-devel sqlite-devel sudo tar zlib-dev |
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
$ emacs . | |
Fatal error 11: Segmentation fault | |
Backtrace: | |
0 emacs 0x000000010009e92f emacs_backtrace + 87 | |
1 emacs 0x0000000100084c4e terminate_due_to_signal + 97 | |
2 emacs 0x000000010009f33a tcsetpgrp_without_stopping + 0 | |
3 emacs 0x000000010009e7d8 maybe_fatal_sig + 0 | |
4 libsystem_platform.dylib 0x00007fff892205aa _sigtramp + 26 | |
5 emacs 0x000000010043bfb8 globals + 0 | |
6 emacs 0x000000010013f948 composition_compute_stop_pos + 1248 |
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
Thu Aug 25 17:02:59 2016 Profile.prof | |
2477285 function calls (2477047 primitive calls) in 1.954 seconds | |
Ordered by: internal time | |
ncalls tottime percall cumtime percall filename:lineno(function) | |
108413 0.295 0.000 0.426 0.000 cyzipfile.pyx:556(readline) | |
288222 0.294 0.000 0.316 0.000 random.py:175(randrange) | |
249 0.232 0.001 0.242 0.001 cyzipfile.pyx:1117(write) |
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
var Event = function(type, target, sender, payload){ | |
this.type = type; | |
this.target = target; | |
this.sender = sender; | |
this.payload = payload; | |
}; | |
var EventTarget = function(){ | |
this.eventListeners = []; | |
}; |
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://blog.amedama.jp/entry/2016/11/20/173932 | |
// http://www.koka.ac.jp/morigiwa/sjs/chi-square_distribution.htm | |
//ピアソンのカイ二乗検定 | |
//http://blog.amedama.jp/entry/2016/11/20/173932 | |
//npi >= 10 | |
var pi = Xorshift.MAX_VALUE; | |
var n = 10000; //標本数 var dist = 10; |
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
environment = {} | |
input1 = ''' | |
def say(self): | |
print("hello") | |
print(self.NAME) | |
self.hoo("say! hoo!") | |
''' | |
func_string = ''' |