The docker tar.gz'd is 2.4 GB in size, download from here
- to set up the new ubuntu docker image, it is 124MB in size,
sudo docker search ubuntu sudo docker pull ubuntu
| import gzip | |
| def gzip_search(query: str, candidate_chunks: list[str], top_k: int=1): | |
| """ | |
| 文字列ベースで類似したテキストチャンクを推定するアルゴリズム. | |
| `query`, `chunk`, および`query + " " + chunk`をそれぞれgzipで圧縮し、編集距離のようなものをベースに評価する. | |
| Parameters: | |
| query (str): 検索クエリとして使用する文字列. | |
| top_k (int, optional): 返される類似チャンクの上位k個を指定する (default: 1). |
| # License: | |
| # I hereby state this snippet is below "threshold of originality" where applicable (public domain). | |
| # | |
| # Otherwise, since initially posted on Stackoverflow, use as: | |
| # CC-BY-SA 3.0 skyking, Glenn Maynard, Axel Huebl | |
| # http://stackoverflow.com/a/31047259/2719194 | |
| # http://stackoverflow.com/a/4858123/2719194 | |
| import builtins | |
| import types |
| # License: | |
| # I hereby state this snippet is below "threshold of originality" where applicable (public domain). | |
| # | |
| # Otherwise, since initially posted on Stackoverflow, use as: | |
| # CC-BY-SA 3.0 skyking, Glenn Maynard, Axel Huebl | |
| # http://stackoverflow.com/a/31047259/2719194 | |
| # http://stackoverflow.com/a/4858123/2719194 | |
| import types | |
| import inspect |
The docker tar.gz'd is 2.4 GB in size, download from here
sudo docker search ubuntu
sudo docker pull ubuntu
| a4b.amazonaws.com | |
| access-analyzer.amazonaws.com | |
| account.amazonaws.com | |
| acm-pca.amazonaws.com | |
| acm.amazonaws.com | |
| airflow-env.amazonaws.com | |
| airflow.amazonaws.com | |
| alexa-appkit.amazon.com | |
| alexa-connectedhome.amazon.com | |
| amazonmq.amazonaws.com |
| # License: | |
| # I hereby state this snippet is below "threshold of originality" where applicable (public domain). | |
| # | |
| # Otherwise, since initially posted on Stackoverflow, use as: | |
| # CC-BY-SA 3.0 skyking, Glenn Maynard, Axel Huebl | |
| # http://stackoverflow.com/a/31047259/2719194 | |
| # http://stackoverflow.com/a/4858123/2719194 | |
| import types |
| import java.io.PrintStream; | |
| import java.util.Base64; | |
| /** | |
| * Java 8 より導入された java.util.Base64 の利用デモ。 | |
| */ | |
| public class Base64Demo { | |
| private static final PrintStream o = System.out; | |
| public static void main(String[] args) { |