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
[{ | |
"name": "Afghanistan", | |
"area_code": "+93", | |
"code": "AF", | |
"emoji": "🇦🇫", | |
"unicode": "U+1F1E6 U+1F1EB", | |
"image": "https://cdn.jsdelivr.net/npm/[email protected]/dist/images/AF.svg" | |
}, { | |
"name": "Åland Islands", | |
"area_code": "+358", |
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
class Node: | |
def __init__(self, value): | |
self.value = value | |
self.left = None | |
self.right = None | |
def __repr__(self): | |
return str(self.value) | |
class Tree: | |
def __init__(self): | |
self.root = Node(0) |
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
################################## | |
# author: [email protected] # | |
################################## | |
import requests | |
import datetime, jdatetime | |
today = datetime.datetime.now() | |
eid = datetime.datetime(2022, 3, 20) # 29 esfand 1400 | |
dates = [] |
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
# Check if all tasks have been executed | |
def check_all_done(tasks): | |
all_done = True | |
for task in tasks: | |
if tasks[task]["duration"] >0 : | |
all_done = False | |
break | |
return all_done | |
# Get the task with shortest remainig service time (duration) |
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
def change_base(n, r1, r2): | |
if n == 0: | |
return 0 | |
n = to_base10(n, r1) | |
digits = "" | |
while n: | |
digit = int(n % r2) | |
if digit > 9: | |
digit = str(chr(65+digit-10)) | |
digits += str(digit) |