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
import datetime | |
A1=datetime.datetime.strptime("21/10/2022", "%d/%m/%Y") | |
A2=datetime.datetime.strptime("29/01/2023", "%d/%m/%Y") | |
count=0 | |
week="Fri" | |
for i in range ((A2-A1).days): #gives the no of days from A1 to A2 | |
if A1.strftime("%a")==week: | |
count+=1 | |
A1+=datetime.timedelta(days=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
mathar.exe 1>errors.txt 2>&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
import pandas as pd | |
file1 = pd.read_csv('./n/oregonhie_descriptive_vars.csv') | |
file2 = pd.read_csv('./n/oregonhie_inperson_vars.csv') | |
file2['treatment'] = file2['person_id'] | |
def proccess(key): | |
a = file1.loc[file1['person_id'] == key, 'treatment'].iloc[0] |
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
import configparser | |
class Config: | |
FILENAME = 'CONFIG.INI' | |
def __init__(self): | |
self.config = configparser.ConfigParser() | |
self.read() |
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
app.exe 1>output.txt 2>&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
from hashlib import md5 | |
from uuid import getnode | |
print ( str(md5(hex(getnode()).encode('utf-8')).hexdigest()) ) |
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 itertools import permutations as perms | |
from itertools import product | |
class miracle: | |
''' | |
i make numerical miracles | |
''' | |
def __init__(self): | |
self.ops = ['+', '-', '*', '/'] |
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
import random | |
dividend_length = 3 | |
divsior_length = 1 | |
integer_results = 0 | |
short_float = 1 | |
pop = 20 | |
_c, res = 0, [] | |
while len(res)<pop and _c<5000: |
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
import random, re, pyautogui, time, pyperclip , sys | |
chat = pyperclip.paste() | |
chatNames = re.findall(r'(?<=[PM|AM]\r\n).*(?=\r\n)', chat) | |
chatNames = set(chatNames)-{'Shadow'} | |
print(chatNames) |
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
#Sol 1 - performance: Exp | |
vowels = { 'A': 1, 'E': 21, 'I': 7, 'O': 8, 'U': 5, 'T':4 } | |
result = [] | |
def backtrack(trac=[], totalWeight=10, vowelsRepeatLimit={'A':5}): | |
''' | |
:params: | |
:totalWeight: total weight target. |
NewerOlder