Skip to content

Instantly share code, notes, and snippets.

(defun find-terms (num-terms max-size
&optional (desired-sum 0)
&aux (iterations 0))
"Returns a list of terms in the range -max-size ... +max-size,
inclusive, that sum to desired-sum.
Has strange properties. Likelier to blow the stack as max-size
increases. Seems to spend most time backtracking on the last few
terms.

The following was sent to the JACL e-mail announcement list on 2021-02-26.

Hello everyone, and a belated happy 2021 to you! I hope your year has been off to a good start.

It's been almost a year since JACL became public, and nearly as long since any other announcement or release, so I thought to share three major related educational and design developments. The project is very much alive, just mostly in my head :-)

First, while I haven't made significant tangible progress on the JACL compiler or runtime since last year, I have continued to research and study implementation techniques. I have prototyped several schemes for efficient and JavaScript-friendly multiple-value returns, consuming relevant literature (mostly from the Scheme community) along the way. I have also studied and experimented with CLOS, and to speculate about how best to support a maximum of CLOS functionality without compromising JACL's calculated relationship with the JavaScript platform. One interes

(defconstant mv-limit 20)
(defparameter *mv-expected* 1)
(defparameter *mv* (make-array mv-limit))
(defun mv (&rest vals)
(do ((i 0 (1+ i))
(vs vals (cdr vs)))
((or (eql i *mv-expected*) (null vs))
@alandipert
alandipert / fb.clj
Last active November 26, 2020 20:57
(defn fizzbuzz [n]
(let [fb (str ({0 "fizz"} (mod n 3))
({0 "buzz"} (mod n 5)))]
({"" (str n)} fb fb)))
const removeAt = (xs, i) => xs.filter((x, j) => j !== i);
const permute = xs => xs.length
? xs.flatMap((x, i) => permute(removeAt(xs, i)).map(ys => [x, ...ys]))
: [[]];
(defconstant mv-limit 20)
(defparameter *mv-expected* 1)
(defparameter *mv* (make-array mv-limit))
(defun mv (&rest vals)
(do ((i 0 (1+ i))
(vs vals (cdr vs)))
((or (eql i *mv-expected*) (null vs))
(def mv-limit 20)
(def ^:dynamic *mv-arr*)
(def ^:dynamic *values-expected* 1)
(defn values [& vals]
(when (thread-bound? #'*values-expected*)
(dotimes [i (set! *values-expected*
(min *values-expected* (count vals)))]
#+BEGIN_COMMENT
Build wiki.html with:
emacs wiki.org --batch -f org-html-export-to-html --kill
#+END_COMMENT
#+OPTIONS: toc:nil
#+BEGIN_SRC emacs-lisp :exports none
(defun hyperorg/sort ()
(save-excursion
(goto-char (point-min))
(goto-char (1- (search-forward "*")))
library(promises)
library(future)
library(shiny)
library(testthat)
plan(multiprocess)
adderModule <- function(id, sleepFor, n) {
moduleServer(id, function(input, output, session) {
output$sum <- renderText({

testServer QA Notes

testServer() is a new function for testing the behavior of reactives inside of Shiny server functions and modules.

Server and module functions

Server functions define the reactive behavior of Shiny applications. Together with UI functions, server functions define a Shiny application. Server functions are R functions such as the following:

server &lt;- function(input, output, session) {