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
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
# 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
# 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
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 |
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
pbcopy | "$TM_SELECTED_TEXT" | |
osascript << END | |
tell application "Terminal" | |
activate | |
do script with command "%paste" in window 1 | |
end tell | |
tell application "TextMate" | |
activate | |
end tell | |
END |
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 SimpleCV as scv | |
import pygame | |
def selectroi(numpyArray): | |
""" | |
upperLeft, lowerRight, twoOrFourPartitions = selectroi(numpyArray) | |
""" | |
roiSelector = ROISelector(numpyArray) | |
upperLeft, lowerRight, twoOrFourPartitions = roiSelector.doDisplay() |
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
contour = np.array([[182, 181, 180, 179, 179, 178, 178, 177, 177, 178, 178, 179, 179, | |
180, 180, 181, 181, 184, 185, 186, 187, 188, 190, 192, 193, 195, | |
195, 199, 199, 200, 201, 203, 208, 211, 211, 210, 210, 209, 209, | |
208, 208, 207, 207, 205, 205, 196, 195, 194, 193, 182], | |
[206, 207, 207, 208, 209, 210, 211, 212, 213, 214, 217, 218, 221, | |
222, 224, 225, 226, 229, 229, 230, 230, 231, 231, 233, 233, 235, | |
236, 240, 241, 242, 242, 244, 244, 241, 233, 232, 229, 228, 225, | |
224, 223, 222, 220, 218, 217, 208, 208, 207, 207, 206]]) | |