Skip to content

Instantly share code, notes, and snippets.

import murmur332 from './murmur332.js';
// https://en.wikipedia.org/wiki/Bloom_filter
// https://hur.st/bloomfilter/
export default class BloomFilter {
#data;
#dataBitMask;
/**
* Performs Murmur3_32 hashing.
* https://en.wikipedia.org/wiki/MurmurHash
* @param key Int32Array input key
* @param seed int32 input seed
* @returns int32 value
*/
export default function murmur332(key, seed) {
let hash = seed;
#!/bin/bash
address=https://ilo.mysite.com:34043
username=Administrator
password=********
session_key=$(
curl -fsS \
--insecure \
"$address/json/login_session" \
@vbezhenar
vbezhenar / slf4j.kt
Created June 27, 2016 19:03
SLF4J wrapper
import org.slf4j.Logger
import org.slf4j.LoggerFactory
val Any.log: Logger get() = LoggerFactory.getLogger(javaClass)
inline fun Any.logTrace(message: () -> Any) {
val l = log
if (l.isTraceEnabled) l.trace(message().toString())
}
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import java.sql.SQLException;
import java.util.Random;
public class EntityManagerUtil {
@FunctionalInterface
public interface TransactionalAction {
void action(EntityManager entityManager) throws Exception;
}
package test;
public class Test {
public static void main(String[] args) throws Exception {
int[] ns = {1_000_000, 5_000_000, 10_000_000, 25_000_000, 50_000_000, 100_000_000, 500_000_000};
for (int n : ns) {
for (int counter = 5; counter --> 0;) {
float[] a = new float[n];
for (int i = 0; i < n; i++)
#!/bin/sh
url='http://pgl.yoyo.org/as/serverlist.php?hostformat=nohtml'
ftp -o - "$url" | awk '{printf "local-zone: \"%s.\" static\n", $1}' > /var/unbound/etc/blacklist.conf.new || exit $?
mv /var/unbound/etc/blacklist.conf.new /var/unbound/etc/blacklist.conf
rcctl reload unbound
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayDeque;
import java.util.HashMap;
import java.util.Map;
import java.util.Queue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
package com.f5group.eauckz.util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.*;
import java.util.concurrent.*;
public class GroupingScheduler<TId> {
private static final Logger logger = LoggerFactory.getLogger(GroupingScheduler.class);