encoding is UTF-8, needs pdflatex
per mille sign
- plain text: ‰ (doesn't render properly in PDF)
- HTML:
‰
(renders properly in PDF) - LaTeX:
$\text{\textperthousand}$
(renders properly in PDF)
delta sign
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) { |
<!DOCTYPE html> | |
<head> | |
<script type="text/javascript" src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min.js'></script> | |
<script type="text/javascript" src='https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.min.js'></script> | |
<script type="text/javascript" src='wordFreq.js'></script> | |
</head> | |
<body ng-app='wordFreqApp'> | |
<div ng-controller='wordFreqCtrl'> | |
<h2>Input something below</h2> |
## from http://tr.im/hH5A | |
logsumexp <- function (x) { | |
y = max(x) | |
y + log(sum(exp(x - y))) | |
} | |
softmax <- function (x) { | |
exp(x - logsumexp(x)) | |
} |
// https://interactive.deolua.com/normal-dist | |
/* | |
*@param number x - the value for which the probability value is desired | |
*@param number mean_val - the value of the mean of the distribution | |
*@param number sd_val_sqrd - the value of the SQUARE of the standard deviation of the distribution | |
*/ | |
var pdf_formula = function(x, mean_val, sd_val_sqrd){ | |
var numer = (x - mean_val)**2; |
// https://interactive.deolua.com/normal-dist | |
/* | |
*@param number x - the value for which the cumulative probability value is desired | |
*@param number mean_val - the value of the mean of the distribution | |
*@param number sd_val_sqrd - the value of the SQUARE of the standard deviation of the distribution | |
*/ | |
var normal_cdf = function(x, mean_val, sd_val_sqrd){ | |
var err_input = (x - mean_val)/(Math.sqrt(2 * sd_val_sqrd)); |
var rand_hex_col_gen = function(){ | |
// do the numbers first | |
var options = []; | |
for(var i=0; i<10; i++){ | |
options.push(i.toString()); | |
}; | |
// add letters | |
options = [].concat.apply(options, ["a", "b", "c", "d", "e", "f"]); |
// plugged in this answer from S.O. - https://stackoverflow.com/a/8904008/5172977 | |
// import { Upload } from 'antd'; | |
// function returns a promise | |
beforeUpload = (file) => { | |
return new Promise((resolve, reject) => { | |
// check the file type - you can specify the types you'd like here: | |
const isImg = file.type === 'image/jpeg' || file.type === 'image/jpg' || file.type === 'image/png' || file.type === 'image/gif'; | |
if (!isImg) { |
'use strict'; | |
/** | |
* @param raw_numbers: an array of integer values. Can either be positive or negative | |
* @return: sorted array, from negative to positive | |
*/ | |
const sortArrayOfIntegers = (raw_numbers) => { | |
let positives = {}, negatives = {}; | |
for(let m = 0; m < raw_numbers.length; m++) { | |
if(raw_numbers[m] >= 0) { | |
// has it occured before? |