This file contains hidden or 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
| """ | |
| total = 2500 | |
| tax = 399 | |
| subtotal = total - tax | |
| vat_percent = tax / subtotal = 0.19 | |
| wanted_revenue = total - tax = 2101 # revenue without fees | |
| new_subtotal = subtotal + X | |
| new_tax = new_subtotal * vat_percent |
This file contains hidden or 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
| # Automatically create and update a symlink to the compile_commands.json file in | |
| # the source directory, so that it is in a known location and can be picked up | |
| # easily by clangd. When using Visual Studio Code, use the clangd extension, | |
| # version 0.3.2 or higher, so the clangd language server automatically restarts | |
| # on configuration change, which is useful when switching between Debug and | |
| # Release builds (to switch between debugging and testing performance). See | |
| # https://github.com/clangd/vscode-clangd/issues/300. Always build the "ALL" | |
| # target during development, to ensure the compile_commands.json is in sync. | |
| if(CMAKE_EXPORT_COMPILE_COMMANDS) | |
| add_custom_target( |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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; |