Skip to content

Instantly share code, notes, and snippets.

View zach-klippenstein's full-sized avatar

Zach Klippenstein zach-klippenstein

View GitHub Profile
@zach-klippenstein
zach-klippenstein / postfix_calc.c
Created October 30, 2009 00:24
Simple console calculator. Uses postfix notation.
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#define STACK_SIZE 1000
#define MAX_OPERATORS 10
#define MAX_LINE 300
// Clear any exception
@zach-klippenstein
zach-klippenstein / kyle_newton.java
Created October 29, 2009 05:26
Various implementations of Netwon's method
public ResultPair solveNewton(double init, double epsilon)
{
int numIt = 1;
double root;
double xn;
double xnPlusOne;
double xnMinusOne;
xn = init;
xnPlusOne = xn - eval(xn) / getDeriv().eval(xn);
@zach-klippenstein
zach-klippenstein / gist:202673
Created October 6, 2009 01:25
Prints out a bunch of information about all files in the current directory and subdirectories, recursively (see comment header for more info)
#!/bin/bash
# by Zachary Klippenstein
#
# Prints out a bunch of information about all files in the current
# directory and subdirectories, recursively.
# Info includes:
# - filename
# - file type (as given by 'file' command)
# - file contents (prefixed by filename and line number in file, and for binary files, result of 'strings')
@zach-klippenstein
zach-klippenstein / complex-diff-csv.rb
Created August 11, 2009 23:04
Ugly-as-heck script for diffing two CSV files that differ in both number of rows and row content.
#!/usr/bin/ruby
#
# Ugly-as-heck script for comparing two CSV files whose rows have changed, and
# where rows were added to or removed from the second file. Traditional diff tools
# can't make the connection between these two types of changes, so show every line as having
# changed.
#
# Uses git and gitk.
require 'fileutils'