What does it mean? Are you perhaps lost?
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
| // Very Smooth | |
| // BCJ - 2014 | |
| // http://log.becojo.me/post/106249890689 | |
| int n = 360; | |
| float a = TWO_PI / n, | |
| d = 150, | |
| z = 100, | |
| p = 50, | |
| v = 2, |
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
| sed ' | |
| s/^>// | |
| t | |
| s/^ *$// | |
| t | |
| s/^/-- / | |
| ' in.lhs > out.hs |
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
| chol22 <- function(A) { | |
| stopifnot(length(A) == 4) | |
| a <- sqrt(A[1,1]) | |
| b <- A[1,2] / a | |
| c <- sqrt(A[2,2] - b^2) | |
| matrix(c(a, 0, b, c), ncol=2) | |
| } |
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
| pwm <- function(sample, r = 0) { | |
| n <- length(sample) | |
| sorted <- sort(sample) | |
| j <- (r+1):n | |
| sum(choose(j - 1, r) * sorted[j]) / (choose(n - 1, r) * n) | |
| } |
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
void setup() {
size(500, 200);
}
void draw() {
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
| float resolution = TWO_PI / 360.0; | |
| int scale = 150; | |
| void setup() { | |
| size(500, 500, P3D); | |
| smooth(); | |
| noFill(); | |
| strokeWeight(10); | |
| } |
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
| float r = 0; | |
| PVector pos = new PVector(0, 0); | |
| void setup() { | |
| size(screen.width, screen.height); | |
| } | |
| void draw() { | |
| translate(pos.x, pos.y); | |
| rotate(r); |
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
| (ns rpn | |
| (:use clojure.test)) | |
| (defn rpn [expr] | |
| (first (reduce | |
| (fn [stack n] | |
| (if (fn? n) | |
| (cons (n (second stack) (first stack)) | |
| (drop 2 stack)) | |
| (cons n stack))) |
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
| PImage img; | |
| void setup() { | |
| img = loadImage("img.jpg"); | |
| size(img.width, img.height); | |
| } | |
| void keyPressed() { | |
| if(key == ' ') saveFrame("frame-" + minute() + "-" + second() + "-#########" + ".png"); | |
| } |