Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

;; 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 = ~{})"
'defmacro
(%lambda (env form name params &rest body)
;; TODO Use %PROGN instead of %LET
---
title: "Promises/Future Test"
runtime: shiny
output: html_document
---
```{r, include=FALSE}
library(promises)
library(future)
knitr::opts_chunk$set(echo = TRUE)
```
#!/usr/bin/env Rscript
library(chromote)
library(jsonlite)
muffle <- function(expr) {
if (.Platform$OS.type == "unix") {
sink("/dev/null")
} else {
sink("NUL")
> options(warn=2)
> shinyloadtest_report(slt_demo_data_1)
shinyloadtest_report - demo1 Session Duration [=======>--------------------------------------------------------------------------------------------] 5/64 eta:10s
Error: (converted from warning) Removed 1 rows containing missing values (geom_vline).
37.
doWithOneRestart(return(expr), restart)
36.
withOneRestart(expr, restarts[[1L]])
35.
withRestarts({
@alandipert
alandipert / topo-sort-dfs.lisp
Last active December 4, 2019 14:09
Depth-first topological sort in Common Lisp
;; some graphs for testing
(setq g1 '((b a d)
(d e)
(e a)
(f d)
(g d a e c)))
(setq g2 '((c a)
(d a)
(b d z)))
#' \describe{
#' \item{run}{Name of the run}
#' \item{session_id}{simulated session identifier, 0-based}
#' \item{user_id}{simulated user identifier, 0-based}
#' \item{iteration}{user session identifier, 0-based}
#' \item{input_line_number}{recording line number associated with event}
#' \item{event}{type of the event}
#' \item{start}{time the event started, in seconds, relative to the time at which all simulated users were running.}
#' \item{end}{time the event ended, in seconds, relative to the time at which all simulated users were running}
#' \item{time}{event duration, in seconds}
ops <- list('+' = `+`, '-' = `-`, '*' = `*`, '/' = `/`)
eval_expr <- function(f1, f2, f3) {
f2(f1(2, .5), f3(1.5, 4)) == -6.25
}
find <- function() {
m <- gtools::permutations(4, 3, 1:4)
for (r in 1:nrow(m)) {
if (do.call(eval_expr, setNames(ops[m[r,]], NULL))) {

JACL (JavaScript Assisted Common Lisp) is an experimental Lisp system for the web browser platform. It was created to explore new techniques for large-scale SPA (Single Page Application) development in Lisp.

Specifically, the project goals are to:

  1. Implement a useful subset of CL
  2. Interoperate efficiently with JavaScript
  3. Host as much development tooling as possible in the browser so that tools may organically evolve with the applications they’re used to build
  4. Support the delivery of applications competitive in size and speed with respect to those produced by JavaScript tools

Why not JavaScript?

# Like choicesWithNames(), but returns a data frame of value, label, and
# optgroup columns. This rectangular view could also be thought of as the set
# of paths into the choicesWithNames() tree.
#
# For example, given a choices argument like this:
#
# list(a = 1, B = list(B = 2), c = list(3))
#
# choicesWithNames() would return a tree like this:
#
@alandipert
alandipert / README.md
Last active August 7, 2019 19:30 — forked from jcheng5/README.md
Installing R-devel on Solaris 10 VM

As far as CRAN is concerned, there are two flavors of R on Solaris: one that is built using the Solaris Studio compiler, and one that is built using the GNU/gcc toolchain. The latter is far more up-to-date, but if your package requires it, then your DESCRIPTION file must declare that with the line SystemRequirements: GNU make.

These instructions are for configuring, building, and installing R-devel using the GNU/gcc toolchain (only).

You'll need VMWare Fusion on Mac, or VMWare Workstation (?) on Windows/Linux.

Get Solaris VM

Download the Solaris VM provided by Jeroen Ooms: https://github.com/jeroen/solarisvm