Skip to content

Instantly share code, notes, and snippets.

@rokujyouhitoma
rokujyouhitoma / YRPgunso.md
Created May 3, 2020 00:30 — forked from ryunosinfx/YRPgunso.md
YRP 軍曹が携帯電話開発の現状を語る 

引用元

https://lolipop-teru.ssl-lolipop.jp/gunsou/index.html

253 名前:YRP常駐from群馬 投稿日:04/07/24 21:42

俺たちは、仕様も知らされぬまま横須賀に送り込まれた。

依頼主も孫請けらしく、正確な情報はかなり伝言ゲーム的にそれも口頭でしか伝えられない。 俺たちは、経験5年の軍曹1人と、経験2年の上等兵1人と、新人の2等兵3人の小隊だった。 現地に就くなり、現場は火を噴いた有様だった。果てしないデバッグの果てに

@rokujyouhitoma
rokujyouhitoma / sample.py
Created June 22, 2018 04:34
context decorator
# See: https://blog.amedama.jp/entry/2015/10/16/224740
import inspect
def context(session = Session):
def _decorator(func):
def __decorator(*args, **kwargs):
name = "context"
value = "some thing"
try:
args_names = inspect.getargspec(func)[0]
target_pos = args_names.index(name)
@rokujyouhitoma
rokujyouhitoma / example.py
Created June 12, 2018 06:39
example apscheduler(TwistedScheduler)
rom datetime import datetime
from apscheduler.schedulers.twisted import TwistedScheduler
from scrapy.crawler import CrawlerProcess
from scrapy.crawler import CrawlerRunner
from scrapy.utils.project import get_project_settings
from scrapy.utils.log import configure_logging
from twisted.internet import reactor, defer
spiders = []
@rokujyouhitoma
rokujyouhitoma / main.py
Created June 5, 2018 02:22
convert wikipedia titles to mecab
import codecs
import re
import sys
import unicodedata
REGEXP_ALIAS = re.compile(r'_\(.*?\)')
REGEXP_NUMBER = re.compile(r'^[0-9]+$')
def IsSyllabaryType(char, syllabaryType):
return unicodedata.name(char).startswith(syllabaryType)
@rokujyouhitoma
rokujyouhitoma / class_get_executed_function.py
Last active May 30, 2018 09:36
Pythonのクラスにexecで評価したfunctionオブジェクトを生やす
environment = {}
input1 = '''
def say(self):
print("hello")
print(self.NAME)
self.hoo("say! hoo!")
'''
func_string = '''
@rokujyouhitoma
rokujyouhitoma / gist:462cccbfaa45017ccfa27982695b25ed
Last active May 1, 2017 08:21
乱数生成器の乱数をピアソンのカイ二乗検定で検定
// 参考
// 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;
@rokujyouhitoma
rokujyouhitoma / gist:17fa8370362fc7a37c7c2cce0de5a98f
Created April 27, 2017 02:12
Event, EventTarget, EventListener
var Event = function(type, target, sender, payload){
this.type = type;
this.target = target;
this.sender = sender;
this.payload = payload;
};
var EventTarget = function(){
this.eventListeners = [];
};
@rokujyouhitoma
rokujyouhitoma / gist:56b877a62db83ad631880146e6e3983e
Created August 25, 2016 08:09
cyzipfile loop 100 test/test_zipfile.py
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)
$ 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
@rokujyouhitoma
rokujyouhitoma / gist:f436ebadd66694153d1bf00c969f33b3
Created August 16, 2016 03:42
Dockerfile for Python2.7.11 on Centos7
FROM centos:centos7
MAINTAINER Ike Tohru "tohru.ike@itakoh.co.jp"
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