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
# download go to /home/zahash/software | |
export PATH="/home/zahash/software/go/bin/:$PATH" # go install path | |
export PATH="/home/zahash/go/bin/:$PATH" # this is where go keeps all the installed binaries | |
make generate | |
make ui | |
make build | |
# for testing |
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
############# config.toml ############# | |
theme = "rose_pine" | |
[editor] | |
line-number = "relative" | |
mouse = false | |
bufferline = "multiple" | |
[editor.lsp] | |
display-inlay-hints = true |
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
x - select current line | |
c - delete current selection and enters insert mode. (shorthand for di) | |
<space> + y/p - yank/paste from system clipboard | |
n{motion} - number before motion repeats it that many times. eg: 2w, 10j, etc... | |
% - select whole file | |
/ - search (uses regex). n and N to cycle through matches. | |
entering visual mode (v) when using n and N will multi-select matches instead of cycling. |
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 install docker.io | |
# add user to docker group for non-sudo access | |
sudo groupadd docker # add docker group | |
sudo usermod -aG docker $USER # add your user to the docker group. | |
newgrp docker # activate the changes to groups. Run this command on each new terminal session | |
docker ps # verify that user can run Docker without sudo |
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
def model_builder(hp): | |
if TASK == "r": | |
loss_fn = "mean_absolute_error" | |
elif TASK == "c": | |
if OUTPUT_NODES == 1: | |
loss_fn = tf.keras.losses.BinaryCrossentropy(from_logits=True) | |
else: | |
loss_fn = tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True) | |
if TASK == "r": |
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
def string_input_processor(inputs): | |
if not inputs: | |
return | |
vocabularies = defaultdict(set) | |
for batch, _ in get_dataset(batch_size=BATCH_SIZE): | |
for col_name in inputs.keys(): | |
for st in np.array(batch[col_name]).astype("str"): | |
vocabularies[col_name].add(st.lower().strip()) |
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
def numerical_input_processor(inputs): | |
if not inputs: | |
return | |
concat = None | |
if len(inputs.values()) > 1: | |
concat = tf.keras.layers.Concatenate()(list(inputs.values())) | |
norm = tf.keras.layers.experimental.preprocessing.Normalization() |
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
#! /usr/bin/env python3 | |
""" | |
Install these packages before running the script | |
beautifulsoup4==4.9.0 | |
bs4==0.0.1 | |
certifi==2020.4.5.1 | |
chardet==3.0.4 | |
idna==2.9 |
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
def search(grid_dict): | |
# try to solve the board | |
grid_dict = run_episode(grid_dict) | |
if grid_dict is False: | |
# it means the current configuration of the board is unsolvable | |
# this happens when any of the boxes have no possible value to fix |
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
def run_episode(grid_dict): | |
stuck = False | |
while not stuck: | |
# Check how many boxes have a fixed value | |
solved_values_before = len([box for box in grid_dict.keys() if len(grid_dict[box]) == 1]) | |
# Use the Eliminate Strategy | |
grid_dict = eliminate(grid_dict) | |
# Use the Only Choice Strategy |
NewerOlder