Skip to content

Commit

Permalink
netwerken en start van algoritmiek
Browse files Browse the repository at this point in the history
  • Loading branch information
MartenPostma committed Feb 4, 2021
1 parent 408a938 commit 9b2ff15
Show file tree
Hide file tree
Showing 19 changed files with 667 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cheat_sheets/MongoDB.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ <h3 class="panel-title">Usage</h3>
<p><a href="MongoDB/mongoimport.html" target="_blank">mongoimport</a></p>
<p><a href="MongoDB/search.html" target="_blank">search</a></p>
<p><a href="MongoDB/crud.html" target="_blank">CRUD</a></p>
<p><a href="MongoDB/aggregate.html" target="_blank">aggregate</a></p>
<p><a href="MongoDB/schema.html" target="_blank">schema</a></p>

</div>
</div>
</div>
Expand Down
29 changes: 29 additions & 0 deletions cheat_sheets/MongoDB/aggregate.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<html>

<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</link>
</head>

<body>
<h2 class="text-center">aggregate</h2>
<div class="panel panel-default">
<div class="panel-heading">aggregate</div>
<div class="panel-body">
<p>aggregate: summarize the data in a certain way.</p>
<p>SYNTAX: collection.aggregate([list of parameters])</p>
<p>each parameter maps a function, e.g, $group, to the arguments of that functions.</p>
<p>Functions include:
<ul>$match: filter document</ul>
<ul>$group: group documents</ul>
<ul>$project: which fields to show in the end result</ul>
<ul>$lookup: combine documents from different collections</ul>
</p>
</div>
</div>

</body>

</html>
24 changes: 24 additions & 0 deletions cheat_sheets/MongoDB/join.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<html>

<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</link>
</head>

<body>
<h2 class="text-center">join</h2>
<div class="panel panel-default">
<div class="panel-heading">join</div>
<div class="panel-body">
<p>embedding: document containing other documents</p>
<p>referencing: refer to other documents</p>
<p>join: combine information from different documents</p>
<p>single source of truth: all information is stored in one place only</p>
</div>
</div>

</body>

</html>
27 changes: 27 additions & 0 deletions cheat_sheets/MongoDB/schema.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<html>

<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</link>
</head>

<body>
<h2 class="text-center">schema</h2>
<div class="panel panel-default">
<div class="panel-heading">schema</div>
<div class="panel-body">
<p>schema: validator for adding documents to collection</p>
<p>SYNTAX: same as with querying the collection.</p>
<p>You can also add the validator such that any added document is checked</p>
<p>db.command("collMod", "COLLECTION", validator=SCHEMA)</p>
<p>It is more common to use JSON schema, which allows for a more detailed error message.</p>
<p><a href="https://json-schema.org/" target="_blank">json schema</a></p>
<p>In Python, this works via "import jsonschema"</p>
</div>
</div>

</body>

</html>
125 changes: 125 additions & 0 deletions cheat_sheets/algoritmiek.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<!DOCTYPE html>
<html lang="en">

<head>
<title>Algoritmiek cheat sheet</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head>

<style>
.row {
margin-top: 40px;
padding: 0 10px;
}

.clickable {
cursor: pointer;
}

.panel-heading span {
margin-top: -20px;
font-size: 15px;
}
</style>

<div class="container">
<div class="row">
<div class="col-md-6">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Key concepts</h3>
<span class="pull-right clickable"><i class="glyphicon glyphicon-chevron-up"></i></span>
</div>
<div class="panel-body">
<p><a href="algoritmiek/intractable.html" target="_blank">intractable problem</a></p>
<p><a href="algoritmiek/polynomial.html" target="_blank">polynominal</a></p>
<p><a href="algoritmiek/p_vs_np.html" target="_blank">P vs NP</a></p>
<p><a href="algoritmiek/pspace.html" target="_blank">PSPACE-complete problems</a></p>
<p><a href="algoritmiek/big_o_notation.html" target="_blank">Big O Notation</a></p>
<p><a href="algoritmiek/greedy.html" target="_blank">greedy</a></p>
<p><a href="algoritmiek/dynamic_programming.html" target="_blank">dynamic programming</a></p>
<p><a href="algoritmiek/efficiency.html" target="_blank">efficiency</a></p>
<p><a href="algoritmiek/asymptotic.html" target="_blank">asymptotic</a></p>

</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title">Graph</h3>
<span class="pull-right clickable"><i class="glyphicon glyphicon-chevron-up"></i></span>
</div>
<div class="panel-body">
<p><a href="algoritmiek/bipartite.html" target="_blank">bipartite graph</a></p>
<p><a href="algoritmiek/independent.html" target="_blank">independent</a></p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Predict</h3>
<span class="pull-right clickable"><i class="glyphicon glyphicon-chevron-up"></i></span>
</div>
<div class="panel-body">
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-warning">
<div class="panel-heading">
<h3 class="panel-title">Evaluate</h3>
<span class="pull-right clickable"><i class="glyphicon glyphicon-chevron-up"></i></span>
</div>
<div class="panel-body">

</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Models</h3>
<span class="pull-right clickable"><i class="glyphicon glyphicon-chevron-up"></i></span>
</div>
<div class="panel-body">
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title">Programming</h3>
<span class="pull-right clickable"><i class="glyphicon glyphicon-chevron-up"></i></span>
</div>
<div class="panel-body">
</div>
</div>
</div>
</div>
</div>

<script>
$(document).on('click', '.panel-heading span.clickable', function (e) {
var $this = $(this);
if (!$this.hasClass('panel-collapsed')) {
$this.parents('.panel').find('.panel-body').slideUp();
$this.addClass('panel-collapsed');
$this.find('i').removeClass('glyphicon-chevron-up').addClass('glyphicon-chevron-down');
} else {
$this.parents('.panel').find('.panel-body').slideDown();
$this.removeClass('panel-collapsed');
$this.find('i').removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up');
}
})
</script>

</html>
83 changes: 83 additions & 0 deletions cheat_sheets/algoritmiek/asymptotic.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<html>

<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=default'></script>
</link>
</head>

<body>
<h2 class="text-center">Asymptotic</h2>
<div class="panel panel-default">
<div class="panel-heading">Information</div>
<div class="panel-body">
<p>asymptotic: approaching but never connecting with a line or a curve.</p>
<p>useful because we want to know how algorithms behave when n is very large.</p>
<p>the definition for function that does the work: T(n).</p>
<p>we have to determine the bounds of the output of T(n) for all possible values of n.</p>
<p>complexity order:
<ul>
<li>O(1)</li>
<li>O(log(n))</li>
<li>O(n)</li>
<li>O(n*log(n))</li>
<li>O(n^2)</li>
<li>O(n^3)</li>
<li>....</li>
<li><a href="https://www.bigocheatsheet.com/" target="_blank">bigocheatsheet.com</a></li>
</ul>
</p>
</div>
</div>

<div class="panel panel-default">
<div class="panel-heading">Big-O: upper-bound</div>
<div class="panel-body">
<p>Big-O is used for the upper-bound of T(n).</p>
<p>This is for the worst case.</p>
<p></p>
<p>$$ {T(n) \text{ is } O( f(n))}$$</p>
<p>$$ {\text{ iff } T(n) \gt c* f(n)} $$</p>
<p>$$ {\text{ for all } n>= n_{0}} $$</p>
<p></p>
<p>T(n) can be upper-bounded using f(n).</p>
<p>T(n) is the function that does the actual work.</p>
<p>O means that we upper-bound it.</p>
<p>f(n) is the function used for bounding.</p>
<p>The iff explains when the function can be used for upper-bounding.</p>
<p>$$ {n_{0}} $$ is when n=0.</p>
</div>
</div>


<div class="panel panel-default">
<div class="panel-heading">$$ {\Omega} $$: lower-bound.</div>
<div class="panel-body">
<p>Lower-bound is for the best case.</p>
<p>In this case, all values must be below the value of T(n).</p>
</div>
</div>

<div class="panel panel-default">
<div class="panel-heading">tight-bound</div>
<div class="panel-body">
<p>You want to upper-bound a function as tightly as possible.</p>
<p>loose upper-bound: an upper-bound that is correct, but far away from the actual upper-bound.</p>
<p>tight upper-bound: an upper-bound that is correct and is close to the actual upper-bound.</p>
</div>
</div>

<div class="panel panel-default">
<div class="panel-heading">$$ {\Theta}: exact bound $$</div>
<div class="panel-body">
<p>where the upper-bound and the lower-bound come together.</p>
<p>there is no little theta since theta is a perfect bound.</p>

</div>
</div>

</body>

</html>
35 changes: 35 additions & 0 deletions cheat_sheets/algoritmiek/big_o_notation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<html>

<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</link>
</head>

<body>
<h2 class="text-center">Big O Notation</h2>
<div class="panel panel-default">
<div class="panel-heading">Information</div>
<div class="panel-body">
<p><a href="https://medium.com/karuna-sehgal/a-simplified-explanation-of-the-big-o-notation-82523585e835" target="_blank">medium.com</a></p>
<p>Big O Notation is the language we use to describe the complexity of an algorithm.</p>
<p>With Big O Notation, we express the runtime in terms of how quickly it grows relative to the input as the input gets larger.</p>
<p>Some examples of Big O Notation:</p>
<p><ul>
<li>O(1) or constant time: does not depend on the size of the input.</li>
<li>O(n) or linear time: running time increases at most linearly with the size of the input.</li>
<li>O(n2) or quadratic time: n to the power of 2.</li>
</ul></p>
<p>Scenarios:
<ul>
<li>worst case scenario: the longest possible time to solve the problem.</li>
</ul>

</p>
</div>
</div>

</body>

</html>
21 changes: 21 additions & 0 deletions cheat_sheets/algoritmiek/bipartite.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<html>

<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</link>
</head>

<body>
<h2 class="text-center">Bipartite graph</h2>
<div class="panel panel-default">
<div class="panel-heading">Information</div>
<div class="panel-body">
<p>We say that a graph G = (V, E) is bipartite if its node set V can be partitioned into sets X and Y in such a way that every edge has one end in X and the other end in Y.</p>
</div>
</div>

</body>

</html>
23 changes: 23 additions & 0 deletions cheat_sheets/algoritmiek/dynamic_programming.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<html>

<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</link>
</head>

<body>
<h2 class="text-center">Dynamic programming</h2>
<div class="panel panel-default">
<div class="panel-heading">Information</div>
<div class="panel-body">
<p>Dynamic Programming (DP) is an algorithmic technique for solving an optimization problem by breaking it down into
simpler subproblems and utilizing the fact that the optimal solution to the overall problem depends upon the optimal
solution to its subproblems.</p>
</div>
</div>

</body>

</html>
Loading

0 comments on commit 9b2ff15

Please sign in to comment.