Skip to content

Instantly share code, notes, and snippets.

View avegancafe's full-sized avatar

Kyle Holzinger avegancafe

View GitHub Profile
abstract class A
case class A1(in: String) extends A
case class A2(num: Int) extends A
val test1: A = A1("Hello")
val test2: A = A2(1)
def receive (inObj: A) = {
Name: Kyle Holzinger
BUID: U92663004
Date: 11.13.14
Problem 1
The first thing to do is to calculate the number of vertices and edges in graph G. Then, using the Floyd Warshall algorithm with a few minor changes, that is to say you still read from K=0 to K = N, given the following changes it now computes the number of different paths between each pair of vertices:
1. Make a list of counters for each pair of vertices
2. Run the original Floyd Warshall algorithm, however now you keep track of the start and end vertices. For each path discovered, add 1 to that counter.
# Name: Kyle Holzinger
# BUID: U92663004
# Date: 12.15.14
from math import floor
from fractions import gcd
from random import randint
'''
Problem 1
@avegancafe
avegancafe / rtime.sh
Created December 30, 2014 20:40
A bash script for updating the time in Linux using ntpdate
#!/bin/bash
# echo "Hello, world!"
sudo service ntp stop
echo "Updating time..."
sudo ntpdate -s time.nist.gov
sudo service ntp start
@avegancafe
avegancafe / 1.py
Last active August 29, 2015 14:12
size = int(input().rstrip())
def neighbors(i,j):
fin = []
for x in [-1,1]:
if i + x > -1 and i + x < size:
fin.append((i+x,j))
if j + x > -1 and j + x < size:
fin.append((i,j+x))
return fin
@avegancafe
avegancafe / min.py
Created February 3, 2015 00:19
A python implementation for finding the minimum of a list.
def min(l):
cur = float('-inf')
for el in l:
if el < cur:
cur = el
return cur
def subsetsum(array,num):
if num == 0 or num < 1:
return None
elif len(array) == 0:
return None
else:
if array[0] == num:
return [array[0]]
else:
var keys = require('./keys'),
yelp = require('yelp').createClient( keys );
var until = function(n, cb){
return function(){ (--n) || cb(); };
};
module.exports = function (search, zip, cb) {
function search(offset, cb, arr){
##############################
# Name: Kyle Holzinger
# Date: April 20th, 2015
# CS 558 Lab 4
##############################
import dpkt, sys, socket
class Detector(object):
package wordcount;
import java.io.IOException;
import java.util.StringTokenizer;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;