This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [tsOffsets, instantRate] = calcCrossCorrelogram(ts1, ts2, window) | |
% INPUT: | |
% ts1 - timestamp array, center of cross-correlogram | |
% ts2 - timestamp array | |
% window - the window of the timestamps to compute, e.g. [-0.1 0.1] for | |
% 0.1 seconds around each spike in ts1. | |
% | |
% OUTPUT: | |
% tsOffsets - the offsets from each spike in ts1 that has spikes nearby | |
% instantRate - 1/ISI of each spike in ts1 that has spikes nearby |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Setting up the Audio Session... | |
// Initialize and configure the audio session, and add an interuption listener | |
AudioSessionInitialize(NULL, NULL, sessionInterruptionListener, self); | |
UInt32 audioCategory = kAudioSessionCategory_PlayAndRecord; | |
AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(audioCategory), &audioCategory); | |
// Allow iPod audio to continue to play while the app is active. | |
UInt32 flag = 1; | |
AudioSessionSetProperty(kAudioSessionProperty_OverrideCategoryMixWithOthers, sizeof(flag), &flag); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyopencl as cl | |
import pyopencl.array as cl_array | |
from pyopencl.elementwise import ElementwiseKernel | |
import numpy.linalg as la | |
import numpy as np | |
from time import clock | |
from pylab import * | |
ctx = cl.create_some_context() | |
queue = cl.CommandQueue(ctx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AutoEncoder.h | |
// QuartzTest | |
// | |
// Created by Alex Wiltschko on 6/27/11. | |
// Copyright 2011 __MyCompanyName__. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Lines configured by zsh-newuser-install | |
HISTFILE=~/.histfile | |
HISTSIZE=1000 | |
SAVEHIST=1000 | |
bindkey -e | |
# End of lines configured by zsh-newuser-install | |
# The following lines were added by compinstall | |
zstyle :compinstall filename '/Users/Alex/.zshrc' | |
autoload -Uz compinit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class Opencv < Formula | |
url 'http://cdnetworks-us-2.dl.sourceforge.net/project/opencvlibrary/opencv-unix/2.3.1/OpenCV-2.3.1.tar.bz2' | |
version "2.3.1" | |
homepage 'http://opencv.willowgarage.com/wiki/' | |
md5 "827c9f8aa14384c531c73aa165f9b777" | |
depends_on 'cmake' => :build | |
depends_on 'pkg-config' => :build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install Macports | |
# We'll install a relatively high-level package first, with a lot of dependencies, | |
# so that we pick up everything along the way | |
# Chaco is an enthought plotting package that'll | |
sudo port install py26-chaco | |
sudo port select python python26 | |
sudo port install py26-ipython |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RepeatingTimer(object): | |
""" | |
USAGE: | |
from time import sleep | |
def myFunction(inputArgument): | |
print(inputArgument) | |
r = RepeatingTimer(0.5, myFunction, "hello") | |
r.start(); sleep(2); r.interval = 0.05; sleep(2); r.stop() | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def densify(self, img): | |
windowSize = [3,3] | |
img = img.astype('float32') | |
img[np.isnan(img)] = np.inf | |
while np.isinf(img).sum() > 0: | |
idx = np.isinf(img) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, shelve | |
# Get the current module (for its namespace, so we can fill it with variables) | |
import sys | |
thismodule = sys.modules[__name__] | |
# Get the hidden directory holding our persistence files | |
persistenceDirectory = os.path.expanduser("~/.mySecretData/") # The directory for our persistent data | |
os.system("mkdir -p " + persistenceDirectory) # Make sure the directory exists | |
pathToStateFile = os.path.join(persistenceDirectory, "stateVariables.db") # a persistent set of variables |
OlderNewer