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 main | |
import ( | |
"errors" | |
"fmt" | |
"log" | |
"math" | |
"os" | |
"os/exec" | |
"strconv" |
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
#!/usr/bin/python3 | |
import sys, subprocess, os, time | |
from subprocess import PIPE, Popen | |
from threading import Thread | |
from queue import Queue, Empty | |
import atexit | |
dir_path = os.path.dirname(os.path.realpath(__file__)) | |
lockfile=os.path.join(dir_path, '.brightness-lock~') |
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
#!/usr/bin/python3 | |
import sys, subprocess, os | |
from subprocess import PIPE, Popen | |
from threading import Thread | |
from queue import Queue, Empty | |
def enqueue_output(out, queue): | |
for line in iter(out.readline, b''): | |
queue.put(line) |
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
""" Disclaimer: This is just pseudocode that's really similar to Python. | |
""" | |
# Generiere ein Spielfeld. Hierbei ist `n` die Seitenlänge | |
# (das Feld ist quadratisch) und `b` die Anzahl der Minen. | |
field = Field(n, b) | |
# - `startFields` ist eine Liste mit allen möglichen Startfeldern. [1] | |
# - `solvedFields` ist eine Liste mit Lösungen für alle Felder `startFields`. | |
# Bis zu diesem Punkt werden sie nur mit den Regeln der Logik gelöst. [2] |
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
#include <stddef.h> | |
#include <stdint.h> | |
int strncmp_fast(const char *str1, const char *str2, size_t size) | |
{ | |
typedef uint_fast32_t word_t; | |
int blocks = size >> 2; | |
if (size > sizeof(word_t)) { | |
word_t *word1 = (word_t *)str1; |