Skip to content

Instantly share code, notes, and snippets.

View axpence's full-sized avatar

Alex Spencer axpence

View GitHub Profile
@axpence
axpence / gist:3184535
Created July 26, 2012 21:10
2A Before Passoff #1 with NO couts avl.h , before decomposing the recursiveRemove() function
#pragma once
#include<string>
#include"my_vect.h"
using namespace std;
template <typename ItemType>
class AVLTreeSet {
friend class Node;
@axpence
axpence / gist:3185074
Created July 26, 2012 22:52
3A vector
#pragma once
#include<string>
#include"my_vect.h"
using namespace std;
template <typename ItemType>
class AVLTreeSet {
friend class Node;
@axpence
axpence / gist:3189065
Created July 27, 2012 16:44
4a before set height and after linked list print~ avl.h
#pragma once
#include<string>
#include"LinkedArrayList_3_passoff.h"
using namespace std;
template <typename ItemType>
class AVLTreeSet {
friend class Node;
@axpence
axpence / gist:3189180
Created July 27, 2012 17:03
5a avl.h after set_h()! working passed all test cases, now i will decompose
#pragma once
#include<string>
#include"LinkedArrayList_3_passoff.h"
using namespace std;
template <typename ItemType>
class AVLTreeSet {
friend class Node;
@axpence
axpence / gist:3190651
Created July 27, 2012 21:54
get_h and set_h
int get_h(Node* n){
if(n == NULL){
return 0;
}
else{
return n->height;
}
}
void set_h(Node* n){
@axpence
axpence / gist:3203504
Created July 30, 2012 02:29
grade_calc w/ bootstrap 1a
<?php
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@axpence
axpence / gist:3212282
Created July 31, 2012 00:32
hashset.h 1a before taking out couts after deconstructor
#pragma once
#include"LinkedArrayListFromSix.h"
#include<string>
using namespace std;
int doHash(const string& s, int tableSize){
unsigned hashCode = 0;
for (unsigned i = 0; i < s.length(); i++){
cout << "hash code in for loop: " << hashCode << endl;
@axpence
axpence / linkedarraylist.h PASSOFF
Created July 31, 2012 05:43
LAB7: hashset.h 1a after taking out couts, after deconstructor, AFTER PASSOFF, see linkedarraylist.h gist
#pragma once
#include<string>
#include<fstream>
#include<sstream>
using namespace std;
template <typename ItemType>
class LinkedArrayList {
@axpence
axpence / gist:3223303
Created August 1, 2012 03:16
KNOCK2_SERVO - 135 degree rotate, uploaded final before MFG202 video
/* Detects patterns of knocks and triggers a motor to unlock
it if the pattern is correct.
By Steve Hoefer http://grathio.com
Version 0.1.10.20.10
Licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0
http://creativecommons.org/licenses/by-nc-sa/3.0/us/
(In short: Do what you want, just be sure to include this line and the four above it, and don't sell it or use it in anything you sell without contacting me.)
Analog Pin 0: Piezo speaker (connected to ground with 1M pulldown resistor)
@axpence
axpence / gist:3243739
Created August 3, 2012 02:35
calculate_grade()
<script>
function calculateGrade(){
for(i=0; i < row_count; i++){
var score_gen = 'score' + (i+1);
score = document.getElementById(score_gen).value * .01;
var percent_gen = 'percent' + (i+1);
percent_of_final = document.getElementById(percent_gen).value;
grade_index_temp = score * percent_of_final;
grade_index_100 += percent_of_final;
grade_index_total += grade_index_temp;