Skip to content

Instantly share code, notes, and snippets.


Benjamin Brittain benbrittain

View GitHub Profile
use ::std::prelude::v1::*;
extern crate std as std;
pub async fn bar()
|mut async_ctx:
pub async fn bar() -> u32{
pub async fn foo() -> u32{
let z = bar().await;
5 + z
View Weka MLP example
@relation NNandMLDataSet
@attribute X1 numeric
@attribute X2 numeric
@ATTRIBUTE Output {"One","Two"}
-1.0,3.0, "One"
-1.0,2.0, "Two"
-0.99,2.9215801494, "One"
-0.99,1.94069601, "Two"
-0.98,2.84624238086, "One"
use std::io::{BufReader,BufRead};
use std::fs::File;
use std::cmp::Ordering;
use std::collections::{BinaryHeap, HashSet};
use std::thread;
use std::sync::mpsc::channel;
* Author: Benjamin Brittain
from struct import *
def wkbToLatLng(coord):
byt = bytearray.fromhex(coord)
(d, t, lng, lat) = unpack('<?idd', byt)
return {"lat": lat, "lng": lng}
with open('gpsmerge.csv') as csvfile:
reader = csv.DictReader(csvfile, delimiter=',')
for row in reader:
View geneious stalker
import urllib2
log = urllib2.urlopen('').read().split("\n")
active_users = dict()
for line in log:
line = line.split(' ')
if len(line) > 4:
View webpush-howto
658 let ioservice = Cc[';1'].getService(Ci.nsIIOService);
659 var aLoadGroup = Cc[";1"].createInstance(Ci.nsILoadGroup);
660 debug("mon: " + this._monitorURI);
661 debug("chan: " + this._channelURI);
662 let chan = ioservice.newChannel(this._monitorURI, 'UTF-8', null);
663 chan.loadGroup = aLoadGroup;
664 chan.notificationCallbacks = {
665 QueryInterface: XPCOMUtils.generateQI([Ci.nsIHttpPushListener,
666 Ci.nsIStreamListener,
667 Ci.nsRequestObserver]),
benbrittain / something.tex
Created Feb 21, 2013
layout for a tex document
View something.tex
% you need "ieeeconf.cls" in the same folder (wget
% run it like "latex something.tex"
% I then use divpdf to make the dvi a pdf
% there are a lot more settings and stuff you are probably gonna need, but this should get you started
\title{A Survey of Function Reactive Programming}