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
// make sure to link against /usr/lib/libpcap.dylib | |
#include "ofMain.h" | |
#include <pcap/pcap.h> | |
class ofApp : public ofBaseApp { | |
public: | |
pcap_t *pcap; | |
struct pcap_pkthdr header; | |
const unsigned char* packet = NULL; | |
list<string> packetHex; |
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
// Port of code from: http://geomalgorithms.com/a07-_distance.html | |
// | |
// Ported by Michael Taylor, Dec 8 2014 | |
// | |
// Copyright 2001 softSurfer, 2012 Dan Sunday | |
// This code may be freely used and modified for any purpose | |
// providing that this copyright notice is included with it. | |
// SoftSurfer makes no warranty for this code, and cannot be held | |
// liable for any real or imagined damage resulting from its use. | |
// Users of this code must verify correctness for their application. |
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
//Based on the fast inverse square root function | |
// https://en.wikipedia.org/wiki/Fast_inverse_square_root | |
// Some original comments preserved for humor value | |
// Designed to try to mimic the original as closely as possible | |
function Q_rsqrt(number) | |
{ | |
var i; | |
var x2, y; | |
const threehalfs = 1.5; | |
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
/* | |
* R3.java | |
* | |
* Copyright (c) 2016 Karambola. All rights reserved. | |
*/ | |
package pt.karambola.R3; | |
public class | |
R3 |
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 <pcap.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <pthread.h> | |
#include <unistd.h> | |
#include <signal.h> | |
pcap_t* pcap; | |
void* thread(void* arg) { |