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
<!doctype HTML> | |
<meta charset = 'utf-8'> | |
<html> | |
<head> | |
<script src='http://ramnathv.github.io/rCharts/libraries/widgets/polycharts/js/polychart2.standalone.js' type='text/javascript'></script> | |
<style> | |
.rChart { | |
display: block; |
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
<!doctype HTML> | |
<meta charset = 'utf-8'> | |
<html> | |
<head> | |
<script src='http://ramnathv.github.io/rCharts/libraries/widgets/polycharts/js/polychart2.standalone.js' type='text/javascript'></script> | |
<style> | |
.rChart { | |
display: block; |
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
It is a rite of passage to post one's successful build instructions for OpenCV on a Mac | |
after you've tried all the other conflicting instructions out there and still failed. | |
brew failed for me (was this because I could never get a happy brew doctor situation? | |
I'll never know). macports? nope. build-from-source recipes? I didn't find one that | |
worked for me. | |
Here's what did work to build OpenCV 2.4.8 from the distribution tarball using cmake, | |
on Mac OSX 10.9.2, linked to an anaconda installation rather than the system python. | |
It is a mashup of various bits of advice out there. If you're already comfortable with | |
build/install from source, all you need to read is the cmake invocation in step 3 and |
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
options = commandArgs(trailingOnly = TRUE) | |
file1 = options[1] #QTIP file | |
file2 = options[2] #SQL query file | |
field_name = options[3] #not used - replace with what column name to use | |
outpath = options[4] #name of output file | |
file1.df = read.csv(file1, header = TRUE, stringsAsFactors = FALSE) | |
file2.df = read.csv(file2, header = TRUE, stringsAsFactors = FALSE) | |
get.filename = function(x) { |
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
#addHSVtoQTIP.R | |
# | |
#adds HSV (as defined on wikipedia) to mean RGB as computed by QTIP | |
#Mehrdad Yazdani, Feb 2014 | |
in_file = "~/Desktop/kiev_merged.csv" | |
out_file = "~/Desktop/kiev_HSV_added.csv" | |
qtip.features = read.csv(in_file, header = TRUE, stringsAsFactors = FALSE) |
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 | |
import shutil | |
def copyFromListToPath(src_paths, dest_path): | |
for i in range(len(src_paths)): shutil.copy2(src_paths[i], dest_path) | |
def getFilesWithPath(path, filetype = ""): | |
return [os.path.join(path,f) for f in os.listdir(path) if f.endswith(filetype)] |
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
get.filename = function(x) { | |
splitted = strsplit(x, split = "/")[[1]] | |
return(splitted[length(splitted)]) | |
} |
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 csv | |
def return_rows(filename, file_encoding = 'rU'): | |
with open(filename, file_encoding) as f: | |
reader = csv.reader(f) | |
rowsInData = [row for row in reader] | |
return rowsInData |
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 | |
from scipy.linalg import toeplitz | |
def pascal_row(n): | |
row = [1] | |
for col in range(1, n): row.append(row[-1] * (n - col) / col) | |
return numpy.array(row) | |
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 | |
image_src_path = "src_path" | |
image_paths = [os.path.join(image_src_path,f) for f in os.listdir(image_src_path) if f.endswith('.jpg')] |
OlderNewer