Skip to content

Instantly share code, notes, and snippets.

@jfsantos
jfsantos / index.Rmd
Created August 5, 2012 17:06
My .Rmd test file
---
# My First Slidify Deck
by Joao Felipe Santos
---
### Slide 1
This is an unordered list
@jfsantos
jfsantos / index.html
Created August 5, 2012 17:30
Slidify compilation result
<!DOCTYPE html>
<!--
Google HTML5 slide template
Authors: Luke Mah?? (code)
Marcin Wichary (code and design)
Dominic Mazzoni (browser compatibility)
Charles Chen (ChromeVox support)
@jfsantos
jfsantos / presentation.bib
Created August 5, 2012 23:46
Attachments for issue #11 @ cboettig/knitcitations
@article{Lord1994,
abstract = {Describes the Autism Diagnostic Interview-Revised (ADI-R), a revision of the Autism Diagnostic Interview, a semistructured, investigator-based interview for caregivers of children and adults for whom autism or pervasive developmental disorders is a possible diagnosis. The revised interview has been reorganized, shortened, modified to be appropriate for children with mental ages from about 18 months into adulthood and linked to ICD-10 and DSM-IV criteria. Psychometric data are presented for a sample of preschool children.},
author = {Lord, C and Rutter, M and {Le Couteur}, A},
issn = {0162-3257},
journal = {Journal of autism and developmental disorders},
keywords = {Algorithms,Autistic Disorder,Autistic Disorder: classification,Autistic Disorder: diagnosis,Autistic Disorder: psychology,Caregivers,Caregivers: psychology,Child,Female,Humans,Intellectual Disability,Intellectual Disability: classification,Intellectual Disability: diagnosis,Intellectual Disability: psychology,Intervie
% shepardtones.m - plays the shepard tones
% based on an example I found here: http://hebb.mit.edu/courses/9.29/2003/athena/auditory/matlab/shepardtones.m
% adjustable parameters
max_time = 2; % time for each tone
max_repeat = 3; % number of loops
A = 440; % "base frequency"
num_harm = 7; % number of harmonics used for each tone
sigmasq = 1; % variance of the amplitude for each partial
function groupby{T}(fn::Function, seq::Array{T})
dict = Dict{Any, Array{T}}();
for item in seq
key = fn(item);
if !haskey(dict, key)
dict[key] = [];
end
push!(dict[key], item);
end
return dict;
@jfsantos
jfsantos / test_ccall.jl
Last active October 16, 2018 13:42
Passing structures and arrays back and forth in Julia with ccall
immutable Cdvec
val::Ptr{Cdouble}
len::Clong
end
a = [1.0, 2.0, 3.0]
b = [3.1, 4.2, 7.3]
Ca = Cdvec(pointer(a), length(a))
Cb = Cdvec(pointer(b), length(b))
@jfsantos
jfsantos / test_phone.yaml
Created March 7, 2014 03:59
pylearn2 model using MLPWithSource and CompositeLayerWithSource
!obj:pylearn2.train.Train {
dataset: &train !obj:research.code.pylearn2.datasets.timit.TIMIT {
which_set: 'train',
frame_length: &flen 160,
frames_per_example: &fpe 1,
samples_to_predict: &ylen 1,
n_next_phones: 1,
n_prev_phones: 1,
#start: 0,
#stop: 100,
@jfsantos
jfsantos / build.jl
Last active August 29, 2015 14:01
BinDeps OSX problem
using BinDeps
@BinDeps.setup
@unix_only begin
ecos = library_dependency("ecos",aliases=["libecos"])
end
provides(Sources, URI("https://github.com/ifa-ethz/ecos/archive/master.zip"),
[ecos], os = :Unix, unpacked_dir="ecos-master")
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import wave
import numpy as np
import scipy as sp
WINSIZE=8192
sound='sound.wav'
def read_signal(filename, winsize):