Skip to content

Instantly share code, notes, and snippets.

View sclaxton's full-sized avatar

Spencer Claxton sclaxton

View GitHub Profile
// examples
function plus_eval(a, b){
return a + b;
}
var plus = new Operation('+', 2, plus_eval);
var operations = [plus];
@sclaxton
sclaxton / index.html
Created July 21, 2014 23:00
Interview files
<html>
<head>
<meta name="viewport" content="width=320, initial-scale=1, user-scalable=no">
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<div id="master_container">
<div id="featured_container">
@sclaxton
sclaxton / interval_tree.js
Last active August 29, 2015 14:04
Interval Score
// An interval object looks like this:
// {
// id: unique id,
// low: x postion,
// len: length
// zscore: z index
// }
// The Interval class constructor takes
// as a string containg the comma-separated
@sclaxton
sclaxton / keybase.md
Last active August 29, 2015 13:57
keybase.md

Keybase proof

I hereby claim:

  • I am sclaxton on github.
  • I am spencer (https://keybase.io/spencer) on keybase.
  • I have a public key whose fingerprint is 9502 CE8F 27FF 5F57 D68B AAF0 D2C6 239B AA27 E2C8

To claim this, I am signing this object:

@sclaxton
sclaxton / tcp.c
Created March 3, 2014 13:58
Implementation of TCP state handling for an undergraduate networks class at the University of Chicago.
/*
* chiTCP - A simple, testable TCP stack
*
* Implementation of the TCP protocol.
*
* chiTCP follows a state machine approach to implementing TCP.
* This means that there is a handler function for each of
* the TCP states (CLOSED, LISTEN, SYN_RCVD, etc.). If an
* event (e.g., a packet arrives) while the connection is
* in a specific state (e.g., ESTABLISHED), then the handler
[2014-02-27 18:38:03] DEBUG lt-chitcpd <<< TCP data AFTER handling:
[2014-02-27 18:38:03] DEBUG lt-chitcpd ······················································
[2014-02-27 18:38:03] DEBUG lt-chitcpd ESTABLISHED
[2014-02-27 18:38:03] DEBUG lt-chitcpd
[2014-02-27 18:38:03] DEBUG lt-chitcpd ISS: 836 IRS: 836
[2014-02-27 18:38:03] DEBUG lt-chitcpd SND.UNA: 837
[2014-02-27 18:38:03] DEBUG lt-chitcpd SND.NXT: 837 RCV.NXT: 851
[2014-02-27 18:38:03] DEBUG lt-chitcpd SND.WND: 4096 RCV.WND: 4096
[2014-02-27 18:38:03] DEBUG lt-chitcpd Send Buffer: 0 / 4096 Recv Buffer: 0 / 4096
[2014-02-27 18:38:03] DEBUG lt-chitcpd