This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// IP info; | |
$(document).ready(function(){ | |
var I = 0 | |
var tt = setInterval(function(){ | |
var L = $("#log"); | |
$.get("http://ipinfo.io", function(e) { | |
L.val(Date() + " ipInfo|" + e.ip + "," + e.city + "," + e.loc); | |
L.trigger("change"); | |
}, "jsonp"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
palette(c("#E41A1C", "#377EB8", "#4DAF4A", "#984EA3", | |
"#FF7F00", "#FFFF33", "#A65628", "#F781BF", "#999999")) | |
shinyServer(function(input, output, session) { | |
# Combine the selected variables into a new data frame | |
selectedData <- reactive({ | |
iris[, c(input$xcol, input$ycol)] | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.mixin({ | |
sum : function(data){ | |
return _.reduce(data, function(memo, num){ return memo + num; }, 0); | |
}, | |
mean : function(data){ | |
return this.sum(data)/data.length | |
}, | |
median : function(data){ | |
return this.percentile(data,50); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(uustats){ | |
uustats.sdev = function(series) { | |
return Math.sqrt(uustats.variance(series)); | |
}; | |
uustats.variance = function(series) { | |
var t = 0, squares = 0, len = series.length; | |
for (var i=0; i<len; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
''' | |
A Simple mjpg stream http server for the Raspberry Pi Camera | |
inspired by https://gist.github.com/n3wtron/4624820 | |
''' | |
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer | |
import io | |
import time | |
import picamera |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shinyUI(pageWithSidebar( | |
# Include css file; | |
tagList( | |
tags$head( | |
tags$title("Upload Data"), | |
tags$h1("Test") | |
) | |
), | |
# Control panel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shinyServer(function(input, output) { | |
observe({ | |
print(input$daterange) | |
}) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shinyServer(function(input, output) { | |
datasetInput <- reactive({ | |
switch(input$dataset, | |
"rock" = rock, | |
"pressure" = pressure, | |
"cars" = cars) | |
}) | |
output$caption <- renderText({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shinyServer(function(input, output) { | |
output$hist1 <- renderPlot({ | |
n <- (input$obs) | |
dist <- NULL | |
for (i in 1:n) { | |
dist <- c(dist, rnorm(1)) | |
} | |
hist(dist,main = paste("hist1", n), breaks = 100) |
NewerOlder