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 gist:508c8ab67296012e8dd182e5c95c3968
> 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 Dec 4, 2019
Depth-first topological sort in Common Lisp
View topo-sort-dfs.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)))
View describe_df.R
#' \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}
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))) {
@alandipert
alandipert / kahn.clj
Last active Nov 15, 2019
Kahn's topological sort in Clojure
View kahn.clj
;; Copyright (c) Alan Dipert. All rights reserved.
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
;; By using this software in any fashion, you are agreeing to be bound by
;; the terms of this license.
;; You must not remove this notice, or any other, from this software.
(ns alandipert.kahn
(:require [clojure.set :refer [difference union intersection]]))
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 / interfaces
Created Mar 12, 2013
raspbian configuration for bridging eth0 and wlan0
View interfaces
# /etc/network/interfaces
# Configured for bridging wifi<->ethernet
# Tested with:
# - RPi Model B Rev. 1
# - 2013-02-09-wheezy-raspbian
# - Edimax 8192-series USB wireless adapter
# - /etc/modprobe.d/8192cu.conf contents:
# - options 8192cu rtw_power_mgnt=0 rtw_enusbss=0
# - firmware: c2d133fb4efe9c9995da7fd7e1c45d74254f5c4b
View ns-cheatsheet.clj
;;
;; NS CHEATSHEET
;;
;; * :require makes functions available with a namespace prefix.
;;
;; * :use makes functions available without a namespace prefix
;; (i.e., refers functions to the current namespace).
;;
;; * :import refers Java classes to the current namespace.
;;
@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

You can’t perform that action at this time.