Skip to content

Instantly share code, notes, and snippets.

View HanSolo's full-sized avatar

Gerrit Grunwald HanSolo

View GitHub Profile
@miho
miho / Main.java
Created March 23, 2014 17:00
Stream DSL like API
package eu.mihosoft.tutorials.streams;
import java.util.Arrays;
import java.util.List;
import static eu.mihosoft.tutorials.streams.Item.*;
import java.util.Objects;
import java.util.function.Predicate;
public class Main {
@pklaus
pklaus / netio230a.cpp
Created January 8, 2010 11:14
Simple Koukaam NETIO-230A automation via Raw TCP using C++, Java, PHP, Ruby, expect, Bash-TCP and wget (HTTP)
// 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()
import javafx.animation.AnimationTimer
RND = new Random()
DATA_PERIOD = 2500000000l
lastDataCall = 0
TIMER = [
handle: {long l ->
long currentNanoTime = System.nanoTime()
if (currentNanoTime > lastDataCall + DATA_PERIOD) {
import javafx.animation.AnimationTimer
RND = new Random()
DATA_PERIOD = 2500000000l
lastDataCall = 0
TIMER = [
handle: {long l ->
long currentNanoTime = System.nanoTime()
if (currentNanoTime > lastDataCall + DATA_PERIOD) {
@timyates
timyates / C compile Linux
Created June 29, 2012 10:07
JNA and Groovy
gcc -o libgreet.so -shared greet.c
@miho
miho / CodeEditor.java
Created July 21, 2012 13:19 — forked from jewelsea/CodeEditor.java
CodeMirror based code editor for JavaFX
import javafx.scene.layout.StackPane;
import javafx.scene.web.WebView;
/**
* A syntax highlighting code editor for JavaFX created by wrapping a
* CodeMirror code editor in a WebView.
*
* See http://codemirror.net for more information on using the codemirror editor.
*/
public class CodeEditor extends StackPane {
@miho
miho / CenteredNodeInScrollPaneExample.java
Created July 21, 2012 13:40 — forked from jewelsea/CenteredNodeInScrollPaneExample.java
Example of scrollpane viewports, transforms and layout bounds in JavaFX
import javafx.application.Application;
import javafx.application.Platform;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Bounds;
import javafx.geometry.Pos;
import javafx.scene.Node;
import javafx.scene.Scene;
@kevinsdooapp
kevinsdooapp / LogarithmicAxis.java
Created July 31, 2012 16:26
LogarithmicAxis class that extends ValueAxis
import javafx.scene.chart.ValueAxis;
/**
* A logarithmic axis implementation for JavaFX 2 charts<br>
* <br>
*
* @author Kevin Senechal
*
*/
public class LogarithmicAxis extends ValueAxis<Number> {
@kevinsdooapp
kevinsdooapp / getTickMarkLabel
Created July 31, 2012 16:48
getTickMarkLabel implementation for javafx 2 logarithmic axis
@Override
protected String getTickMarkLabel(Number value) {
NumberFormat formatter = NumberFormat.getInstance();
formatter.setMaximumIntegerDigits(6);
formatter.setMinimumIntegerDigits(1);
return formatter.format(value);
}
@kevinsdooapp
kevinsdooapp / getRange
Created July 31, 2012 16:52
getRange implementation for javafx 2 logarithmic axis
@Override
protected Object getRange() {
return new Number[] { lowerBoundProperty().get(), upperBoundProperty().get() };
}