Skip to content

Instantly share code, notes, and snippets.

View ruimaranhao's full-sized avatar

Rui Maranhao ruimaranhao

View GitHub Profile
@ruimaranhao
ruimaranhao / lanterna_and_fonts.java
Created November 23, 2021 10:38
How to use another font in Laterna.
public class Application {
public static void main(String[] args) throws IOException, FontFormatException, URISyntaxException {
new Application().run();
}
private void run() throws IOException, FontFormatException, URISyntaxException {
URL resource = getClass().getClassLoader().getResource("square.ttf");
File fontFile = new File(resource.toURI());
Font font = Font.createFont(Font.TRUETYPE_FONT, fontFile);
@ruimaranhao
ruimaranhao / crazy_simple_sorting.py
Created May 9, 2022 00:23
Crazy simple sorting
# Described in As found in https://arxiv.org/pdf/2110.01111.pdf.
import random
def generate_random_list(size, min_value=0, max_value=10):
return random.sample(range(min_value, max_value), size)
def simple_sort(lst):
for i in range(len(lst)):
for j in range(len(lst)):
if lst[i] < lst[j]: