Instantly share code, notes, and snippets.

# Kazuki Tanakagogotanaka

• Sort options
Created Nov 28, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
 // Use Gists to store code you would like to remember later on console.log(window); // log the "window" object to the console
Last active Jun 6, 2016 — forked from h2non/libvips-installer.sh
libvips 7.42.x cross-platform simple installer script (supports OSX, Debian, Ubuntu, CentOS, Fedora, Amazon Linux)
View libvips-installer.sh
 #!/bin/sh # # Orinally made by Lovell Fuller for sharp # https://github.com/lovell/sharp # # Usage: # curl -s https://gist.githubusercontent.com/h2non/89bb2f87c6499d0b25f1/raw/bf3d0743107f02f5db2b93c53f7f0e07a1c33112/libvips-installer.sh | sudo bash - #
Created Jan 18, 2016
``````function x = conjgrad(A,b,tol)
%   X = CONJGRAD(A,B) attemps to solve the system of linear equations A*X=B
%   for X. The N-by-N coefficient matrix A must be symmetric and the right
%   hand side column vector B must have length N.
%
%   X = CONJGRAD(A,B,TOL) specifies the tolerance of the method. The
%   default is 1e-10.
%
``````
Last active Jan 18, 2016
ludecomp.c
View ludecomp.c
 #include main(){ long i,j,N=4,NRHS=1,IPIV[N],LDA=N,LDB=N,INFO; double A[N*N],b[N]; /* 変数の説明 N:変数の数 NRHS:右辺の列数 IPIV[N]:Pivot選択の情報 LDA:左辺の行数 LDB:右辺の行数 INFO:ルーチンが成功したかどうかを返す */ /* 配列の引数は列に対して連続になるようにする(例:1行1列の次は2行1列) */
Created Jan 18, 2016
tridiag.c
View tridiag.c
 /*　三重対角行列を係数行列に持つ連立一次方程式の数値解法(掃き出し法)　*/ /*　係数行列A=(a_{i,j})はa_{i,j}=2(if i==j),-1(if |i-j|==1),0(otherwise)である。*/ /*　これは１次元微分方程式の離散化ではよく見かける形式である　*/ #include main(){ int i,j; long N=10,NRHS=1,IPIV[N],LDA=N,LDB=N,INFO; double DL[N-1],D[N],DU[N-1],b[N],h=1./N,hs=h*h;
Created Jan 15, 2016
mini
View gist:6ce2a540caa674793e0d
 (defun _null (x) (eq x NIL)) (defun _or (x y) (if x t (if y t NIL))) (defun _not (x) (if x NIL t)) (defun _and (x y)
Created Jan 15, 2016
brcil.lsp
View gist:c5ac4786386807b2c609
 (load "blockdata.lsp") (load "helper.lsp") (defun match-element (x y) (or (equal x y) (equal y '?))) (defun match-triple (x pat) (every #'match-element x pat))
Created Jan 15, 2016
View test.lsp
 (load "blockdata.lsp") (defun match-element (x y) (or (eq x y) (eq y '?))) (match-element 1 1) (match-element 1 2) (match-element 1 '?) (defun match-triple (x pat)
Last active Aug 29, 2015
Add lat and lng to venue
View gist:8b3c3317b5be971dc755
 Venue.where("latitude IS NULL").map{|v| v.latitude = v.location.lat; v.longitude = v.location.lng;v.save } Venue.where("latitude IS NULL"). Venue.where("dbapp_id IS NULL").each do |v| lat_lng = GogoMaps.get_latlng(v.location.to_pretty_full) rescue next v.latitude = lat_lng[:lat] v.longitude = lat_lng[:lng] v.save end
Last active Aug 29, 2015
CRuby, Feature#10785
View gist:379b00397d494a2b22d2

# Ruby, math.c with Fixnum, after r49449

```require 'benchmark'

print 'cos   '; puts Benchmark.realtime { 10_000_000.times { Math.cos    1    }}
print 'sin   '; puts Benchmark.realtime { 10_000_000.times { Math.sin    1    }}
print 'tan   '; puts Benchmark.realtime { 10_000_000.times { Math.tan    1    }}
print 'acos  '; puts Benchmark.realtime { 10_000_000.times { Math.acos   1    }}
print 'asin  '; puts Benchmark.realtime { 10_000_000.times { Math.asin   1    }}
print 'atan  '; puts Benchmark.realtime { 10_000_000.times { Math.atan   1    }}```
You can’t perform that action at this time.