This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import murmur332 from './murmur332.js'; | |
// https://en.wikipedia.org/wiki/Bloom_filter | |
// https://hur.st/bloomfilter/ | |
export default class BloomFilter { | |
#data; | |
#dataBitMask; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
address=https://ilo.mysite.com:34043 | |
username=Administrator | |
password=******** | |
session_key=$( | |
curl -fsS \ | |
--insecure \ | |
"$address/json/login_session" \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |