# Play an audio beep. Any audio URL will do.
from google.colab import output
output.eval_js('new Audio("https://upload.wikimedia.org/wikipedia/commons/0/05/Beep-09.ogg").play()')
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
from typing import List | |
from pathlib import Path | |
import multiprocessing | |
from gensim.models.doc2vec import Doc2Vec, TaggedDocument | |
from gensim.models import Word2Vec | |
import argparse | |
from gensim.utils import simple_preprocess | |
from datetime import datetime | |
from tqdm import tqdm |
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
logging.basicConfig( | |
format='%(asctime)s - %(levelname)s - %(name)s - %(message)s', | |
datefmt='%m/%d/%Y %H:%M:%S', | |
level=logging.INFO) | |
logger = logging.getLogger(__name__) |
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
""" | |
avg O(m+n), worst O(m*n) | |
only returns the index of the first pattern occurrence. | |
so if you search 'a' in 'bdaba', it returns 2 | |
""" | |
class RollingHash: | |
def __init__(self, text, sizeWord): |
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
apt-get install tmux && pip install jupyter lab && \ | |
tmux && \ | |
jupyter lab --ip 0.0.0.0 --port 56784 |
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
# Setup Ubuntu | |
sudo apt update --yes | |
sudo apt upgrade --yes | |
# Get Miniconda and make it the main Python interpreter | |
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh | |
bash ~/miniconda.sh -b -p ~/miniconda | |
rm ~/miniconda.sh | |
export PATH=~/miniconda/bin:$PATH |
https://stackoverflow.com/questions/1463340/how-to-revert-multiple-git-commits/1470452#1470452
$ git reset --hard A
$ git reset --soft @{1} # (or ORIG_HEAD), which is D
$ git commit
-
transfer learning is the process of training a model on a large-scale dataset and then using that pretrained model to conduct learning for another downstream task (i.e., target task).
-
Deep-Learning-Adaptive-Computation-Machine
Transfer learning and domain adaptation refer to the situation where what has been learned in one setting … is exploited to improve generalization in another setting
-
Handbook of Research on Machine Learning Applications, 2009. >Transfer learning is the improvement of learning in a new task through the transfer of knowledge from a rela
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
#!/usr/bin/env python | |
""" author: svmihar | |
problem source: https://www.youtube.com/watch?v=W2Nz3733mCw&lc=z222zbry0m3ogrpj404t1aokg0k1ngnhw55naycpr2chbk0h00410.1565984354643611 | |
""" | |
# problem1 | |
# adder(5)(3) --> 8 | |
def adder(x): | |
def wrapper(y): | |
return x+y |
Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
Commit type | Emoji |
---|---|
Initial commit | 🎉 :tada: |
Version tag | 🔖 :bookmark: |
New feature | ✨ :sparkles: |
Bugfix | 🐛 :bug: |