-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
many files again, + again a new cpp program
- Loading branch information
1 parent
a3fd403
commit db04c89
Showing
17 changed files
with
1,741 additions
and
54 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#! /usr/bin/env -S /usr/bin/time /usr/bin/python3.9.5 -i | ||
|
||
# -*- coding: utf-8 -*- | ||
|
||
# Some other needed imports | ||
import datetime | ||
import dill | ||
import gzip | ||
import os | ||
import pdb | ||
import re | ||
import sys | ||
import traceback | ||
|
||
import numpy as np | ||
import pandas as pd | ||
import multiprocessing as mp | ||
|
||
from collections import defaultdict | ||
from copy import deepcopy, copy | ||
from dotmap import DotMap | ||
from functools import reduce | ||
from hashlib import sha256 | ||
from io import BytesIO | ||
from memory_tempfile import MemoryTempfile | ||
from shutil import copyfile | ||
from pprint import pprint | ||
from typing import List, Set, Tuple, Dict, Union, Any | ||
from PIL import Image | ||
|
||
CURRENT_WORKING_DIR = os.getcwd() | ||
PATH_ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) | ||
HOME_DIR = os.path.expanduser("~") | ||
TEMP_DIR = MemoryTempfile().gettempdir() | ||
PYTHON_PROGRAMS_DIR = os.path.join(HOME_DIR, 'git/python_programs') | ||
|
||
# set the relative/absolute path where the utils_load_module.py file is placed! | ||
sys.path.append(PYTHON_PROGRAMS_DIR) | ||
from utils_load_module import load_module_dynamically | ||
|
||
var_glob = globals() | ||
load_module_dynamically(**dict(var_glob=var_glob, name='utils', path=os.path.join(PYTHON_PROGRAMS_DIR, "utils.py"))) | ||
load_module_dynamically(**dict(var_glob=var_glob, name='utils_multiprocessing_manager', path=os.path.join(PYTHON_PROGRAMS_DIR, "utils_multiprocessing_manager.py"))) | ||
|
||
mkdirs = utils.mkdirs | ||
MultiprocessingManager = utils_multiprocessing_manager.MultiprocessingManager | ||
|
||
OBJS_DIR_PATH = os.path.join(PATH_ROOT_DIR, 'objs') | ||
mkdirs(OBJS_DIR_PATH) | ||
|
||
PLOTS_DIR_PATH = os.path.join(PATH_ROOT_DIR, 'plots') | ||
mkdirs(PLOTS_DIR_PATH) | ||
|
||
def bit_kth_remove(n, k): | ||
print('Hello There') | ||
|
||
|
||
def find_and_execute_function(): | ||
with open('bits_challanges.py', 'r') as f: | ||
content = f.read() | ||
|
||
a = re.search(r'def bit_kth_remove\(n, k\):\n( .*\n)+', content) | ||
f_str = a.string[a.start():a.end()] | ||
|
||
return content, f_str | ||
|
||
if __name__ == '__main__': | ||
print("Hello World!") | ||
|
||
n = 123654 | ||
print("n: {}".format(n)) | ||
n_bits = bin(n)[2:] | ||
print("n_bits: {}".format(n_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.DEFAULT_GOAL := all | ||
|
||
CC=g++ | ||
CFLAGS=-Wall -std=c++20 | ||
|
||
utils: | ||
$(CC) $(CFLAGS) utils.cpp -c | ||
main: utils | ||
$(CC) $(CFLAGS) main.cpp utils.o -o main.o | ||
all: main |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include <iostream> | ||
|
||
using namespace std; | ||
|
||
using std::cout; | ||
using std::endl; | ||
|
||
int main(int argc, char* argv[]) { | ||
cout << "Hello World!" << endl; | ||
|
||
return 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.DEFAULT_GOAL := all | ||
|
||
CC=g++ | ||
CFLAGS=-Werror -Wall -std=c++20 -g | ||
# CFLAGS=-Werror -Wall -std=c++20 -O2 -g | ||
# CFLAGS=-Wall -std=c++20 | ||
|
||
utils: utils.cpp | ||
$(CC) $(CFLAGS) utils.cpp -c | ||
main: main.cpp utils | ||
$(CC) $(CFLAGS) main.cpp utils.o -o main.o | ||
all: main |
Oops, something went wrong.