“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 。
// 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 |
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.
2014年末にリリースのRuby 2.2にはFloat#next_float, Float#prev_floatという機能が新しく追加される。 浮動小数点演算の精度保証などに用途があるらしい。試してみる。
なおIEEE標準の倍精度浮動小数点数は 1ビットの符号ビットと53ビットの有効数字 (significand) と11ビット幅の指数部を持つ。 隠れビット (hidden bit) があるから、合計で1+53+11-1=64ビット幅になっている。 有効数字は10進数ならlog10253=53log102=15.95…だから、16桁程度である。
RubyForge.orgがサービスを縮小させつつあるので、 そのSubversionレポジトリをGitHubに移動させる。 ssh-keyは双方について適宜設定されているものとする。
もっと冴えたやりかた等、ご意見募集中。
- http://dqn.sakusakutto.jp/2012/10/svn-git-github-migration.html 仕事で使ってる巨大SVNレポジトリをGithubに移管するためにやったことまとめ
! is_power2.f -*-f90-*- | |
! is_power2(a) returns .true. if a is power of 2, i.e. a==2**n. | |
! Author: Takeshi Nishimatsu | |
!! | |
logical function is_power2(a) | |
implicit none | |
integer, intent(in) :: a | |
integer :: x | |
x = a | |
if (x<=0) then |
Official version of this document is distributed from https://github.com/cmsi/MateriAppsLive/wiki/GettingStarted .
CAUTION for Beginners: Follow the instructions 1. How to boot MateriApps LIVE! below.
! spinpump.F -*-f90-*- | |
! Fu-Kane spin pump | |
! Shun-Qing Shen: "Topological Insulators: Dirac Equation in Condensed Matters" | |
! (Springer Series in Solid-State Sciences, 2013) Section 4.6 | |
! Liang Fu and C. L. Kane: "Time reversal polarization and a Z_2 adiabatic spin pump", | |
! Phys. Rev. B 74, 195312 (2006). | |
! Time-stamp: <2015-10-07 17:00:57 takeshi> | |
! Author: Takeshi NISHIMATSU | |
! Gist: https://gist.github.com/t-nissie/98aeb84ed30467aa24b7 | |
! Clone: git clone git@gist.github.com:98aeb84ed30467aa24b7.git 04.6.Fu-Kane-spin-pump |