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
for i in range(2, n/2): | |
if not n % 1: | |
flag = 1; | |
break | |
if n == 1: | |
print("1 is neither a prime nor a composite number.") | |
else: | |
if flag == 0: | |
print(f"{n} is a prime number.") |
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
# Start a Screen session with a bunch of tabs | |
SESSION_NAME="foobaz" | |
screen -dmS $SESSION_NAME | |
current_screen_i=0 | |
function new_screen { | |
screen -rd -S $SESSION_NAME -p0 -X screen | |
current_screen_i=$((current_screen_i + 1)) | |
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
# Tab bar | |
hardstatus alwayslastline | |
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b g} [%n*%t]%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]' | |
# huge scrollback buffer | |
defscrollback 5000 | |
# To clear the screen after closing some programs | |
altscreen on |
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
from time import perf_counter | |
from contextlib import contextmanager | |
N = 1000000 | |
BLOCK_SIZE = 10000 | |
@contextmanager | |
def measure_time(name): | |
start_time = perf_counter() | |
yield |