Skip to content

Instantly share code, notes, and snippets.

Alan Dipert alandipert

Block or report user

Report or block alandipert

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View bruteforce.R
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))) {
View jacl-rationale.md

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?

View choicesWithNamesRectangle.R
# 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 Aug 7, 2019 — forked from jcheng5/README.md
Installing R-devel on Solaris 10 VM
View README.md

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

View err.txt
test-bootstrap.r:48: error: Repeated names for selectInput and radioButtons choices
Couldn't normalize path in `addResourcePath`, with arguments: `prefix` = 'font-awesome-5.3.1'; `directoryPath` = ''
1: radioButtons("id", "label", choiceNames = list(icon("calendar"), HTML("<p style=\"color:red;\">Red</p>"), "Normal"), choiceValues = list("icon", "html", "text")) at /home/alan/github/rstudio/shiny/tests/testthat/test-bootstrap.r:48
2: generateOptions(inputId, selected, inline, "radio", args$choiceNames, args$choiceValues) at /home/alan/github/rstudio/shiny/R/input-radiobuttons.R:96
3: mapply(choiceValues, choiceNames, FUN = function(value, name) {
inputTag <- tags$input(type = type, name = inputId, value = value)
if (value %in% selected)
inputTag$attribs$checked <- "checked"
pd <- processDeps(name, session)
if (inline) {
@alandipert
alandipert / app.R
Created Aug 2, 2019
Shiny app with malformed HTML ui
View app.R
library(shiny)
ui <- fluidPage(
titlePanel("Shiny App with Malformed HTML"),
sidebarLayout(
sidebarPanel(
sliderInput("bins",
"Number of bins:",
min = 1,
max = 50,
@alandipert
alandipert / app.R
Created Aug 2, 2019
Shiny app with malformed HTML ui
View app.R
library(shiny)
ui <- fluidPage(
titlePanel("Shiny App with Malformed HTML"),
sidebarLayout(
sidebarPanel(
sliderInput("bins",
"Number of bins:",
min = 1,
max = 50,
View httpuv_test.R
#!/usr/bin/env Rscript
app <- list(
call = function(req) {
list(
status = 200L,
headers = list('Content-Type' = 'text/html'),
body = '
<html>
<head><title>websocket test</title></head>
View square.lisp
(defun square-list (list)
(reduce (lambda (x xs) (cons (* x x) xs))
list
:initial-value '()
:from-end t))
View app.R
library(shiny)
ui <- fluidPage(
tags$h1("cool2")
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
You can’t perform that action at this time.