Skip to content

Instantly share code, notes, and snippets.

View tailriver's full-sized avatar

Shinsuke Ogawa tailriver

View GitHub Profile
@tailriver
tailriver / gist:1651602
Created January 21, 2012 05:48
Bookmarklet of Matrix authorization for Tokyo Tech Portal
javascript:(function(){var c='AAAAAAABBBBBBBCCCCCCCDDDDDDDEEEEEEEFFFFFFFGGGGGGGHHHHHHHIIIIIIIJJJJJJJ';var r=document.body.innerHTML.match(/\[\w,\d\]/g);for(var i=0;i<r.length;i++){document.getElementsByName('message'+(i+3))[0].value=c.charAt(7*(r[i].charCodeAt(1)-String("A").charCodeAt(0))+(r[i].charAt(3)-1));}})();
@tailriver
tailriver / .vimrc
Created January 22, 2012 11:09
.vimrc
" References:
" http://www.kawaz.jp/pukiwiki/?vim#cb691f26
" http://archiva.jp/web/tool/vimrc.html
set nocompatible
set number
set ruler
set cmdheight=1
set laststatus=2
@tailriver
tailriver / HSL_V.dat
Created June 25, 2012 10:33
Schematic Graph of HSL Color Space for certain Vs on ANSYS
! Schematic Graph of HSL Color Space for certain Vs on ANSYS
!
! Requirement:
! ANSYS (FEM software)
!
! Usage:
! File > Read Input from ... [select this file]
! or
! Copy and paste to ANSYS Command Prompt
!
@tailriver
tailriver / gist:3141139
Created July 19, 2012 06:26
D-optimality
input_file <- commandArgs()[6]
output_file <- commandArgs()[7]
search_max <- as.integer(commandArgs()[8])
M <- data.matrix(read.table(input_file))
nrows <- dim(M)[1]
if (search_max < 1) search_max <- nrows
selected_rows <- rep(0, nrows)
@tailriver
tailriver / 1_introduction.tex
Last active December 10, 2015 20:08
makeによるTeX論文作成用タイプセット
\setcounter{chapter}{0}
\chapter{Introduction}
\section{Background}
Lorem ipsum dolor sit amet ...
\section{Purpose}
Lorem ipsum dolor sit amet ...
#!/usr/bin/env perl
use strict;
use warnings;
use List::MoreUtils qw(uniq);
my %bucket;
while (<>) {
tr/\r\n//d;
#!/usr/bin/env perl
use strict;
use warnings;
my @series = (0, 1);
my $f42 = fibonacci(42);
my $f43 = fibonacci(43);
print_count(42, 144);
print_count($f42, $f43);
@tailriver
tailriver / mycalc.F90
Created March 30, 2013 17:49
Polymorphic Fortran by using preprocessor
#ifndef _MYCALC_F90
#define _MYCALC_F90
module mycalc
implicit none
interface mysum
module procedure mysum_I
module procedure mysum_S, mysum_SI
module procedure mysum_C, mysum_CI, mysum_CS
@tailriver
tailriver / sample.pl
Last active December 21, 2015 06:58
Windows + Strawberry Perl + Gnuplotでパイプ処理の場合に文字化けする例
#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use File::Temp qw(tempfile);
my $xlabel = "時刻 [s]";
my $ylabel = "振幅 [m]";
@tailriver
tailriver / abaqus_remove_parameter.pl
Created January 9, 2015 08:48
Remove *parameter from Abaqus input file
#!/usr/bin/env perl
use strict;
use warnings;
if (@ARGV != 1) {
warn "$0 input_with_parameter.inp > output_without_parameter.inp\n";
exit 1;
}