Skip to content

Instantly share code, notes, and snippets.

View ground0state's full-sized avatar

abetan ground0state

View GitHub Profile
@kyo-takano
kyo-takano / lexical_search_with_gzip.py
Last active March 11, 2024 03:39
Lexical Search with gzip (gzipによる語彙検索)
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).
@raven38
raven38 / noglobal.py
Created December 6, 2020 08:23 — forked from yoshipon/noglobal.py
Useful Noglobal in Python
# 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
@yoshipon
yoshipon / noglobal.py
Last active November 20, 2022 03:45 — forked from ax3l/noglobal.py
Useful Noglobal in Python
# 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
@nishadhka
nishadhka / ml-Python-libraries.md
Last active October 15, 2019 12:55
Python machine learning libraries in docker

Machine learning libraries of Python in Docker

The docker tar.gz'd is 2.4 GB in size, download from here

background and installed libraries in the docker

  • to set up the new ubuntu docker image, it is 124MB in size,
    sudo docker search ubuntu
    sudo docker pull ubuntu
    
@shortjared
shortjared / list.txt
Last active May 6, 2024 17:16
List of AWS Service Principals
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
@ax3l
ax3l / noglobal.py
Last active December 26, 2022 12:44
Useful Noglobal in Python
# 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
@tkuchiki
tkuchiki / memo.md
Last active July 22, 2020 08:38
Jenkins の実行ユーザを変更する

実行ユーザ変更

/etc/sysconfig/jenkins

JENKINS_USER="USER"

を設定

@komiya-atsushi
komiya-atsushi / Base64Demo.java
Created August 31, 2014 17:51
Java 8 より導入された java.util.Base64 の利用デモ。
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) {