Skip to content

Instantly share code, notes, and snippets.

View mhagiwara's full-sized avatar

Masato Hagiwara mhagiwara

View GitHub Profile
@mhagiwara
mhagiwara / 201306.txt
Last active December 19, 2015 22:18
トライリンガル子育て日記@ニューヨーク   自然言語処理研究者である自分が子育て中に感じたこと、特に語学や言語教育、言語発達関連の話題を書いていきます。
2013/6/7
誕生!
この病院(NewYork Downtown Hospital)はやはり中国系の看護師・医師が多い。最初に担当してくれた看護師は広東系、麻酔師も中国系。みんなバリバリで英語も中国語も話すのが早い。
誕生前から日本語の五十音をひととおり子宮に向かって話しかけていたが、覚えているかな?
2013/6/8
外婆と初のご対面。病院側から受け取った必要書類に名前、親の情報など必要事項を記入。出生証明書は6週間ほどで送られてくるそうな。
2013/6/9
退院。タクシーにチャイルドシートを無理やり乗っけて恐る恐る帰ってくる。
@mhagiwara
mhagiwara / quotes.txt
Last active August 29, 2015 14:00
Favorite Quotes
"Do the things and you shall have the power" --- Ralph Waldo Emerson
知之者不如好之者、好之者不如樂之者。
"One who knows is no match for one who likes.
One who likes is no match for one who enjoys." --- Confusious
Life has taught us that love does not consist in gazing at each other
but in looking outward together in the same direction. -- Antoine de Saint Exupéry
13 Now listen, you who say, "Today or tomorrow we will go to this or that city,
@mhagiwara
mhagiwara / zhtop1000chars
Last active September 28, 2015 09:42
Chinese top 1000 frequent words and characters (from Chinese TreeBank 3.0)
, 84383
的 64839
。 36088
一 22740
是 21038
国 19095
在 17992
人 14882
有 14032
中 13722
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import math
import random
import sys
from builtins import range
from collections import Counter
## MEMO: Mastering Chaos - A Netflix Guide to Microservices
https://www.youtube.com/watch?v=CZ3wIuvmHeM
- はじめに
- Josh Evans (Netflix)
- ストリーミング・ビジネスにシフトした時に在籍
- マイクロサービスを AWS で走らせる
## MEMO: Introduction to Docker
https://www.youtube.com/watch?v=Q5POuMHxW-0
- docker (dotCloud - platform as a service, Heroku の競合)
- サーバーにコードを出荷するのが難しい → 簡単であるべき!
- 昔 サーバー+LAMP 、現在はもっと複雑(異なる言語、構成、プラットフォーム)
- 各コンポーネント x プラットフォームのマトリックス 全ての組み合わせでテストが通り、期待通り動く
- 昔、同様の問題に着想 → 運搬する物 x 物の種類 のマトリックスに似ている → コンテナ!
- 開発者 → docker (標準コンテナフォーマット) → Ops (運用)
@mhagiwara
mhagiwara / pomo.py
Created September 14, 2018 02:37
Pomodoro timer in command line with 50 lines of Python
#!/usr/bin/env python3
import os
import time
import sys
from datetime import datetime
import pyscreenshot
from PIL import Image
from tqdm import tqdm
import re
from ast import literal_eval
def parse1(code):
"""Approach 1 — use Python's internal literal parser to parse code.
Parameter:
code (str): code string