Skip to content

Instantly share code, notes, and snippets.

View ennerf's full-sized avatar

Florian Enner ennerf

View GitHub Profile
@ennerf
ennerf / missing_symbols.c
Created December 19, 2025 09:57
src/main/resources/native/android/c/missing_symbols.c
#include <stdlib.h>
// AWT: GraalVM native-image explicitly adds (unresolved) references that are not called,
// but result in a loading error if not defined. See https://github.com/gluonhq/substrate/pull/1000#issuecomment-1152529456
// ============ Generate ============
/*
nm target/gluonfx/aarch64-android/lib*.so | grep "U Java_" | awk '{print "void " $2 "() {\n fprintf(stderr, \"We should never reach here ("$2")\\n\");\n}\n"}'
*/
@ennerf
ennerf / ImageFuryCodec_158838041_640070680_523794808.java
Last active August 1, 2023 21:12
Fury benchmarks generated classes
package io.fury.benchmark.data;
import java.util.List;
import java.util.Map;
import java.util.Set;
import io.fury.Fury;
import io.fury.memory.MemoryBuffer;
import io.fury.resolver.NoRefResolver;
import io.fury.resolver.ClassInfo;
import io.fury.resolver.ClassInfoCache;
@ennerf
ennerf / ContainerMessage.java
Created February 10, 2023 08:49
QuickBuffers 1.1.0 - Generated samples
// Code generated by protocol buffer compiler. Do not edit!
package protos.test.quickbuf;
import java.io.IOException;
import protos.test.quickbuf.external.ImportEnum;
import protos.test.quickbuf.external.ImportMessage;
import us.hebi.quickbuf.FieldName;
import us.hebi.quickbuf.InvalidProtocolBufferException;
import us.hebi.quickbuf.JsonSink;
import us.hebi.quickbuf.JsonSource;
import com.lmax.disruptor.EventHandler;
import com.lmax.disruptor.EventPoller;
import com.lmax.disruptor.dsl.Disruptor;
import com.lmax.disruptor.util.DaemonThreadFactory;
import javafx.animation.AnimationTimer;
/**
* Uses a JavaFX AnimationTimer that gets called once per frame to poll
* events from a Disruptor. This automatically batches events down to the
* frame rate and can remove other synchronization code for getting data
@ennerf
ennerf / MandelbrotFX.java
Last active December 27, 2022 11:33
Multi-threaded Mandelbrot for JavaFX
import javafx.application.Application;
import javafx.beans.binding.Bindings;
import javafx.geometry.Orientation;
import javafx.scene.Scene;
import javafx.scene.control.Slider;
import javafx.scene.image.*;
import javafx.scene.layout.*;
import javafx.stage.Stage;
import java.nio.ByteBuffer;
@ennerf
ennerf / UiConfig.java
Last active May 28, 2022 21:35
Properties with persistence
/**
* Properties with added persistence between runs. Generated accessors are omitted.
*/
public class UiConfig extends PersistentProperties {
private final BooleanProperty debugEnabled = getBoolean("ENABLE_DEBUG", true);
private final StringProperty unitLabel = getString("SELECTED_UNITS", "mm");
}
@ennerf
ennerf / PersistentProperties.java
Created May 28, 2022 21:28
Class to help persist JavaFX properties between runs
/*-
* %%
* Copyright (C) 2018-2022 HEBI Robotics
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@ennerf
ennerf / view2.fxml
Last active May 28, 2022 21:07
View 2 FXML bindigns
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Text?>
<StackPane xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="us.hebi.gui.ViewController">
<children>
@ennerf
ennerf / ViewController.java
Last active May 28, 2022 21:01
View Controller w/ DI
public class ViewController {
@FXML
Button button;
@Getter
@Inject
UiConfig cfg;
}
@ennerf
ennerf / UiConfig.java
Created May 28, 2022 20:44
UI Config
public class UiConfig {
public boolean getDebugEnabled() {
return debugEnabled.get();
}
public BooleanProperty debugEnabledProperty() {
return debugEnabled;
}