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
| # Replacing file contents with a clean, serial OCR script | |
| import sys | |
| import os | |
| import pytesseract | |
| from tqdm import tqdm | |
| from pdf2image import convert_from_path | |
| def main(): | |
| if len(sys.argv) < 2: |
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
| import base64 | |
| import os | |
| import re | |
| import time | |
| from gtts import gTTS | |
| import requests | |
| from tqdm import tqdm | |
| # ----------------------------- | |
| DECK_NAME = "Mobile_A1" # change it accordingly |
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
| import base64 | |
| import os | |
| import re | |
| import time | |
| from gtts import gTTS | |
| import requests | |
| from tqdm import tqdm | |
| # ----------------------------- | |
| DECK_NAME = "Edito_A2_2022" |
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 get_balloon_parameters(self): | |
| """get balloon model parameters.""" | |
| alpha = 0.32 | |
| E0 = 0.4 | |
| eps = 0.5 | |
| par = { | |
| "eps": eps, | |
| "E0": 0.4, | |
| "V0": 4.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
| #include <iostream> | |
| #include <vector> | |
| #include <immintrin.h> // For SIMD intrinsics (optional for AVX/AVX2) | |
| #include <string> | |
| #include <random> | |
| #include <assert.h> | |
| #include <algorithm> | |
| #include <sys/stat.h> | |
| #include <unistd.h> |
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
| # Function to convert musical notes to numerical values | |
| def convert_notes_to_numbers(notes): | |
| ''' | |
| Convert characters to numbers, keeping the punctuation unchanged | |
| Parameters | |
| ---------- | |
| notes: str - the string of notes to convert | |
| Returns |
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
| import numpy as np | |
| x = np.fromfile("X.bin", dtype=float, count=-1) | |
| # dtype: float for double, | |
| # np.uint32 for integer. |
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
| // open file as binary: | |
| std::ofstream oX((path + "/X.bin").c_str(), std::ios::out | std::ios::binary); | |
| // write a vector into the file | |
| oX.write((char *)&x[0], x.size() * sizeof x[0]); | |
| // close the file | |
| oX.close(); |