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
{ | |
pkgs, | |
... | |
}: | |
{ | |
environment.systemPackages = [ pkgs.libfprint-2-tod1-synatudor ]; | |
services.dbus.packages = [ pkgs.libfprint-2-tod1-synatudor ]; | |
systemd.packages = [ pkgs.libfprint-2-tod1-synatudor ]; |
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
{-# LANGUAGE | |
DerivingStrategies, | |
TypeFamilies, | |
PatternSynonyms, | |
DataKinds | |
#-} | |
class (Show (SymbolIdent' p)) => IdentParam p where | |
data SymbolIdent' p |
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
import itertools | |
from pathlib import Path | |
def tonelli3(a,p,many=False): | |
def solution(p,root): | |
g=p-2 | |
while pow(g,(p-1)//3,p)==1: g-=1 #Non-trivial solution of x**3=1 | |
g=pow(g,(p-1)//3,p) | |
return sorted([root%p,(root*g)%p,(root*g**2)%p]) |
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/env bash | |
set -o errexit -o nounset -o pipefail | |
declare -r NAME="toggle-redshift" | |
# If user doesn't have write permission to /var/lock then the $NAME directory | |
# with write permissions should be created beforehand. | |
declare -r LOCK_FILE="/var/lock/$NAME/$NAME.lock" | |
declare -r PERSISTENT_FILE="/tmp/$NAME.tmp" |
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
mod Foo | |
{ | |
use ::std::ops; | |
pub struct Bar<T> | |
{ | |
a: T, |
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 <chrono> | |
#include <ctime> | |
#include <iostream> | |
#include <thread> | |
template <auto f> | |
constexpr auto foo() { | |
return f(); | |
} |
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
$ clang -Wall -Wextra -std=c++17 -O2 commonfleet.o rebelfleet.o commonfleet.o rebelfleet.o test.cc -o test | |
/usr/bin/ld: /tmp/test-394cbc.o: in function `main': | |
test.cc:(.text+0x2e): undefined reference to `RebelArmedStarship<float, 299796ll, 2997960ll>::RebelArmedStarship(float, float, float)' | |
clang-7: error: linker command failed with exit code 1 (use -v to see invocation) |
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
cmake_minimum_required(VERSION 2.8.12) | |
set(KF5_MIN_VERSION "5.15.0") | |
set(ECM_MIN_VERSION "1.8.0") | |
find_package(ECM ${ECM_MIN_VERSION} REQUIRED NO_MODULE) | |
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) | |
include(KDEInstallDirs) |
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
import string | |
# num = msg * C | |
# We know num, so we have to check every possible C, | |
# but there's a hint "P.S.2. It's just two bytes.", | |
# so we only check two-byte numbers | |
num = 1087943696176439095600323762148055792209594928798662843208446383247024 # given number | |
# converts integer to array of its bytes |
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 <cstdio> | |
#include <cinttypes> | |
#include <iostream> | |
int main(); | |
#define in : | |
template<typename T> | |
struct _xrange { | |
T b, e; |