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
# ssh-agent singleton setup | |
# If no SSH agent is already running, start one now. Re-use sockets so we never | |
# have to start more than one session. | |
export SSH_AUTH_SOCK=$HOME/.ssh-socket | |
NKEYS_SSHAGENT=`ssh-add -l 2> /dev/null | wc -l` | |
if [ $NKEYS_SSHAGENT = 0 ]; then | |
# No ssh-agent running | |
rm -f $SSH_AUTH_SOCK | |
ssh-agent -a $SSH_AUTH_SOCK >/tmp/.ssh-script | |
source /tmp/.ssh-script |
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
template < class MatrixType > | |
MatrixType inverse(const MatrixType & m) | |
{ | |
typedef itk::Vector<typename MatrixType::ValueType, MatrixType::RowDimensions> VectorType; | |
typedef itk::SymmetricEigenAnalysis<MatrixType,VectorType> EigenAnalysisType; | |
EigenAnalysisType eigenAnalysis; | |
eigenAnalysis.SetOrderEigenMagnitudes(true); // order by abs val of eigenvals.. | |
eigenAnalysis.SetDimension(MatrixType::RowDimensions); | |
VectorType eigenVals; | |
MatrixType eigenVecs; |
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
# originally from: | |
# http://groups.google.com/group/ggplot2/attach/6bf632a9718dddd6/ggcorplot.R?part=2 | |
# linked to from here: | |
# http://www.r-bloggers.com/five-ways-to-visualize-your-pairwise-comparisons/ | |
# I've updated to remove warnings and errors. | |
library(ggplot2) | |
#define a helper function (borrowed from the "ez" package) | |
ezLev=function(x,new_order){ |
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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>dataproj.maven</groupId> | |
<artifactId>running-lucene-with-maven</artifactId> | |
<packaging>war</packaging> | |
<version>0.1</version> | |
<profiles> | |
<!-- Add profile configuration here --> | |
</profiles> |
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
#! /usr/bin/env python | |
"""BIL parser to load elevation info from sites like | |
http://earthexplorer.usgs.gov/ | |
Mostly based of: | |
http://stevendkay.wordpress.com/2010/05/29/parsing-usgs-bil-digital-elevation-models-in-python/ | |
Documentation for the format itself: | |
http://webhelp.esri.com/arcgisdesktop/9.2/index.cfm?TopicName=BIL,_BIP,_and_BSQ_raster_files |
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
# 30D gaussian data set with the following properties: | |
# anisotropic (covariance not scaled identity) | |
# non-axis aligned (rotated) | |
# non-centered (translated) | |
n = 300 | |
d = 30 | |
Sigma = eye(d) | |
Sigma[1,1] = 20 |
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
#ifndef COMMON_KDTREE_H | |
#define COMMON_KDTREE_H | |
/* | |
* Copyright (c) 2015 Daniel Perry | |
* | |
*/ | |
#include <vector> | |
using std::vector; |
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
# converts a .psb (photoshop photo type) to a raw image format. | |
# | |
# Raw format: | |
# height Uint32 | |
# width Uint32 | |
# depth Uint32 (8,16,32) | |
# data block Uint8, Uint16, Uint32 (depending on depth value = 8, 16, 32) | |
# using file description Oct 2013 version here: |
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
# Conversion of Ceres solver curve fitting example to julia - see http://ceres-solver.org/. | |
# Copyright (c) Daniel Perry 2015 | |
# MIT License | |
function init() | |
ccall((:ceres_init,"libceres"), Void, ()) | |
end | |
init() |
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
using PyPlot | |
using PyCall | |
@pyimport overfeat | |
@pyimport scipy.ndimage as pyndimage | |
@pyimport scipy.misc as pymisc | |
# read image | |
image = pyndimage.imread("../../samples/bee.jpg") | |
# resize and crop into a 231x231 image |
OlderNewer