Skip to content

Instantly share code, notes, and snippets.

## from http://tr.im/hH5A
logsumexp <- function (x) {
y = max(x)
y + log(sum(exp(x - y)))
}
softmax <- function (x) {
exp(x - logsumexp(x))
}
@DeoluA
DeoluA / common-sci-symbols.md
Created December 10, 2015 08:31 — forked from benmarwick/common-sci-symbols.md
Commonly used scientific symbols in pandoc markdown

Commonly used scientific symbols in pandoc markdown

encoding is UTF-8, needs pdflatex

per mille sign

  • plain text: ‰ (doesn't render properly in PDF)
  • HTML: &permil; (renders properly in PDF)
  • LaTeX: $\text{\textperthousand}$ (renders properly in PDF)

delta sign

@DeoluA
DeoluA / server.R
Created October 23, 2015 13:57 — forked from withr/server.R
Encrypt password with md5 for Shiny-app.
library(shiny)
library(datasets)
Logged = FALSE;
PASSWORD <- data.frame(Brukernavn = "withr", Passord = "25d55ad283aa400af464c76d713c07ad")
# Define server logic required to summarize and view the selected dataset
shinyServer(function(input, output) {
source("www/Login.R", local = TRUE)
observe({
if (USER$Logged == TRUE) {