Skip to content

Instantly share code, notes, and snippets.

View gw666's full-sized avatar

Gregg Williams gw666

View GitHub Profile
@gw666
gw666 / core.clj
Created February 28, 2015 06:13
my version of SICPDistilled/escher/core.clj: mostly completed, w/docstrings & refactoring for beginners
(ns escher.core
(require [quil.core :as q])
(:gen-class))
;;==================================================================
;;
;; vector-manipulation primitives
;;
;;==================================================================
@gw666
gw666 / reset-db-errmsg.txt
Created April 26, 2012 05:17
error msg for clj-record, `lein reset-db`
22:11 clj-record $lein reset-db
resetting mysql
Exception in thread "main" java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'clj_record_test'
at clojure.lang.Util.runtimeException(Util.java:165)
at clojure.lang.Compiler.eval(Compiler.java:6476)
at clojure.lang.Compiler.eval(Compiler.java:6455)
at clojure.lang.Compiler.eval(Compiler.java:6431)
at clojure.core$eval.invoke(core.clj:2795)
at clojure.main$eval_opt.invoke(main.clj:296)
at clojure.main$initialize.invoke(main.clj:315)
*/
This is a Java class that has been translated into
Clojure at http://gist.github.com/369239
*/
package edu.umd.cs.piccolo.tutorial;
import java.awt.Color;
; This is the "Graph Editor" sample program for the Piccolo2D structured 2D
; graphics framework. It draws 50 circular nodes, then draws 50 lines
; (called "edges" in the code) between randomly selected nodes. On mouseover,
; nodes turn red. As you drag a node to a new position, the lines stretch and
; stay with the node.
;
; You can find the original Java program at
;
; http://www.piccolo2d.org/learn/grapheditor.html
;
@gw666
gw666 / graph-editor.clj
Created May 12, 2010 02:58
example Java program for Piccolo2D graphics framework, ported to Clojure--WITH DEBUGGING
; This is the "Graph Editor" sample program for the Piccolo2D structured 2D
; graphics framework. It draws 50 circular nodes, then draws 50 lines
; (called "edges" in the code) between randomly selected nodes. On mouseover,
; nodes turn red. As you drag a node to a new position, the lines stretch and
; stay with the node.
;
; You can find the original Java program at
;
; http://www.piccolo2d.org/learn/grapheditor.html
;
package edu.umd.cs.piccolo.tutorial;
import java.awt.Color;
import java.awt.Graphics2D;
import edu.umd.cs.piccolo.*;
import edu.umd.cs.piccolo.event.*;
import edu.umd.cs.piccolo.nodes.*;
import edu.umd.cs.piccolo.util.*;
import edu.umd.cs.piccolox.*;
; This is the canonical Hello World program for the Piccolo2D structured 2D
; graphics framework. You can find the original Java program at
;
; http://www.piccolo2d.org/learn/patterns.html
;
; This program creates a Swing window that displays the phrase "Hello World"
; as a pNode object. You can:
;
; * pan the underlying canvas by holding down the LEFT mouse button while the
; pointer is anywhere within the window