Skip to content

Instantly share code, notes, and snippets.

View HanSolo's full-sized avatar

Gerrit Grunwald HanSolo

View GitHub Profile
@HanSolo
HanSolo / JavaFX_ePaper
Created January 1, 2015 13:37
JavaFX create snapshot and save as xbm file
// create the xbm image from a given node
createSnapshotAndWriteXbm(pane, "epaperImage");
// display the image on the e-paper display
try {
Process p1 = new ProcessBuilder("/bin/bash", "-c", "/home/pi/gratis/PlatformWithOS/driver-common/xbm2bin < /home/pi/epaper/yotaclock.xbm > /dev/epd/display").start();
p1.waitFor(1, TimeUnit.SECONDS);
Process p2 = new ProcessBuilder("/bin/bash", "-c", "echo U > /dev/epd/command").start();
p2.waitFor(1, TimeUnit.SECONDS);
} catch (InterruptedException | IOException e) {
07-06 15:36:24.272 21269-21269/? I/art﹕ Late-enabling -Xcheck:jni
07-06 15:36:24.474 21269-21269/eu.hansolo.healthtrack W/ResourceType﹕ Found multiple library tables, ignoring...
07-06 15:36:24.490 21269-21269/eu.hansolo.healthtrack I/HealthTrackApp﹕ HealthTrackApp onCreate()
07-06 15:36:24.761 21269-21269/eu.hansolo.healthtrack I/HealthTrack﹕ UpdateService started (Main)
07-06 15:36:24.804 21269-21269/eu.hansolo.healthtrack I/HealthTrack﹕ TrackService started (Main)
07-06 15:36:24.805 21269-21269/eu.hansolo.healthtrack I/HealthTrack﹕ Connecting to fitness api...
07-06 15:36:24.911 21269-21351/eu.hansolo.healthtrack D/OpenGLRenderer﹕ Render dirty regions requested: true
07-06 15:36:24.935 21269-21269/eu.hansolo.healthtrack D/Atlas﹕ Validating map...
07-06 15:36:24.973 21269-21269/eu.hansolo.healthtrack I/UpdateService﹕ UpdateService onCreate
07-06 15:36:24.979 21269-21269/eu.hansolo.healthtrack I/UpdateService﹕ UpdateService onStartCommand
07-06 16:25:29.482 1067-1089/eu.hansolo.healthtrack D/BluetoothLeScanner﹕ onScanResult() - ScanResult{mDevice=EC:3E:A1:B8:2C:3E, mScanRecord=ScanRecord [mAdvertiseFlags=4, mServiceUuids=null, mManufacturerSpecificData={76=[2, 21, -89, -82, 46, -73, 31, 0, 65, 104, -71, -101, -89, 73, -70, -63, -54, 100, 0, 1, 0, 1, -69, 80]}, mServiceData={}, mTxPowerLevel=-2147483648, mDeviceName=null], mRssi=-72, mTimestampNanos=7024043898743}
07-06 16:25:29.554 1067-1091/eu.hansolo.healthtrack D/BluetoothLeScanner﹕ onScanResult() - ScanResult{mDevice=DD:7A:EB:E8:28:59, mScanRecord=ScanRecord [mAdvertiseFlags=4, mServiceUuids=null, mManufacturerSpecificData={76=[2, 21, -89, -82, 46, -73, 31, 0, 65, 104, -71, -101, -89, 73, -70, -63, -54, 100, 0, 1, 0, 3, -69, 97]}, mServiceData={}, mTxPowerLevel=-2147483648, mDeviceName=null], mRssi=-79, mTimestampNanos=7024125671816}
07-06 16:25:29.845 1067-1173/eu.hansolo.healthtrack D/BluetoothLeScanner﹕ onScanResult() - ScanResult{mDevice=78:A5:04:71:7C:B9, mScanRecord=ScanReco
@HanSolo
HanSolo / IOS6Clock.java
Created June 14, 2012 06:18
JavaFX iOS6 style clock control (needs >= jfxtras-labs-0.2-SNAPSHOT.jar)
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
import jfxtras.labs.scene.control.gauge.Clock;
import jfxtras.labs.scene.control.gauge.ClockBuilder;
public class IOS6Clock extends Application
{
// example for a raw TCP socket connection using C++ to interface the Koukaam NETIO-230A
// resources:
// <http://www.ecst.csuchico.edu/~beej/guide/ipc/usock.html>
// <http://cs.nmu.edu/~randy/Classes/CS228/Notes/making-a-client-socket.html>
#include <iostream>
#include <string>
#include <unistd.h> // gethostbyname()
#include <sys/socket.h> // socket(), connect()
@HanSolo
HanSolo / lcdconfig
Created July 25, 2013 11:40
A JavaScript file that will be used to configure a JavaFX8 application at runtime by using the Nashorn scripting engine
var Lcd = Packages.eu.hansolo.enzo.lcd.Lcd;
var obj = new Object();
obj.configLcd = function(lcd) {
lcd.value = 0;
lcd.lowerRightText = 'config';
lcd.styleClass.setAll("lcd", "lcd-blue");
}
@HanSolo
HanSolo / MedusaCompass.java
Last active February 2, 2016 16:37
Compass control with Medusa Gauge (needs Medusa > 3.1)
import eu.hansolo.medusa.Fonts;
import eu.hansolo.medusa.Gauge;
import eu.hansolo.medusa.Gauge.KnobType;
import eu.hansolo.medusa.Gauge.NeedleBehavior;
import eu.hansolo.medusa.Gauge.NeedleShape;
import eu.hansolo.medusa.Gauge.NeedleType;
import eu.hansolo.medusa.GaugeBuilder;
import javafx.animation.AnimationTimer;
import javafx.application.Application;
import javafx.collections.ObservableList;
import eu.hansolo.tilesfx.Tile.SkinType;
import eu.hansolo.tilesfx.Tile.TileColor;
import eu.hansolo.tilesfx.tools.Location;
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import eu.hansolo.fx.dotmatrix.DotMatrix;
import eu.hansolo.fx.dotmatrix.DotMatrix.DotShape;
import eu.hansolo.fx.dotmatrix.DotMatrixBuilder;
import eu.hansolo.fx.dotmatrix.Test;
import javafx.application.Application;
import javafx.concurrent.Service;
import javafx.concurrent.Task;
import javafx.geometry.HPos;
import javafx.geometry.Insets;
import javafx.geometry.Pos;