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
#!/bin/bash | |
cd / | |
sudo apt update | |
echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | sudo tee /etc/apt/sources.list.d/coral-edgetpu.list | |
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - |
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
Country | ISO2 | ISO3 | |
---|---|---|---|
Afghanistan | AF | AFG | |
Albania | AL | ALB | |
Algeria | DZ | DZA | |
Andorra | AD | AND | |
Angola | AO | AGO | |
Antigua and Barbuda | AG | ATG | |
Argentina | AR | ARG | |
Armenia | AM | ARM | |
Australia | AU | AUS |
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
import tensorflow as tf | |
if not str(tf.__version__).startswith('1.15'): | |
print('please use tensorflow 1.15') | |
exit() | |
from tensorflow.keras.models import Model | |
from tensorflow.keras.layers import Input, Conv2D | |
tf.enable_eager_execution() | |
image_shape = (64,64,3) |
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
#!/bin/sh | |
# rename-pictures.sh | |
# Author: Justine Tunney <jtunney@gmail.com> | |
# License: Apache 2.0 | |
# | |
# This shell script can be used to ensure all the images in a folder | |
# have good descriptive filenames that are written in English. It's | |
# based on the Mistral 7b and LLaVA v1.5 models. | |
# | |
# For example, the following command: |
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 format_example(image, label): | |
image = tf.cast(image, tf.float32) | |
# Normalize the pixel values | |
image = image / 255.0 | |
# Resize the image | |
image = tf.image.resize(image, (IMG_SIZE, IMG_SIZE)) | |
return image, label | |
train = raw_train.map(format_example) | |
validation = raw_validation.map(format_example) |
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
# BlueBook code decryption | |
import sys | |
def sieve(n): | |
# Compute primes using sieve of Eratosthenes | |
x = [1]*n | |
x[1] = 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
94143243431512659321054872390486828512913474876027 | |
67195923460328582958304725016523252592969257276553 | |
64363462727184012012643147546329450127847264841075 | |
62234789626728592858295347502772262646456217613984 | |
829519475412398501 |
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
# Ref: https://youtu.be/a-zEbokJAgY | |
# quine | |
s='s=%r;print(s%%s)';print(s%s) | |
# interactive intron | |
t='';s='t=input()or t;print(f"t={repr(t)};s={repr(s)};exec(s)#{t}")';exec(s)# |
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
“Quickness is the essence of the war.” – Sun Tzu | |
“To know your Enemy, you must become your Enemy.” – Sun Tzu | |
“If your enemy is secure at all points, be prepared for him. If he is in superior strength, evade him. If your opponent is temperamental, seek to irritate him. Pretend to be weak, that he may grow arrogant. If he is taking his ease, give him no rest. If his forces are united, separate them. If sovereign and subject are in accord, put division between them. Attack him where he is unprepared, appear where you are not expected.” – Sun Tzu | |
“Strategy without tactics is the slowest route to victory. Tactics without strategy is the noise before defeat.” – Sun Tzu | |
“There are not more than five musical notes, yet the combinations of these five give rise to more melodies than can ever be heard.There are not more than five primary colors, yet in combination they produce more hues than can ever been seen.There are not more than five cardinal tastes, yet combinations of them yield more flavors t |
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
git_config_author(){ | |
git config --local user.name "${1}" | |
git config --local user.email "${2}" | |
} | |
git_config_sshkey(){ | |
# get ssh hosts | |
local ssh_hosts="$(grep "github.com-[a-Z]*" ~/.ssh/config | \ | |
awk '{print $2}' | sed 's/github\.com-//g' | tr '\n' ' ')" |
NewerOlder