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
# Reference: | |
# https://techspot.zzzeek.org/2012/07/07/the-absolutely-simplest-consistent-hashing-example/ | |
# Changes done on top of Mike Bayer's original Implementation | |
# - Remove replica concept to (over)simplify the code | |
# - Address Python2 -> Python3 changes | |
import bisect | |
import hashlib |
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(dplyr) | |
library(lubridate) | |
# Load libraries and functions needed to create SQLite databases. | |
library(RSQLite) | |
library(RSQLite.extfuns) | |
saveSQLite <- function(data, name){ | |
path <- dplyr:::db_location(filename=paste0(name, ".sqlite")) |
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
// TMP36 Pin Variables | |
// the analog pin the TMP36's Vout (sense) pin is connected to | |
// the resolution is 10 mV / degree centigrade with a | |
// 500 mV offset to allow for negative temperatures | |
int sensorPin = 0; | |
void setup() | |
{ | |
Serial.begin(9600); //Start the serial connection with the computer | |
//to view the result open the serial monitor | |
} |
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("foreign") |
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) | |
disableActionButton <- function(id,session) { | |
session$sendCustomMessage(type="jsCode", | |
list(code= paste("$('#",id,"').prop('disabled',true)" | |
,sep=""))) | |
} | |
shinyServer(function(input, output,session) { | |
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
/* | |
// Skills included in this script: | |
// (1) FOR loop; | |
// (2) IF statement; | |
// (3) Get the current time; | |
// (4) Usage of vector (build, insert, size); | |
// (5) How to convert int into string; | |
// (6) Write into file; | |
// (7) Output; | |
*/ |
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
from Crypto.Cipher import AES | |
import base64 | |
import os | |
# the block size for the cipher object; must be 16, 24, or 32 for AES | |
BLOCK_SIZE = 32 | |
# the character used for padding--with a block cipher such as AES, the value | |
# you encrypt must be a multiple of BLOCK_SIZE in length. This character is | |
# used to ensure that your value is always a multiple of BLOCK_SIZE |