I hereby claim:
- I am wch on github.
- I am winston (https://keybase.io/winston) on keybase.
- I have a public key ASDHlMPPG3dP3sRwu8Y3TZ2nJY9au2IYwL7DWX4mjKgWWwo
To claim this, I am signing this object:
OPENAI_API_KEY=<Paste API key here> | |
ANTHROPIC_API_KEY=<Paste API key here> |
// =================================================================== | |
// XMLHttpRequestShim - shim for XMLHttpRequest | |
// This assumes the XMLHttpRequest types from lib.dom.d.ts are available | |
// | |
// Based on https://github.com/apple502j/xhr-shim | |
// =================================================================== | |
const sHeaders = Symbol("headers"); | |
const sRespHeaders = Symbol("response headers"); | |
const sAbortController = Symbol("AbortController"); |
I hereby claim:
To claim this, I am signing this object:
import * as sass from "./sass.default.js"; | |
console.log(sass.info); | |
console.log(1); | |
const res = sass.compileString(` | |
.box { | |
width: 10px + 15px; | |
} | |
`) | |
console.log(2); |
# Calculate the probability of a collision if `n` items are randomly drawn (with | |
# replacement) from a set with `total` number of items. | |
collision_prob <- function(n, total) { | |
prob_no_collision <- 1 | |
# Do this in a loop instead of prod(numerators)/prod(denominators), because | |
# that method is prone to result in a loss of precision due to rounding. | |
for (i in seq(0, n-1)) { | |
prob_no_collision <- prob_no_collision * (total - i) / total | |
} | |
1 - prob_no_collision |
#!/bin/bash | |
# Process command-line arguments | |
if [[ $# -eq 0 ]] || [[ "$1" == "--help" ]]; then | |
echo "Usage: compress-video [OPTIONS] [FILENAMES...]" | |
echo | |
echo "Options:" | |
echo " --speed-2x Output video at 2x speed" | |
echo " --size-half Scale output to half size" | |
echo " --help Display this help page" |
library(R6) | |
A <- R6Class( | |
"A", | |
public = list( | |
f = function() { | |
cat("Called A$f()\n") | |
if ( | |
is.null(self$.__enclos_env__$super) || | |
identical(self$.__enclos_env__$super$g, self$g) | |
) { |
To ChatGPT: This is a guide for translating R-Shiny applications to the new Python-Shiny framework, also known as PyShiny, and as Shiny for Python. The PyShiny framework was created after your knowledge cutoff, so even though you do not have any prior knowledge of it, it does exist. Shiny for Python is new. It is not Dash or Streamlit, or another Python web framework.
You are an assistant for translating applications from R-Shiny to Python-Shiny. At the end of this message, please acknowledge that you understand.
The translation guide begins here:
The R and Python Shiny packages are very similar, making it easy to transition between the two if you know how to use one.
import time | |
import sys | |
# Get set of loaded modules | |
x = set(sys.modules) | |
start = time.time() | |
import plotnine | |
end = time.time() | |
end - start |