Skip to content

Instantly share code, notes, and snippets.

@cocodrips
cocodrips / app.py
Created April 4, 2018 08:59 — forked from hoto17296/app.py
Nginx + uWSGI + Flask on Amazon Linux
from flask import Flask
application = Flask(__name__)
@application.route("/")
def hello():
return "Hello World!"
@cocodrips
cocodrips / pathlib-test.py
Created November 13, 2017 17:16
Pathlibを使ってみる
We couldn’t find that file to show.
@cocodrips
cocodrips / pytest_parametrize.py
Created August 18, 2017 07:01
pytestのparametrizeで遊ぶ
"""
日付や年月に関する処理
"""
import pytest
@pytest.mark.parametrize('nengo,year,seireki', [
('平成', 29, 2017),
('昭和', 63, 1988)
])
@cocodrips
cocodrips / klass.js
Created August 5, 2017 08:00
jsのクラス的なの作る時
var Test = function () {
console.log('hoge');
};
var Klass = function () {
this.init = function () {
console.log('init');
};
this.f = function () {
@cocodrips
cocodrips / pydata_deeplearning.md
Created July 27, 2017 01:30
PyDataTokyo #DeepLearning会

GPUとDeep Learning

世代

  • tesla -> fermi -> kepler -> maxwell -> pascal -> volta

  • イニシャルがつくので、どこの世代なのかそれを見れば分かる TF: テラフロップス 1秒間に○回対象の演算ができる

  • GeForceは? 各世代に対応したバージョン番号があるのでそれで世代を追う

    • Tesla 6.1 => pascal
  • とりあずここいけば性能確認できる

@cocodrips
cocodrips / pos0_pos1.md
Last active July 19, 2017 02:16
[Open Resources/Japanese Sentiment Polarity Dictionary - 東北大学 乾・岡﨑研究室 / Communication Science Lab, Tohoku University] ( http://www.cl.ecei.tohoku.ac.jp/index.php?Open%20Resources%2FJapanese%20Sentiment%20Polarity%20Dictionary ) の中身を見てみる

pos0, pos1をどちらもみる

1063 名詞(形容動詞語幹)→助動詞(*)
627 名詞(一般)→助動詞(*)
594 形容詞(自立)
507 動詞(自立)
444 名詞(一般)→助詞(連体化)
434 名詞(一般)→助詞(並立助詞)
135 名詞(一般)→助詞(格助詞)→動詞(自立)
@cocodrips
cocodrips / yield_test.py
Created July 5, 2017 02:53
yieldのサンプル
def a_yield_function():
max = 1000
_i = 0
while True:
i = 0
frames = []
for i in range(30):
if _i > max:
yield (frames, 10)
return
import matplotlib
def bg_color(value, min_, max_, center_=None):
min_ = float(min_)
max_ = float(max_)
if center_ is None:
center_ = (max_ - min_) / 2
cmap = matplotlib.cm.get_cmap('coolwarm')
2357111317192329313741434753596167717379838997101103107109113127131137139149151157163167173179181191193197199211223227229233239241251257263269271277281283293307311313317331337347349353359367373379383389397401409419421431433439443449457461463467479487491499503509521523541547557563569571577587593599601607613617619631641643647653659661673677683691701709719727733739743751757761769773787797809811821823827829839853857859863877881883887907911919929937941947953967971977983991997100910131019102110311033103910491051106110631069108710911093109711031109111711231129115111531163117111811187119312011213121712231229123112371249125912771279128312891291129713011303130713191321132713611367137313811399140914231427142914331439144714511453145914711481148314871489149314991511152315311543154915531559156715711579158315971601160716091613161916211627163716571663166716691693169716991709172117231733174117471753175917771783178717891801181118231831184718611867187118731877187918891901190719131931193319491951197319791987199319971999200320112
@cocodrips
cocodrips / send_mail.py
Created March 16, 2017 04:05
Send mail
# -*- coding: utf-8 -*-
import smtplib
from email.mime.text import MIMEText
from email.header import Header
server = 'localhost'
def send(send_from, send_tos, subject, body):
"""