Skip to content

Instantly share code, notes, and snippets.

View xranby's full-sized avatar
🧘
guru meditation

Xerxes Rånby xranby

🧘
guru meditation
View GitHub Profile
@xranby
xranby / Log.java
Created December 14, 2021 00:05
Log.java Productive Java logging measure the time in ms between two calls to System.out.println This allow simple java code to be benchmarked.
/*
Productive Java logging
measure the time in ms
between two calls to System.out.println
This allow simple java code to be benchmarked.
Have a great day!
- Xerxes Rånby
2021 12 14
@xranby
xranby / gist:e7549d016fc6365e021ce99b5bfb2911
Created October 17, 2021 09:45
unpacked jar java example
#!/bin/sh
# assume you have a java application named update/*.jar that is using jars in update/lib/.jar
# this script will unpack all jars into the run folder
# then start your application inside the run folder with very simple classpath options
sdir=`dirname $(readlink -f $0)`
rootdir=`dirname $sdir`
echo rootdir $rootdir
@xranby
xranby / mali EGL and mesa GL at the same time
Last active November 13, 2016 20:02
Nov 3 2016 CHIP 4.4 - JogAmp 2.3.2 autodetection mesa GL and mali EGL
chip@chip:/usr/local/lib/processing/core/library$ ../../java/bin/java -cp gluegen-rt.jar:jogl-all.jar com.jogamp.newt.opengl.GLWindow
forceES2 false
forceES3 false
forceGL3 false
forceGL4ES3 false
-----------------------------------------------------------------------------------------------------
Platform: LINUX / Linux 4.4.13-ntc-mlc (4.4.13), arm-6 (ARMv6, EABI_GNU_ARMHF), 1 cores, littleEndian true
MachineDataInfo: runtimeValidated true, 32Bit true, primitive size / alignment:
int8 1 / 1, int16 2 / 2
int 4 / 4, long 4 / 4
@xranby
xranby / #openjdk #javaone 26 oct 2015
Last active October 26, 2015 14:14
ARM32 C1 and C2 jit's is comming to OpenJDK inside the AArch32 port
(14:28:25) xranby: Remember to talk & ask about the #OpenJDK #MobileProject & the #OpenJDK Port #AArch32 #ARM at #JavaOne #JavaOne2015 #Embedded #Mobile #Java!
(14:28:32) adinn: look under jdk9/jdk9/jdk or jdkN/jdkNu/jdk for N = 7/8
(14:30:36) xranby: both of these topics has not yet been granted infrastructure by the openjdk Governing Board
(14:31:56) xranby: Port: AArch32 http://mail.openjdk.java.net/pipermail/porters-dev/2015-October/000503.html
(14:32:14) xranby: Result: New Project: Mobile http://mail.openjdk.java.net/pipermail/announce/2015-October/000201.html
(14:32:32) xranby: however no infrastructure online at http://openjdk.java.net/
(14:34:58) adinn: xranby: the OpenJDK AArch32 Port project has only just been proposed so it's not surprising that it has no infrastructure as yet -- the GB has not actually convened since the proposal
(14:35:50) xranby: adinn: how about the Mobile Project?
(14:36:03) adinn: xranby: I have no dog in that fight :-)
(14:36:31) adinn: xranby: but I don't think the GB has
#include <Servo.h>
Servo myServo; // create a servo object
void setup() {
// ställ in utgångar (lamporna)
pinMode(5, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(7, INPUT);
@xranby
xranby / gl2.newt.TestGearsNewtAWTWrapper
Created October 5, 2015 22:53
gl2.newt.TestGearsNewtAWTWrapper
Fedora 22
gnome
OpenJDK 8
junit test test01
java.lang.RuntimeException: Waited 5000ms for: <2401f4c3, 7637f22>[count 1, qsz 0, owner <main-AWTAnimator#00>] - <main>
at jogamp.common.util.locks.RecursiveLockImpl01Unfairish.lock(RecursiveLockImpl01Unfairish.java:198)
at com.jogamp.nativewindow.awt.JAWTWindow.lockSurface(JAWTWindow.java:655)
at jogamp.opengl.GLDrawableImpl.lockSurface(GLDrawableImpl.java:307)
@xranby
xranby / JOGLQuad.java
Created September 25, 2015 12:13
JOGLQuad.java
import com.jogamp.opengl.*;
import com.jogamp.opengl.fixedfunc.*;
import com.jogamp.opengl.util.Animator;
import com.jogamp.newt.opengl.GLWindow;
/**
* Self-contained example (within a single class only to keep it simple)
* displaying a rotating quad
*/
public class JOGLQuad implements GLEventListener {
@xranby
xranby / JOGLQuadES2.java
Created September 25, 2015 11:33
JOGLQuadES2.java
import com.jogamp.opengl.*;
import com.jogamp.opengl.fixedfunc.*;
import com.jogamp.opengl.util.Animator;
import com.jogamp.opengl.util.ImmModeSink;
import com.jogamp.opengl.util.PMVMatrix;
import com.jogamp.opengl.util.glsl.ShaderState;
import com.jogamp.opengl.util.glsl.fixedfunc.FixedFuncUtil;
import com.jogamp.opengl.util.glsl.fixedfunc.ShaderSelectionMode;
import com.jogamp.newt.opengl.GLWindow;
/**
@xranby
xranby / JOGLQuadES1.java
Last active September 23, 2015 15:23
This program displays a simple 3D rendering of a polygon using JOGL. Please note though that this code is a demonstration of the use of JOGL and as such makes use of immediate mode drawing commands; this serves to show how the conventional C style API is used through JOGL, but it is strongly recommended to make use of modern OpenGL techniques.
import com.jogamp.opengl.*;
import com.jogamp.opengl.fixedfunc.*;
import com.jogamp.opengl.util.Animator;
import com.jogamp.opengl.util.ImmModeSink;
import com.jogamp.newt.opengl.GLWindow;
/**
* Self-contained example (within a single class only to keep it simple)
* displaying a rotating quad
*/
public class JOGLQuadES1 implements GLEventListener {
@xranby
xranby / gldemo.rb
Last active August 29, 2015 14:27
Initialized fine now
Dir.glob('*.jar').each {|jar| require jar }
java_import 'com.jogamp.opengl.GLCapabilities',
'com.jogamp.opengl.GLDrawableFactory',
'com.jogamp.opengl.GLProfile',
'com.jogamp.opengl.GL4',
'com.jogamp.nativewindow.util.Rectangle',
'com.jogamp.newt.opengl.GLWindow',
'com.jogamp.opengl.util.FPSAnimator',
'com.jogamp.opengl.GLEventListener',