I hereby claim:
- I am allenaven on github.
- I am aven (https://keybase.io/aven) on keybase.
- I have a public key whose fingerprint is D674 B45A F42C 888B 3AEA 40C1 7A58 8D55 9755 D1ED
To claim this, I am signing this object:
# Gets the frequencies returned by the FFT function | |
getFFTFreqs <- function(Nyq.Freq, data) | |
{ | |
if ((length(data) %% 2) == 1) # Odd number of samples | |
{ | |
FFTFreqs <- c(seq(0, Nyq.Freq, length.out=(length(data)+1)/2), | |
seq(-Nyq.Freq, 0, length.out=(length(data)-1)/2)) | |
} | |
else # Even number | |
{ |
## HIDDEN MARKOV MODEL practice... | |
library(RHmm) | |
# Sim up some financial market data... | |
bear <- rnorm(100, -0.01, 0.20) | |
bull1 <- rnorm(100, 0.1, 0.10) | |
bull2 <- rnorm(100, 0.11, 0.08) |
### Function to match a time datum with the closest time in another (for, say, finding water heights) | |
closest.time <- function(in.datum, ref.vec){ | |
return(which.min(abs(difftime(in.datum, ref.vec, units="secs")))) | |
} |
## library(devtools) | |
## source_gist(7489113) | |
## use like this: ggplot(mtcars, aes(x=hp, y=mpg)) + geom_point(aes(col=factor(cyl)), size=3) + t1 | |
t1 <- theme( | |
plot.background = element_blank(), | |
panel.grid.major = element_blank(), | |
panel.grid.minor = element_blank(), | |
panel.border = element_blank(), | |
panel.background = element_blank(), |
import simplegui | |
my_number = int(0) | |
n_stops = int(0) | |
n_stops_on_zero = int(0) | |
is_running = False | |
def timer_handler(): | |
global my_number | |
my_number += 1 |
##### Recreate Cam Davidson Pilon's Python script to sort RGB color values | |
##### using Principal Components Analysis: | |
library(scatterplot3d) | |
## Make a function to plot a series of color values in rectangles: | |
plot_colors <- function(values) { | |
# Note, this function takes an matrix of dimensions (n, 3) of numbers | |
# between 0 and 1 for RGB values. Plotspace is between 0 and 100 for x and y | |
x <- 0:100 |
# The circular conversion/transformation: | |
library(circular) | |
library(ggplot2) | |
k <- rad(360) | |
u <- runif(100000, 0, 359) | |
x <- cos(rad(u) * 2 * pi) / k | |
y <- sin(rad(u) * 2 * pi) / k |
Pct,Won,Lost,Home,Away,Neutral,Diff,Team,Season,Result | |
.878,72,10,39-2,33-8,0-0,12.2,ChicagoBulls,1995-96,1 | |
.841,69,13,36-5,31-7,2-1,12.3,LosAngelesLakers,1971-72,1 | |
.841,69,13,39-2,30-11,0-0,10.8,ChicagoBulls,1996-97,1 | |
.829,68,14,33-6,32-8,3-0,8.2,BostonCeltics,1972-73,0 | |
.840,68,13,28-2,26-8,14-3,9.4,Philadelphia76ers,1966-67,1 | |
.817,67,15,36-5,31-10,0-0,7.2,DallasMavericks,2006-07,0 | |
.817,67,15,40-1,27-14,0-0,9.4,BostonCeltics,1985-86,1 | |
.817,67,15,36-5,31-10,0-0,10.4,ChicagoBulls,1991-92,1 | |
.817,67,15,36-5,31-10,0-0,8.5,LosAngelesLakers,1999-00,1 |
# -*- coding: utf-8 -*- | |
""" | |
Created on Tue Aug 12 23:54:45 2014 | |
@author: Allen | |
""" | |
primes = [2] # Vector of prime numbers: initialize with 2, since that is | |
# a prime number but fails the tests |
I hereby claim:
To claim this, I am signing this object: