From python CGI to jekyll stuff

This commit is contained in:
Thomas FORGIONE
2015-04-23 17:49:59 +02:00
parent 36e4e5b916
commit 445219b013
135 changed files with 194 additions and 5112 deletions

View File

@@ -1,7 +1,11 @@
<section>
<h2>Hermite test</h2>
<code>
<div id="content"></div>
</code>
#
</section>
---
layout: withjs
title: Hermite Test
extrajs: <script src="/static/js/HermiteTest/HermiteTest.js"></script>
---
<section>
<pre>
<div id="content"></div>
</pre>
</section>

View File

@@ -1,28 +0,0 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from webtools import Web
def main():
print('Content-type: text/html')
print()
page = Web.Element(Web.ROOT_DIR + 'templates/page.html')
head = Web.Element(Web.ROOT_DIR + 'templates/head.html')
body = Web.Element(Web.ROOT_DIR + 'templates/body.html')
jsIncludes = Web.Element(Web.ROOT_DIR + 'templates/jsIncludes.html')
mainJs = Web.Element()
mainJs.open_string = ' <script src="js/HermiteTest.js"></script>'
content = Web.Element('index.html')
page.add_child(head)
page.add_child(body)
body.add_child(content)
body.add_child(jsIncludes)
jsIncludes.add_child(mainJs)
page.print()
if __name__ == '__main__':
main()

View File

@@ -1,44 +0,0 @@
var container = document.getElementById('content');
function print(text) {
var content = document.createTextNode(text);
var new_line = document.createElement('br');
container.appendChild(content);
container.appendChild(new_line);
}
function toString(variable) {
if (variable instanceof THREE.Vector3) {
return variable.x + ', ' + variable.y + ', ' + variable.z;
} else {
return variable;
}
}
// Test with THREE.Vector3
// t = [0,1];
// f = [new THREE.Vector3(0,0,0), new THREE.Vector3(1,1,1)];
// fp = [new THREE.Vector3(0,1,2), new THREE.Vector3(0,0,0)];
// Test with doubles
t = [0,1];
f = [0,1];
fp = [-1,-1];
var hermite = new Hermite.special.Polynom(0, 1, -1);
print('M = [');
for (var t = 0; t < 1; t += 0.01) {
var res = hermite.eval(t);
print("\t" + t + ',' + toString(res) + ';');
}
print('];');
print('MP = [');
for (var t = 0; t < 1; t += 0.01) {
var res = hermite.prime(t);
print("\t" + t + ',' + toString(res) + ';');
}
print('];');