Skip to content

Instantly share code, notes, and snippets.

@feyderm
feyderm / rstudio_vim_keymappings.txt
Created April 13, 2018 00:57
RStudio Vim keymappings
:imap jj <Esc>
:nmap f x
" NB: must be capital 'S', unlike in .vimrc
:map <Space> viw
@feyderm
feyderm / Karatsuba.scala
Created March 4, 2018 16:27
Karatsuba multiplication algorithm
object Karatsuba {
def main(args: Array[String]): Unit = {
def loop(str1: String, str2: String): BigInt = {
val n_digits1 = str1.length
val n_digits2 = str2.length
if (n_digits1 == 1 || n_digits2 == 1) {
BigInt(str1) * BigInt(str2)
} else {
val min_split = List(n_digits1, n_digits2).map(_ / 2).min
@feyderm
feyderm / .gitignore
Last active April 26, 2019 06:25
Concurrent temporal data (pan and zoom)
.eslintrc.js
@feyderm
feyderm / README.md
Last active May 9, 2017 13:48
A change of perspective...

Scroll down to lift top layer; scroll up to stack layers.

@feyderm
feyderm / README.md
Last active April 23, 2017 22:24
Cellular automata
@feyderm
feyderm / index.html
Last active April 21, 2017 15:23
I made a mistake...
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.cell {
height: 10px;
width: 10px;
}
</style>
<body>
@feyderm
feyderm / README.md
Last active April 14, 2017 23:53
Exploring Gradient Descent with Momentum

The green decision boundary uses momentum, while the grey decision boundary does not. Inspired by a recent article on Distill.

@feyderm
feyderm / README.md
Last active March 26, 2017 05:58
k-means clustering

Data are a sample from the S2 dataset of P. Fränti and O. Virmajoki, "Iterative shrinking method for clustering problems", Pattern Recognition, 39 (5), 761-765, May 2006.

Reload to explore local minima.

@feyderm
feyderm / README.md
Last active March 4, 2017 02:55
D3 v4 shape drag

Drag 'em!

@feyderm
feyderm / README.md
Last active February 23, 2017 17:51
Exploring Gradient Decent Parameters for Logistic Regression

Update of bl.ock to include user-supplied parameters and dragging of data points.