Skip to content

Commit

Permalink
v0.2.2
Browse files Browse the repository at this point in the history
* Performance Upgrades
  * Added BetaNode indexing
  * Abstracted out JoinNode to extend BetaNode (Prevents the checking of constraints if there are not any constraints to check)
  * Refactored BetaNetwork
  * Created a new Memory Class to encapusulate left and right memory for BetaNodes
* Added new `exists` logic operator to check for existence of fact (opposite of `not`)
  • Loading branch information
doug-martin committed Nov 20, 2013
1 parent 86eea5e commit 11f79aa
Show file tree
Hide file tree
Showing 81 changed files with 13,336 additions and 8,722 deletions.
2 changes: 2 additions & 0 deletions docs-md/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
* [Sudoku](./examples/browser/sudoku.html)
* [Fibonacci](./examples/browser/fibonacci.html)
* [Miss Manners](./examples/browser/manners.html)
* [Waltz DB](./examples/browser/waltzDb.html)
* [Send More Money](./examples/browser/sendMoreMoney.html)
* [Diagnosis](./examples/browser/diagnose.html)
11 changes: 11 additions & 0 deletions docs/History.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,17 @@



<h1>0.2.2</h1>
<ul>
<li>Performance Upgrades<ul>
<li>Added BetaNode indexing</li>
<li>Abstracted out JoinNode to extend BetaNode (Prevents the checking of constraints if there are not any constraints to check)</li>
<li>Refactored BetaNetwork</li>
<li>Created a new Memory Class to encapusulate left and right memory for BetaNodes</li>
</ul>
</li>
<li>Added new <code>exists</code> logic operator to check for existence of fact (opposite of <code>not</code>)</li>
</ul>
<h1>0.2.1</h1>
<ul>
<li>Added support for js expression in the <code>from</code> node addressing issue <a href="https://github.com/C2FO/nools/issues/86">#86</a></li>
Expand Down
2 changes: 2 additions & 0 deletions docs/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ <h2>Examples</h2>
<li><a href="./examples/browser/sudoku.html">Sudoku</a></li>
<li><a href="./examples/browser/fibonacci.html">Fibonacci</a></li>
<li><a href="./examples/browser/manners.html">Miss Manners</a></li>
<li><a href="./examples/browser/waltzDb.html">Waltz DB</a></li>
<li><a href="./examples/browser/sendMoreMoney.html">Send More Money</a></li>
<li><a href="./examples/browser/diagnose.html">Diagnosis</a></li>
</ul>

Expand Down
106 changes: 86 additions & 20 deletions docs/examples/browser/assets/conways.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,45 +16,91 @@ body {
height: 100%;
}

#fibonacci div.inline {
.fibonacci div.inline {
height: 100%;
margin: 10px;
}

#fibonacci #results_container {
.fibonacci .results_container {
word-wrap: break-word;
max-width: 100%;
line-height: 50px;
}

#diagnose {
width: 500px;
padding: 10px;
border: 1px solid rgba(0, 0, 0, 0.1);
-webkit-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.1);
-moz-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.1);
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.1);
.diagnose {
width: 100%;
}

#manners {
width: 50%;
.diagnose .diagnose-container{
width: 49%;
vertical-align: top;
padding: 10px;
border: 1px solid rgba(0, 0, 0, 0.1);
-webkit-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.1);
-moz-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.1);
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.1);
}

.waltz-db,
.manners {
width: 100%;
}

#manners #results_container {
.waltz-db .editor-container,
.manners .editor-container,
.diagnose .editor-container,
.send-more-money .editor-container {
width: 49%;
height: 100%;
display: inline-block;
}

.waltz-db .results_container,
.manners .results_container {
width: 49%;
vertical-align: top;
display: inline-block;
height: 100%;
overflow: auto;
height: 400px;
width: 95%;
background: #dfdfdf;
color: #09C;
font-family: Tahoma, Geneva, sans-serif;
padding-left: 10px;
}

.editor-container {
width: 100%;
height: 400px;
position: relative;
border: 1px solid lightgray;
}

.editor-container .editor {
width: 100%;
height: 100%;
position: relative;
}

.send-more-money {
width: 100%;
}

.send-more-money .equation-container {
vertical-align: top;
width: 49%;
}

.send-more-money .equation {
font-size: 6em;
text-align: right;
width: 400px;
}

.send-more-money .equation > div > span {
width: 30px;
display: inline-block;
height: 50px;
padding: 10px;
border-radius: 10px;
}

.send-more-money .equation > div:last-child {
border-top: solid black 1px;
}

.container > header {
Expand Down Expand Up @@ -108,6 +154,12 @@ input[type="submit"], input[type="button"] {
margin: 10px;
}

input[type="submit"]:disabled,
input[type="button"]:disabled {
background-color: lightgray;
cursor: not-allowed;
}

#grid {

overflow: hidden;
Expand Down Expand Up @@ -136,6 +188,7 @@ input[type="submit"], input[type="button"] {
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.2);
position: absolute;
bottom: 5px;
right: 5px;
}

.row {
Expand All @@ -152,6 +205,10 @@ input[type="submit"], input[type="button"] {
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.2);
}

.sudoku {
width: 100%;
}

.sudoku .col {
width: 50px;
height: 50px;
Expand All @@ -164,11 +221,20 @@ input[type="submit"], input[type="button"] {
background-color: rgba(255, 0, 0, 0.43);
}

.sudoku #grid{
.sudoku #grid {
width: 465px;
height: 470px;
}

.sudoku .grid-container {
vertical-align: top;
width: 49%;
}

.sudoku .editor-container {
width: 49%;
}

.col.live {
background-color: black;
}
Expand Down
126 changes: 56 additions & 70 deletions docs/examples/browser/diagnose.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,56 +11,58 @@
<body>


<div id="diagnose" class="middle">
<h1>Diagnose Me <input type="button" id="edit" value="Edit Rules"/></h1>


<form action="#">
<div class="errors"></div>
<label for="name">Patient Name</label>
<input type="text" id="name"/>
<label for="fever">Fever</label>
<select id="fever">
<option value="">None</option>
<option value="high">High</option>
<option value="mild">Mild</option>
</select>

<div>
<label for="spots">Spots</label>
<input type="checkbox" id="spots"/>
</div>
<div>
<label for="rash">Rash</label>
<input type="checkbox" id="rash"/>
</div>
<div>
<label for="sore_throat">Sore Throat</label>
<input type="checkbox" id="sore_throat"/>
</div>
<div>
<label for="innoculated">Innoculated</label>
<input type="checkbox" id="innoculated"/>
</div>
<input type="submit" value="Diagnose"/>
</form>
<hr/>
<h2>Diagnoses</h2>

<div id="results_container"></div>
<div class="diagnose middle">
<div class="header">
<h1>Diagnose Me</h1>
</div>

<div class="editor-container">
<div id="editor"></div>
</div>

<div class="diagnose-container inline">
<form action="#">
<div class="errors"></div>
<label for="name">Patient Name</label>
<input type="text" id="name"/>
<label for="fever">Fever</label>
<select id="fever">
<option value="">None</option>
<option value="high">High</option>
<option value="mild">Mild</option>
</select>

<div>
<label for="spots">Spots</label>
<input type="checkbox" id="spots"/>
</div>
<div>
<label for="rash">Rash</label>
<input type="checkbox" id="rash"/>
</div>
<div>
<label for="sore_throat">Sore Throat</label>
<input type="checkbox" id="sore_throat"/>
</div>
<div>
<label for="innoculated">Innoculated</label>
<input type="checkbox" id="innoculated"/>
</div>
<input type="submit" value="Diagnose"/>
</form>
<hr/>
<h2>Diagnoses</h2>

<div id="results_container"></div>
</div>

</div>

<div id="editor-dialog">
<div id="editor"></div>
</div>

<script type="text/javascript" src="//code.jquery.com/jquery-1.10.1.min.js"></script>
<script type="text/javascript" src="//code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/ace/0.2.0/ace.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/ace/1.1.01/ace.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/ace/1.1.01/mode-javascript.js"></script>
<script type="text/javascript" src="../../nools.js"></script>
<script type="text/javascript" src="./src/common.js"></script>
<script type="text/javascript" src="./src/guests.js"></script>
<script type="text/javascript">

$(document).ready(function () {
Expand Down Expand Up @@ -126,35 +128,19 @@ <h2>Diagnoses</h2>
return false;
});

$("#edit").on("click", function () {
$("#editor-dialog").dialog("open");
return false;
});
var height = $(document).height() - $("#manners .header").height() - 100;
$(".editor-container").height(height);

var editor = ace.edit("editor");
//editor.setTheme("ace/theme/monokai");
var session = editor.getSession();
session.setMode("ace/mode/javascript");
session.setValue(res);
editor.setReadOnly(true);

$("#editor-dialog").dialog({
autoOpen: false,
modal: true,
width: window.innerWidth * 0.9,
height: window.innerHeight * 0.9,
open: function () {
(editor = ace.edit("editor").getSession()).setValue(flowStr);
},
buttons: {
"Save": function () {
$(this).dialog("close");
nools.deleteFlow("diagnosis");
stop();
flow = nools.compile((flowStr = editor.getValue()), {name: "diagnosis"});
},
Cancel: function () {
$(this).dialog("close");
}
}
});

});
})
;
});
</script>

</body>
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/browser/fibonacci.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</head>
<body>

<div id="fibonacci" class="middle">
<div class="fibonacci middle">

<h1>Fibonacci</h1>

Expand All @@ -20,7 +20,7 @@ <h1>Fibonacci</h1>
<div class="inline">
<div class="large"><span>=</span></div>
</div>
<div class="inline large" id="results_container">
<div class="inline large results_container">
</div>
</form>
</div>
Expand Down Expand Up @@ -90,7 +90,7 @@ <h1>Fibonacci</h1>
}


var resultsContainer = $("#results_container"), valInput = $("#val");
var resultsContainer = $(".results_container"), valInput = $("#val");
$("#fibonacci_form").on('submit', function () {
var num = parseInt(valInput.val(), 10);
resultsContainer.text("Calculating...");
Expand Down
Loading

0 comments on commit 11f79aa

Please sign in to comment.