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
xquery version "3.1"; | |
import module namespace sm="http://exist-db.org/xquery/securitymanager"; | |
import module namespace xmldb="http://exist-db.org/xquery/xmldb"; | |
(: these variables need to be set by the caller :) | |
declare variable $collection as xs:string external; | |
declare variable $group as xs:string? external; | |
declare variable $user as xs:string? external; | |
declare variable $mode as xs:string external; |
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
xquery version "3.1"; | |
(: adapted from https://stackoverflow.com/a/4936099 :) | |
declare function local:fib-reducer ($r, $n) { $r[1] + $r[2], $r[1] }; | |
declare function local:fib($n as xs:integer) { | |
fold-left((1 to $n), (0,1), local:fib-reducer#2)[1] | |
}; | |
let $results := |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>dc.js multi-line chart attempt</title> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/dc/1.7.3/dc.css"/> | |
</head> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>dc.js multi-line chart attempt</title> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/dc/1.7.3/dc.css"/> | |
</head> |
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 sandbox(script, context){ | |
context.window = {}; | |
for (var key in context){ | |
context.window[key] = context[key]; | |
} | |
context.global = context.window; | |
eval("with (context){ " + script + " }"); | |
} |
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
# searches a combination of the given elements that matches toMatch | |
# @param c array - initially empty, carries the current combination throught | |
# the recursion | |
# @param els array - the predefined set of elements | |
# @param toMatch string - the rest-string to be matched with the elements | |
# | |
# @return an array of combinations that recursively match | |
searchCombination = (c, els, rest) -> | |
return c if rest.length==0 |
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
{ | |
"locale": "fi", | |
"text": { | |
"#authors": [ | |
{ | |
"name": "Juri Leino", | |
"screen-name": "line-o" | |
} | |
], | |
"tweet": { |