This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Name: Kyle Holzinger | |
# BUID: U92663004 | |
# Date: 12.15.14 | |
from math import floor | |
from fractions import gcd | |
from random import randint | |
''' | |
Problem 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# echo "Hello, world!" | |
sudo service ntp stop | |
echo "Updating time..." | |
sudo ntpdate -s time.nist.gov | |
sudo service ntp start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Learning and prediction functions for perceptrons.""" | |
# NAME: Kyle Holzinger | |
# BUID: U92663004 | |
# DATE: 9.4.14 | |
import common | |
class NotConverged(Exception): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def min(l): | |
cur = float('-inf') | |
for el in l: | |
if el < cur: | |
cur = el | |
return cur |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Problem: | |
The Magic Box (Programming) | |
It is well known at Palantir that Director of Engineering Khan is a very skilled engineer. What is much | |
less well known is that he is also a skilled ninja, wizard, and genie. Khan has used his impressive | |
wizarding power to create a magic box locked with an M by N grid of two wizarding symbols that look | |
suspiciously like the letters "P" and "T", the initials of Khan's favorite company. The box can only be | |
unlocked by a given person once in that person's lifetime. | |
Khan has infused the box with his genie powers so that it grants the opener a number of wishes equal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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){ |
OlderNewer