Skip to content

Instantly share code, notes, and snippets.

@cyriux
cyriux / Re-architect-your-batches-with-DDD-references.md
Last active April 30, 2024 12:17
Links of the conference talk Devoxx 2023
@cyriux
cyriux / Crafter_links.md
Created October 11, 2019 15:31
Liens de mon talk « Crafter, pourquoi pas moi ? »
@cyriux
cyriux / ModelingMusicDDDPractitioner.md
Last active October 3, 2019 19:01
Links of the talk Modeling Music for DDD Practitioner
@cyriux
cyriux / JsynWobbleDemo.java
Created September 29, 2019 18:23
Dubstep-ish Wobble (LFO-modulated filter) from a LFO-modulated PWM, using Java Modular Synth Jsyn
package com.martraire.synthesis;
import org.junit.Test;
import com.jsyn.JSyn;
import com.jsyn.Synthesizer;
import com.jsyn.ports.UnitInputPort;
import com.jsyn.unitgen.Add;
import com.jsyn.unitgen.FilterLowPass;
import com.jsyn.unitgen.LineOut;
@cyriux
cyriux / craft-forever-links.md
Last active June 29, 2019 05:58
Sunny Tech 2019 - Craft Forever Links & References
@cyriux
cyriux / MonoidTest.java
Created July 23, 2018 14:41
Testing the properties of a Monoid with Property-based Testing in Java with JUnit-Quickcheck
package pbt;
import static org.junit.Assert.assertEquals;
import static pbt.MonoidTest.Balance.ERROR;
import static pbt.MonoidTest.Balance.ZERO;
import org.junit.runner.RunWith;
import com.pholser.junit.quickcheck.From;
import com.pholser.junit.quickcheck.Property;
@cyriux
cyriux / CashflowSequenceTest.java
Created July 19, 2018 16:38
A simplified example of a list of cashflow made into a monoid (could easily become a space vector)
package com.cyrillemartraire.monoids;
import static java.lang.Double.doubleToLongBits;
import static java.util.Arrays.asList;
import static org.junit.Assert.assertEquals;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@cyriux
cyriux / HistogramTest.java
Created July 19, 2018 15:15
A simplistic monoidal histogram (fixed range of values, fixed bins)
package com.cyrillemartraire.monoids;
import static org.junit.Assert.assertEquals;
import java.util.Arrays;
import org.junit.Test;
public class HistogramTest {
@cyriux
cyriux / Weight.java
Last active July 23, 2018 14:32
Simplest monoid ever: a weight (in kg) with addition, equality and toString
public class Weight {
private final double weight;
public final static Weight ZERO = new Weight(0.);
public Weight(double weight) {
if (weight < 0) {
throw new IllegalArgumentException("Weight must be positive");
}
this.weight = weight;
@cyriux
cyriux / MonoidMapTest.java
Last active July 19, 2018 21:51
[MONOID] An example of a monoidal map with an operation defined so that the left-hand value always wins (overwrites)
package com.cyrillemartraire.monoids;
import static org.junit.Assert.assertEquals;
import java.util.HashMap;
import java.util.Map;
import org.junit.Test;
public class MonoidMapTest {