To check if access time logging is enabled, use the mount
command:
mount | grep ' on / '
import pandas as pd | |
def df_to_latex(df, table_caption, table_label): | |
# Start building the LaTeX table string | |
latex_str = r""" | |
\renewcommand{\arraystretch}{1.5} % Adjust this value to change the row height | |
\begin{table}[h!] | |
\centering | |
\begin{adjustbox}{max width=\textwidth, center} % Fit table to page width and center it |
from time import sleep | |
import zipfile | |
import string | |
import itertools | |
from concurrent.futures import ProcessPoolExecutor, as_completed | |
# Define the path to the zip file and character set for passwords | |
zip_file_path = '/content/0.zip' | |
last_password_file = '/content/last_password.txt' | |
characters = string.ascii_uppercase |
import zipfile | |
import tarfile | |
import os | |
def zip_folder(folder_path, zip_filename): | |
with zipfile.ZipFile(zip_filename, 'w') as zipf: | |
for foldername, subfolders, filenames in os.walk(folder_path): | |
for filename in filenames: | |
file_path = os.path.join(foldername, filename) | |
arcname = os.path.relpath(file_path, folder_path) |
# -*- coding: utf-8 -*- | |
"""vocab.ipynb | |
Automatically generated by Colaboratory. | |
Original file is located at | |
https://colab.research.google.com/drive/1GNxF9QyJc8hL3KgVKB8t4GPgH8sGNTci | |
""" | |
# ! pip install google-translate-for-goldendict |
#!/bin/bash | |
# Check if ffmpeg is installed | |
command -v ffmpeg >/dev/null 2>&1 || { echo >&2 "ffmpeg is required but it's not installed. Exiting."; exit 1; } | |
# Check for valid number of arguments | |
if [ "$#" -ne 4 ]; then | |
echo "Usage: $0 input.mp4 start_time end_time output_base_path" | |
echo "Time format: HH:MM:SS or MM:SS" | |
exit 1 |
import os | |
from moviepy.editor import VideoFileClip | |
folder_path = '/home/ri/Desktop/TFL/ahmadian' # Replace with the path to your folder | |
total_duration = 0 | |
for file in os.listdir(folder_path): | |
if file.endswith('.webm'): # Adjust the file extension if necessary | |
file_path = os.path.join(folder_path, file) | |
video = VideoFileClip(file_path) |
!pip uninstall numpy -y | |
!pip install numpy==1.24.2 | |
!wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz | |
!tar -xzvf ta-lib-0.4.0-src.tar.gz | |
%cd ta-lib | |
!./configure --prefix=/usr | |
!make | |
!make install | |
%cd .. |
from scipy.stats import hmean | |
# https://stats.stackexchange.com/questions/7471/can-the-standard-deviation-be-calculated-for-harmonic-mean | |
harmonic_var = lambda S : (np.power(S,-1).var())/(len(S)*np.power(np.power(S,-1).mean(),4)) | |
# example | |
import numpy as np | |
np.random.seed(100) | |
s = np.random.dirichlet((1,5),10) |
import re | |
def read_dot_dat_file(path): | |
datContent = [i.strip().split() for i in open(path).readlines()] | |
r = re.compile("@inputs.*") | |
_at_data = datContent.index(['@data']) | |
assert datContent[0][0] == '@relation' | |
assert datContent[_at_data-1][0] == '@outputs' | |
assert datContent[_at_data-2][0] == '@inputs' | |
assert len(datContent[_at_data-3][2:]) == 2 # Two Class |