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
@prefix : <#>. | |
@prefix ex: <https://example.com/>. | |
@prefix : <./>. | |
<_:b0> | |
ex:blocks ( <_:b1> <_:b4> ); ex:meta <_:b9>; ex:pandoc-api-version ( 1 17 5 4 ). | |
<_:b1> a ex:Header; ex:attr :subject; ex:inline <_:b3>; ex:level 1 . | |
<_:b2> ex:about "https://example.com/subject". |
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
# Login to an Identity Provider and request resource from a Solid Pod using DPoP | |
# Following https://solid.github.io/solid-oidc/primer/ | |
library(httr2) | |
library(jsonlite) | |
library(jose) | |
# httr2 uses req_oauth_{name} to cache access tokens from oauth_flow_{name} | |
# - we define req_oauth_solid_dpop | |
# - oauth_client has to be called manually. We instead register a client dynamically with the IDP |
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
# Translated from https://stackoverflow.com/questions/6048975/google-maps-v3-how-to-calculate-the-zoom-level-for-a-given-bounds | |
getBoundsZoomLevel=function(bounds, mapDim) { | |
WORLD_DIM = list(height=256, width= 256); | |
ZOOM_MAX = 21; | |
latRad=function(lat) { | |
sin = sin(lat * pi / 180); | |
radX2 = log((1 + sin) / (1 - sin)) / 2; | |
return(max(min(radX2, pi), -pi) / 2); |
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(xml2) | |
library(magrittr) | |
#extract document | |
unzip(docx,files = "word/document.xml",junkpaths = T) | |
doc=read_xml("document.xml") | |
#extract field code text | |
refs=xml_find_all(doc,"//w:instrText") | |
refs_text = sapply(refs,xml_text) |
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
//https://stackoverflow.com/questions/22757908/google-calendar-render-action-template-parameter-documentation | |
javascript:(function(){ | |
var times=document.querySelectorAll(".itinerary-summary-row.open .itinerary-main .itinerary-time-column .itinerary-time-column-time"); | |
if(times.length==0) return false; | |
var startTime=times[0].innerHTML.replace(":",""); | |
var endTime=times[times.length-1].innerHTML.replace(":",""); | |
var dateSelector=document.querySelector(".time-selectors .date"); | |
var d=new Date(parseInt(dateSelector[dateSelector.selectedIndex].value)*1000); | |
var date=d.toISOString().substr(0,10).replace(/-/g,""); | |
var dates=date+"T"+startTime+"00/"+date+"T"+endTime+"00"; |
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
#Prepare data | |
data(Cotter) | |
x <- Cotter[1:1000] | |
#Specify gr4j model | |
mod0 <- hydromad(x, sma = "gr4j", routing = "gr4jrouting",transformed=TRUE) | |
#Use transformed parameter ranges | |
mod0 <- update(mod0,newpars=gr4j.transformpar(c(hydromad.getOption("gr4j"), | |
hydromad.getOption("gr4jrouting") |
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(sensitivity) | |
library(hydromad) | |
data(Cotter) | |
x <- Cotter[1:1000] | |
obj <- hydromad(x, sma = "cwi", routing = "expuh", | |
tau_s = c(2,100), v_s = c(0,1)) | |
objective=hmadstat("r.squared") | |
incompl <- delsa(model=NULL, | |
par.ranges=getFreeParsRanges(obj), | |
samples=100,method="sobol") |
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(hydromad) | |
################################################################################ | |
## Prepare example data | |
data(Cotter) | |
x <- Cotter[1:1000] | |
## Define exact model to be used | |
fitt <- hydromad(DATA = x, sma = "cmd",f=0.6,e=0.166,d=220,return_state=T, |
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(hydromad) | |
################################################################################ | |
## Prepare example data | |
data(Cotter) | |
x <- Cotter[1:1000] | |
## Define exact model to be used | |
fitt <- hydromad(DATA = x, sma = "cmd",f=0.6,e=0.166,d=220,return_state=T, |
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(hydromad) | |
################################################################################ | |
## Prepare example data | |
data(Cotter) | |
x <- Cotter[1:1000] | |
## Define exact model to be used | |
fitt <- hydromad(DATA = x, sma = "cmd",f=0.6,e=0.166,d=220,return_state=T, |
NewerOlder