This file contains hidden or 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 os, struct | |
from array import array | |
from cvxopt.base import matrix | |
def read(digits, dataset = "training", path = "."): | |
""" | |
Python function for importing the MNIST data set. | |
""" | |
if dataset is "training": |
This file contains hidden or 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
// For each line of the input file, remove nonalphanumeric characters, | |
// lowercase all letters, remove stopwords, and write the result to the output | |
// file. I used the answer here as a template for reading/writing files: | |
// http://stackoverflow.com/questions/1821811/how-to-read-write-from-to-file/9739903#9739903 | |
package main | |
import ( | |
"bufio" | |
"fmt" |
This file contains hidden or 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
# Copyright 2013 [email protected] | |
import requests | |
import urllib | |
import datetime | |
import time | |
import os | |
import json | |
RUN_ID = int(time.mktime(datetime.datetime.now().timetuple())) | |
MAX_POSTS_REQUESTED = 1000 |
This file contains hidden or 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/env bash | |
if [[ -n "$1" ]] ; then | |
if [[ *"$1"* == "display screen monitor" ]] ; then | |
flip_display=true | |
flip_input=false | |
elif [[ *"$1"* == "input wacom tablet stylus" ]] ; then | |
flip_display=false | |
flip_input=true | |
else |
This file contains hidden or 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
var x = 0; | |
var y = 0; | |
var ds = 100; | |
var track = document.getElementById('track'); | |
var viewport = document.getElementById('viewport').getContext('2d'); | |
viewport.drawImage(track,x,y,ds,ds,0,0,500,500); | |
var pixels = viewport.getImageData(); |
This file contains hidden or 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
> document.getElementById("viewport").getContext('2d').getImageData() | |
Unable to get image data from canvas because the canvas has been tainted by cross-origin data. | |
Error: SECURITY_ERR: DOM Exception 18 |
This file contains hidden or 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
execve("./AnomalyWarzoneEarth", ["./AnomalyWarzoneEarth", "2"], [/* 58 vars */]) = 0 | |
[ Process PID=7248 runs in 32 bit mode. ] | |
brk(0) = 0x9cf4000 | |
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xfffffffff77dc000 | |
readlink("/proc/self/exe", "/media/space/Anomaly/AnomalyWarzoneEarth", 4096) = 40 | |
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) | |
open("tls/i686/sse2/libX11.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) | |
open("tls/i686/libX11.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) | |
open("tls/sse2/libX11.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) | |
open("tls/libX11.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) |
This file contains hidden or 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
/* | |
* Code for making one potentiometer control 3 LEDs, red, grn and blu, or one tri-color LED | |
* The program cross-fades from red to grn, grn to blu, and blu to red | |
* Debugging code assumes Arduino 0004, as it uses Serial.begin()-style functions | |
* Clay Shirky <[email protected]> | |
*/ | |
// INPUT: Potentiometer should be connected to 5V and GND | |
int potPin = 3; // Potentiometer output connected to analog pin 3 | |
int potVal = 0; // Variable to store the input from the potentiometer |
NewerOlder