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
progress_print <- function(){ | |
L <- list(init = function(x) {M <<- x}, step = function() NULL, term = function() NULL) | |
itr <- 0 | |
M <- 1 | |
L$step <- function(){ | |
itr <<- itr + 1 | |
cat(paste0("Job ", itr, " out of ", M, "\n")) | |
} | |
return(L) | |
} |
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(sp) | |
library(rgeos) | |
library(rgdal) | |
library(maptools) | |
library(dplyr) | |
library(leaflet) | |
library(scales) | |
### Begin data prep | |
# Grab air/water quality data from the EPA | |
url = "https://data.cdc.gov/api/views/cjae-szjv/rows.csv?accessType=DOWNLOAD" |
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
# | |
# This Shiny web application demonstrates the use of custom image files | |
# in place of icons for value boxes in Shiny Dashboard by overriding two | |
# functions: | |
# | |
# 'icon' from the shiny package and 'valueBox' from the shinydashboard package. | |
# | |
# Each function adds minimal, specific additional handling of image files. | |
# Note: A custom css file must also be included so that value boxes can | |
# display the icons. For that reason, do not expect images in place of icons to |
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
/*==================================================================== | |
Title: Computes Longest Repeated Substring from a given string | |
Complexity: O(n.log(n)) | |
Author : Sudipto Chandra (Dipu) | |
=====================================================================*/ | |
#include <bits/stdc++.h> | |
using namespace std; | |
#define mem(a,b) memset(a, b, sizeof(a)) | |
#define loop(i, x) for(__typeof((x).begin()) i=(x).begin(); i!=(x).end(); ++i) | |
#define rloop(i, x) for(__typeof((x).rbegin()) i=(x).rbegin(); i!=(x).rend(); ++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
doInstall <- TRUE # Change to FALSE if you don't want packages installed. | |
toInstall <- c("sna", "ggplot2", "Hmisc", "reshape2") | |
if(doInstall){install.packages(toInstall, repos = "http://cran.r-project.org")} | |
lapply(toInstall, library, character.only = TRUE) | |
# Empty ggplot2 theme | |
new_theme_empty <- theme_bw() | |
new_theme_empty$line <- element_blank() | |
new_theme_empty$rect <- element_blank() | |
new_theme_empty$strip.text <- element_blank() |
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(inline) | |
inc <- ' | |
/* This is taken from envir.c in the R 2.15.1 source | |
https://github.com/SurajGupta/r-source/blob/master/src/main/envir.c | |
*/ | |
#define FRAME_LOCK_MASK (1<<14) | |
#define FRAME_IS_LOCKED(e) (ENVFLAGS(e) & FRAME_LOCK_MASK) | |
#define UNLOCK_FRAME(e) SET_ENVFLAGS(e, ENVFLAGS(e) & (~ FRAME_LOCK_MASK)) | |
' |
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
# Before running the code... | |
# 1. Set VPN function in Opera | |
# 2. Download Opera Webdriver from https://github.com/operasoftware/operachromiumdriver/releases | |
# 3. Type about://about in Opera and get profile path and installation path. | |
# 4. Set the variables. | |
# opera_profile = r"C:\profile path" | |
# options._binary_location = r"C:\\installation path." | |
from selenium import webdriver |
OlderNewer