ゼロ近傍で傾きを持ち、x→±∞ で f(x) → ±1 or ±π/2 になる関数、ようするに図1の5つの関数を集めてみた。
図1: グーデルマン関数 gd(x)、誤差関数 erf(x)、tanh(x)、ランジュバン関数 L(x)
| #!/usr/bin/env python | |
| # delxattr.py recursively removes all extended attributes (xattr) from | |
| # all files and directories under the current or given directory. | |
| # In the latest Mac OS X, you can do the same thing with "xattr -rc". | |
| # See a help of xattr with "xattr -h". | |
| # Author: Takeshi NISHIMATSU | |
| # Gist: https://gist.github.com/t-nissie/8491009 | |
| # Example1$ delxattr.py | |
| # Example2$ delxattr.py ../foo | |
| # Example3$ delxattr.py ~/foo |
| #!/bin/sh | |
| # gnuplot-safari-emacs.sh | |
| # Edit and execute a GNUPLOT script on Emacs | |
| # while previewing an SVG file with Safari on Mac OS X. | |
| # Author: Takeshi NISHIMATSU | |
| # Gist: https://gist.github.com/t-nissie/ | |
| # Usage: | |
| # (1) Put this gnuplot-safari-emacs.sh in /usr/local/bin/. | |
| # (2) Add following 3 lines at the end of your GNUPLOT script foo.gp. | |
| # #Local variables: |
| // crd2enex.cpp | |
| // Description: cardfile (.crd file of Windows 3.1) to Evernote export format (.enex) converter | |
| // Copyright (C) 2014,2015 Takeshi Nishimatsu | |
| // Gist: https://gist.github.com/t-nissie/9771048 | |
| // Compile: g++ -Wall -g -o crd2enex crd2enex.cpp | |
| // Usage: ./crd2enex English.crd > English.enex | |
| // ./crd2enex Japanese.crd | nkf -S -w > Japanese.enex | |
| // Bug: If a card has <> or [] in its text, its converted note will be irregular. | |
| // You can find the irregularity by synchronization failure of the note. | |
| // Please fix the irregular note manually. |
| #!/usr/bin/env gnuplot | |
| # histogram.gp | |
| # Time-stamp: <2014-05-21 11:50:24 takeshi> | |
| # Author: Takeshi NISHIMATSU | |
| # Gist: https://gist.github.com/t-nissie/24cc524481474bb497c5 | |
| ## | |
| set terminal postscript portrait color dashed "Times-Roman" 20 | |
| set output "histogram.eps" | |
| set ylabel 'count' | |
| bin(x,width)=width*floor(x/width)+width/2 |
“Serial evaluation occurs only in parentheses
and is guaranteed to proceed in left to right order.
The value of the rightmost subexpression is returned.
(GNUPLOTのhelp operator binaryより)”
例えば、(y=$3<10 ? $3 : lasty, lasty=$3, y)。
以下のsample.gpでは1つ前の値をlastyに取っておいて、ノイズを消すのに使っている。
データの簡単な微分に使うこともできる→
http://www.ss.scphys.kyoto-u.ac.jp/person/yonezawa/contents/program/gnuplot/diff_data1.html 。
周期Tの三角波を生成するにはabs(mod(i,T)-T/2)-T/4とする。
ここで、i=0,1,2,3,...。
また、Tは4の倍数である必要がある。
この文章は Gist https://gist.github.com/t-nissie/0325fc29d833e0aa6f4d に置いてある。
git clone https://gist.github.com/0325fc29d833e0aa6f4d.git triangle_waveもしくは
git clone git@gist.github.com:0325fc29d833e0aa6f4d.git triangle_waveでクローンできる。
In Fortran, SYSTEM_CLOCK() internal subroutine is commonly used for timing.
However, on some platforms, it is difficult to measure a
time interval longer than one day, bucause the counter is reset once a day.
Here is a list of COUNT_RATE and COUNT_MAX from
CALL SYSTEM_CLOCK(COUNT, COUNT_RATE, COUNT_MAX) on various platforms.
手もとでGFM (GitHub Flavored Markdown) ファイルをHTMLファイルに変換する簡単なRubyスクリプトgfm2html.rbを下に置きました。 github-markdownを用いています。 google-code-prettifyを使えばsyntax highlightができることが特徴です。 簡単なCSSファイルを用意して使います。例としてstyle.cssが下に置いてあります。
この文章は Gist https://gist.github.com/t-nissie/c415b7da3a694e82d6b5 に置いてあります。
git clone https://gist.github.com/c415b7da3a694e82d6b5.git gfm2htmlでクローンできます。