Alan Dipert (@alandipert) and Micha Niskin (@micha)
for Boot, slides and help with Boot intel.
Juno Terepi (@deraen)
for slides and help with Lein pitfals
@Grab("org.grails:gorm-hibernate4-spring-boot:1.0.0.RC2") | |
@Grab("com.h2database:h2:1.3.173") | |
import grails.persistence.* | |
import org.springframework.http.* | |
import static org.springframework.web.bind.annotation.RequestMethod.* | |
@RestController | |
class GreetingController { | |
@RequestMapping(value="/person/greet", method = GET) |
package hu.axt.iotrace; | |
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ACC_FINAL; | |
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ACC_PRIVATE; | |
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ACC_PUBLIC; | |
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ACC_STATIC; | |
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ACC_SUPER; | |
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ILOAD; | |
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.INVOKESPECIAL; | |
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.INVOKESTATIC; |
;; warm up: balancing | |
=> (s/def ::balanced | |
(s/* (s/cat :open #{'<} :children ::balanced :close #{'>}))) | |
:user/balanced | |
=> (s/conform ::balanced '[< < > < > > < >]) | |
[{:open <, :children [{:open <, :close >} {:open <, :close >}], :close >} {:open <, :close >}] | |
=> (s/conform ::balanced '[< < > < < > > > < >]) | |
[{:open <, :children [{:open <, :close >} {:open <, :children [{:open <, :close >}], :close >}], :close >} {:open <, :close >}] | |
;; infix to prefix |
# From the series R(emodelling) E(electronic) C(lassics) with Sonic Pi | |
# Black Dog Productions - Otaku (1992) | |
use_bpm 120 | |
# Download sample and adjust path to your environement | |
path = "/home/marty/projects/leuphana-local/sonic-pi/mb/samples/", 0 | |
load_sample path, 2 | |
# http://www.freesound.org/people/kendallbear/sounds/123804/ | |
clap = path, 2 |
(defn on-changes | |
"Middleware factory which acts a bit like \"reaction\" (but it flows into db , rather than out) | |
It observes N inputs (paths into db) and if any of them change (as a result of the | |
handler being run) then it runs 'f' to compute a new value, which is | |
then assoced into the given out=path within app-db. | |
Usage: | |
(defn my-f | |
[a-val b-val] |
#Tribute to Dr Who coded by Robin Newman, February 2015 | |
#Better on a Pi2 or Mac. A bit scratchy on B+ but just about OK | |
use_synth :prophet #synth for bass part | |
s=0 #to set the scope of the variable redefined in the next function | |
define :usebpm do |n| #setup own bpm definition | |
s=1.0/8*120/n | |
end | |
usebpm(200) #set required bpm |
for Boot, slides and help with Boot intel.
for slides and help with Lein pitfals
;;;; Super top secret talk stuff nobody should ever see. Shhh. | |
(in-ns 'user) | |
(defmacro bench [& body] | |
`((re-find #"\"(.*)\"" (with-out-str (time (do ~@body)))) 1)) | |
*ns* | |
(require 'clojure.walk) |
(ns midi-parser.core | |
(:use clojure.java.data) | |
#_(:use utils.utils) | |
#_(:use vendors.debug-repl) | |
(:import (java.io File) | |
#_(java.util Arrays) | |
#_(java.nio ByteBuffer) | |
(javax.sound.midi MidiSystem Sequence MidiMessage MidiEvent ShortMessage MetaMessage Track))) | |
;***************** Utils ******************** |