Skip to content

Instantly share code, notes, and snippets.

View ennerf's full-sized avatar

Florian Enner ennerf

View GitHub Profile
package us.hebi.flatbuffers;
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.runner.Runner;
import org.openjdk.jmh.runner.RunnerException;
import org.openjdk.jmh.runner.options.Options;
import org.openjdk.jmh.runner.options.OptionsBuilder;
import org.openjdk.jmh.runner.options.VerboseMode;
import java.util.concurrent.TimeUnit;
@ennerf
ennerf / BufferWriteBenchmark.java
Created June 18, 2015 22:44
Benchmark of Protobuf JavaNano writeRawLittleEndian32 and writeRawVarint32 using byte[] (old) and ByteBuffer (new)
package us.hebi.protocol.nano;
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.runner.Runner;
import org.openjdk.jmh.runner.RunnerException;
import org.openjdk.jmh.runner.options.Options;
import org.openjdk.jmh.runner.options.OptionsBuilder;
import org.openjdk.jmh.runner.options.VerboseMode;
import java.nio.ByteBuffer;
------------------------------
OS: Windows 8.1
JDK: Oracle JDK 1.8.0_20-b26
CPU: Intel i5-3427U @ 1.80 Ghz
------------------------------
Benchmark Mode Samples Score Score error Units
o.e.f.b.BenchmarkComparison.flatEncodeDirect avgt 20 1.137 0.036 us/op
o.e.f.b.BenchmarkComparison.flatUseDirect avgt 20 0.639 0.013 us/op
o.e.f.b.BenchmarkComparison.flatDecodeDirect avgt 20 0.009 0.001 us/op
% Simplified source code for mecanum wheel base demo video without
% camera and tilt
%
% YouTube: Teleop Taxi - HEBI Robotics
% https://youtu.be/zaPtxre4tFc
%
% Features: joystick input to control motions of a 4 wheel base
%
% Requirements: MATLAB 2013b or higher
% Logitech Gamepad F310
% Source code for mecanum wheel base demo video
%
% YouTube: Teleop Taxi - HEBI Robotics
% https://youtu.be/zaPtxre4tFc
%
% Features: joystick input to control motions of a 4 wheel base
% joystick input to control camera tilt
% displays live video streaming
%
% Requirements: MATLAB 2013b or higher
@ennerf
ennerf / pom.xml
Last active August 31, 2020 08:55
Sample pom for using fat jars (e.g. shaded or obfuscated) with the java-fx-maven plugin
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.enner.samples</groupId>
<artifactId>packager-with-shade-jar</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
@ennerf
ennerf / MappedBufferPool.java
Created November 11, 2020 13:03
Memory mapped buffer pool for MAT File Library
package us.hebi.core.io.mat;
import com.google.common.collect.Lists;
import us.hebi.glue.Buffer6;
import us.hebi.glue.DirectBuffer6;
import us.hebi.glue.Unsafe9;
import us.hebi.matlab.mat.format.BufferAllocator;
import java.io.Closeable;
import java.io.File;
@ennerf
ennerf / view1.fxml
Created May 28, 2022 18:05
Blog FXML Files
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.layout.StackPane?>
<StackPane xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1" fx:controller="us.hebi.gui.ViewController">
<children>
<Button fx:id="button" text="Change to View 2"/>
</children>
</StackPane>
@ennerf
ennerf / FXML
Last active May 28, 2022 19:04
FXML Files
<?xml version="1.0" encoding="UTF-8"?>
<!-- main.fxml -->
<StackPane fx:id="root" prefHeight="500.0" prefWidth="500.0" xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1" fx:controller="us.hebi.gui.ViewSwitchAppController">
<HBox alignment="CENTER" spacing="50.0">
<children>
<!-- include the other fxml files as nested components -->
<fx:include fx:id="view1" source="view1.fxml" />
@ennerf
ennerf / ViewController.java
Last active May 28, 2022 19:22
ViewController
public class ViewController {
@FXML
Button button;
}