Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
struct Point
{
public:
double x,y,z;
};
// A mixin to add an 'A' value to a point
template<class Base>
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy
hl, = plt.plot([], [])
#plt.show()
def update_line(hl, new_data):
hl.set_xdata(numpy.append(hl.get_xdata(), new_data))
hl.set_ydata(numpy.append(hl.get_ydata(), new_data))
----------------------------------------------------------------------
-- This script demonstrates how to define a couple of different
-- models:
-- + 2-layer neural network (MLP)
--
----------------------------------------------------------------------
require 'torch' -- torch
require 'nn' -- provides all sorts of trainable modules/layers
@daviddoria
daviddoria / .bashrc
Created April 29, 2015 19:35
Environment files
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
int vtkImageData::ComputeStructuredCoordinates( const double x[3], int ijk[3], double pcoords[3],
const int* extent,
const double* spacing,
const double* origin,
const double* bounds)
{
// tolerance is needed for 2D data (this is squared tolerance)
const double tol2 = 1e-12;
//
// Compute the ijk location
@daviddoria
daviddoria / FastMarchingSimple.cxx
Created February 18, 2011 15:46
An example of the level of simplicity that should be available.
#include "itkImage.h"
#include "itkImageFileWriter.h"
#include "itkPolyLineParametricPath.h"
#include "itkSpeedFunctionToPathFilter.h"
#include "itkPathIterator.h"
#include "itkGradientDescentOptimizer.h"
#include "itkSigmoidImageFilter.h"