Skip to content

Instantly share code, notes, and snippets.

View shabbychef's full-sized avatar
tcb

Steven Pav shabbychef

tcb
View GitHub Profile
suppressMessages({
library(shiny)
library(ggplot2)
library(dplyr)
library(tidyr)
library(viridis)
library(Rcpp)
})
init_x <<- c(-1,1)
init_y <<- c(-1,1)
@shabbychef
shabbychef / negroni_plot.r
Created April 19, 2020 05:24
negroni plot
library(dplyr)
library(ggplot2)
library(ggpattern)
library(cocktailApp)
data(cocktails)
# geometry of the tumblers
botwid <- 0.8
topwid <- 1.0
height <- 0.9
@shabbychef
shabbychef / candidates_1962.pgn
Last active December 30, 2019 05:51
1962 Candidates Tournament PGN file
[Event "FIDE (25) 1961-1963"]
[Site "Curacao ct"]
[Date "1962.05.??"]
[Round "1"]
[White "Benko, P. (wh)"]
[Black "Fischer, R. (bl)"]
[Result "1/2-1/2"]
[ECO "A49"]
1. g3 g6 2. Bg2 Bg7 3. d4 c5 4. c3 Qb6 5. Nf3 Nf6 6. O-O O-O 7. d5 d6
@shabbychef
shabbychef / Dockerfile
Created December 30, 2019 00:34
Dockerfile to check MarkowitzR as CRAN with atlas
#
# dockerfile to CRAN-check with r-base
#
# docker build --rm -t shabbychef/markcheck .
#
# docker run -it --rm --volume $(pwd):/srv:rw --volume /tmp:/tmp:rw shabbychef/markcheck
#
# Created: 2016.01.10
# Copyright: Steven E. Pav, 2016
# Author: Steven E. Pav
@shabbychef
shabbychef / xmas_tree.r
Created December 18, 2019 16:37
generate christmas tree maze in R
library(TurtleGraphics)
library(mazealls)
set.seed(1234)
turtle_init(900,2000,mode='clip')
turtle_up()
turtle_hide()
turtle_do({
turtle_left(180)
turtle_forward(700)
@shabbychef
shabbychef / this_do_crash.r
Created January 27, 2019 06:52
this causes segfaults for fromo. sad.
library(fromo)
set.seed(1234)
nel <- 20
xna <- rnorm(nel)
xna[xna < -0.5] <- NA
xall <- list(rnorm(nel),
xna,
as.integer(rnorm(nel,sd=100)))
@shabbychef
shabbychef / improved_moment_estimator_snr.ipynb
Last active March 5, 2018 06:04
Jupyter notebook with sympy for finding an improved moment-based estimator of Signal Noise ratio. No pasaran.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shabbychef
shabbychef / confirming.r
Created February 9, 2018 06:56
confirming a theorem regarding the asymptotic expectation and variance blah blah blah
library(matrixcalc)
# linear algebra utilities
# quadratic form x' A x
qform <- function(A,x) { t(x) %*% (A %*% x) }
# quadratic form x A x'
qoform <- function(A,x) { qform(A,t(x)) }
# outer gram: x x'
ogram <- function(x) { x %*% t(x) }
# A kron A
@shabbychef
shabbychef / trimaze.logo
Last active September 23, 2017 06:31
hexagonal maze generator in logo
@shabbychef
shabbychef / mazer.logo
Created September 21, 2017 04:37
make a maze in jslogo