Skip to content

Instantly share code, notes, and snippets.

View mv.lisp
(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))
View fb.clj
(defn fizzbuzz [n]
(let [fb (str ({0 "fizz"} (mod n 3))
({0 "buzz"} (mod n 5)))]
({"" (str n)} fb fb)))
View permute.js
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]))
: [[]];
View mv.lisp
(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))
View mv.clj
(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)))]
Build wiki.html with:
emacs --batch -f org-html-export-to-html --kill
#+OPTIONS: toc:nil
#+BEGIN_SRC emacs-lisp :exports none
(defun hyperorg/sort ()
(goto-char (point-min))
(goto-char (1- (search-forward "*")))
View promise_test.R
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 <- function(input, output, session) {
View boot.lisp
;; in JACL package; use JACL from COMMON-LISP and switch to COMMON-LISP
(%let ((cl-pkg (\. (%js "Package") (|get| (\. '#:common-lisp |name|)))))
(\. cl-pkg (|usePackage| cl:*package*))
(%setq cl:*package* cl-pkg))
(\. *package* (|exportSymbol| (\. 'defmacro |name|)))
(%js "(~{}.setMacro().fvalue = ~{})"
(%lambda (env form name params &rest body)
;; TODO Use %PROGN instead of %LET
View future_error.Rmd
title: "Promises/Future Test"
runtime: shiny
output: html_document
```{r, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
You can’t perform that action at this time.