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 / JOAL-raspberry-pi-demo.sh
Last active December 14, 2018 06:12
JOAL test for Raspberry Pi
sudo apt-get update
# First install openjdk jre/jdk to get java running on the Pi
# For a complete list of openjdk package names options to use see:
# http://www.raspberrypi.org/phpBB3/viewtopic.php?f=81&t=27805
sudo apt-get install openjdk-7-jre
# Download the gluegen-rt, joal and native armel/armhf libs for the Pi (~400kb)
wget http://jogamp.org/deployment/jogamp-current/jar/gluegen-rt.jar
wget http://jogamp.org/deployment/jogamp-current/jar/gluegen-rt-natives-linux-armv6.jar
@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 / jogl-demos inventory
Created July 10, 2013 14:31
jogl-demos library
JOGL demos
wget http://jogamp.org/deployment/jogamp-current/jogl-demos/jar/jogl-demos.jar
java -cp jogl-demos.jar:jar/jogl-all.jar:jar/gluegen-rt.jar
UTIL
wget http://jogamp.org/deployment/jogamp-current/jogl-demos/jar/jogl-demos-util.jar
wget http://jogamp.org/deployment/jogamp-current/jogl-demos/jar/jogl-demos-dualDepthPeeling.jar
wget http://jogamp.org/deployment/jogamp-current/jogl-demos/jar/jogl-demos-data.jar
java -cp jogl-demos.jar:junit.jar:jogl-test.jar:jogl-all.jar:gluegen-rt.jar:jogl-demos-data.jar:jogl-demos-dualDepthPeeling.jar:jogl-demos-tennis.jar:jogl-demos-util.jar
/**
* Copyright 2012 JogAmp Community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
@xranby
xranby / xorg.conf
Created March 27, 2013 10:23
ac100 GLX xorg.conf
# This is the minimal configuration necessary to use the Tegra driver.
# Please refer to the xorg.conf man page for more configuration
# options provided by the X server, including display-related options
# provided by RandR 1.2 and higher.
# Disable extensions not useful on Tegra.
Section "Module"
Disable "dri"
Disable "dri2"
# Disable "glx"
@xranby
xranby / sc05-download-compile-run.sh
Last active December 10, 2015 21:08
3D Convex hull - Scala/Swing JOGL 2 setup http://www.falcon.at-ninja.jp/sc05.html
# This gist will focus on how to setup and run the 3D Convex hull - Scala/Swing JOGL 2 project.
http://www.falcon.at-ninja.jp/sc05.html
# Debian/Ubuntu users can install scalac, scala and 7z using-apt-get:
sudo apt-get install scala p7zip-full
# Download and unpack the sc05 project source, jogamp jogl2 and scala-swing dependencies.
wget http://www.falcon.at-ninja.jp/src/sc05.zip
unzip sc05.zip
wget http://jogamp.org/deployment/jogamp-current/archive/jogamp-all-platforms.7z
@xranby
xranby / libgdx-demos-gdx-backend-jogl.patch
Created January 5, 2013 22:44
libgdx demos gdx-backend-jogl
diff --git a/demos/cuboc/cuboc/.classpath b/demos/cuboc/cuboc/.classpath
index 45b2d1c..e3b9615 100644
--- a/demos/cuboc/cuboc/.classpath
+++ b/demos/cuboc/cuboc/.classpath
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry combineaccessrules="false" kind="src" path="/gdx"/>
@xranby
xranby / gist:4463257
Last active December 10, 2015 16:48
ARM/Linux libgdx runnable jar deployment using gdx-backend-jogl experiment.
# Tested using xranby/libgdx.git master that includes the gdx-backend-jogl eclipse runnable jar deployment fix
git clone http://github.com/xranby/libgdx.git
# libgdx runnable jar deployment using gdx-backend-jogl
1. From inside Eclipse and choose file > Export... > Java > Runable JAR File
2. Select the libgdx game project in the dropdown menu
3. Change export destination and name the "main" jar i will assume you have choosen the name exportedname.jar .
4. Library handling:
select one of:
Package required libraries into generated JAR