I hereby claim:
- I am jdz on github.
- I am smuglispweenie (https://keybase.io/smuglispweenie) on keybase.
- I have a public key whose fingerprint is 057D C86F 35D8 3051 88C1 4E1A 1AB6 BD2A AC66 2788
To claim this, I am signing this object:
;;; The Ubuntu image file is 564MB, the largest file close to 1G I could | |
;;; quickly find. | |
(defun process (&optional (file #p"~/Downloads/ubuntu-14.04-server-amd64.iso")) | |
(declare (optimize (speed 3) (safety 1))) | |
(with-open-file (in file :direction :input | |
:element-type 'unsigned-byte) | |
(let ((buf (make-array #xffff :element-type '(unsigned-byte 8))) | |
(result 0)) | |
(loop for read = (read-sequence buf in) | |
until (zerop read) |
### Keybase proof | |
I hereby claim: | |
* I am jdz on github. | |
* I am smuglispweenie (https://keybase.io/smuglispweenie) on keybase. | |
* I have a public key whose fingerprint is AC46 2D08 9883 7EC9 31DD 0799 9FC1 24B0 C3E5 B22E | |
To claim this, I am signing this object: |
I hereby claim:
To claim this, I am signing this object:
(in-package #:pastelyser.log) | |
(defvar *categories* (make-instance 'cl-log:category-set)) | |
(macrolet ((defcategory (category &optional expands-as) | |
`(cl-log:defcategory ,category ,expands-as *categories*))) | |
(defcategory :hit) | |
(defcategory :critical) | |
(defcategory :error (or :error :critical)) | |
(defcategory :warning (or :warning :error)) |
;; Alternative graphics: "⣀⣄⣤⣦⣶⣷⣿" or "⠆⡇⡷⣿" | |
(defun bar (stream width n max &optional (graphics "▏▎▍▌▋▊▉█")) | |
"Draw an N/MAX bar no wider than WIDTH using charecters from GRAPHICS." | |
(declare (type number width n max) | |
(type string graphics)) | |
(assert (<= 1 (length graphics)) | |
(graphics) | |
"Invalid graphics provided: ~S" graphics) | |
(let* ((nchars (length graphics)) | |
(inc (/ 1 nchars 2))) |
(in-package #:cl-user) | |
(eval-when (:load-toplevel :compile-toplevel :execute) | |
(unless (find-package "WHO") | |
(require "cl-who"))) | |
(defun test () | |
(values | |
(who:with-html-output-to-string (html nil :prologue nil :indent nil) | |
(:span (who:str "whatever"))) |
(defmethod sample ((input list) k &aux (length (length input))) | |
(assert (<= 1 k length)) | |
(let ((indices (loop with result = '() | |
with i = k | |
for j = (random length) | |
unless (member j result) | |
do (push j result) | |
(decf i) | |
while (< 0 i) | |
finally (return result)))) |
;;; -*- lexical-binding: t -*- | |
(defun usr:match-pattern-backwards (pattern) | |
;;; XXX: Check if we hit (point-min)? | |
(cond ((integerp pattern) | |
(when (char-equal (char-before) pattern) | |
(backward-char) | |
t)) | |
((and (consp pattern) | |
(keywordp (car pattern))) |