Skip to content

Instantly share code, notes, and snippets.

@benrasmusen
benrasmusen / statistics-distributions.js
Created October 4, 2011 15:44
JavaScript library for calculating critical values and upper probabilities of common statistical distributions
/*
* NAME
*
* statistics-distributions.js - JavaScript library for calculating
* critical values and upper probabilities of common statistical
* distributions
*
* SYNOPSIS
*
*
@Robsteranium
Robsteranium / statistics-distributions.js
Created May 11, 2012 20:20 — forked from benrasmusen/statistics-distributions.js
JavaScript library for calculating critical values and upper probabilities of common statistical distributions
/*
* NAME
*
* statistics-distributions.js - JavaScript library for calculating
* critical values and upper probabilities of common statistical
* distributions
*
* SYNOPSIS
*
*
@dherman
dherman / javascript.js
Created November 28, 2012 00:27
javascript
(({}+[])[!![]+!![]+!![]]+[]+(![]+[])[+!![]]+(+(!![]+!![]+!![]+[]+(+!![])))[(!![]+[])[+![]]+[]+({}+[])[+!![]]+[][(![]+[])[!![]+!![]+!![]]+[]+(![]+[])[!![]+!![]]+([][![]]+[])[!![]+!![]+!![]+!![]+!![]]+({}+[])[!![]+!![]+!![]+!![]+!![]]+(!![]+[])[!![]+!![]+!![]]][({}+[])[!![]+!![]+!![]+!![]+!![]]+[]+(![]+[])[+!![]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]](+[![]]+[]+(!![]+[])[({}+[])[!![]+!![]+!![]+!![]+!![]]+[]+({}+[])[+!![]]+([][![]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+![]]+(!![]+[])[+!![]]+([][![]]+[])[+![]]+({}+[])[!![]+!![]+!![]+!![]+!![]]+(!![]+[])[+![]]+({}+[])[+!![]]+(!![]+[])[+!![]]])[(![]+[])[+![]]+[]+([][![]]+[])[!![]+!![]+!![]+!![]+!![]]+(![]+[])[!![]+!![]]+(!![]+[])[+![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+!![]]]([][({}+[])[!![]+!![]+!![]+!![]+!![]]+[]+({}+[])[+!![]]+([][![]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+![]]+(!![]+[])[+!![]]+([][![]]+[])[+![]]+({}+[])[!![]+!![]+!![]+!![]+!![]]+(!![]+[])[+![]]+({}+[])[+!![]]+(!![]+[])[+!![]]][({}+[])[!![]+!![]+!![]+!![]+!![]]+[]+({}+[])[
@YujiSODE
YujiSODE / statistics-distributions.js
Created July 21, 2016 06:25 — forked from Robsteranium/statistics-distributions.js
JavaScript library for calculating critical values and upper probabilities of common statistical distributions
/*
* NAME
*
* statistics-distributions.js - JavaScript library for calculating
* critical values and upper probabilities of common statistical
* distributions
*
* SYNOPSIS
*
*
@YujiSODE
YujiSODE / stRank.js
Last active June 17, 2017 01:44
the function returns a rank object available for the statistical rank test, by a given array A.
/*stRank.js
*
* Copyright (c) 2017 Yuji SODE <yuji.sode@gmail.com>
*
* This software is released under the MIT License.
*/
//it returns a rank object available for the statistical rank test, by a given array A.
/*
* A=[a0, ..., an]; the all aj in A is numerical data.
* rank of x: O.x=[rank,count,true rank].
@YujiSODE
YujiSODE / uCal.js
Last active August 2, 2016 10:33
It returns value of u for Mann–Whitney U test.
/*it returns value of u estimated with two given array: A and B, for Mann–Whitney U test.
* returned value is [u, u approximated with standard normal distribution, the maximum sample size].
* reference:
* Mann, H. B., and Whitney, D. R. 1947. On a Test of Whether one of Two Random Variables is Stochastically Larger than the Other. Ann. Math. Statist. vol. 18 , no. 1, p. 50-60.
*/
var uCal=function(A,B){
//A=[a0, ..., an] and B=[b0, ..., bn]; the all element in both Arrays is numerical data.
var slf=this.window,C=[],R2=0,I=0,u=0,u1=0,u2=0,n1=A.length,n2=B.length,Obj;
//------------------------------------------------------
//it returns a rank object available for the statistical rank test, by a given array A.
@YujiSODE
YujiSODE / csv2GnuplotData.js
Created September 20, 2016 11:01
it converts csv formatted text data into tab separated data for gnuplot.
//csv2GnuplotData.js
//it converts csv formatted text data into tab separated data for gnuplot
function csv2GnuplotData(title,csv){
var slf=this.window,_csvD=csv.split(/,/),N=_csvD.length,I=0,txt='#'+title+'\n'+'#N='+N+'\n';
var saveD=function(a){slf.location.href='data:application/octet-stream,'+encodeURIComponent(a);};
while(I<N){txt+=I+'\t'+_csvD[I]+'\n',I+=1;}
txt+='#EOF';
saveD(txt);
}
/* Copyright (c) 2016 Yuji SODE <yuji.sode@gmail.com>
@mignonstyle
mignonstyle / markdown-cheatsheet.md
Last active July 16, 2024 03:26
Markdown記法 チートシート

Block Elements ## Headers 見出し 先頭に#をレベルの数だけ記述します。 ```

見出し1

見出し2

見出し3

見出し4

見出し5
見出し6
## 見出し2
### 見出し3
#### 見出し4
##### 見出し5
###### 見出し6 ## Block 段落 空白行を挟むことで段落となります。 ```
段落1
(空行)
段落2
``` 段落1 段落2 ## Br 改行 改行の前に半角スペース` `を2つ記述します。 ```
hoge
fuga(スペース2つ)
piyo
``` hoge
fuga piyo ## Blockquotes 引用 先頭に`&gt;`を記述します。ネストは`&gt;`を多重に記述します。 ```
&gt; 引用 &gt; 引用
&gt;&gt; 多重引用
``` &gt; 引用 &gt; 引用
&gt;&gt; 多重引用 ## Code コード `` `バッククオート` `` 3つ、あるいはダッシュ`~`3つで囲みます。 ```
print 'hoge'
``` ```
print 'hoge'
``` ### インラインコード `` `バッククオート` `` で単語を囲むとインラインコードになります。 ```
これは `インラインコード`です。
``` これは `インラインコード`です。 ## pre 整形済みテキスト 半角スペース4個もしくはタブで、コードブロックをpre表示できます ``` class Hoge def hoge print 'hoge' end end
``` class Hoge def hoge print 'hoge' end end ## Hr 水平線 アンダースコア`_` 、アスタリスク`*`、ハイフン`-`などを3つ以上連続して記述します。 ```
hoge
***
hoge
___
hoge
---
``` hoge
***
hoge
___
hoge
--- # Lists ## Ul 箇条書きリスト ハイフン`-`、プラス`+`、アスタリスク`*`のいずれかを先頭に記
@YujiSODE
YujiSODE / touch2MouseEvt.js
Last active January 17, 2017 16:50
function simulates mouse event via touch event.
//touch2MouseEvt.js
//Copyright (c) 2017 Yuji SODE <yuji.sode@gmail.com>
//this function simulates mouse event via touch event.
function touch2MouseEvt(e){
//e is event object
e.preventDefault();
if(!!e.changedTouches&&e.changedTouches.length>0){
var touch0=null,
/*function simulates new mouse event*/
newMEvt=function(EventName,tObj,tgt){
@YujiSODE
YujiSODE / multiCount.js
Created February 14, 2017 07:23
Function returns function for multiple count.
//multiCount.js
//this function returns function for multiple count
function multiCount(){
//n is integer, no less than 0
var mC=function(n){
//n is integer, no less than 0
if(+n<0){throw new Error('n<0');}
mC.c[n]=(mC.c[n]!==undefined)?mC.c[n]+1:1;
return mC.c;
};