Skip to content

Instantly share code, notes, and snippets.

View dhilst's full-sized avatar
😻

Daniel Hilst dhilst

😻
View GitHub Profile
public class JNIThread {
/* This method will be called asychrounously from
* native code. There is no native method because
* we will use JNI_OnLoad to make the magic happens. */
public static void calledAsynchronously() {
System.out.println("Asynchronous hello from Java");
}
public static void main(String[] args)
@dhilst
dhilst / JNIExceptionMain.java
Last active October 29, 2016 05:57
JNIExceptionMain.java
// At this example I will show how to throw and handle exceptions from native
// code. And how you can map the native return codes to different Exceptions in
// Java. I follow principles here.
//
// First. Less is more. The less classes you have tied to native code, the
// better. You can simply think this as encapsulation. The native code should
// be encapsuled in the smallest number of classes as possible.
//
// Sencond. Play safe. Surround all the error report so that at last one
// exception arrises. Even when native code return unexpected values. This
// In this example I will show how to cache classes, method and field IDs. Caching
// these lookups can improve performance of native calls by safing native code
// from extra JNI calls.
public class JNICache {
// Here we load our native library at a static block. This ensures that the library
// is loaded as soon as the class is loaded. This will make caching simpler and safer.
static {
System.loadLibrary("cache");
}
DESCRIPTION = "JDK 8.60 plus JavaFX compiled for iMX.6"
LICENSE = "MIT"
TARFILE = "jdk1.8.0_60-plus-JFX.tar.gz"
SRC_URI = "file://${TARFILE}"
FILES_${PN} = "/opt/jdk1.8.0_60/*"
# Disable -dbg package creation.
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
INSANE_SKIP_${PN} = "already-stripped dev-so ldflags"
mvn archetype:generate -DgroupId=io.github.gkos -DartifactId=springexmpl -DarchetypeArtifactId=spring-mvc-archetype -archetype-webapp -DinteractiveMode=false
@dhilst
dhilst / syntax-highlighter-for-java-snippet.html
Last active November 10, 2016 00:57
SyntaxHightLighter setup for Java
<link href="http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css" rel="stylesheet" type="text/css" />
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shAutoloader.js" type="text/javascript"></script>
<script src='http://alexgorbatchev.com/pub/sh/2.1.364/scripts/shBrushJava.js' type='text/javascript'></script>
<script language='javascript'>
SyntaxHighlighter.all();
</script>
# Copyright (C) 2016 Daniel Hilst SellI <[email protected]>
# Released under the Apache 2 license
DESCRIPTION = "Java depency manager and build tool"
HOMEPAGE = "http://maven.apache.org"
LICENSE = "Apache2"
SECTION = "devel/java"
DEPENDS = ""
_pkg_prefix = "apache-maven-${PV}"
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@dhilst
dhilst / bitbake-output.txt
Created December 2, 2016 16:47
rpm-native problem
[geckos@csi24 build_x11]$ bitbake rpm-native
WARNING: Host distribution "ArchLinux" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Loading cache: 100% |#########################################################################################################################################################################################################| ETA: 00:00:00
Loaded 2806 entries from dependency cache.
Parsing recipes: 100% |#######################################################################################################################################################################################################| Time: 00:00:00
Parsing of 2235 .bb files complete (2230 cached, 5 parsed). 2811 targets, 208 skipped, 6 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Build Configuration:
BB_VERSION = "1.30.0"
[geckos@csi24 build_x11]$ bitbake pharosserver-imx6-image
WARNING: Host distribution "ArchLinux" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Loading cache: 100% |################################################################################################################| ETA: 00:00:00
Loaded 2818 entries from dependency cache.
Parsing recipes: 100% |##############################################################################################################| Time: 00:00:01
Parsing of 2258 .bb files complete (2241 cached, 17 parsed). 2835 targets, 184 skipped, 6 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Build Configuration:
BB_VERSION = "1.30.0"