-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(indexservlet): escape </script> in embedded-topic
- Loading branch information
1 parent
ba2eb56
commit a825a7d
Showing
12 changed files
with
322 additions
and
69 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
curl -X GET -u $1 http://localhost:5984/$2-map/_all_docs\?include_docs\=true\&attachments\=true > map.json | ||
curl -X GET -u $1 http://localhost:5984/$2-test/_all_docs\?include_docs\=true\&attachments\=true > test.json | ||
curl -X GET -u $1 http://localhost:5984/$2-state/_all_docs\?include_docs\=true > state.json | ||
curl -X GET -u $1 http://localhost:5984/$2-course/_all_docs\?include_docs\=true > course.json | ||
curl -X GET -u $1 http://localhost:5984/$2-feedback/_all_docs\?include_docs\=true > feedback.json |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# ./import.sh username:password <instance> | ||
curl -X DELETE -u $1 http://127.0.0.1:5984/$2-map | ||
curl -X DELETE -u $1 http://127.0.0.1:5984/$2-test | ||
curl -X DELETE -u $1 http://127.0.0.1:5984/$2-state | ||
curl -X DELETE -u $1 http://127.0.0.1:5984/$2-course | ||
curl -X DELETE -u $1 http://127.0.0.1:5984/$2-feedback | ||
|
||
curl -X PUT -u $1 http://localhost:5984/$2-map | ||
curl -X PUT -u $1 http://localhost:5984/$2-test | ||
curl -X PUT -u $1 http://localhost:5984/$2-state | ||
curl -X PUT -u $1 http://localhost:5984/$2-course | ||
curl -X PUT -u $1 http://localhost:5984/$2-feedback | ||
|
||
#curl -X PUT -u $1 http://localhost:5984/$2-map/_design/net -d @design-map.json | ||
#curl -X PUT -u $1 http://localhost:5984/$2-test/_design/test -d @design-test.json | ||
|
||
curl -d @map.json -H "Content-type: application/json" -X POST -u $1 http://127.0.0.1:5984/$2-map/_bulk_docs | ||
curl -d @test.json -H "Content-type: application/json" -X POST -u $1 http://127.0.0.1:5984/$2-test/_bulk_docs | ||
curl -d @state.json -H "Content-type: application/json" -X POST -u $1 http://127.0.0.1:5984/$2-state/_bulk_docs | ||
curl -d @course.json -H "Content-type: application/json" -X POST -u $1 http://127.0.0.1:5984/$2-course/_bulk_docs | ||
curl -d @feedback.json -H "Content-type: application/json" -X POST -u $1 http://127.0.0.1:5984/$2-feedback/_bulk_docs |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
node ../transformdocs.js map.json | ||
node ../transformdocs.js test.json | ||
node ../transformdocs.js state.json | ||
node ../transformdocs.js course.json | ||
node ../transformdocs.js feedback.json |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
function(doc) { | ||
if ('_' === doc.topic) return; | ||
index("chapter", doc.chapter, {'store': true}); | ||
index("topic", doc.topic, {'store': true, 'boost': 2}); | ||
if (doc.summary) | ||
index("summary", doc.summary, {'store': true, 'boost': 2}); | ||
if (doc.description) | ||
index("description", doc.description, {'store': true}); | ||
if (doc.thumb) | ||
index("thumb", doc.thumb, {'store': true, 'index': false}); | ||
function convert(docel) { | ||
if ('_' === docel.topic) return; | ||
index("chapter", docel.chapter, {'store': true}); | ||
index("topic", docel.topic, {'store': true, 'boost': 2}); | ||
if (docel.summary) | ||
index("summary", docel.summary, {'store': true, 'boost': 2}); | ||
if (docel.description) | ||
index("description", docel.description, {'store': true}); | ||
if (docel.thumb) | ||
index("thumb", docel.thumb, {'store': true, 'index': false}); | ||
} |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
<!doctype html> | ||
<html lang="de"> | ||
<head> | ||
<title>Zentraler Grenzwertsatz</title> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" /> | ||
<link rel='stylesheet' type='text/css' href='https://cdn.jsdelivr.net/npm/jsxgraph@latest/distrib/jsxgraph.css'/> | ||
<script src='https://cdn.jsdelivr.net/npm/jsxgraph@latest/distrib/jsxgraphcore.js' type='text/javascript'></script> | ||
|
||
<style> | ||
body { | ||
margin: 0px; | ||
padding: 0px; | ||
overflow: hidden; | ||
} | ||
.container { | ||
display: grid; | ||
grid-template-columns: 1fr; | ||
} | ||
.jxgbox { border-radius: 0px; border: none} | ||
.term { | ||
background-color: white; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
|
||
<div class="container"> | ||
<div id='sliders' class='jxgbox' style='width: 100%; aspect-ratio: 12'></div> | ||
<div id='board' class='jxgbox' style='width: 100%; aspect-ratio: 3'></div> | ||
</div> | ||
|
||
<script> | ||
|
||
var olds = 1; | ||
|
||
var sliders = JXG.JSXGraph.initBoard('sliders', { boundingbox: [0, 2, 18, 0], intl: { enabled: true, locale: 'de-DE'}, showNavigation: false, showZoom: false, showCopyright: false, pan: { enabled: false }}); | ||
var ns = sliders.create('slider', [[1, 1.3], [13, 1.3], [1, 1, 7]], {snapWidth: 1, ticks: { minorTicks: 1, drawLabels: true, label: {fontSize: 13, strokeColor: '#D55E00'} }, name: 'n', digits: 0, label: {fontSize: 14, strokeColor: '#D55E00'}}); | ||
|
||
var board = JXG.JSXGraph.initBoard('board', { boundingbox: [-3, .2, 30, -.03], axis: true, showNavigation: false, showZoom: false, showCopyright: false, pan: { enabled: false }}); | ||
sliders.addChild(board); | ||
|
||
var mu = 7; | ||
var si = 4; | ||
|
||
const normal = x => 1/Math.sqrt(2 * Math.PI * si**2) * Math.exp(-1/2 * ((x-mu)/si)**2); | ||
var f = board.create('functiongraph', [normal], {strokeWidth: 3, layer: 10}); | ||
|
||
function sums() { | ||
const n = ns.Value(); | ||
const l = n * 5; | ||
const arr = []; | ||
for (let i = 0; i <= l; i++) { | ||
arr.push(i + n); | ||
} | ||
return arr; | ||
} | ||
function abs() { | ||
const n = ns.Value(); | ||
const il = n * 6; | ||
const arr = []; | ||
for (let i = n; i <= il; i++) { | ||
let s = 0; | ||
const kl = Math.floor((i-n)/6); | ||
for (let k = 0; k <= kl; k++) { | ||
const v = (-1)**k*JXG.Math.binomial(n,k)*JXG.Math.binomial(i-1-6*k,n-1); | ||
s += v; | ||
} | ||
arr.push(Math.round(s)); | ||
} | ||
return arr; | ||
} | ||
function rels(as) { | ||
const n = ns.Value(); | ||
return as.map(a => a/6**n); | ||
} | ||
|
||
var chart, chartl; | ||
|
||
function genchart() { | ||
const n = ns.Value(); | ||
const ss = sums(); | ||
const as = abs(); | ||
const rs = rels(as); | ||
chart = board.create('chart', [ss, rs], {chartStyle: 'bar', width: 1, color: '#66bb6a'}); | ||
for (let i = 0; i < chart[0].length; i++) { | ||
const element = chart[0][i]; | ||
element.rendNode.style = "stroke: green; opacity: .5"; | ||
element.setAttribute({stroke: 'green', opacity: .5}); | ||
} | ||
chartl = board.create('chart', [ss, rs], {chartStyle: 'point,line', width: 1, color: '#66bb6a'}); | ||
chartl[1].setAttribute({strokeColor: 'black', strokeWidth: 3, fillColor: 'none'}); | ||
for (let i = 0; i < chartl[0].length; i++) { | ||
const element = chartl[0][i]; | ||
element.setAttribute({strokeColor:'green', fillColor: 'green', size: 1}); | ||
} | ||
mu = n * 3.5 | ||
si = Math.sqrt(n*35/12); | ||
f.updateCurve(); | ||
} | ||
|
||
genchart(); | ||
|
||
ns.on('drag', () => { | ||
const s = ns.Value().toFixed(0); | ||
if (s === olds) | ||
return; | ||
|
||
board.suspendUpdate(); | ||
board.removeObject(chart); | ||
board.removeObject(chartl); | ||
genchart(); | ||
board.unsuspendUpdate(); | ||
|
||
olds = s; | ||
}); | ||
</script> | ||
|
||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
<!doctype html> | ||
<html lang="de"> | ||
<head> | ||
<title>Entstehung der Normalverteilung</title> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" /> | ||
<link rel='stylesheet' type='text/css' href='https://cdn.jsdelivr.net/npm/jsxgraph@latest/distrib/jsxgraph.css'/> | ||
<script src='https://cdn.jsdelivr.net/npm/jsxgraph@latest/distrib/jsxgraphcore.js' type='text/javascript'></script> | ||
|
||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css" crossorigin="anonymous"> | ||
<script src="https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.js" crossorigin="anonymous"></script> | ||
|
||
<style> | ||
body { | ||
margin: 0px; | ||
padding: 0px; | ||
overflow: hidden; | ||
} | ||
.container { | ||
display: grid; | ||
grid-template-columns: 1fr; | ||
} | ||
.jxgbox { border-radius: 0px; border: none} | ||
.term { | ||
background-color: white; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
|
||
<div class="container"> | ||
<div id='sliders' class='jxgbox' style='width: 100%; aspect-ratio: 12'></div> | ||
<div id='board' class='jxgbox' style='width: 100%; aspect-ratio: 3'></div> | ||
</div> | ||
|
||
<script> | ||
var olds = 1; | ||
|
||
var sliders = JXG.JSXGraph.initBoard('sliders', { boundingbox: [0, 2, 13, 0], showNavigation: false, showZoom: false, showCopyright: false, pan: { enabled: false }}); | ||
var ns = sliders.create('slider', [[1.5, 1.3], [9.5, 1.3], [1, 1, 5]], {snapWidth: 1, ticks: { drawLabels: true, label: {fontSize: 13, strokeColor: '#D55E00'} }, name: 'S', digits: 0, label: {fontSize: 14, strokeColor: '#D55E00'}}); | ||
|
||
var board = JXG.JSXGraph.initBoard('board', { boundingbox: [-100, .004, 1600, -.001], axis: true, showNavigation: false, showZoom: false, showCopyright: false, pan: { enabled: false }}); | ||
sliders.addChild(board); | ||
|
||
const μ = 1024; | ||
const σ = 128; | ||
const nn = () => 2**(ns.Value()+4); | ||
|
||
const normal = x => 1/Math.sqrt(2 * Math.PI * σ**2) * Math.exp(-1/2 * ((x-μ)/σ)**2); | ||
var f = board.create('functiongraph', [normal], {strokeWidth: 2}); | ||
|
||
function dataX() { | ||
const arr = []; | ||
const n = nn(); | ||
for (let i = 0; i <= 2 * μ; i++) { | ||
arr.push(μ / n + i * (2 * μ / n)); | ||
} | ||
return arr; | ||
} | ||
function dataY() { | ||
const arr = []; | ||
const n = nn(); | ||
for (let k = 1; k <= n; k++) { | ||
arr.push(JXG.Math.Numerics.I([(k - 1)*(2*μ) / n, (k * 2*μ) / n], normal) / ((2*μ) / n)); | ||
} | ||
return arr; | ||
} | ||
|
||
var chart = board.create('chart', [dataX(), dataY()], { chartStyle: 'bar', width: (2*μ) / nn(), color: '#66bb6a' }); | ||
for (i = 0; i < chart[0].length; i++) { | ||
element = chart[0][i]; | ||
element.rendNode.style = "strokeWidth: 1px; stroke: green"; | ||
} | ||
|
||
ns.on('drag', () => { | ||
const s = ns.Value().toFixed(0); | ||
if (s === olds) | ||
return; | ||
const n = nn(); | ||
|
||
board.suspendUpdate(); | ||
for (let i = 0; i <= chart[0].length; i++) { | ||
board.removeObject(chart[0][i]); | ||
} | ||
chart = board.create('chart', [dataX(), dataY()], { chartStyle: 'bar', width: (2*μ) / n, color: '#66bb6a' }); | ||
for (i = 0; i < chart[0].length; i++) { | ||
element = chart[0][i]; | ||
element.rendNode.style = "strokeWidth: 1px; stroke: green"; | ||
} | ||
board.unsuspendUpdate(); | ||
|
||
olds = s; | ||
}); | ||
</script> | ||
|
||
</body> | ||
</html> |
Oops, something went wrong.