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
int state = 0; | |
int time1 = 2000; | |
int time2 = 5000; | |
void setup() { | |
} | |
void draw() { | |
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.FileInputStream; | |
import java.io.IOException; | |
import javax.print.Doc; | |
import javax.print.DocFlavor; | |
import javax.print.DocPrintJob; | |
import javax.print.PrintException; | |
import javax.print.PrintService; | |
import javax.print.PrintServiceLookup; | |
import javax.print.SimpleDoc; |
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
void setup() { | |
size(400, 400); | |
} | |
void draw() { | |
background(0); | |
translate(width/2, height/2); | |
scale(1, -1); |
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
// Trilateration | |
// from: http://en.wikipedia.org/wiki/Trilateration | |
// Daniel Shiffman <http://www.shiffman.net> | |
// April 2006 | |
// Updating for Processing 2.1, Jan 2014 | |
PVector p1,p2,p3; | |
float d1,d2,d3; | |
PVector it; |
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
// Perlin Noise Blob | |
// Polar to Cartesian Coordinates | |
// Daniel Shiffman | |
// Nature of Code, Spring 2014 | |
float yoff = 0.0; | |
void setup() { | |
size(640,360); | |
} |
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
function setup() { | |
} |
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
/* | |
[ { | |
"name": "Morgan", | |
"age": "30", | |
"location": "Boston", | |
"desire": "Singing", | |
"fear": "Violence" | |
}, | |
{ | |
"name": "Joss", |
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
color c = color(0); | |
void setup() { | |
size(200, 200); | |
} | |
void draw() { | |
background(c); | |
// % is the remainder http://processing.org/reference/modulo.html |
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
void setup () { | |
size (400, 400); | |
} | |
void draw () { | |
background (0); | |
int spacing = 10; | |
noStroke(); | |
int cols = width / spacing; | |
int rows = height / spacing; |
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
// While this seems like the right idea | |
// This does not work at all! | |
// The loop will finish and i will be at 10 by | |
// the time the anonymous function is called | |
for (var i = 0; i < 100; i++) { | |
setTimeout(function() { | |
console.log(i); | |
}, 100*i); |