Skip to content

Instantly share code, notes, and snippets.

function sums = getsums1d(name,boxsize,noise)
if( noise == 1 )
folder = strcat("/cygdrive/c/dev/af_paper/images/",name,"/noise/");
else
folder = strcat("/cygdrive/c/dev/af_paper/images/",name,"/resized/");
endif;
files = dir(folder);
%sums = zeros(length(files));
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
FILE *f;
FILE *frnd;
int i = 0;
import json
mydict = {}
mydict['myfield'] = "super_awesome_stuff"
myjson = json.dumps(mydict)
print myjson
if (i/2 == 9) {
if (i == 18) {
cumulScores[bowlIndex][9] += cumulScores[bowlIndex][8];
}
if(curScore[i] != -2) {
cumulScores[bowlIndex][9] += curScore[i];
}
} else if (i/2 == 10) {
if(curScore[i] != -2) {
cumulScores[bowlIndex][9] += curScore[i];
@thequbit
thequbit / gist:a139f64d5cde952771f5
Created May 2, 2014 18:31
Pull single frame from mjpeg file
#!/usr/bin/env python
import socket
import sys
if len(sys.argv) != 3:
print "Usage: %s video.mjpeg destfile.jpg" % sys.argv[0]
sys.exit(1)
fh = open(sys.argv[1],'r')
@thequbit
thequbit / gist:d3ed1b862058bdc2243e
Created May 2, 2014 18:42
get a frame every 5 minutes from a mjpeg stream
#/bin/sh
# this assumes you want to take an image every 5 minutes for 12 hours.
# ( 60 minutes / hour / 5 minutes * 12 hours = 144 images )
#
# get singleframe.py from here:
# https://gist.github.com/thequbit/a139f64d5cde952771f5
#
<html>
<script>
// return our array of dicts
function getFaultData() {
// create array of dict
var retData = [{
"Name": "Fault A",
"Status": "FAULT",
> document.cookie
"authtoken=8911efe248a116d5ecaa7df1b4a30edd"
> authtoken
"8911efe248a116d5ecaa7df1b4a30edd"
> authlevel
2
<form action="/uploadtest.json" method="post" accept-charset="utf-8" enctype="multipart/form-data">
<input id="sometext" name="sometext" type="text" value="This is a test!">
<input type="submit" value="submit" />
</form>
<form action="http://yellrdev.wxxi.org/uploadtest.json" method="post" accept-charset="utf-8" enctype="multipart/form-data">
<input id="sometext" name="sometext" type="text" value="This is a test!">
<input type="submit" value="submit" />
</form>