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 java.io.PrintStream; | |
import java.util.function.Consumer; | |
import java.util.function.IntConsumer; | |
public class Benchmarks { | |
public static record BenchmarkResult(String name, int maxPasses, long maxTime, | |
int passes, long totalTime, double averagePassTime) { | |
public BenchmarkResult print(PrintStream stream) { | |
long tms = totalTime / 1_000_000; |
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
---@diagnostic disable: undefined-field | |
-- Check if the library has already been loaded | |
if _G.LIB_OBJECTS_LOADED then | |
return "already loaded" | |
end | |
------------------------------------------------ | |
----- Utilities | |
------------------------------------------------ |
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; | |
import org.junit.jupiter.api.Test; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.Random; | |
import java.util.UUID; | |
import java.util.function.BiConsumer; | |
import java.util.function.Consumer; |
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
/* | |
Copyright 2022 orbyfied <https://www.github.com/orbyfied> | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. | |
This program is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
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
/* | |
Copyright 2022 orbyfied <https://www.github.com/orbyfied> | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. | |
This program is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
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 sys | |
import os.path | |
# get file to erase | |
fn = input("file to erase: ") | |
# open file' | |
try: | |
# check if it exists | |
if not os.path.exists(fn): |
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
# | |
# By orbyfied, (C) 2022 L | |
# | |
from abc import abstractmethod | |
import time | |
import math | |
# utility class for building strings | |
class StringBuffer: |
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
/* | |
Copyright 2022 - orbyfied (https://www.github.com/orbyfied) | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. | |
This program is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
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
public class Bench { | |
static boolean isPrime(int n) { | |
float f = (float)Math.sqrt(n) + 1; | |
int i = 2; | |
while (i < f) { | |
if ((n % i) == 0) | |
return false; | |
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
/** | |
* Simple tuple class. | |
* @author orbyfied | |
*/ | |
public class Tuple { | |
/** | |
* Marks a field in a layout class as | |
* a unpackable field. | |
*/ |