Skip to content

Instantly share code, notes, and snippets.

View daveliepmann's full-sized avatar

Dave Liepmann daveliepmann

View GitHub Profile
;; 300x300 seems to be about where performance starts to degrade.
(let [i (cell (interval :frame inc))]
(cell
(apply layer
(for [x (range 0 300 20)
y (range 0 300 20)]
(let [angle (* (/ 3.14 180) (+ @i x y))]
(position (+ x (* 15 (Math/cos angle)))
(+ y (* 15 (Math/sin angle)))
@daveliepmann
daveliepmann / java-interop2.md
Last active April 26, 2021 03:03
Java interop for the Clojurists who haven't done Java and who need to translate Java code to Clojure
@daveliepmann
daveliepmann / tensor-with-placeholders.clj
Last active April 16, 2018 13:52
"Construction of a trivial graph to add two float tensors and then repeated invocation of the single graph using placeholders", from https://github.com/tensorflow/tensorflow/issues/6781#issuecomment-271888411 in Clojure based on the original Java
;; make sure your ns has `(:import [org.tensorflow DataType Graph Output Session Tensor])`
;; or if in REPL, evaluate `(import [org.tensorflow DataType Graph Output Session Tensor])` first
;; Construct a graph to add two float Tensors, using placeholders.
(let [g (Graph.)
s (Session. g)
x (-> (.opBuilder g "Placeholder" "x")
(.setAttr "dtype" DataType/FLOAT)
(.build)
(.output 0))

Speech at the American Legion

Hans Liepmann, circa 1946-8


During the long weary days and nights I spent in the Army, I had ample time to think about my American citizenship. I knew Germany under the Kaiser, during the Weimar Republic, in the beginning of Hitler’s regime and I saw it again at the end of it. Therefore, I had quite some occasion to compare it with America and maybe some of my experiences and observations will be interesting for you to hear. I consider it a great honor to be asked by the American Legion to talk to you and I thank the chairman very much.

You heard in the introduction a short outline of my story but I may be permitted to say a few more words about it. In 1933, when Hitler was chancellor, I received a letter from the government that from the next day on I, being a Jewish physician, was not permitted any longer to take care of patients who were members of the medical insurance companies. That was not so terribly bad in itself. But at that

@daveliepmann
daveliepmann / load_edn.cljd
Created September 11, 2023 13:11
clojuredart mvp of loading edn from asset file
(ns sample.load-edn
"Load EDN from asset on startup"
(:require
["package:flutter/material.dart" :as m]
["package:flutter/widgets.dart" :as f.widgets]
["package:flutter/services.dart" :as f.services]
[cljd.flutter :as f]
[cljd.reader]))
@daveliepmann
daveliepmann / assert-or-not.md
Last active March 2, 2025 12:24
A guide to orthodox use of assertions in Clojure.

When to use assert?

In JVM Clojure, Exceptions are for operating errors ("something went wrong") and Assertions are for programmer and correctness errors ("this program is wrong").

An assert might be the right tool if throwing an Exception isn't enough. Use them when the assertion failing means

  • there's a bug in this program (not a caller)
  • what happens next is undefined
@daveliepmann
daveliepmann / ultimate-s&c.md
Last active January 24, 2025 13:50
ultimate frisbee s&c brainstorming

S&C targets for an Ultimate (Frisbee) player

Each athlete must decide which areas of interest get prioritized in a particular training block. Note that exercises like RDLs and lunges are useful for multiple goals.

[Performance, pre-hab] Plyometrics & Sprints

These are of the highest importance. Consider them almost mandatory. Bouncing, jumping, bounding, skipping, and maximal sprints are critical to develop tissue resilience and to maintain or improve the athletic qualities most important in Ultimate.

Winter training conditions might make it tough to find a place to run, so plyometrics must take up the slack by being part of every workout.

Train them in multiple directions, not just straight forward. Most plyometrics should be extensive, not intensive. Stay fresh; never try to train these through fatigue.