| marp | true |
|---|---|
| theme | default |
Powered by kroki.io
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
| marp | true |
|---|---|
| theme | default |
Powered by kroki.io
| @echo off | |
| call grasspile quine-base.ml -P 1000000 >quine-base.grass | |
| if ERRORLEVEL 1 ( | |
| echo compile failed [exitcode=%ERRORLEVEL%] | |
| exit /b 1 | |
| ) | |
| ruby mkquine.rb >quine.grass |
2020-05-13 追記
| 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). |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2011 Mathieu 'p01' Henri http://www.p01.org/releases/ | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
| (dotimes [n 101] | |
| ((lambda args | |
| (newline) ; ~&, should be fresh-line | |
| (let/cc break | |
| (case (car args) ; ~[ | |
| [(0)] ; ~; | |
| [(1) (display (cadr args)) ; ~A | |
| (if (zero? (caddr args)) (break))] ; ~v^, ~; | |
| [(2)] ; ~; | |
| [(3) (display "Fi")] ; Fi~; |
Lazy K interpreter in Grass language
You need grasspiler
| ;;; -*- mode: lisp; package: wsl -*- | |
| (defpackage :wsl | |
| (:use :lisp :editor)) | |
| (in-package :wsl) | |
| (export '(run-wsl | |
| run-wsl-in-buffer | |
| convert-wslpath-to-win |
| ;; どんな人でも瞬時に凄腕ハッカーになれる方法・・・ for #xyzzy | |
| ;; | |
| ;; * M-x hacker-typer で開始 | |
| ;; 何かキー入力するたびにすごい勢いでコードを書いていく | |
| ;; * C-g で終了 | |
| ;; * ハックするコードは *hacker-typer-dir* と *hacker-typer-file-pattern* | |
| ;; で指定 | |
| ;; | |
| ;; http://duiker101.tk/hackertyper/ | |
| ;; http://developer.cybozu.co.jp/akky/2011/04/post-a879.html |