Skip to content

Instantly share code, notes, and snippets.

function viewClassTree(directory)
% View a class inheritence hierarchy. All classes residing in the directory
% or any subdirectory are discovered. Parents of these classes are also
% discovered as long as they are in the matlab search path.
% There are a few restrictions:
% (1) classes must be written using the new 2008a classdef syntax
% (2) classes must reside in their own @ directories.
% (3) requires the bioinformatics biograph class to display the tree.
% (4) works only on systems that support 'dir', i.e. windows.
%
@dgolden1
dgolden1 / matlab-alpha-bug
Last active August 29, 2015 14:04
Reproduce Matlab 2014b bug with alpha channel
function matlab_alpha_bug
% Reproduce a bug on Matlab 2014b
% The peppers image will be plotted correctly; coins will not
% Both are plotted correctly in 2014a
% Daniel Golden (dan, followed by cellscope, followed by dot com)
%% Setup
close all;
@dgolden1
dgolden1 / ubuntu_freenx_instructions.txt
Last active August 29, 2015 14:04 — forked from zachbrowne/instructions.txt
Install freenx on Ubuntu Server
This is a method to using your Ubuntu 12.04 server without the Unity desktop on a very fast remote desktop program. This is by far the best method to managing your Ubuntu server if you like GUI.
apt-get install ubuntu-desktop
#apt-get --yes purge unity unity-2d unity-2d-places unity-2d-panel unity-2d-spread
#apt-get --yes purge unity-asset-pool unity-services unity-lens-* unity-scope-*
#apt-get --yes purge liboverlay-scrollbar*
#apt-get --yes purge appmenu-gtk appmenu-gtk3 appmenu-qt
#apt-get --yes purge firefox-globalmenu thunderbird-globalmenu
#apt-get --yes purge unity-2d-common unity-common
#apt-get --yes purge libunity-misc4 libunity-core-5*
@dgolden1
dgolden1 / Makefile.config.osx
Created October 2, 2014 22:54
Caffe Makefile.config for OS X
## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!
# No GPU
CPU_ONLY := 1
# CUDA directory contains bin/ and lib/ directories that we need.
CUDA_DIR := /usr/local/cuda
# CUDA architecture setting: going with all of them (up to CUDA 5.5 compatible).
@dgolden1
dgolden1 / Makefile.diff
Created October 16, 2014 19:51
caffe Makefile XCode 6 patch vecLib -> Accelerate (against 5c4125da)
From d98e6fb63e689166a9919c59eed0ec37aaf782d6 Mon Sep 17 00:00:00 2001
From: Daniel Golden <dgolden1@gmail.com>
Date: Thu, 16 Oct 2014 10:46:08 -0700
Subject: [PATCH] Use accelerate instead of vecLib on OS X
Fix for https://github.com/BVLC/caffe/issues/1212
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@dgolden1
dgolden1 / blah.csv
Created October 22, 2014 17:05
Matlab readtable bug example file
number letter
88226 x
88226 y
88229
@dgolden1
dgolden1 / test_random_rotation.m
Last active August 29, 2015 14:08
Matlab code to test rotation logic of https://github.com/BVLC/caffe/pull/1386
function test_random_rotation
% Test random rotation logic for BVLC PR #1386
% https://github.com/BVLC/caffe/pull/1386
%
% This code is meant to mirror as closely as possible the image rotation code in Caffe's
% data_transformer.cpp
% Author: Daniel Golden
% Date: 2014-10-31
@dgolden1
dgolden1 / verify_parse_log_equal.m
Created December 9, 2014 18:23
Verify that old and new versions of parse_log.py give the same results
function verify_parse_log_equal(filename_old, filename_new)
% Verify that the old and new versions of the caffe parse_log.py output are the same
%% Setup
close all;
%% Read tables and homogenize variable names
t_old = readtable(filename_old, 'FileType', 'text', 'Delimiter', ',');
t_new = readtable(filename_new, 'FileType', 'text', 'Delimiter', ',');
@dgolden1
dgolden1 / no_job_control.md
Last active August 29, 2015 14:12
no job control bug

See http://stackoverflow.com/questions/27805096/wget-and-bash-error-bash-line-0-fg-no-job-control

Command:

export PS4='+($?) $BASH_SOURCE:$FUNCNAME:$LINENO:'
echo "wget --no-check-certificate --no-verbose -O a-very-long-folder-de090952623b4865c2c34bd6330f8a423ed05ed8de090952623b4865c2c34bd6330f8a423ed05ed8de090952623b4865c2c34bd6330f8a423ed05ed8/blah.jpg http://d4u3lqifjlxra.cloudfront.net/uploads/example/file/48/accordion.jpg" | xargs -J % bash -x -c %

Output:

a b c
1 3
4 6
7 8, 9 10