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
# Ayoub Ghriss, 2024 | |
@njit(int64[:, :](int64, int64, int64[:, :]), parallel=True, cache=True, nogil=True) | |
def sample_excluded_parallel(n: int, k: int, to_exclude: np.ndarray) -> np.ndarray: | |
""" | |
Generate random integers in parallel excluding specified values. | |
Parameters: | |
n (int): Number of samples. |
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
local M = {} | |
-- Map intergers 1... to A.... | |
local function int_to_char(i) return string.char(i + 64) end | |
local function group_by_first(b_to_s) | |
local starts = {} | |
for b, s in pairs(b_to_s) do | |
if #s == 0 then | |
error("empty string in hash_by_first" .. vim.inspect(b_to_s)) | |
end |
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
local S = {} | |
-- define the files for each language | |
-- new words will be added to the last file in the language table | |
S.dictionaries = { | |
["en-US"] = { vim.fn.stdpath("config") .. "/spell/en.txt" }, | |
} | |
-- function to avoid interacting with the table directly | |
function S.getDictFiles(lang) |
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
python3 -m venv my_test_env | |
source my_test_env/bin/activate | |
pip install jupyter | |
pip install nbgrader | |
jupyter nbextension install --sys-prefix --py nbgrader --overwrite | |
jupyter nbextension enable --sys-prefix --py nbgrader | |
jupyter serverextension enable --sys-prefix --py nbgrader |
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
# Maintainer: Ayoub Ghriss <aghriss@yandex.com> | |
# Save file in folder as PKGBUILD and run "makepkg -si" in the same folder | |
# Works for Python3.7 on Arch, for other versions, change the Vim replacement line to corresponding folders | |
pkgname=openfst | |
pkgver=1.7.2 | |
pkgrel=1 | |
pkgdesc='Library for constructing, combining, optimizing, and searching weighted finite-state transducers (FSTs)' | |
arch=(i686 x86_64) | |
url='http://www.openfst.org' |
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
sudo apt purge cmake -y | |
wget https://cmake.org/files/v3.11/cmake-3.11.3-Linux-x86_64.tar.gz -O cmake.tar.gz | |
tar -xvf cmake.tar.gz -C ./ | |
cd cmake-3.11.3-Linux-x86_64 | |
sudo cp -r bin /usr/ | |
sudo cp -r share /usr/ | |
sudo cp -r doc /usr/share/ | |
sudo cp -r man /usr/share/ | |
cd .. | |
rm -rf cmake |
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
# Ubuntu packages | |
VERSION=1.6.7 | |
sudo apt update | |
sudo apt install -y vim build-essential python3 python3-dev vim | |
# Compile OpenFST with Python extension for Python 3 and Install | |
wget http://www.openfst.org/twiki/pub/FST/FstDownload/openfst-$VERSION.tar.gz | |
tar xzvf openfst-$VERSION.tar.gz | |
cd openfst-$VERSION/ |