Skip to content

Instantly share code, notes, and snippets.

@eliantor
eliantor / checklogin.java
Last active August 29, 2015 13:57
Dear Diary Android blog post
if( BaasUser.current() == null ) {
startLoginScreen();
return;
}
@eliantor
eliantor / gist:bec7002b1b9d74cdc6e6
Last active August 29, 2015 14:03
esempio di init script
// esempio di auto init per il server
// helpers.js
on('install',function(e){
try{
['beverages','food','orders'].forEach(function(c){
_command({resource: 'collections', name: 'post', params: c});
});
} catch(e){
return {
/*
* An implementation of C11 stdatomic.h directly borrowed from FreeBSD
* (original copyright follows), with minor modifications for
* portability to other systems. Works for recent Clang (that
* implement the feature c_atomic) and GCC 4.7+; includes
* compatibility for GCC below 4.7 but I wouldn't recommend it.
*
* Caveats and limitations:
* - Only the ``_Atomic parentheses'' notation is implemented, while
* the ``_Atomic space'' one is not.
using clojure-1.3.0-beta1
with leiningen 1.6.0
user=> @(future 2)
RejectedExecutionException java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution (ThreadPoolExecutor.java:1768)
user=> (pst)
RejectedExecutionException
java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution (ThreadPoolExecutor.java:1768)
java.util.concurrent.ThreadPoolExecutor.reject (ThreadPoolExecutor.java:767)
java.util.concurrent.ThreadPoolExecutor.execute (ThreadPoolExecutor.java:658)
git branch
devel
experimental
gles2
* master
perf
renderplan
[eto@mac Kiosk]$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 3 commits.
try {
URL url=new URL("foo");
} catch (MalformedURLException e) {
//throw new RuntimeException(e);
sneak(e);
}
StackTrace:
Exception in thread "main" java.net.MalformedURLException: no protocol: foo
@eliantor
eliantor / Android.mk
Created April 23, 2012 13:54
The java class
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := bitmapsfix
LOCAL_SRC_FILES := bitmaps.c
LOCAL_LDLIBS := -llog -ljnigraphics
include $(BUILD_SHARED_LIBRARY)
public final class Data {
private Data(){}
static final String TABLE_DESTINAZIONE = "destinazione";
static final String TABLE_DESTINAZIONE_GALLERY = "destinazione_gallery";
static final String TABLE_DESTINAZIONE_PREFERITI = "destinazione_preferiti";
static final String TABLE_EVENTO = "evento";
static final String TABLE_EVENTO_GALLERY = "evento_gallery";
static final String TABLE_EVENTO_PREFERITI = "evento_preferiti";
static final String TABLE_INFOPOINT = "infopoint";
public class ImageMapView extends ImageView{
private final static int INVALID_POINTER_ID = -1;
private final ArrayList<Area> mAreaList = new ArrayList<ImageMapView.Area>();
private final SparseArray<Area> mIdToArea = new SparseArray<ImageMapView.Area>();
private OnClickAreaListener mListener;
private int mTouchId = INVALID_POINTER_ID;
private float mTouchX;
private float mTouchY;
private final float mSquaredTouchSlop;
package sincro.safetrack.fragment;
import static sincro.safetrack.utility.MetodiStatici.equalString;
import it.skymedia.safetrack.bean.Documento;
import it.skymedia.safetrack.bean.Indirizzo;
import it.skymedia.safetrack.bean.Persona;
import it.skymedia.safetrack.bean.Persona.Tipo;
import it.skymedia.safetrack.bean.Riferimento;
import it.skymedia.safetrack.bean.Veicolo;