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://stackoverflow.com/a/57939957 | |
export default { | |
MESSAGE: "default message"; | |
} | |
export const MESSAGE = "specific message"; |
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
#!/user/bin/env python3 | |
# Code written while writing this StackOverflow answer: | |
# https://stackoverflow.com/a/58126026 | |
from timeit import timeit | |
def test(bit_lengths, trials=10000, unit=1000, rounding=16): | |
"""Test how long it takes to find a random n-bit number less than the largest | |
and smallest number with exactly that many bits. |
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
""" | |
Code in other all other files adapted from here: | |
https://stackoverflow.com/q/58424446 | |
This is just a simple script that runs processes for the server and client. | |
My comments in server.py and client.py all start with '##'. | |
shared.py sets the global variables shared by the client and the server, | |
and it modifies a handful of functions they use to improve logging. |
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
# Comparing answers to this Stack Overflow question: | |
# https://stackoverflow.com/q/58791296/ | |
from original import process_tones, halftone | |
from tstanisl import process_tones2, halftone_fast | |
from jirassimok import tones_as_array, np_halftone | |
def full_halftone(img): | |
return halftone(img, process_tones()) |
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
""" | |
Simulate assignment to different-shaped, non-contiguous slices of a NumPy array. | |
Note that this is unnecessarily complex and inefficient for most use cases. | |
Created for this Stack Overflow answer: | |
https://stackoverflow.com/a/60803701 | |
""" | |
from itertools import chain | |
import numpy as np |