Skip to content

Instantly share code, notes, and snippets.

View tkamishima's full-sized avatar

Toshihiro Kamishima tkamishima

View GitHub Profile
@tkamishima
tkamishima / gist:17f4fa0a2888088bf4d43d0c5e7230eb
Last active July 20, 2023 13:27
Normal distribution on Adobe Illustrator
const start = -300;
const end = 300;
const step = 1;
const sigma = 100;
var anchorpoint = [];
for (var x = start; x <= end; x += step) {
var y = 00 * (1 / Math.sqrt(2.0 * Math.PI * sigma * sigma)) * Math.exp(- x * x / (2 * sigma * sigma));
anchorpoint.push([x, y]);
}
@tkamishima
tkamishima / math_symbol.txt
Last active June 7, 2021 20:35
Mathematical symbols registered in the ATOK
!!ATOK_TANGO_TEXT_HEADER_1
!!一覧出力
!!単語種類;登録単語(*)
!!読み範囲;(読みの先頭) → (読みの最終)
!!出力日時;21/06/08 05:34
& ‖ 単漢字*
& ¬ 単漢字*
& ∠ 単漢字*
& ∮ 単漢字*
@tkamishima
tkamishima / shuffle_lines.py
Created May 15, 2021 00:42
2021-05-15 マスターアルゴリズム 抽選スクリプト
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Lotterry
Description
===========
Random shuffle lines
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tkamishima
tkamishima / hg_index.ipynb
Last active January 29, 2021 10:22
citation indexes: h & g-index
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# https://github.com/github/gitignore/blob/master/Python.gitignore
# Mac OS -----------------------------------------------------------------------
.DS_Store
._*
@tkamishima
tkamishima / numerical_errors.ipynb
Created September 22, 2018 04:34
数値計算の誤差
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tkamishima
tkamishima / demo_loadbalanced_view.ipynb
Created May 9, 2018 16:38
IPython notebook samples
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tkamishima
tkamishima / gist:7d11fea6c78e90477c6810479e194ec6
Created May 7, 2018 08:49
iterate arrays that is composed of the last two dimensions
In [58]: a = np.arange(72).reshape(3, 2, 3, 4)
In [59]: for index in np.ndindex(*(list(a.shape)[:-2])):
...: print(a[index])
...:
[[ 0 1 2 3]
[ 4 5 6 7]
[ 8 9 10 11]]
[[12 13 14 15]
[16 17 18 19]
@tkamishima
tkamishima / inner_function.py
Created January 21, 2018 03:04
How can I call function defined in a method
class A(object):
def fun_a(self):
def fun_ab(x):
print(x)
fun_ab('def')