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
using Plots, Interact, Base.Threads, BenchmarkTools | |
# only called by resize. | |
function batchify(maxIndex, numBatches) | |
if mod(maxIndex, numBatches) == 0 | |
n = numBatches | |
else | |
n = numBatches - 1 | |
end | |
batchSize = div(maxIndex, n) |
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
#lang racket | |
(define cyphertext | |
"") | |
(define code | |
#hash(("a" . "_") | |
("b" . "_") | |
("c" . "_") | |
("d" . "_") |
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
RESTful: /mymock/17 | |
Model: | |
====== | |
package com.….; | |
import lombok.Data; |
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
package gitchen; | |
import java.io.ByteArrayInputStream; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.util.Arrays; | |
import java.util.zip.InflaterInputStream; | |
// a class to look into the private parts of your git repo | |
public class Read { |
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
def spread3(num_accents, size, *args) | |
args_h = resolve_synth_opts_hash_or_array(args) | |
beat_rotations = args_h[:rotate] | |
res = [] | |
# if someone requests 8 or more accents in a bar of 8 beats | |
# default to filling the output with accents | |
# (rotation is futile here) | |
if num_accents >= size # changed to >=, so v2 is not empty below | |
res = [true] * size | |
return res.ring |
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
# helper for spread2 | |
def redistribute(v1, v2) | |
vNew = [] | |
while v1.length > 0 && v2.length > 0 | |
a1 = v1.shift | |
a2 = v2.shift | |
vNew.unshift(a1 + a2) | |
end | |
if v1.length > 0 then |
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
def redistribute(v1, v2) | |
vNew = [] | |
while v1.length > 0 && v2.length > 0 | |
a1 = v1.shift | |
a2 = v2.shift | |
vNew.unshift(a1 + a2) | |
end | |
if v1.length > 0 then | |
[vNew, v1] | |
else |
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
# Want to make it better? | |
# 1. the volume scale should center about a | |
# frequency, not an octave | |
# 2. Check why using saw instead of sine doesn't work somehow. | |
# 3. The scaling with v and s shall make the overall volume | |
# sounds right AND smooth the ends. | |
# This should be seperated. | |
# 4. The smooting may be easier using subtractive synthesis | |
# 5. Can I create a complete synthesizer this way? What is missing? |
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 datomic-zero | |
(:use [datomic.api :only [q db entity] :as d]) | |
(:use (clojure pprint))) | |
;; URI as identifyer of the db | |
(def uri "datomic:mem://trials") | |
;; create database | |
(d/create-database uri) |
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
object GitTest { | |
println("Testing JGit with Scala") | |
/* | |
- I used the Typesafe Scala IDE (Eclipse and a bit more) | |
- Downloaded JGit (2.1.0.201209190230-r) from http://eclipse.org/jgit/download/ | |
- Donloaded JSch (Java Secure Channel, jsch-0.1.49.jar) from http://www.jcraft.com/jsch/ | |
- Put both in the build path. |
NewerOlder