]> git.mdlowis.com Git - proto/sclpl-rb.git/commitdiff
added ada notes
authorMichael D. Lowis <mike.lowis@gentex.com>
Fri, 20 Sep 2019 20:37:21 +0000 (16:37 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Fri, 20 Sep 2019 20:37:21 +0000 (16:37 -0400)
Ada Notes.html [new file with mode: 0644]

diff --git a/Ada Notes.html b/Ada Notes.html
new file mode 100644 (file)
index 0000000..c209969
--- /dev/null
@@ -0,0 +1,205 @@
+<!DOCTYPE html>
+<!-- saved from url=(0059)file:///home/mdlowis/Source/proto/sclpl-rb/Ada%20Notes.html -->
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <title>Ada Notes</title>
+    
+    <style>
+* { -moz-box-sizing: border-box; box-sizing: border-box; }
+*:focus { outline: none; }
+
+body {
+       font-family: sans-serif;
+       font-size: 16px;
+       max-width: 90%;
+       margin-left: auto;
+       margin-right: auto;
+}
+
+h1 { font-size: 2.0rem; }
+h2 { font-size: 1.5rem; }
+h3 { font-size: 1.17rem; }
+h4 { font-size: 1.0rem; }
+h5 { font-size: 0.83rem; }
+h6 { font-size: 0.67rem; }
+a { color: deepskyblue; }
+li  { margin-bottom: 1rem; }
+
+table {
+       display: block;
+       width: 100%;
+       overflow: auto;
+       border-spacing: 0;
+       border-collapse: collapse;
+}
+
+code {
+       display: block;
+       padding: 1rem 1.5rem;
+       white-space: pre;
+       margin: 0.2rem;
+       background: #F1F1F1;
+       border: 1px solid #E1E1E1;
+       border-radius: 4px;
+       -moz-tab-size: 4;
+       -o-tab-size:   4;
+       tab-size:      4;
+}
+
+blockquote {
+       display: block;
+       border-left: 4px solid deepskyblue;
+       margin-left: -19px;
+       padding-left: 15px;
+       margin-right: 0px;
+}
+
+table {
+       width: 100%;
+       display: table;
+       border-collapse: separate;
+       border-color: grey;
+       text-align: left;
+       vertical-align: middle;
+}
+
+th, td {
+       padding: 0.80rem 0.80rem;
+       border-bottom: 1px solid #E1E1E1;
+}
+
+th:first-child, td:first-child {
+       padding-left: 0;
+}
+    </style>
+</head>
+<body>
+    <section>
+        <header id="header"><h1 align="center" contenteditable="true">Ada Notes</h1><hr></header>
+        <article id="content" contenteditable="true"><h2>Ada Links</h2><div><a href="https://learn.adacore.com/courses/intro-to-ada/chapters/strongly_typed_language.html">https://learn.adacore.com/courses/intro-to-ada/chapters/strongly_typed_language.html</a><br></div><div><a href="http://www.ada-auth.org/standards/ada12.html">http://www.ada-auth.org/standards/ada12.html</a><br></div><div><br></div><h2>Types System</h2><div><p></p><ul><li><b>Integers</b>&nbsp;are defined as "ranges" of values to specify size and signedness</li><li><b>Floats</b>&nbsp;are defined as "digits" to specify minimum precision and size</li><li><b>Enumerations</b>&nbsp;define a set of symbols that hold no integral value, only symbolic</li><li><b>Booleans</b>&nbsp;are defined as an enumeration with special semantics</li><li><b>Derived types</b></li><li><b>Subtypes</b></li></ul><div><code>type_definition := enum_def | int_def | real_def | array_def | record_def | access_def | derived_def | interface_def
+
+enum_def := '(' symbol { ',' symbol } ')'
+
+int_def := range_spec
+         | 'mod' static_expr
+
+real_def := 'digits' static_simple_expr { range_spec }
+
+array_def := 
+
+record_def := 
+
+access_def := 
+
+derived_def := 
+
+interface_def := 
+
+# Miscellaneous
+symbol := &lt;ident&gt; | &lt;char-lit&gt;
+range_spec := 'range' static_simple_expr '..' static_simple_expr
+static_expr :=
+static_simple_expr := 
+
+</code></div><p></p></div></article>
+    </section>
+    <script>
+"use strict";
+
+(() => {
+       const doc = document;
+       doc.exec = doc.execCommand;
+       const ls = (() => {
+               try { return localStorage; }
+               catch (e) { return {}; }
+       })();
+
+       const getSelNode = () => {
+               const node = doc.getSelection().anchorNode;
+               return (node.nodeType === 3 ? node.parentNode : node);
+       };
+
+       const ymd_string = () => {
+               const dt = new Date(), month = (dt.getMonth() + 1), day = dt.getDate();
+               return [dt.getFullYear(), (month > 9 ? '' : '0') + month, (day > 9 ? '' : '0') + day].join('.');
+       };
+
+       const initialize = (force) => {
+               if (!!force) document.title = "", ls.clear();
+
+               if (doc.title === "") {
+                       content.innerHTML = !!ls['content'] ? ls['content'] : "<p>&nbsp;</p>";
+                       header.innerHTML = !!ls['header'] ? ls['header']
+                                        : '<h1 align="center" contenteditable="true">' + ymd_string() + '</h1><hr/>' ;
+                       doc.title = header.innerText;
+               }
+
+               header.onkeydown = (ev) => (!!keys[ev.key] ? (keys[ev.key])(ev) : true);
+               content.onkeydown = (ev) => (!!keys[ev.key] ? (keys[ev.key])(ev) : true);
+               document.onkeyup = (ev) => {
+                       doc.title = header.innerText;
+                       ls['header'] = header.innerHTML;
+                       ls['content'] = content.innerHTML;
+               };
+               content.focus();
+       }
+
+       const ctrlHeld = (ev) => (ev.ctrlKey || ev.metaKey);
+       const inTag = (tag) => (getSelNode().nodeName === tag);
+       const keyCmd = (ev, cmd, arg) => (ctrlHeld(ev) ? !doc.exec(cmd, false, arg) : true);
+       const reinit = (ev) => {
+               if (ctrlHeld(ev)) {
+                       initialize(true);
+                       return false;
+               } else {
+                       return true;
+               }
+       }
+
+       const keys = {
+               ".": (ev) => reinit(ev),
+               ";": (ev) => keyCmd(ev, "insertHTML", "<code>\r\n</code>"),
+               "b": (ev) => keyCmd(ev, "bold"),
+               "i": (ev) => keyCmd(ev, "italic"),
+               "u": (ev) => keyCmd(ev, "underline"),
+               "0": (ev) => keyCmd(ev, "formatBlock", "<p>"),
+               "1": (ev) => keyCmd(ev, "formatBlock", "<h1>"),
+               "2": (ev) => keyCmd(ev, "formatBlock", "<h2>"),
+               "3": (ev) => keyCmd(ev, "formatBlock", "<h3>"),
+               "4": (ev) => keyCmd(ev, "formatBlock", "<h4>"),
+               "5": (ev) => keyCmd(ev, "formatBlock", "<h5>"),
+               "6": (ev) => keyCmd(ev, "formatBlock", "<h6>"),
+               "7": (ev) => keyCmd(ev, "insertOrderedList"),
+               "8": (ev) => keyCmd(ev, "insertUnorderedList"),
+               "9": (ev) => {
+                       if (ctrlHeld(ev)) {
+                               const defurl = (inTag("A") ? getSelNode().href : "http://");
+                               const url = prompt("Enter URL:", defurl);
+                               return !doc.exec((url !== null && url !== "" ? "createLink" : "unlink"), false, url);
+                       }
+                       return true;
+               },
+
+               "Enter": () =>  !doc.exec(inTag("CODE") ? "insertHTML" : "insertParagraph", false, "\n"),
+
+               "Tab": (ev) => {
+                       if (inTag("CODE"))
+                               return !doc.exec("insertHTML",false,"\t");
+                       else
+                               return !doc.exec((ev.shiftKey ? "out" : "in")+"dent",false);
+               },
+
+               "'": (ev) => {
+                       if (ctrlHeld(ev)) {
+                               const block = (inTag("BLOCKQUOTE") ? "<p>" : "<blockquote>");
+                               return !doc.exec("formatBlock", false, block);
+                       }
+                       return true;
+               },
+       };
+
+       initialize();
+})();
+    </script>
+
+
+</body></html>
\ No newline at end of file