Skip to content

Instantly share code, notes, and snippets.

@Vzor-
Vzor- / Main.java
Created August 9, 2019 20:47
LookupServiceTest
import sun.awt.AppContext;
import javax.print.PrintServiceLookup;
public class Main {
public static void main(String[] args) {
int count = 0;
while (true) {
count++;
long time1 = System.currentTimeMillis();
import sun.awt.AppContext;
import javax.print.PrintServiceLookup;
import java.util.Set;
public class Main {
public static void main(String[] args) {
int count = 0;
while (true) {
count++;
abstract class Util {
public static Util INSTANCE = setInstance();
abstract String getOSName();
public static Util setInstance() { return null; }
}
#include <Arduino.h>
#include <esp_log.h>
void setup() {
Serial.begin(115200);
String a = "test";
String b = "12345678";
String out = a + b;
log_printf("%s + %s = %s\n", a, b, out);
function sendHidData() {
printData = '\x0d\x0a\x50\x52\x49\x4e\x54\x45\x44\x20\x57\x49\x54\x48\x20\x51\x5a\x20\x54\x52\x41\x59\x0d\x0a\x0d\x0a\x55\x53\x49\x4e\x47\x20\x68\x65\x78\x20\x43\x4f\x4d\x4d\x41\x4e\x44\x53\x0d\x0a\x0d\x0a\x0d\x0a\x0d\x0a';
qz.hid.sendData({
vendorId: $("#hidVendor").val(),
productId: $("#hidProduct").val(),
usagePage: $("#hidUsagePage").val(),
serial: $("#hidSerial").val(),
data: printData.substring(0, 32),
endpoint: $("#hidReport").val()
async function sendHidData() {
printData = '\x0d\x0a\x50\x52\x49\x4e\x54\x45\x44\x20\x57\x49\x54\x48\x20\x51\x5a\x20\x54\x52\x41\x59\x0d\x0a\x0d\x0a\x55\x53\x49\x4e\x47\x20\x68\x65\x78\x20\x43\x4f\x4d\x4d\x41\x4e\x44\x53\x0d\x0a\x0d\x0a\x0d\x0a\x0d\x0a';
await qz.hid.sendData({
vendorId: $("#hidVendor").val(),
productId: $("#hidProduct").val(),
usagePage: $("#hidUsagePage").val(),
serial: $("#hidSerial").val(),
data: printData.substring(0, 32),
endpoint: $("#hidReport").val()
function createDataChain(targetFunction, deviceInfo, data, chunkLength) {
var chain = Promise.resolve();
for (var i = 0; i < data.length; i += chunkLength) {
deviceInfo.data = data.substring(i, Math.min(i + chunkLength, data.length));
chain = chain.then(()=>targetFunction(deviceInfo));
}
return chain;
}
function sendHidData() {
printData = "abcdefghijklmnopqrstuvwhyz\n" +
"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var deviceInfo = {
vendorId: $("#hidVendor").val(),
productId: $("#hidProduct").val(),
usagePage: $("#hidUsagePage").val(),
serial: $("#hidSerial").val(),
data: "",
/**
USB kick code for the posiflex 4000 series:
- 120 bytes including the report id
- all 0x00 with byte[1] and byte[2] the drawer number
- the drawers can be assigned a number 0-7 (default is 7)
**/
function openDrawer(number)
{
// Posiflex Cash Drawer
var deviceInfo = {
@Vzor-
Vzor- / JNA Windows aarch64.md
Created September 23, 2020 20:26 — forked from tresf/JNA Windows aarch64.md
Building JNA on Windows ARM64

Building JNA on Windows 10 for ARM64:

  1. Using Windows 10 on ARM, Install Visual Studio with ARM compiler support
  2. Manually install and configure ANT with Microsoft's experimental ARM Java build https://github.com/microsoft/openjdk-aarch64/releases
  3. Download the x86 version of Cygwin (the 64-bit version will NOT run on ARM64)
  4. Take the defaults
  5. When prompted select a reputable mirror (e.g. for US: https://mirrors.rit.edu)
  6. Cygwin will ask for packages. Many required packages are provided by default (shell, sed, grep) however the following must be manually selected: