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
; Inspired by a tweet from the self-aware Roomba to Carin Maier | |
(ns binary-tweet | |
(:require [clojure.xml :as xml] | |
[clojure.string :as string])) | |
(defn binary-to-text [s] | |
(apply str | |
(->> s | |
(partition-all 8) |
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
; This is a transliteration of the code listed here: http://wiki.processing.org/w/Stereo_viewing | |
; I stumbled on it in search of a means to get a handle to the GL context that | |
; exposes the lower level OpenGL methods. | |
(ns stereo-viewing | |
(:import [processing.core PConstants]) | |
(:use [quil.core] [quil.applet]) | |
) | |
(def rotation (atom 0)) |
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
; This is _really_ hacky; I converted Processing code from within a presentation | |
; here, www.dsic.upv.es/~jlinares/grafics/processing_eng_7.pdf, to Clojure/quil code. | |
; | |
; OK, now... I have a slightly more interesting function in here, the ability to | |
; move the plot around and be able to zoom in and out. I'm not nuts about the zoom feature since | |
; there are clipping issues if you zoom too far out. But it's cool. | |
; | |
; Ugh... still too many magic numbers. And apparently you can't mix AWT nor Swing with Processing. | |
; I have to figure out how to embed a PApplet onto a Frame and add UI widgets to that. Only then can I | |
; allow user input of functions, x and y ranges, and the number of plot points. |
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 simple-love-clone | |
(:import [processing.core PConstants]) | |
(:use quil.core quil.applet)) | |
(def screen-w 1920) | |
(def screen-h 1080) | |
(def initial-stroke-color [0 255 255]) | |
(def initial-diameter 250) | |
(def initial-stroke 30) |
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 flowers-clone | |
(:import [processing.core PConstants]) | |
(:use quil.core quil.applet)) | |
(def screen-w 1920) | |
(def screen-h 1080) | |
(def orange [240 101 34]) | |
(def indigo [46 49 146]) | |
(def border-width 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
(ns saved-inspiration | |
(:use quil.core)) | |
(def screen-w 1920) | |
(def screen-h 1080) | |
(def swath-colors | |
[[249 228 85] | |
[246 181 65] | |
[255 159 64] |
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 filling-time-inspiration | |
(:use quil.core)) | |
(def screen-w 1920) | |
(def screen-h 1080) | |
(def background-color [0 0 0]) | |
(def ellipses-per-ring 14) | |
(def slices-per-ellipse 7) |
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 starfield | |
(:use quil.core)) | |
(def screen-w 1920) | |
(def screen-h 1080) | |
(defn setup [] | |
(smooth) | |
(no-fill) | |
(stroke-cap :square) |
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 sempervivium | |
(:use quil.core quil.applet)) | |
(def screen-w 1000) | |
(def screen-h 1000) | |
(def rosette-count 15) | |
(def leaf-color [110 148 73]) | |
(def leaf-edge-color [220 255 146]) |
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 java.lang.reflect.Field; | |
public class FunWithFieldsAndReflection { | |
public static void main (String[] args) { | |
SalesForce sf = new SalesForce(); | |
sf.setFun(false); | |
sf.setGreat(false); | |
sf.setWellArchitected(false); | |
sf.setWellDocumented(false); | |
sf.setRecommended(false); |