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
# See also: README. | |
# These are convenience functions to encrypt and decrypt files and folders. | |
function help() { | |
echo "Functions:" | |
echo " compress_folder (in_folder) [out_file_basename]" | |
echo " decompress_folder (in_file) [out_folder]" | |
echo "Call with -h for help." | |
} |
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
# This script sanitizes a latex project for an arXiv submission. | |
# Specifically, it "sanitizes" the project by removing any files that are not used in compilation. | |
# | |
# Usage: | |
# cd latex_folder_root | |
# ./prepForArxiv.sh | |
# (generates a zip archive in /tmp/archive.zip) | |
# | |
# It is not exhaustive, but it is pretty good and should work for most cases. | |
# Also, it does not remove comments within the latex source. |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
""" | |
See also: https://gist.github.com/gchenfc/a0efa92e954a609bf031f7da4cc8dd70 | |
Gauranteed correct up to 318,665,857,834,031,151,167,461 (which is >2^64 so works for any uint64) | |
Usage: | |
print(is_probably_prime(17)) # True | |
print(is_probably_prime(12345678910987654321)) # True | |
print(is_probably_prime(46)) # False | |
""" | |
_known_primes = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37) |
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
"""Simple implementation of the Miller-Rabin primality test. | |
Usage: | |
``` | |
from primetest import is_prime | |
print(is_prime(17)) # True | |
print(is_prime(12345678910987654321)) # True | |
print(is_prime(46)) # False | |
``` |
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 b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