Skip to content

Instantly share code, notes, and snippets.

View nojima's full-sized avatar
o_O

Yusuke Nojima nojima

o_O
View GitHub Profile
JA: 昼食 会 に 1 0 人 を 招待 し た 。
EN: We asked ten people to the luncheon .
Output: A one invited ten people to the meeting .
JA: 彼女 の 言葉づかい に は 誤り が 多い 。
EN: Her grammar is bad .
Output: Her heart 's beating wildly .
JA: その 文書 に は その 戦い が 1 7 0 0 年 に 起こっ た と 記録 さ れ て いる 。
EN: The document records that the war broke out in 1700 .
@nojima
nojima / jq_recipes.md
Last active September 20, 2017 01:36

jq レシピ集

JSON オブジェクトの特定のキーの値を出力する

. に続けて所望するキー名を書く。

例:

$ echo '{"foo": "hello", "bar": "world"}' | jq -r '.foo'

KMCカントー例会 入館方法

  • 日時: 9/2 (土) 18:00~
    • 17:00 ぐらいから入室可能です。
  • 場所: サイボウズ株式会社 東京オフィス

入館方法

@nojima
nojima / bpf_fs_operation_distribution.py
Last active December 6, 2017 15:22
open() や stat() などのレイテンシの分布を一定の間隔で出力するやつ。
#!/usr/bin/python
from __future__ import print_function
from bcc import BPF
import argparse
import time
import datetime
import sys
import ctypes
from logging import getLogger, StreamHandler, DEBUG
from typing import Tuple, Iterator, Dict
import chainer.functions as F
import chainer.links as L
import numpy as np
from chainer import Variable, optimizers, serializers, Chain
from chainer.utils import walker_alias
from scipy.spatial.distance import cosine
from sklearn.manifold import TSNE
import numpy as np
import pandas as pd
import chainer
from chainer import cuda, Function, gradient_check, Variable, optimizers, serializers, utils, Link, Chain, ChainList
import chainer.functions as F
import chainer.links as L
from sklearn import datasets
import matplotlib.pyplot as plt
from typing import Tuple, Iterator
import numpy as np
import pandas as pd
import chainer
from chainer import cuda, Function, gradient_check, Variable, optimizers, serializers, utils, Link, Chain, ChainList
import chainer.functions as F
import chainer.links as L
from sklearn import datasets
import matplotlib.pyplot as plt
from typing import Tuple
@nojima
nojima / calc.rs
Last active July 17, 2017 08:44
整数の足し算と掛け算ができるやつ。
use std::io::{self, Read, Write};
use std::process::exit;
use std::error::Error;
use std::fmt;
// 型宣言 ////////////////////////////////////////////////////////////////////////
// ParseError -----------------------------------
#[derive(Debug)]
from typing import Optional, Iterator, Tuple
import unittest
class Matcher:
def match(self, string: str) -> Iterator[int]:
raise NotImplementedError()
class ZeroMatcher(Matcher):

Design Patterns for Infra Development

インフラ開発で使えるデザインパターンを雑に集めるページ。 パターン名は適当。

Fail Fast

  • エラーが起こったら余計なことはせずに即座にエラーメッセージを出力して終了すること。
  • エラー処理の基本。