Skip to content

Instantly share code, notes, and snippets.

View maarzt's full-sized avatar

Matthias Arzt maarzt

  • MPI-CBG
  • Dresden
View GitHub Profile
@maarzt
maarzt / SwingMultiThreadingDemo.java
Created November 30, 2022 10:11
A long lasting method inside SwingUtilities.invokeLater() blocks the UI.
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;
import net.miginfocom.swing.MigLayout;
/**
* Demo:
* A long lasting method inside SwingUtilities.invokeLater() still blocks the
* event dispatch thread, and therefore the UI.
@maarzt
maarzt / gist:7889bb2e19c105b23417104cf95b21e0
Created September 15, 2021 22:39
Labkit quick start tutorial as GIF, version 1
Labkit quick start tutorial as GIF
@maarzt
maarzt / test.txt
Created December 22, 2020 14:34
File for testing remote access
Hello World!
@maarzt
maarzt / LoopBuilderPerformanceDemo.java
Created May 22, 2020 15:31
Benchmark comparing the performance of ImgLib2 Cursor agains LoopBuilder
import net.imglib2.Cursor;
import net.imglib2.img.Img;
import net.imglib2.img.array.ArrayImg;
import net.imglib2.img.array.ArrayImgs;
import net.imglib2.img.cell.CellImg;
import net.imglib2.img.cell.CellImgFactory;
import net.imglib2.img.planar.PlanarImg;
import net.imglib2.img.planar.PlanarImgs;
import net.imglib2.loops.LoopBuilder;
import net.imglib2.type.numeric.real.FloatType;
import net.imglib2.RandomAccessibleInterval;
import net.imglib2.img.array.ArrayImgs;
import net.imglib2.type.numeric.integer.IntType;
import net.imglib2.util.StopWatch;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
/**
* Demonstration on how to use (and how not to use) multi-threaded LoopBuilder,
@maarzt
maarzt / ForkJoinPool.java
Created April 15, 2019 12:01
Example Using The ForkJoinPool
import net.imglib2.util.StopWatch;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinTask;
import java.util.concurrent.Future;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
@maarzt
maarzt / Sandbox.java
Created July 25, 2018 13:05
Suggestion for imglib2 PR #214
import net.imglib2.img.basictypeaccess.ByteAccess;
import net.imglib2.img.basictypeaccess.IntAccess;
import net.imglib2.img.basictypeaccess.LongAccess;
import net.imglib2.img.basictypeaccess.ShortAccess;
import net.imglib2.img.basictypeaccess.array.ByteArray;
import net.imglib2.type.NativeType;
import net.imglib2.type.numeric.integer.ByteType;
import net.imglib2.type.numeric.integer.IntType;
import net.imglib2.type.numeric.integer.LongType;
import net.imglib2.type.numeric.integer.ShortType;