Skip to content

Instantly share code, notes, and snippets.

View matutter's full-sized avatar

Mat Utter matutter

View GitHub Profile
@matutter
matutter / fft.md
Last active August 29, 2015 14:10
FFT polynomial multiplication walk through

given 'n' polynomials to mupliply,
3+x 2x^2+2

take the first polynomials coefficients,
3+x --> 3, 1

add enough slack coefficients n^2,
3, 1 --> 3, 1, 0, 0 indexed 0 1 2 3

@matutter
matutter / dfaMinimizer.cpp
Last active August 29, 2015 14:10
Minimal DFA.cpp computes minimal DFA by partition factoring.
/*
This is computationally terrible and resource abusive...
I just did this to finish some homework for me.
*/
#include <iostream>
#include "dfaMinimizer.hpp"
#include <vector>
#include <map>
@matutter
matutter / queues.cpp
Created November 11, 2014 21:41
using queues
#include <iostream>
#include <queue>
#include <time.h>
#include <stdlib.h>
#include <unistd.h>
using namespace std;
int main(int argc, char const *argv[])
@matutter
matutter / termios.h
Last active August 29, 2015 14:09
terminal emulator... in a terminal?
#include <iostream>
#include <unistd.h>
#include <termios.h>
#include <cstdio>
#include <vector>
#include <string>
using namespace std;
#include <stdio.h>
#include <stdlib.h>
int populate( char word_array[40][15] )
{
FILE *words;
int end;
/* open the file */
@matutter
matutter / setupRoR.sh
Last active August 29, 2015 14:08
Setup RoR
echo '--> Run me with sudo privileges'
echo '--> If an error about a signature occurs add the key holder in the error'
apt-get update
apt-get install curl
\curl -L https://get.rvm.io | bash -s stable --rails
source ~/.rvm/scripts/rvm
rvm install ruby-2.1.4
rvm use ruby-2.1.4
rails new sample
@matutter
matutter / asm.c
Last active August 29, 2015 14:08
Flex file, AT-ASM to AT-ROM
/*
Mat Utter 10/27/2014
compiler design, Confer
*/
/*
line comments begin with a semicolon (';')
a ".msg" precompiler directive is allowed prior to any labels or code.
It may contain a message of up to 70 characters beginning after
@matutter
matutter / basicRational.rb
Last active August 29, 2015 14:08
An example class of cartisian graphs and rational numbers. although rational numbers is really just a class x > delegate(float) with a hat.
# mat utter 10/25/2014
# ...arrays of fractions - find the sum of an array.. is this an integral number class or not? Your directions are very unclear.
class Rational2
def initialize( n = 0 )
@num = n.to_f
@roundTo = 100
end
def +(other)
return Rational2.new( @num + other )
@matutter
matutter / DijkstrasShortestPath.rb
Last active August 29, 2015 14:07
DijkstrasShortestPath.rb
require 'matrix'
=begin
:mat utter, 10/19/2014
=end
class Graph
From = 0
To = 1
Length = 2
def initialize()
@graph = Array.new
@matutter
matutter / shortestpath2.rb
Last active August 29, 2015 14:07
shortestpath.rb Finds the shortest path given tuples to represent the graph. For directed and directed.
=begin
:mat utter, 10/19/2014
=end
class Graph
def initialize()
@graph = Array.new
end
def add(key,val)
@graph.push( [key,val] )