Skip to content

Instantly share code, notes, and snippets.

@jeryini
jeryini / gist:0a634830b177b4cacef44328e0ceac00
Created August 26, 2020 10:22
Mobile-UXSDK-Beta-Android Mavic Mini YUV data example log output
2020-08-26 12:19:10.755 32271-32271/? I/.ux.beta.sampl: Late-enabling -Xcheck:jni
2020-08-26 12:19:10.824 32271-32271/? E/.ux.beta.sampl: Unknown bits set in runtime_flags: 0x8000
2020-08-26 12:19:10.957 32271-32271/com.dji.ux.beta.sample I/.ux.beta.sampl: The ClassLoaderContext is a special shared library.
2020-08-26 12:19:10.971 32271-32271/com.dji.ux.beta.sample I/.ux.beta.sampl: The ClassLoaderContext is a special shared library.
2020-08-26 12:19:12.088 32271-32271/com.dji.ux.beta.sample W/.ux.beta.sampl: Accessing hidden field Ldalvik/system/BaseDexClassLoader;->pathList:Ldalvik/system/DexPathList; (greylist, reflection, allowed)
2020-08-26 12:19:12.088 32271-32271/com.dji.ux.beta.sample W/.ux.beta.sampl: Accessing hidden method Ldalvik/system/DexPathList;->makeInMemoryDexElements([Ljava/nio/ByteBuffer;Ljava/util/List;)[Ldalvik/system/DexPathList$Element; (greylist, JNI, allowed)
2020-08-26 12:19:12.338 32271-32271/com.dji.ux.beta.sample W/.ux.beta.sampl: Accessing hidden field Ldalvik/system/DexPathList
@jeryini
jeryini / com.dji.ux.beta.sample.DefaultLayoutActivity.java
Created August 26, 2020 10:15
Mobile-UXSDK-Beta-Android Mavic Mini YUV data example
/*
* Copyright (c) 2018-2020 DJI
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@jeryini
jeryini / m.js
Created August 5, 2018 17:34 — forked from cazala/m.js
var libUrl = null;
var scriptTag = Array.prototype.slice
.call(document.getElementsByTagName("script"))
.filter(x => /\?proxy?/.test(x.src));
if (scriptTag.length > 0) {
libUrl = scriptTag[0].src.split("m.js")[0];
} else {
throw new Error("missing '?proxy' query parameter in your proxy url!");
}
@jeryini
jeryini / get_public_key_from_seed.js
Created November 26, 2017 18:15
Seed to public key
var bitcoin = require('bitcoinjs-lib');
var network = bitcoin.networks.testnet;
var bip39 = require('bip39');
var mnemonic = 'Insert mnemonics'
var seed = bip39.mnemonicToSeed(mnemonic)
var root = bitcoin.HDNode.fromSeedBuffer(seed, network);
var master = root.derivePath("m/44'/1'/0'");
var xpub = master.neutered().toBase58();
package com.jernejerin.traffic.helper;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Queue;
// Given a stream of unsorted integers, find the median element in sorted order at any given time.
// http://www.ardendertat.com/2011/11/03/programming-interview-questions-13-median-of-integer-stream/
public class MedianOfIntegerStream {
@jeryini
jeryini / SimpleForkJoinPool2.java
Created April 14, 2015 12:07
Multiple stages for forking and joining.
package com.jernejerin.reactor.samples;
import reactor.Environment;
import reactor.core.DispatcherSupplier;
import reactor.rx.Streams;
import java.util.Arrays;
import java.util.List;
/**
@jeryini
jeryini / SimpleTcpServer.java
Created April 14, 2015 08:46
A simple example of Reactor TCP server.
package com.jernejerin.reactor.samples;
import reactor.Environment;
import reactor.fn.Consumer;
import reactor.io.codec.json.JsonCodec;
import reactor.io.net.ChannelStream;
import reactor.io.net.NetStreams;
import reactor.io.net.tcp.TcpClient;
import reactor.io.net.tcp.TcpServer;
import reactor.rx.Streams;
@jeryini
jeryini / ReactorHelloWorld.java
Created April 3, 2015 07:40
Using ThreadPoolExecutorDispatcher.
package com.jernejerin;
import reactor.Environment;
import reactor.core.Dispatcher;
import reactor.core.dispatch.ThreadPoolExecutorDispatcher;
import reactor.rx.broadcast.Broadcaster;
public class ReactorHelloWorld {
public static void main(String[] args) throws InterruptedException {
// If using Reactor’s static Environment instance, it must be