Skip to content

Instantly share code, notes, and snippets.

import java.io.*;
public class ReadLineBenchmark {
long volume = 0;
static class StringSlice implements CharSequence {
private final String str;
private final int idx;
private final int end;
package net.jhorstmann.queryengine
import org.junit.jupiter.api.Test
import org.objectweb.asm.ClassVisitor
import org.objectweb.asm.ClassWriter
import org.objectweb.asm.Opcodes
import org.objectweb.asm.util.CheckClassAdapter
import java.io.FileOutputStream
import java.util.function.IntSupplier
import java.util.function.Supplier
@jhorstmann
jhorstmann / mio-fuse-ble-setup.txt
Created February 7, 2016 20:25
MIO Fuse Buetooth LE Protocol
# alerts
0000 12 20 00 09 02 4a 00 5d 6f 82 94 a7 82 94 # 4a=5zone,2sec,novib ? end_rest end_zone1 end_zone2 end_zone3 end_zone4 end_zone2 end_zone3
0000 12 20 00 09 02 4b 00 5d 6f 82 94 a7 82 94 # 4b=1zone,2sec,novib
0000 12 20 00 09 02 8b 00 5d 6f 82 94 a7 82 94 # 8b=1zone,1sec,novib
0000 12 20 00 09 02 cb 00 5d 6f 82 94 a7 82 94 # cb=1zone,on,novib
0000 12 20 00 09 02 fb 00 5d 6f 82 94 a7 82 94 # fb=1zone,on,vib
0000 12 20 00 09 02 7b 00 5d 6f 82 94 a7 82 94 # 7b=1zone,2sec,vib
0000 12 20 00 09 02 bb 00 5d 6f 82 94 a7 82 94 # bb=1zone,1sec,vib
0000 12 20 00 09 02 ba 00 5d 6f 82 94 a7 82 94 # ba=5zone,1sec,vib
@jhorstmann
jhorstmann / gist:1579903
Created January 8, 2012 22:15
How to modify android-x86 asus_laptop image to add rtl8192se wireless lan driver

The "intellibook" netbook contains a rtl8192se pci network chip that is not currently included in the android-x86 builds. I could not get a complete self-build image to work so I decided to add the neccessary drivers to the existing release from 20120101. This has the added benefit that the installation contains the google apps, which are not included in the source download. The image can be downloaded from http://www.android-x86.org/releases/build-20120101 (android-x86-4.0-asus_laptop-20120101.iso).

Extract the iso image and the contained squashfs image and mount the contained filesystem image as a loopback device.

$ bsdtar -C android-image -xf android-x86-4.0-asus_laptop-20120101.iso
$ cd android-image
$ unsquashfs system.sfs
$ sudo mkdir /mnt/iso
$ sudo mount ./squashfs-root/system.img /mnt/iso  -o loop
@jhorstmann
jhorstmann / Main.java
Last active May 12, 2023 08:05
How to get the method name from a java 8 lambda using serialization hacks
package net.jhorstmann;
import java.io.*;
public class Main {
public static class SerializedLam implements Serializable {
private static final long serialVersionUID = 8025925345765570181L;
public Class<?> capturingClass;
public String functionalInterfaceClass;