Skip to content

Instantly share code, notes, and snippets.

View wedesoft's full-sized avatar

Jan Wedekind wedesoft

View GitHub Profile
@wedesoft
wedesoft / deps.edn
Last active July 3, 2024 19:33
Using NASA SPK format to interpolate planet ephemerides (translating jplephem code to Clojure)
{:deps {org.clojure/clojure {:mvn/version "1.11.3"}
instaparse/instaparse {:mvn/version "1.5.0"}
org.clj-commons/gloss {:mvn/version "0.3.6"}
generateme/fastmath {:mvn/version "2.4.0" :exclusions [com.github.haifengl/smile-mkl org.bytedeco/openblas]}
org.lwjgl/lwjgl {:mvn/version "3.3.3"}
org.lwjgl/lwjgl$natives-linux {:mvn/version "3.3.3"}}
:paths ["."]}
@wedesoft
wedesoft / cube.pde
Created October 1, 2023 15:20
Rubik's cube implemented in Java Processing
int t;
int n;
int dir;
int axis;
int grid = 100;
int size = 80;
void setup() {
size(854, 480, P3D);
rnd();
@wedesoft
wedesoft / get-assimp-mesh.clj
Last active August 3, 2023 20:54
using LWJGL Assimp to access a mesh in Clojure
; https://lwjglgamedev.gitbooks.io/3d-game-development-with-lwjgl/content/chapter27/chapter27.html
; https://github.com/LWJGL/lwjgl3/issues/558
(require '[clojure.reflect :as r]
'[clojure.pprint :as p])
(import '[org.lwjgl.assimp Assimp AIMesh AIVector3D AIVector3D$Buffer AIMaterial AIString AITexture])
(import '[org.lwjgl.stb STBImage])
(defn all-methods [x]
@wedesoft
wedesoft / dmesg.txt
Created June 15, 2023 19:59
dmesg output of amdgpu rendering failure
[ 3789.603274] [drm:amdgpu_job_timedout [amdgpu]] *ERROR* ring gfx timeout, signaled seq=428555, emitted seq=428557
[ 3789.603742] [drm:amdgpu_job_timedout [amdgpu]] *ERROR* Process information: process java pid 7811 thread java:cs0 pid 7848
[ 3789.604177] amdgpu 0000:05:00.0: amdgpu: GPU reset begin!
[ 3789.705737] ------------[ cut here ]------------
[ 3789.705743] WARNING: CPU: 0 PID: 4769 at drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:656 amdgpu_irq_put+0x45/0x70 [amdgpu]
[ 3789.706167] Modules linked in: ctr ccm rfcomm xt_conntrack nft_chain_nat xt_MASQUERADE nf_nat nf_conntrack_netlink nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 xfrm_user xfrm_algo xt_addrtype nft_compat nf_tables libcrc32c nfnetlink br_netfilter bridge stp llc snd_seq_dummy snd_hrtimer snd_seq snd_seq_device qrtr overlay cmac algif_hash algif_skcipher af_alg bnep binfmt_misc nls_ascii nls_cp437 vfat fat iwlmvm btusb mac80211 btrtl btbcm btintel btmtk intel_rapl_msr libarc4 intel_rapl_common bluetooth edac_mce_amd uvcvideo videobuf2_vmalloc
@wedesoft
wedesoft / bounce.pde
Created June 11, 2023 13:34
Bouncy ball implemented in Java Processing
float x;
float y;
float vx;
float vy;
int radius;
float ay;
void setup() {
size(1000, 800);
x = 500;
@wedesoft
wedesoft / deps.edn
Last active October 26, 2023 04:44
{:deps {org.clojure/clojure {:mvn/version "1.11.1"}
org.lwjgl/lwjgl {:mvn/version "3.3.2"}
org.lwjgl/lwjgl$natives-linux {:mvn/version "3.3.2"}
org.lwjgl/lwjgl-opengl {:mvn/version "3.3.2"}
org.lwjgl/lwjgl-opengl$natives-linux {:mvn/version "3.3.2"}
org.lwjgl/lwjgl-glfw {:mvn/version "3.3.2"}
org.lwjgl/lwjgl-glfw$natives-linux {:mvn/version "3.3.2"}}}
@wedesoft
wedesoft / deps.edn
Last active May 23, 2023 08:04
Clojure/Java matrix library comparison core.matrix vs EJML vs vectorz-clj vs fastmath
{:deps {org.clojure/clojure {:mvn/version "1.11.1"}
net.mikera/core.matrix {:mvn/version "0.63.0"}
net.mikera/vectorz-clj {:mvn/version "0.48.0"}
org.ejml/ejml-all {:mvn/version "0.43"}
criterium/criterium {:mvn/version "0.4.6"}
generateme/fastmath {:mvn/version "2.2.2-SNAPSHOT" :exclusions [com.github.haifengl/smile-mkl org.bytedeco/openblas]}}}
@wedesoft
wedesoft / guard.sh
Created April 27, 2023 07:47
Guard script to automatically run tests
#!/bin/sh
while true; do
clear;
poetry run pytest "$@";
git ls-files -z | xargs -0 inotifywait -e CLOSE_WRITE;
done
@wedesoft
wedesoft / cloudcube.clj
Last active November 18, 2022 21:37
Clouds with self-shadowing using deep opacity map
(require '[clojure.core.matrix :refer (matrix div sub mul add mget mmul inverse) :as m]
'[clojure.core.matrix.linear :refer (norm)]
'[clojure.math :refer (PI sqrt pow cos sin to-radians)]
'[com.climate.claypoole :as cp]
'[gnuplot.core :as g]
'[sfsim25.quaternion :as q]
'[sfsim25.atmosphere :refer :all]
'[sfsim25.clouds :refer :all]
'[sfsim25.shaders :as s]
'[sfsim25.ray :refer :all]
@wedesoft
wedesoft / testletter.tex
Last active November 7, 2022 11:44
Latex letter
% https://www.dickimaw-books.com/latex/admin/html/letter.shtml
\documentclass[12pt]{letter}
\usepackage[a4paper]{geometry}
\usepackage[british]{babel}
\begin{document}
\begin{letter}{Mrs Mabel Canary\\24 The Street\\