Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <unistd.h>
#include "gl.h"
https://www.youtube.com/watch?v=hIqEHc9_Bwo
https://www.youtube.com/watch?v=PwedoZZHadY
https://www.youtube.com/watch?v=tM_HRwqKzFk
https://www.youtube.com/watch?v=zufLcLT8fmI
https://www.youtube.com/watch?v=hdNHKUCbNmE
https://www.youtube.com/watch?v=4Ge2h8Apgd8
https://www.youtube.com/watch?v=wBkvzbw5cDM
https://www.youtube.com/watch?v=-8KmEO0hrz0
https://www.youtube.com/watch?v=gBLalqndgYQ
https://www.youtube.com/watch?v=QgmTsvIMD-k
@i2pi
i2pi / love_simple.R
Last active June 22, 2021 06:27
Love Simple

love

@i2pi
i2pi / jformat.c
Created May 25, 2012 18:09
jformat
/*
** Disk Funtions **
⁄ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ∑
≥ JAOS 0.0.1 - Josh and Andrew's Operating System ∫
√ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ∂
≥ THIS IS DESIGNED FOR VERSION 0.0.1 OF THE JAOS CODE ∫
√ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ∂
≥ ∫
ld += ldd;
if(ld>0.5f) ld -= 1.0f;
ldd += ledg * (lddd - ldd);
lde *= 0.99983f; //decay
tmp = lf + lm * lde;
if(tmp<0.0f) tmp=0.0f; else if(tmp>1.1f) tmp=1.1f; lf1 -= tmp * (lf0 + lq * lf1 + lde * ld);
lf0 += tmp * lf1;
tmp = 0.45f * lf0;
if(tmp>0.10f) tmp = 0.12f;
l += tmp;
@i2pi
i2pi / gist:2155443
Created March 22, 2012 03:36
sierpinski
s=embed(rt(5,1),2);plot(t(replicate(1e4,s[4,]<<-(s[4,]+s[sample(3,1),])/2)),cex=.1)
@i2pi
i2pi / gist:1881742
Created February 22, 2012 05:40
ml_talk.R
#
# This file gives a quick demonstration of a few ML techniques that
# are available in R. The file is designed as a walk through, so instead
# of simply running the entire file at once, copy and paste the logical
# blocks and check the output as we go along.
#
# Joshua Reich (josh@simple.com)
# April 2, 2009
# Updated: February 21, 2012
#
> difftime(end_day, start_day)
Time difference of 209.0417 days
> difftime(end_day, start_day, 'day')
Time difference of 208.8333 days
> start_day
[1] "2011-06-01 EDT"
> end_day
[1] "2011-12-27 EST"
lm(formula = Convert ~ factor(form_version), data = round1)
Residuals:
Min 1Q Median 3Q Max
-0.4963 -0.4478 -0.3778 0.5522 0.6222
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.496296 0.042682 11.628 <2e-16 ***
factor(form_version)1 -0.118519 0.060362 -1.963 0.0499 *
d <- read.csv('even_sample.csv')
# Fake
d$Convert <- (runif(nrow(d)) < 0.27)
sent <- aggregate(rep(1, nrow(d)), list(Date=d$Date), sum)
conv <- aggregate(d$Convert, list(Date=d$Date), sum)
by_date <- merge(sent,conv, by='Date')
colnames(by_date)[2:3] <- c('sent', 'conv')