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
(defmethod hash (status (set stream) &key &aux (block #0=(make-array (/ (blocklength status) 8) :element-type 'octet)) (rest #0#) (count 0) (length 0)) | |
"Return the appropriate SHA checksum digest of the contents of a STREAM of (UNSIGNED-BYTE 8). | |
The STREAM will be closed afterwards, so use a CONCATENATED or BROADCAST stream if you need." | |
(declare (dynamic-extent block rest count length) (type fixnum count) (type unsigned-byte length)) | |
(setq status (copy-status status)) | |
(with-open-stream (stream set) ;How should I nicely check the STREAM-ELEMENT-TYPE is correct here? | |
(incf length (read-sequence block stream)) ;Such checking can truly stay with PAD and BLOCKHASH. | |
(loop | |
(setq count (read-sequence rest stream) length (+ length count)) | |
(if (zerop count) |
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
(defun make-net/1/construct-implicit-arcs (net) | |
(with-accessors+ (objects places transitions arcs next-guid) | |
net | |
(maphash (lambda (name transition) | |
;; initial value of in-arcs is a LIST of NAMES of places that this transition will be fed from | |
(let (arc-names) | |
(dolist (in-arc (in-arcs transition)) | |
(if (symbolp in-arc) | |
;; if the in-arc form is a single symbol, then it names the place to be connected to, anonymous arc, single token | |
(let* ((from-place-name in-arc) |
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
(in-package #:fouric) | |
;; TODO: ask whether to use symbol-plists or hash tables | |
;; actually, should almost certainly use a hash table in the fouric package, to prevent pollution... | |
;; or maybe just need to CLEAR-TESTS for everything before deploying binary | |
;; TODO: ask #lisp and lisp discord about this | |
(defun run-tests (name) | |
;;(format t "~&running tests for ~a::~s~%" (package-name (symbol-package name)) name) | |
(a:doplist (test-name test-function (get name 'function-tests)) |
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
2020-02-25 hashes dump to prevent Google idea stealing due to accidental unencrypted upload of files to Google Drive: | |
c9d22b84faf5d9b31a8ec42212f1d9f8 alexandria.txt | |
5b547ecdd36c0635584dfc04ee9b6687 animation.txt | |
00c7f9bbb2d923cd6f4d9852f31ff341 asp.txt | |
f0a103eb5e8fca07a4a66a8906e7c655 astaire.txt | |
52e405169c2194c72f30311ccf2a8870 async.txt | |
92c95642b98df58649ef6c30fe123cf3 ataglance.txt | |
45c0f3721de75b7c7b53cddf7fa511da athena.txt | |
a71068499261e730b6d3d0e177330baf author.txt |
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
md5sum: | |
1745fa446f14a97dbf49a9deb98f4e41 mercurial.txt | |
9ac997c2338cfaed8ce58e4d6adb5633 butterfly.txt | |
ae1033dae0a93626b63a34e3d6649184 astaire.txt | |
c15e76cdd8646dba61e947b7fc98e928 counterstrike.txt | |
0320aa76274126316f5a755778447beb eiro.txt | |
3d524a3ccfcec2eeea7341ecb2270452 funny.txt | |
9ce61339f024815dda6a8c689e769a63 megan.txt | |
e0d4fed25bcc7f23221bb3b7827eae3d poseur.txt |
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
import collections | |
import random | |
import re | |
import string | |
alphabet = string.ascii_lowercase | |
# Make a counter for each lowercase letter, and add a count to it | |
# whenever a letter follows it in /usr/share/dict/words | |
counters = {letter: collections.Counter() for letter in alphabet} |
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
Switching Power Supply Design - Abraham Pressman | |
Practical Binary Analysis - Andiesse | |
Solving Mathematical Problems: A Personal Perspective - Terence Tao | |
Software Design Decoded: 66 Ways Experts Think - Marian Petre and Andre van der Hoek | |
Exercises in Style | |
Concepts in Programming Languages | |
The Innovator's Dilemma | |
Psychology of Intelligence | |
Thinking, Fast and Slow | |
Programming Languages: Application and Interpretation |
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
https://stackoverflow.com/questions/8874615/how-to-replace-a-running-function-in-common-lisp | |
http://readevalprint.tumblr.com/post/101841449553/its-alive-the-path-from-library-to-web-app | |
https://stackoverflow.com/questions/46499463/hot-debug-and-swap-in-common-lisp | |
http://lisp-univ-etc.blogspot.com/2013/06/free-lisp-hackers-ebook.html | |
https://mitpress.mit.edu/sicp/ | |
http://www.ymeme.com/ | |
https://google-styleguide.googlecode.com/svn/trunk/lispguide.xml | |
http://stackoverflow.com/questions/5447071/lisp-importing-loading-file | |
http://programming-puzzler.blogspot.com/2010/08/racket-vs-clojure.html | |
http://stackoverflow.com/questions/11876815/common-lisp-a-lisp-n |
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
(defclass square () | |
((state :initarg :state :accessor state) ;; -1 if queen, 0, 1, ... N otherwise | |
(x :initarg :x :accessor x) | |
(y :initarg :y :accessor y))) | |
(defmethod update-square ((self square) new-state) | |
(if (!= (state self) -1) | |
(incf (state self) new-state) ;; it's not a queen - update | |
(setf (state self) 0))) ;; remove the queen |
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
# Final Project | |
# AI-NQueens-CSP | |
# March 17, 2019 | |
# Sharice Mayer | |
import numpy as np | |
from matplotlib import pyplot as plt | |
import random | |
import time | |
from timeit import default_timer as timer |