Skip to content

Instantly share code, notes, and snippets.

@wkschwartz
wkschwartz / gist:5295571
Last active December 15, 2015 17:19
Java utility method for helping me find outliers for the Princeton/Coursera Algorithms Part 2 course assignment "WordNet."
/**
* Reflect a upper triangular matrix across its diagonal and return the row
* index whose sum is greatest, without modifying the input matrix.
* <p>
* The non-mutating reflection is accomplished by adding down column <em>i</em>
* from 0 to <em>i</em> - 1 and adding across row <em>i</em> from <em>i</em> to
* <code>a[i].length</code>.
*
* @param a An array of arrays of integers in row-major form. The arrays should
* but do not have to be equal lengths.
@josephwecker
josephwecker / new_bashrc.sh
Created August 11, 2012 04:36
Replace .bashrc, .bash_profile, .profile, etc. with something much more clean, consistent, and meaningful. Now a repo: https://github.com/josephwecker/bashrc_dispatch
#!/bin/bash
# License: Public Domain.
# Author: Joseph Wecker, 2012
#
# -- DEPRICATED --
# This gist is slow and is missing .bashrc_once
# Use the one in the repo instead! https://github.com/josephwecker/bashrc_dispatch
# (Thanks gioele)
#
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile?
@dcernst
dcernst / HWTemplate.tex
Last active April 23, 2024 05:19
LaTeX homework template for Weekly Homework assignments for Dana Ernst's courses.
% --------------------------------------------------------------
% This is all preamble stuff that you don't have to worry about.
% Head down to where it says "Start here"
% --------------------------------------------------------------
\documentclass[12pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath,amsthm,amssymb}