Skip to content

Instantly share code, notes, and snippets.

View ikegami-yukino's full-sized avatar

IKEGAMI Yukino ikegami-yukino

View GitHub Profile
@akirakubo
akirakubo / build-mozc-on-macos-10.13.6.md
Last active April 11, 2020 17:19
Build Mozc with/without Qt on macOS 10.13.6 (or later)

Build Mozc with/without Qt on macOS 10.13.6 (or later)

環境

  • macOS 10.13.6
  • Xcode 10.1 (10B61)

ビルドエラーへの対処

いつの間にかビルドがうまく出来なくなったので対処。

@dhgrs
dhgrs / chainerui.sh
Created July 21, 2018 12:54
chainerui script
function chainerui() {
docker run \
-v $(readlink -f $1):$(readlink -f $1) \
-p ${2:-5000}:5000 \
-d \
--rm \
--name ${2:-5000} \
-it chainer/chainerui:v0.4.0 \
bash -c \
"chainerui project create -d $(readlink -f $1);
@GINK03
GINK03 / tor-requests.md
Last active June 13, 2018 16:11
Tor+Requests

torのインストール

$ sudo apt install tor
$ sudo pip3 install pysocks

requestsで使う

IPがそれぞれ異なる

@nakagami
nakagami / jabstract.py
Last active April 4, 2021 05:31
Japanese summarization module using LexRank algorithm.
#!/usr/bin/env python
# The MIT License (MIT)
# Copyright © 2015 Recruit Technologies Co.,Ltd.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@scapegoat06
scapegoat06 / TopicModelZoo.md
Created February 23, 2018 08:25
Topic Model Zoo
@fukatani
fukatani / hyperopt_chainer.py
Last active February 25, 2019 07:08
How to hyperparameter of deep learning by hyperopt.
try:
import matplotlib
matplotlib.use('Agg')
except ImportError:
pass
import chainer
import chainer.functions as F
import chainer.links as L
from chainer import training
@tam17aki
tam17aki / CFNCell.py
Last active July 20, 2022 06:25
An implementation of Chaos-Free Network (CFN) in TensorFlow
# -*- coding: utf-8 -*-
# Copyright (C) 2017 by Akira TAMAMORI
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
@unnonouno
unnonouno / npz_keys.py
Created April 19, 2017 13:51
npz_keys.py
import sys
import numpy
if __name__ == '__main__':
with numpy.load(sys.argv[1]) as f:
print(f.keys())
@katzchang
katzchang / sleep-well.md
Last active September 21, 2021 02:30
処理が成功するまで実行しつづける - @katzchang.gist

処理が成功するまで実行しつづける

インスタンスの起動スクリプトとかを書いてるときによく欲しいと思うやつです。

例えば、 service nginx start が実行されたあとに curl -i localhost | grep "200 OK" とかをすると、サービスがそれなりに動いていることが確認できてよかったりするのですが、あまりにも直後だとサーバの起動が間に合わず、curl が失敗してしまいます。nginxだとまだましだけど、アプリケーションサーバだとそれなりに時間がかかったりする。

古典的な解決方法は、 sleep 30 です。簡単だけど、アプリケーションが巨大になってくると30秒では起動しないこともある。じゃぁ sleep 60 が妥当か?でも、サーバインスタンスの起動スクリプト全体はできるだけ早く立ち上がってほしい。困った。

なので、curlが成功するまで叩き続ける、みたいなスクリプトに仕上げたくなるわけです。

@masayu-a
masayu-a / gist:64ba39287ae8b3b5b498
Last active December 19, 2019 06:31
BCCWJ Copyright

BCCWJ のうちコピーライトフリーで再配布可能なサンプル

  • OW6X_00000 (コアデータに内包)
  • OW6X_00027
  • OW6X_00165
  • OW6X_00657

BCCWJ の新聞データの取り扱い

  • BCCWJ の新聞データは統計情報であっても商用利用不可
  • BCCWJ の新聞データを含むデータから学習した解析モデルは BSD/GNU などの商用可ライセンスで再配布してはいけない