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
# NOTE: IF THIS FAILS, YOU MAY HAVE TO | |
# sudo apt-get install libxmu-dev libxi-dev | |
# http://ubuntuforums.org/showthread.php?t=1703770 | |
cmake_minimum_required(VERSION 3.3) | |
project(ass4) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | |
#--- Find GLUT |
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
[Background] | |
Color=0,0,0 | |
[BackgroundIntense] | |
Color=104,104,104 | |
[Color0] | |
Color=0,0,0 | |
[Color0Intense] |
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
import java.io.IOException; | |
import java.io.InputStream; | |
import java.nio.ByteBuffer; | |
import java.util.NoSuchElementException; | |
import java.util.Queue; | |
import java.util.concurrent.ConcurrentLinkedQueue; | |
/** | |
* Simulates an InputStream that provides pre-determined packet data | |
* |
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
import java.io.File; | |
import java.io.IOException; | |
import java.nio.ByteBuffer; | |
import java.nio.channels.FileChannel; | |
import java.util.LinkedList; | |
import java.util.List; | |
/** | |
* Extracts byte data from a text file with comments and a hex stream. | |
* The comments must start with '#' on each line. |
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
#!/usr/bin/python | |
import os | |
import sys | |
# Paths longer than this amount of bytes will generate a warning | |
MAX_PATH_LEN = 256 | |
# Good characters | |
GOOD_CHARS = " 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!?'._-()[]" |
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
#include "buffer.h" | |
Buffer* buffer_create(int capacity) { | |
if (capacity <= 0) | |
return NULL; | |
Buffer* b = (Buffer*)malloc(sizeof(Buffer)); | |
if (b) { | |
if (b->data = (char*)malloc(capacity * sizeof(char))) { |
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 | |
# Adapted from the script on: | |
# http://notes.tweakblogs.net/blog/7955/ | |
TMP=$HOME/tmp | |
PREFIX=proxy | |
FIFO=`mktemp -u -p $TMP -t $PREFIX.XXXXXXXXXXX` | |
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
#include <stdio.h> | |
#include <stdint.h> | |
#include <ifaddrs.h> | |
#include <netdb.h> | |
int main(int argc, char** argv) { | |
struct ifaddrs* addrs; | |
struct ifaddrs* ifa; |
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
/** | |
* Responsible for allocating and deallocating IP addresses in a given range. | |
*/ | |
var ip = require('./iptools.js'); | |
/** | |
* @param {string} network IPv4 address of the network address (e.g. "10.0.0.0") | |
* @param {number} prefix (optional) Network prefix (e.g. 24 for a 10.0.0.0/24 net) | |
* @constructor |
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
#include <stdio.h> | |
#include <unistd.h> | |
#include <stdlib.h> | |
#include <fcntl.h> | |
#include <sys/select.h> | |
#include <sys/types.h> | |
#include <sys/wait.h> | |
#define BUFFER_SIZE 4096 |