From 9f9dc39a31ccd96fb3ac1448bcbaa7fddeee2568 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Thu, 24 Nov 2022 17:24:21 +0100 Subject: [PATCH] chore: do not keep SVGs in the repository MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Do not keep the SVG files in the repository, generate them just for the builds • Also generate ZIP files with sources for downloading Signed-off-by: Matej Focko --- .gitignore | 3 + ib002/03-time-complexity/extend.md | 36 +--- ib002/10-graphs/bfs-tree.md | 92 --------- makefile | 15 +- regenerate-zips.sh | 18 ++ static/files/ib002/bfs-tree/bfs_graph.svg | 105 ---------- .../bfs_graph_with_additional_edge.svg | 110 ---------- static/files/ib002/bfs-tree/bfs_tree.svg | 102 --------- .../bfs_tree_with_additional_edge.svg | 102 --------- static/files/ib002/extend/.zipit | 0 static/files/ib002/extend/construction.svg | 194 ------------------ .../ib002/iterative-and-iterators/.zipit | 0 static/files/pb071/bonuses/03/.zipit | 0 static/files/pb071/bonuses/04/.zipit | 0 static/files/pb071/bonuses/05-06/.zipit | 0 static/files/pb071/bonuses/08/.zipit | 0 static/files/pb071/bonuses/10/.zipit | 0 17 files changed, 31 insertions(+), 746 deletions(-) create mode 100644 regenerate-zips.sh delete mode 100644 static/files/ib002/bfs-tree/bfs_graph.svg delete mode 100644 static/files/ib002/bfs-tree/bfs_graph_with_additional_edge.svg delete mode 100644 static/files/ib002/bfs-tree/bfs_tree.svg delete mode 100644 static/files/ib002/bfs-tree/bfs_tree_with_additional_edge.svg create mode 100644 static/files/ib002/extend/.zipit delete mode 100644 static/files/ib002/extend/construction.svg create mode 100644 static/files/ib002/iterative-and-iterators/.zipit create mode 100644 static/files/pb071/bonuses/03/.zipit create mode 100644 static/files/pb071/bonuses/04/.zipit create mode 100644 static/files/pb071/bonuses/05-06/.zipit create mode 100644 static/files/pb071/bonuses/08/.zipit create mode 100644 static/files/pb071/bonuses/10/.zipit diff --git a/.gitignore b/.gitignore index b2d6de3..aa8c739 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,6 @@ npm-debug.log* yarn-debug.log* yarn-error.log* + +# ignore generate zips +static/files/**/*.zip \ No newline at end of file diff --git a/ib002/03-time-complexity/extend.md b/ib002/03-time-complexity/extend.md index d348e46..6abbbab 100644 --- a/ib002/03-time-complexity/extend.md +++ b/ib002/03-time-complexity/extend.md @@ -1,8 +1,7 @@ --- title: Time complexity of ‹extend› description: | - Hidden time complexity behind commonly used functions on lists and how can - repeating of a relatively cheap operation increase its time complexity. + How to make inefficient algorithm unknowingly. --- ## Introduction @@ -80,39 +79,6 @@ Consider constructing of this list: ![Rendered construction of the list](/files/ib002/extend/construction.svg) -
-Source for the rendered construction of the list - -```dot -digraph G { - node [shape=record]; - - a_node [label="1|2|3|4|5|6|7|8|9"] - - b_node [label="1|2|3"] - c_node [label="4|5|6"] - d_node [label="7|8|9"] - - a_node -> b_node [label="B"] - a_node -> c_node [label="C"] - a_node -> d_node [label="D"] - - b_node -> "1" - b_node -> "2" - b_node -> "3" - - c_node -> "4" - c_node -> "5" - c_node -> "6" - - d_node -> "7" - d_node -> "8" - d_node -> "9" -} -``` - -
- Let us assume that you extend the result with the list that you get from the recursive call. - B iterates through 1, 2 and 3; returns `[1, 2, 3]` diff --git a/ib002/10-graphs/bfs-tree.md b/ib002/10-graphs/bfs-tree.md index d9dc18d..77e9163 100644 --- a/ib002/10-graphs/bfs-tree.md +++ b/ib002/10-graphs/bfs-tree.md @@ -17,56 +17,10 @@ Consider the following graph: ![BFS graph](/files/ib002/bfs-tree/bfs_graph.svg) -
-Source for the rendered graph - -```dot showLineNumbers -graph { - a -- c - a -- e - - c -- i - c -- b - - e -- j - - i -- d - - b -- h - - d -- h - - h -- j -} -``` - -
- We run BFS from the vertex $a$ and obtain the following BFS tree: ![BFS tree](/files/ib002/bfs-tree/bfs_tree.svg) -
-Source for the BFS tree - -```dot showLineNumbers -digraph { - a -> c - a -> e - - c -> b - c -> i - - e -> j - - b -> h - - i -> d -} -``` - -
- Let's consider pair of vertices $e$ and $h$. For them we can safely lay, from the BFS tree, following properties: - lower bound: $2$ @@ -82,32 +36,6 @@ Now the more important question, is there a shorter path in that graph? The answ ![BFS tree](/files/ib002/bfs-tree/bfs_graph_with_additional_edge.svg) -
-Source for the BFS graph with an additional edge - -```dot showLineNumbers -graph { - a -- c - a -- e - - c -- i - c -- b - - e -- j - e -- h - - i -- d - - b -- h - - d -- h - - h -- j -} -``` - -
- Okay, so we have a graph that breaks the rule we have laid. However, we need to run BFS to obtain the new BFS tree, since we have changed the graph. :::tip @@ -120,26 +48,6 @@ Do we need to run BFS after **every** change? ![BFS tree](/files/ib002/bfs-tree/bfs_tree_with_additional_edge.svg) -
-Source for the BFS tree - -```dot showLineNumbers -digraph { - a -> c - a -> e - - c -> b - c -> i - - e -> h - e -> j - - i -> d -} -``` - -
- Oops, we have gotten a new BFS tree, that has a height difference of 1. :::tip diff --git a/makefile b/makefile index 52e93dc..3f5bd61 100644 --- a/makefile +++ b/makefile @@ -1,17 +1,20 @@ -dev: - URL=http://localhost BASE_URL=/ npm run start +dev: regenerate-dots regenerate-zips + URL=http://localhost BASE_URL=/ yarn run start deploy-aisa: - URL=https://fi.muni.cz BASE_URL=~xfocko/kb/ npm run build + URL=https://fi.muni.cz BASE_URL=~xfocko/kb/ yarn run build rsync -avzrlpptv --delete build/ aisa:~/public_html/kb/ deploy-poincare: - URL=https://fi.mfocko.xyz BASE_URL=/ npm run build + URL=https://fi.mfocko.xyz BASE_URL=/ yarn run build rsync -avzrlpptv --delete build/ poincare:~/public_html/fi/ -deploy: deploy-aisa deploy-poincare +deploy: regenerate-dots regenerate-zips deploy-aisa deploy-poincare regenerate-dots: bash regenerate-dots.sh -.PHONY: deploy-aisa deploy-poincare regenerate-dots +regenerate-zips: + bash regenerate-zips.sh + +.PHONY: deploy-aisa deploy-poincare regenerate-dots regenerate-zips diff --git a/regenerate-zips.sh b/regenerate-zips.sh new file mode 100644 index 0000000..13ac00f --- /dev/null +++ b/regenerate-zips.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# remove preexisting ZIPs +find ./static/files -name '*.zip' -exec rm {} \; + +for relative_path in $(find ./static/files -name '.zipit' -print); do + relative_path=$(dirname $relative_path) + base=$(basename $relative_path) + pushd $relative_path/.. + + echo "PWD: $PWD" + + all_files=$(find $base/** ! -name '.zipit' -print) + zip -9 $base.zip $all_files + mv $base.zip $base/$base.zip + + popd +done; \ No newline at end of file diff --git a/static/files/ib002/bfs-tree/bfs_graph.svg b/static/files/ib002/bfs-tree/bfs_graph.svg deleted file mode 100644 index 2cb753b..0000000 --- a/static/files/ib002/bfs-tree/bfs_graph.svg +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - -a - -a - - - -c - -c - - - -a--c - - - - -e - -e - - - -a--e - - - - -i - -i - - - -c--i - - - - -b - -b - - - -c--b - - - - -j - -j - - - -e--j - - - - -d - -d - - - -i--d - - - - -h - -h - - - -b--h - - - - -d--h - - - - -h--j - - - - diff --git a/static/files/ib002/bfs-tree/bfs_graph_with_additional_edge.svg b/static/files/ib002/bfs-tree/bfs_graph_with_additional_edge.svg deleted file mode 100644 index 0bcc7e8..0000000 --- a/static/files/ib002/bfs-tree/bfs_graph_with_additional_edge.svg +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - -a - -a - - - -c - -c - - - -a--c - - - - -e - -e - - - -a--e - - - - -i - -i - - - -c--i - - - - -b - -b - - - -c--b - - - - -j - -j - - - -e--j - - - - -h - -h - - - -e--h - - - - -d - -d - - - -i--d - - - - -b--h - - - - -h--j - - - - -d--h - - - - diff --git a/static/files/ib002/bfs-tree/bfs_tree.svg b/static/files/ib002/bfs-tree/bfs_tree.svg deleted file mode 100644 index ee67d36..0000000 --- a/static/files/ib002/bfs-tree/bfs_tree.svg +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - -a - -a - - - -c - -c - - - -a->c - - - - - -e - -e - - - -a->e - - - - - -b - -b - - - -c->b - - - - - -i - -i - - - -c->i - - - - - -j - -j - - - -e->j - - - - - -h - -h - - - -b->h - - - - - -d - -d - - - -i->d - - - - - diff --git a/static/files/ib002/bfs-tree/bfs_tree_with_additional_edge.svg b/static/files/ib002/bfs-tree/bfs_tree_with_additional_edge.svg deleted file mode 100644 index 5988d13..0000000 --- a/static/files/ib002/bfs-tree/bfs_tree_with_additional_edge.svg +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - -a - -a - - - -c - -c - - - -a->c - - - - - -e - -e - - - -a->e - - - - - -b - -b - - - -c->b - - - - - -i - -i - - - -c->i - - - - - -h - -h - - - -e->h - - - - - -j - -j - - - -e->j - - - - - -d - -d - - - -i->d - - - - - diff --git a/static/files/ib002/extend/.zipit b/static/files/ib002/extend/.zipit new file mode 100644 index 0000000..e69de29 diff --git a/static/files/ib002/extend/construction.svg b/static/files/ib002/extend/construction.svg deleted file mode 100644 index 043018d..0000000 --- a/static/files/ib002/extend/construction.svg +++ /dev/null @@ -1,194 +0,0 @@ - - - - - - -G - - - -a_node - -1 - -2 - -3 - -4 - -5 - -6 - -7 - -8 - -9 - - - -b_node - -1 - -2 - -3 - - - -a_node->b_node - - -B - - - -c_node - -4 - -5 - -6 - - - -a_node->c_node - - -C - - - -d_node - -7 - -8 - -9 - - - -a_node->d_node - - -D - - - -1 - -1 - - - -b_node->1 - - - - - -2 - -2 - - - -b_node->2 - - - - - -3 - -3 - - - -b_node->3 - - - - - -4 - -4 - - - -c_node->4 - - - - - -5 - -5 - - - -c_node->5 - - - - - -6 - -6 - - - -c_node->6 - - - - - -7 - -7 - - - -d_node->7 - - - - - -8 - -8 - - - -d_node->8 - - - - - -9 - -9 - - - -d_node->9 - - - - - diff --git a/static/files/ib002/iterative-and-iterators/.zipit b/static/files/ib002/iterative-and-iterators/.zipit new file mode 100644 index 0000000..e69de29 diff --git a/static/files/pb071/bonuses/03/.zipit b/static/files/pb071/bonuses/03/.zipit new file mode 100644 index 0000000..e69de29 diff --git a/static/files/pb071/bonuses/04/.zipit b/static/files/pb071/bonuses/04/.zipit new file mode 100644 index 0000000..e69de29 diff --git a/static/files/pb071/bonuses/05-06/.zipit b/static/files/pb071/bonuses/05-06/.zipit new file mode 100644 index 0000000..e69de29 diff --git a/static/files/pb071/bonuses/08/.zipit b/static/files/pb071/bonuses/08/.zipit new file mode 100644 index 0000000..e69de29 diff --git a/static/files/pb071/bonuses/10/.zipit b/static/files/pb071/bonuses/10/.zipit new file mode 100644 index 0000000..e69de29