\Biggl(\biggl(\Bigl(\bigl((x)\bigr)\Bigr)\biggr)\Biggr)
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
# https://codegolf.stackexchange.com/questions/59670/the-drunken-bishop | |
def h(f): | |
# Alias 17 because it gets used enough times for this to save bytes | |
w = 17 | |
h = 9 | |
# Input parsing | |
s = [f"{int(g,16)>>s&3:02b}" for g in f.split(":") for s in (0, 2, 4, 6)] |
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 <boost/multiprecision/cpp_int.hpp> | |
#include <iostream> | |
int main() { | |
boost::multiprecision::cpp_int n1 = 0, n2 = 1; | |
for (long i = 1; i <= 1000000; ++i) { | |
n1 = std::exchange(n2, n1 + n2); | |
} | |
std::cout << n2; | |
} |
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 multiprocessing | |
import subprocess | |
import tqdm | |
def work(args): | |
def workimpl(task_id, core_ids_queue): | |
core_id = core_ids_queue.get() | |
tqdm.tqdm.write( |
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
cmake_minimum_required(VERSION "3.23") | |
# C project | |
project(xenodochial_sinoussi C) | |
add_executable(prog prog.c) |
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 os | |
import subprocess | |
def lmod(command: str, *args: str, verbose: bool = False, dry_run: bool = False): | |
""" | |
Basic wrapper for lmod commands. | |
Based on https://github.com/TACC/Lmod/blob/master/init/env_modules_python.py.in | |
Parameters |
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 <hpx/hpx.hpp> | |
#include <hpx/hpx_init.hpp> | |
#include <hpx/parallel/algorithms/reverse.hpp> | |
#include <algorithm> | |
#include <execution> | |
#include <functional> | |
#include <random> | |
#include <vector> | |
#include "stopwatch.hpp" |
HPX performance counter line filter
^/[^{]+\{[^}]+\}/([^,]+,)*[^,]+$
Matches:
/objectname{full_instancename}/countername@parameters[,whatever[,whatever]...]
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
curl -sSL https://get.docker.com | sh |
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
# SLURM {{{ # | |
function idev() { | |
local nodes="1" | |
if [[ "$(sinfo -h -o "%P")" =~ .*^$1$.* ]]; then | |
local partition="$1" | |
shift | |
fi | |
if [[ "$1" =~ [0-9]+ ]]; then | |
nodes="$1" | |
shift |
NewerOlder