Browse Source

3 dingen

main
Joshua Moerman 4 years ago
parent
commit
7825e48781
  1. 2
      .gitignore
  2. 16
      123bicategorie/index.html
  3. 28
      baas/.gitignore
  4. BIN
      baas/Joshua.jpg
  5. BIN
      baas/Jurriaan.jpg
  6. 3
      baas/README.md
  7. BIN
      baas/Rob.jpg
  8. BIN
      baas/ginger-cat-713.png
  9. BIN
      baas/ginger-cat-718.png
  10. BIN
      baas/ginger-cat-746.png
  11. 185
      baas/index.html
  12. 5
      baas/star.svg
  13. 284
      baas/style.css
  14. 25
      index.html
  15. 61
      rust-wasm/0.bootstrap.js
  16. BIN
      rust-wasm/512e9878aaa7c8600613.module.wasm
  17. 270
      rust-wasm/bootstrap.js
  18. 29
      rust-wasm/index.html

2
.gitignore

@ -0,0 +1,2 @@
.DS_Store

16
123bicategorie/index.html

@ -0,0 +1,16 @@
<!doctype html>
<html lang="nl">
<head>
<meta charset="utf-8">
<title>123 Bicategorie webshop</title>
<style>
body {text-align: center; max-width: 700px; margin: 0 auto 0 auto;}
h1 {margin: 30px; font-size: 28pt; font-family: sans-serif;}
</style>
</head>
<body>
<h1>123 Bicategorie</h1>
<h2>D&eacute; webshop voor al uw categorische producten!</h2>
</body>
</html>

28
baas/.gitignore

@ -0,0 +1,28 @@
# ---> macOS
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

BIN
baas/Joshua.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
baas/Jurriaan.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

3
baas/README.md

@ -0,0 +1,3 @@
# bisimulation-online
April fools website

BIN
baas/Rob.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
baas/ginger-cat-713.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
baas/ginger-cat-718.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
baas/ginger-cat-746.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

185
baas/index.html

@ -0,0 +1,185 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>BaaS: Bisimulation as a Service</title>
<link rel="stylesheet" media="screen" href="style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Joshua Moerman">
<meta name="description" content="Checking behavioural equivalence was never this easy!">
</head>
<!--
Hi there!
Great to see you look at the source of this webpage. As you
have probably guessed, this is an April fools day joke. Hope
you can enjoy :-).
In case you actually want to compute bisimulations, you can
have a look at model checkers such as:
- mCRL2: https://www.mcrl2.org
- Storm: https://www.stormchecker.org
- CADP: https://cadp.inria.fr
- UPPAAL: http://www.uppaal.org
- Prism: https://www.prismmodelchecker.org
Many provide implementations for checking bisimilarity.
I would like to draw you attention to CoPaR:
- https://git8.cs.fau.de/software/copar
It is a generic implementation of parition refinement, based
on category theory. It implements all the usual bisimulation
algorithms (bisimulation, weighted bisimulation, lumping, ...)
with a single generic algorithm. In most cases it provides the
current best complexity of these algorithms.
Kind regards,
Joshua Moerman
-->
<body>
<div>
<section class="intro">
<header>
<h1>BaaS</h1>
<h2>Bisimulation as a Service</h2>
</header>
<div class="summary">
<p>Check behavioural equivalence of your models NOW!
</div>
</section>
<div class="main">
<div class="middle">
<h3>What we do as BaaS</h3>
<p>We provide an online service for <em>bisimulation checking</em>.
Bisimulation is a must in the Industry 4.0 era.
Correctness and robustness of your software products are our top priority.
With BaaS, we are changing the way you do verification.
<p>Developers can now check behavioural equivalence with the touch of a button, increasing their productivity.
We support many types of bisimulation, including the latest up-to techniques.
<p>You can register for a monthly subscription which allows you to check many models.
We provide a free plan with reduced functionality.
</div>
<div class="solide grid">
<div>
<img class="cat" src="ginger-cat-746.png"/>
</div>
<div>
<h3>What is a bisimulation?</h3>
<p>Two systems are <em>bisimilar</em> if they match each other's moves.
In this sense, each of the systems cannot be distinguished from the other by an observer.
<p>A bisimulation relation is a <em>certificate</em> of this equivalence.
Our service computes this certificate automatically for you.
This makes our service trustworthy and secure, as it does not only return a binary output.
<p>If your system contains a bug, our service will not be able to produce this certificate.
Instead, it will return a counterexample, which can be used to resolve the bug.
<p>Bisimulations are also used to minimise your state-based systems.
This enables model-checkers to prove correctness in terms of temporal logics.
</div>
<div>
<h3>Efficient</h3>
<p>Our algorithms are state-of-the art, using up-to techniques, making us the most efficient BaaS.
These up-to-techniques compress the bisimulation by using algebraic and coalgebraic properties of the system.
It allows the bisimulation algorithm to exit early and find bugs more quickly.
This is not only good for efficiency and throughput, it also shrinks the size of the certificate.
</div>
<div>
<img class="cat" src="ginger-cat-713.png"/>
</div>
<div>
<div class="profile">
<img class="profile-pic" src="Rob.jpg"><br>
Prof. Dr. Rob van Glabbeek.<br>
<em>Expert.</em>
</div>
</div>
<div>
<h3>Testimonial</h3>
<p style="font-style:italic">"BaaS is by far the most user-friendly bisimulation checker I have every tried.
Small systems, or ones with millions of transitions, Baas gives me the
right answers in virtually no time at all. Never again need I
experiment with dotted lines on a whiteboard: just pipe it through
BaaS and all will be clear!"
<p style="text-align:right">- Rob van Glabbeek
</div>
</div>
<div class="middle">
<h3>BaaS Plans</h3>
<p>Get in touch to inquire about the pricing.
Below is a table of the different features we provide.
<table>
<tr class="rowheader"><th>You get<th>Free<th>Premium BaaS
<tr><td>Maximal number of models per month<td>10<td>9000
<tr><td>Maximal number of states per model<td>50<td>1000000
<tr><td>Maximal number of transitions per model<td>100<td>9000000
<tr class="rowheader"><th>Features<th><th>
<tr><td>Standard (strong) bisimulation<td><td>
<tr><td>Branching bisimulation<td><td>
<tr><td>Bisimulation up-to transitive closure and congruence<td><td>
<tr><td>Bisimulation up-to bisimulation<td><td>
<tr><td>CEGAR & CEGIS API<td><td>
<tr><td>O(m log n) algorithms<td><td>
<tr><td>Big Data Types<!-- Credits to Freek Wiedijk for this joke! --><td><td>
<tr class="rowheader"><th>Models<th><th>
<tr><td>Deterministic Automata<td><td>
<tr><td>Nondeterministic Automata<td><td>
<tr><td>Weighted Automata<td><td>
<tr><td>Weighted Tree Automata<td><td>
<tr><td>Deterministic Register Automata<td><td>
<tr><td>Markovian Timed Fault Trees<td><td>
<tr><td>Quantum Software Product Line Systems<td><td>
<tr><td>Labelled Transition Blockchain Coalgebras<td><td>
</table>
<p>Upon request, we can provide <em>divergence-preserving branching bisimilarity</em> for citizens from The Netherlands and France.
</div>
<div class="middle">
<h3>Team</h3>
<p>We're a team of bisimulation technologists and serious entrepreneurs.
We work around the clock, to make sure your bisimulations are always ready to go.
<div class="team">
<div class="profile">
<img class="profile-pic" src="Joshua.jpg"><br>
Joshua Moerman, PhD.<br>
Founder, Bisimulation Evangelist.
</div>
<div class="profile">
<img class="profile-pic" src="Jurriaan.jpg"><br>
Jurriaan Rot, PhD.<br>
CEO, CPO, and CTO.
</div>
</div>
</div>
<footer>
Copyright 2020 - BaaS - Bisimulation Online
</footer>
</div>
<!-- A bit of a hack. This creates the cats and star! -->
<aside></aside>
</div>
</body>
</html>

5
baas/star.svg

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="922px" height="922px" viewBox="0 0 922 922">
<polygon fill="#fff" points="745,829 515,577 572,913 464,590 379,921 412,580 200,849 368,551 66,710 340,507 0,529 333,455 13,336 347,404 103,166 381,364 255,47 428,341 442,0 481,339 632,33 529,359 792,140 566,396 895,304 584,446 922,495 580,498 869,680 556,544 "/>
</svg>

After

Width:  |  Height:  |  Size: 576 B

284
baas/style.css

@ -0,0 +1,284 @@
body {
margin: 0;
color: #034;
font-family: "Nunito Sans", "Avenir", "Helvetica Neue", sans-serif;
font-size: 14pt;
line-height: 1.4em;
}
p {
text-align: justify;
}
a {
color: #3be;
}
a:hover {
color: #034;
}
header {
margin: 0 auto;
max-width: 1040px;
position: relative;
text-align: center;
top: 0;
width: 100%;
z-index: 1;
}
h1 {
font-family: 'Adelle W01 Bold', "Lucida Bright", Lucida, "DejaVu Serif", "Bitstream Vera Serif", Georgia, serif;
font-size: 90px;
font-weight: 500;
background-color: #fff;
color: #034;
display: inline-block;
min-height: 18px;
margin: 40px auto 0;
padding: 0 10px;
z-index: 2;
}
/* Creates horizontal line */
h1:after {
background-color: #e42;
content: '';
height: 12px;
left: 0;
margin-top: 2px;
position: absolute;
width: 100%;
z-index: -1;
}
h2 {
color: #e42;
font-size: 22px;
font-style: italic;
font-weight: 400;
text-align: right;
max-width: 695px;
margin: -10px auto 0;
width: 100%;
}
.summary {
position: relative;
max-width: 1040px;
margin: 20px auto;
z-index: 2;
}
.summary p {
color: #e42;
font-style: italic;
text-align: right;
max-width: 695px;
margin: 10px auto 0;
}
.intro {
background: linear-gradient(to bottom, #fff 0%, #edf6ff 100%);
height: 450px;
}
h3 {
color: #e42;
text-transform: uppercase;
font-size: 160%;
font-weight: 900;
}
.main {
background-color: rgba(255, 255, 255, 0.9);
border-top: 5px solid #e42;
border-bottom: 5px solid #3be;
position: relative;
width: 100%;
z-index: 3;
}
.main p, .main h3, .main .middle {
max-width: 495px;
}
.middle {
margin: 25px auto 40px auto;
}
.solide {
background: #edf6ff;
border-top: 5px solid #def;
border-bottom: 5px solid #def;
margin: 25px 0;
display: grid;
grid-template-columns: auto auto;
grid-gap: 10px;
padding: 0 10%;
align-items: center;
}
.solide > div {
padding: 20px 0;
max-width: 495px;
margin-left:auto;
margin-right:auto;
}
.solide .cat {
max-height: 250px;
}
table {
border-collapse: collapse;
max-width: 100%;
}
table th {
padding: 15px;
}
table td {
text-align: center;
max-width: 200px;
padding: 10px;
}
.rowheader {
border-bottom: 2px solid #e42;
}
.team {
display: grid;
grid-template-columns: auto auto;
grid-gap: 30px;
align-items: top;
}
.profile {
text-align: center;
max-width: 220px;
margin: 0 auto;
}
.profile-pic {
margin: 20px;
width: 160px;
border-radius:100px;
box-shadow: 0 0 10px 0 black;
}
/* star */
@keyframes spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
aside:before {
animation: spin 37s infinite linear;
background: url('star.svg') center top no-repeat;
content: '';
height: 921px;
left: 50%;
margin-left: -461.5px;
position: fixed;
top: 60px;
width: 923px;
}
/* cats */
@keyframes rise {
from { top: 100%; }
to { top: 165px; }
}
aside:after {
animation: rise 1.25s 1 ease;
background: url('ginger-cat-718.png') center no-repeat;
content: '';
position: fixed;
z-index: 1;
left: 50%;
margin-left: -330px;
width: 660px;
height: 640px;
top: 165px;
}
footer {
color: #fff;
padding: 20px;
background: #034;
font-size: 22px;
text-align: center;
}
footer a {
text-decoration: underline;
}
footer a:hover {
color: #fff;
}
@media (max-width: 750px) {
.intro {
height: 320px;
}
aside:before {
top: 80px;
}
@keyframes rise-short {
from { top: 100%; }
to { top: 40px; }
}
aside:after {
background-size: 67%;
animation: rise-short 1.5s 1 ease;
top: 40px;
}
h1 {
font-size: 60px;
min-height: 50px;
margin-top: 35px;
}
.main footer {
font-size: 18px;
}
.middle {
/*width: 85%;*/
}
.solide {
grid-template-columns: auto;
grid-gap: 0px;
}
.solide > div {
padding: 0px;
}
.solide .cat {
max-height: 140px;
padding: 10px;
}
}
@media (max-width: 500px) {
body {
font-size: 15pt;
}
.solide {
padding: 5px;
}
.middle {
padding: 5px;
}
table th {
padding: 8px;
}
table td {
padding: 4px;
}
table {
font-size: 80%;
}
.team {
grid-template-columns: auto;
}
.profile {
max-width: 400px;
}
}

25
index.html

@ -0,0 +1,25 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Experiments</title>
<style>
body {text-align: center; font-family: sans-serif; background: #faf;}
</style>
</head>
<body>
<h1>Dingen</h1>
<ul>
<li><a href="./baas/">BaaS: Bisimulation as a Service</a>
<li><a href="./123bicategorie/">123bicategorie.nl: webshop for categorical products</a>
<li><a href="./rust-wasm/">Rust animation in the browser</a>
</ul>
<footer style="color: #ffa">
Copyright Joshua Moerman 2020
</footer>
</body>
</html>

61
rust-wasm/0.bootstrap.js

@ -0,0 +1,61 @@
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[0],{
/***/ "../pkg/rust_wasm.js":
/*!***************************!*\
!*** ../pkg/rust_wasm.js ***!
\***************************/
/*! exports provided: Universe, __wbg_random_a3b3bcffa2ed629c, __wbindgen_throw */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _rust_wasm_bg_wasm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rust_wasm_bg.wasm */ \"../pkg/rust_wasm_bg.wasm\");\n/* harmony import */ var _rust_wasm_bg_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rust_wasm_bg.js */ \"../pkg/rust_wasm_bg.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Universe\", function() { return _rust_wasm_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"Universe\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"__wbg_random_a3b3bcffa2ed629c\", function() { return _rust_wasm_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"__wbg_random_a3b3bcffa2ed629c\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_throw\", function() { return _rust_wasm_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"__wbindgen_throw\"]; });\n\n\n\n\n//# sourceURL=webpack:///../pkg/rust_wasm.js?");
/***/ }),
/***/ "../pkg/rust_wasm_bg.js":
/*!******************************!*\
!*** ../pkg/rust_wasm_bg.js ***!
\******************************/
/*! exports provided: Universe, __wbg_random_a3b3bcffa2ed629c, __wbindgen_throw */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(module) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Universe\", function() { return Universe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_random_a3b3bcffa2ed629c\", function() { return __wbg_random_a3b3bcffa2ed629c; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_throw\", function() { return __wbindgen_throw; });\n/* harmony import */ var _rust_wasm_bg_wasm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rust_wasm_bg.wasm */ \"../pkg/rust_wasm_bg.wasm\");\n\n\nconst lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;\n\nlet cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });\n\ncachedTextDecoder.decode();\n\nlet cachegetUint8Memory0 = null;\nfunction getUint8Memory0() {\n if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== _rust_wasm_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"memory\"].buffer) {\n cachegetUint8Memory0 = new Uint8Array(_rust_wasm_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"memory\"].buffer);\n }\n return cachegetUint8Memory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));\n}\n\nfunction notDefined(what) { return () => { throw new Error(`${what} is not defined`); }; }\n/**\n*/\nclass Universe {\n\n static __wrap(ptr) {\n const obj = Object.create(Universe.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n free() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n _rust_wasm_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"__wbg_universe_free\"](ptr);\n }\n /**\n */\n tick() {\n _rust_wasm_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"universe_tick\"](this.ptr);\n }\n /**\n * @returns {Universe}\n */\n static new() {\n var ret = _rust_wasm_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"universe_new\"]();\n return Universe.__wrap(ret);\n }\n /**\n */\n init() {\n _rust_wasm_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"universe_init\"](this.ptr);\n }\n /**\n * @returns {number}\n */\n width() {\n var ret = _rust_wasm_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"universe_width\"](this.ptr);\n return ret;\n }\n /**\n * @returns {number}\n */\n height() {\n var ret = _rust_wasm_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"universe_height\"](this.ptr);\n return ret;\n }\n /**\n * @returns {number}\n */\n stress() {\n var ret = _rust_wasm_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"universe_stress\"](this.ptr);\n return ret;\n }\n /**\n * @returns {number}\n */\n cells() {\n var ret = _rust_wasm_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"universe_cells\"](this.ptr);\n return ret;\n }\n}\n\nconst __wbg_random_a3b3bcffa2ed629c = typeof Math.random == 'function' ? Math.random : notDefined('Math.random');\n\nconst __wbindgen_throw = function(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n};\n\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../www/node_modules/webpack/buildin/harmony-module.js */ \"./node_modules/webpack/buildin/harmony-module.js\")(module)))\n\n//# sourceURL=webpack:///../pkg/rust_wasm_bg.js?");
/***/ }),
/***/ "../pkg/rust_wasm_bg.wasm":
/*!********************************!*\
!*** ../pkg/rust_wasm_bg.wasm ***!
\********************************/
/*! exports provided: memory, __wbg_universe_free, universe_tick, universe_new, universe_init, universe_width, universe_height, universe_stress, universe_cells */
/***/ (function(module, exports, __webpack_require__) {
eval("\"use strict\";\n// Instantiate WebAssembly module\nvar wasmExports = __webpack_require__.w[module.i];\n__webpack_require__.r(exports);\n// export exports from WebAssembly module\nfor(var name in wasmExports) if(name != \"__webpack_init__\") exports[name] = wasmExports[name];\n// exec imports from WebAssembly module (for esm order)\n/* harmony import */ var m0 = __webpack_require__(/*! ./rust_wasm_bg.js */ \"../pkg/rust_wasm_bg.js\");\n\n\n// exec wasm module\nwasmExports[\"__webpack_init__\"]()\n\n//# sourceURL=webpack:///../pkg/rust_wasm_bg.wasm?");
/***/ }),
/***/ "./index.js":
/*!******************!*\
!*** ./index.js ***!
\******************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var rust_wasm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rust-wasm */ \"../pkg/rust_wasm.js\");\n/* harmony import */ var rust_wasm_rust_wasm_bg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rust-wasm/rust_wasm_bg */ \"../pkg/rust_wasm_bg.wasm\");\n\n\n\nconst CELL_SIZE = 5; // px\nconst GRID_COLOR = \"#CCCCCC\";\nconst COLOURS = [\"#FFF\", \"#FF8\", \"#FF0\", \"#F80\", \"#F00\", \"#800\", \"#000\"];\n\n// Construct the universe, and get its width and height.\nconst universe = rust_wasm__WEBPACK_IMPORTED_MODULE_0__[\"Universe\"].new();\nuniverse.init();\nconst width = universe.width();\nconst height = universe.height();\n\n// Give the canvas room for all of our cells and a 1px border\n// around each of them.\nconst infochaos = document.getElementById(\"chaos\");\nconst infomax = document.getElementById(\"max\");\nconst infoavg = document.getElementById(\"avg\");\nvar maxstress = 0;\nvar avgstress = 31000;\nconst canvas = document.getElementById(\"game-of-life-canvas\");\ncanvas.height = (CELL_SIZE) * height;\ncanvas.width = (CELL_SIZE) * width;\n\nconst ctx = canvas.getContext('2d');\n\nconst renderLoop = () => {\n universe.tick();\n\n //drawGrid();\n drawCells();\n\n const st = universe.stress();\n if (st > maxstress) maxstress = st;\n avgstress = 0.999 * avgstress + 0.001 * st\n infochaos.innerHTML = st;\n infomax.innerHTML = maxstress;\n infoavg.innerHTML = Math.round(avgstress);\n\n // setTimeout(renderLoop, 200);\n requestAnimationFrame(renderLoop);\n};\n\n// setTimeout(renderLoop, 1);\nrequestAnimationFrame(renderLoop);\n\nconst drawGrid = () => {\n ctx.beginPath();\n ctx.strokeStyle = GRID_COLOR;\n\n // Vertical lines.\n for (let i = 0; i <= width; i++) {\n ctx.moveTo(i * (CELL_SIZE + 1) + 1, 0);\n ctx.lineTo(i * (CELL_SIZE + 1) + 1, (CELL_SIZE + 1) * height + 1);\n }\n\n // Horizontal lines.\n for (let j = 0; j <= height; j++) {\n ctx.moveTo(0, j * (CELL_SIZE + 1) + 1);\n ctx.lineTo((CELL_SIZE + 1) * width + 1, j * (CELL_SIZE + 1) + 1);\n }\n\n ctx.stroke();\n};\n\nconst getIndex = (row, column) => {\n return row * width + column;\n};\n\nconst drawCells = () => {\n const cellsPtr = universe.cells();\n const cells = new Uint8Array(rust_wasm_rust_wasm_bg__WEBPACK_IMPORTED_MODULE_1__[\"memory\"].buffer, cellsPtr, width * height);\n\n ctx.beginPath();\n\n for (let row = 0; row < height; row++) {\n for (let col = 0; col < width; col++) {\n const idx = getIndex(row, col);\n const rat = Math.round(COLOURS.length * cells[idx] / 101);\n const colour = COLOURS[rat];\n\n ctx.fillStyle = colour;\n\n ctx.fillRect(\n col * (CELL_SIZE),\n row * (CELL_SIZE),\n CELL_SIZE,\n CELL_SIZE\n );\n }\n }\n\n ctx.stroke();\n};\n\n\n//# sourceURL=webpack:///./index.js?");
/***/ }),
/***/ "./node_modules/webpack/buildin/harmony-module.js":
/*!*******************************************!*\
!*** (webpack)/buildin/harmony-module.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("module.exports = function(originalModule) {\n\tif (!originalModule.webpackPolyfill) {\n\t\tvar module = Object.create(originalModule);\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"exports\", {\n\t\t\tenumerable: true\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n\n\n//# sourceURL=webpack:///(webpack)/buildin/harmony-module.js?");
/***/ })
}]);

BIN
rust-wasm/512e9878aaa7c8600613.module.wasm

Binary file not shown.

270
rust-wasm/bootstrap.js

@ -0,0 +1,270 @@
/******/ (function(modules) { // webpackBootstrap
/******/ // install a JSONP callback for chunk loading
/******/ function webpackJsonpCallback(data) {
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1];
/******/
/******/
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0, resolves = [];
/******/ for(;i < chunkIds.length; i++) {
/******/ chunkId = chunkIds[i];
/******/ if(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ resolves.push(installedChunks[chunkId][0]);
/******/ }
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/ for(moduleId in moreModules) {
/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
/******/ modules[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(parentJsonpFunction) parentJsonpFunction(data);
/******/
/******/ while(resolves.length) {
/******/ resolves.shift()();
/******/ }
/******/
/******/ };
/******/
/******/
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // object to store loaded and loading chunks
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // Promise = chunk loading, 0 = chunk loaded
/******/ var installedChunks = {
/******/ "main": 0
/******/ };
/******/
/******/
/******/
/******/ // script path function
/******/ function jsonpScriptSrc(chunkId) {
/******/ return __webpack_require__.p + "" + chunkId + ".bootstrap.js"
/******/ }
/******/
/******/ // object to store loaded and loading wasm modules
/******/ var installedWasmModules = {};
/******/
/******/ function promiseResolve() { return Promise.resolve(); }
/******/
/******/ var wasmImportObjects = {
/******/ "../pkg/rust_wasm_bg.wasm": function() {
/******/ return {
/******/ "./rust_wasm_bg.js": {
/******/ "__wbg_random_a3b3bcffa2ed629c": function() {
/******/ return installedModules["../pkg/rust_wasm_bg.js"].exports["__wbg_random_a3b3bcffa2ed629c"]();
/******/ },
/******/ "__wbindgen_throw": function(p0i32,p1i32) {
/******/ return installedModules["../pkg/rust_wasm_bg.js"].exports["__wbindgen_throw"](p0i32,p1i32);
/******/ }
/******/ }
/******/ };
/******/ },
/******/ };
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/ // This file contains only the entry chunk.
/******/ // The chunk loading function for additional chunks
/******/ __webpack_require__.e = function requireEnsure(chunkId) {
/******/ var promises = [];
/******/
/******/
/******/ // JSONP chunk loading for javascript
/******/
/******/ var installedChunkData = installedChunks[chunkId];
/******/ if(installedChunkData !== 0) { // 0 means "already installed".
/******/
/******/ // a Promise means "currently loading".
/******/ if(installedChunkData) {
/******/ promises.push(installedChunkData[2]);
/******/ } else {
/******/ // setup Promise in chunk cache
/******/ var promise = new Promise(function(resolve, reject) {
/******/ installedChunkData = installedChunks[chunkId] = [resolve, reject];
/******/ });
/******/ promises.push(installedChunkData[2] = promise);
/******/
/******/ // start chunk loading
/******/ var script = document.createElement('script');
/******/ var onScriptComplete;
/******/
/******/ script.charset = 'utf-8';
/******/ script.timeout = 120;
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ }
/******/ script.src = jsonpScriptSrc(chunkId);
/******/
/******/ // create error before stack unwound to get useful stacktrace later
/******/ var error = new Error();
/******/ onScriptComplete = function (event) {
/******/ // avoid mem leaks in IE.
/******/ script.onerror = script.onload = null;
/******/ clearTimeout(timeout);
/******/ var chunk = installedChunks[chunkId];
/******/ if(chunk !== 0) {
/******/ if(chunk) {
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
/******/ var realSrc = event && event.target && event.target.src;
/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
/******/ error.name = 'ChunkLoadError';
/******/ error.type = errorType;
/******/ error.request = realSrc;
/******/ chunk[1](error);
/******/ }
/******/ installedChunks[chunkId] = undefined;
/******/ }
/******/ };
/******/ var timeout = setTimeout(function(){
/******/ onScriptComplete({ type: 'timeout', target: script });
/******/ }, 120000);
/******/ script.onerror = script.onload = onScriptComplete;
/******/ document.head.appendChild(script);
/******/ }
/******/ }
/******/
/******/ // Fetch + compile chunk loading for webassembly
/******/
/******/ var wasmModules = {"0":["../pkg/rust_wasm_bg.wasm"]}[chunkId] || [];
/******/
/******/ wasmModules.forEach(function(wasmModuleId) {
/******/ var installedWasmModuleData = installedWasmModules[wasmModuleId];
/******/
/******/ // a Promise means "currently loading" or "already loaded".
/******/ if(installedWasmModuleData)
/******/ promises.push(installedWasmModuleData);
/******/ else {
/******/ var importObject = wasmImportObjects[wasmModuleId]();
/******/ var req = fetch(__webpack_require__.p + "" + {"../pkg/rust_wasm_bg.wasm":"512e9878aaa7c8600613"}[wasmModuleId] + ".module.wasm");
/******/ var promise;
/******/ if(importObject instanceof Promise && typeof WebAssembly.compileStreaming === 'function') {
/******/ promise = Promise.all([WebAssembly.compileStreaming(req), importObject]).then(function(items) {
/******/ return WebAssembly.instantiate(items[0], items[1]);
/******/ });
/******/ } else if(typeof WebAssembly.instantiateStreaming === 'function') {
/******/ promise = WebAssembly.instantiateStreaming(req, importObject);
/******/ } else {
/******/ var bytesPromise = req.then(function(x) { return x.arrayBuffer(); });
/******/ promise = bytesPromise.then(function(bytes) {
/******/ return WebAssembly.instantiate(bytes, importObject);
/******/ });
/******/ }
/******/ promises.push(installedWasmModules[wasmModuleId] = promise.then(function(res) {
/******/ return __webpack_require__.w[wasmModuleId] = (res.instance || res).exports;
/******/ }));
/******/ }
/******/ });
/******/ return Promise.all(promises);
/******/ };
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // on error function for async loading
/******/ __webpack_require__.oe = function(err) { console.error(err); throw err; };
/******/
/******/ // object with all WebAssembly.instance exports
/******/ __webpack_require__.w = {};
/******/
/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || [];
/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
/******/ jsonpArray.push = webpackJsonpCallback;
/******/ jsonpArray = jsonpArray.slice();
/******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);
/******/ var parentJsonpFunction = oldJsonpFunction;
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "./bootstrap.js");
/******/ })
/************************************************************************/
/******/ ({
/***/ "./bootstrap.js":
/*!**********************!*\
!*** ./bootstrap.js ***!
\**********************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("// A dependency graph that contains any wasm must all be imported\n// asynchronously. This `bootstrap.js` file does the single async import, so\n// that no one else needs to worry about it again.\n__webpack_require__.e(/*! import() */ 0).then(__webpack_require__.bind(null, /*! ./index.js */ \"./index.js\"))\n .catch(e => console.error(\"Error importing `index.js`:\", e));\n\n\n//# sourceURL=webpack:///./bootstrap.js?");
/***/ })
/******/ });

29
rust-wasm/index.html

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Rust Animation</title>
<style>
body {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
</style>
</head>
<body>
<canvas id="game-of-life-canvas"></canvas>
<div style="text-align: center;">chaos: <span id="chaos"></span>, max: <span id="max"></span>, mv avg: <span id="avg"></span></div>
<noscript>This page contains webassembly and javascript content, please enable javascript in your browser.</noscript>
<script src="./bootstrap.js"></script>
<div style="padding:20px; color:#888">Copyright Joshua Moerman 2020 (git commit af5a529)</div>
</body>
</html>
Loading…
Cancel
Save