Skip to content

Commit 62a1d8d

Browse files
committed
feat: a9 cs506
1 parent 6d95f7f commit 62a1d8d

8 files changed

+81
-76
lines changed

assignments.org

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1+
| [[file:assignments.html][Assignments]] | [[file:contact.html][Contact]] | [[file:index.html][Index]] | [[file:projects.html][Projects]] | [[file:work_experience.html][WorkExperience]] | [[file:cv/rossMikulskisResume.pdf][CV]] | [[file:research/index.html][Research/]] |
12
#+OPTIONS: toc:nil num:nil
2-
[[file:assignments.html][Assignments]] | [[file:contact.html][Contact]] | [[file:cv/rossMikulskisResume.pdf][CV]] | [[file:index.html][About Me]] | [[file:projects.html][Projects]] | [[file:research/][Research]] | [[file:work_experience.html][WorkExperience]] |
3-
43
* Assignments
54

65
** Assignment 0: Dummy test program
@@ -37,3 +36,6 @@
3736
** Assignment 8: Logistic regression and shift distance
3837
* Plots relationships between logistic regression params and shift distance.
3938
* [[https://github.com/rkulskis/rkulskis-assignment-8][Github Link]]
39+
** Assignment 9: Visualizing neural network
40+
* Plots neural network visualizations during training over step sizes.
41+
* [[https://github.com/rkulskis/rkulskis-assignment-9][Github Link]]

contact.org

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1+
| [[file:assignments.html][Assignments]] | [[file:contact.html][Contact]] | [[file:index.html][Index]] | [[file:projects.html][Projects]] | [[file:work_experience.html][WorkExperience]] | [[file:cv/rossMikulskisResume.pdf][CV]] | [[file:research/index.html][Research/]] |
12
#+OPTIONS: toc:nil num:nil
2-
[[file:assignments.html][Assignments]] | [[file:contact.html][Contact]] | [[file:cv/rossMikulskisResume.pdf][CV]] | [[file:index.html][About Me]] | [[file:projects.html][Projects]] | [[file:research/][Research]] | [[file:work_experience.html][WorkExperience]] |
3-
43
* Contact
54
- [[https://www.linkedin.com/in/ross-mikulskis/][www.linkedin.com/in/ross-mikulskis/]]
65
- [[mailto:rkulskis@gmail.com][rkulskis@gmail.com]]

index.org

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1+
| [[file:assignments.html][Assignments]] | [[file:contact.html][Contact]] | [[file:index.html][Index]] | [[file:projects.html][Projects]] | [[file:work_experience.html][WorkExperience]] | [[file:cv/rossMikulskisResume.pdf][CV]] | [[file:research/index.html][Research/]] |
12
#+OPTIONS: toc:nil num:nil
2-
[[file:assignments.html][Assignments]] | [[file:contact.html][Contact]] | [[file:cv/rossMikulskisResume.pdf][CV]] | [[file:index.html][About Me]] | [[file:projects.html][Projects]] | [[file:research/][Research]] | [[file:work_experience.html][WorkExperience]] |
3-
43
* Ross A. Mikulskis
54

6-
#+ATTR_HTML: :width 300
5+
#+ATTR_HTML: :width 200
76
[[./profile.jpg]]
87

98
#+ATTR_HTML: :width 200

projects.org

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1+
| [[file:assignments.html][Assignments]] | [[file:contact.html][Contact]] | [[file:index.html][Index]] | [[file:projects.html][Projects]] | [[file:work_experience.html][WorkExperience]] | [[file:cv/rossMikulskisResume.pdf][CV]] | [[file:research/index.html][Research/]] |
12
#+OPTIONS: toc:nil num:nil
2-
[[file:assignments.html][Assignments]] | [[file:contact.html][Contact]] | [[file:cv/rossMikulskisResume.pdf][CV]] | [[file:index.html][About Me]] | [[file:projects.html][Projects]] | [[file:research/][Research]] | [[file:work_experience.html][WorkExperience]] |
3-
43
* Projects ([[https://github.com/rkulskis/]])
54

65
** Fraternity App

research/index.org

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1+
| [[file:../index.html][../]] | [[file:index.html][Index]] | [[file:parallel_hdd.html][ParallelHdd]] |
12
#+OPTIONS: toc:nil num:nil
2-
[[file:../index.html][About Me]] | [[file:../parallel_hdd.html][ParallelHdd]] |
3-
* Ideas
4-
* [[file:parallel_hdd.html][Parallel HDD]]
3+

research/parallel_hdd.org

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
| [[file:../index.html][../]] | [[file:index.html][Index]] | [[file:parallel_hdd.html][ParallelHdd]] |
12
#+OPTIONS: toc:nil num:nil
2-
[[file:../index.html][About Me]] | [[file:../parallel_hdd.html][ParallelHdd]] |
33
* Parallel HDD magnetic reader
44

55
** Problem statement

utils.sh

Lines changed: 69 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,69 @@
11
#!/bin/bash
22

3-
generate_prefix() {
4-
local depth=$(echo "$1" | grep -o "/" | wc -l)
5-
local prefix=""
6-
for ((i=2; i<depth; i++)); do
7-
prefix="../$prefix"
8-
done
9-
echo "$prefix"
10-
}
3+
HEADER="| "
4+
TOP_DIR="$(pwd)"
115

126
clear_header() {
13-
local file="$1"
14-
if grep -q "contact\.html" "$file"; then
15-
sed -i '1,/contact\.html/d' "$file"
16-
else
17-
echo "contact.html not found in $file. No lines cleared."
18-
fi
7+
file="$1"
8+
if grep -q '^#+OPTIONS: toc:nil num:nil' "$file"; then
9+
sed -i '0,/^#+OPTIONS: toc:nil num:nil/d' "$file"
10+
fi
1911
}
2012

2113
declare -A EXCEPTIONS=(
22-
["index.html"]="About Me"
23-
["cv"]="[[file:${prefix}cv/rossMikulskisResume.pdf][CV]]"
24-
["research"]="[[file:${prefix}research/][Research]]"
14+
["cv"]="[[file:cv/rossMikulskisResume.pdf][CV]]"
2515
)
2616

2717
capitalize() {
28-
local input="$1"
18+
input="$1"
2919
echo "$input" | sed -E 's/(^|_)([a-z])/\U\2/g'
3020
}
3121

32-
add_header() {
33-
local file="$1"
34-
local prefix=$(generate_prefix "$file")
35-
local dir=$(dirname "$file")
36-
37-
local HEADER="#+OPTIONS: toc:nil num:nil\n"
38-
39-
for item in "$dir"/*; do
40-
if [ -d "$item" ]; then
41-
local dir_name=$(basename "$item")
42-
if [[ -n "${EXCEPTIONS[$dir_name]}" ]]; then
43-
HEADER="$HEADER ${EXCEPTIONS[$dir_name]} |"
44-
else
45-
local dir_item=$(capitalize "$dir_name")
46-
HEADER="$HEADER \
47-
[[file:${prefix}${dir_name}/index.html][$dir_item]] |"
48-
fi
49-
elif [ -f "$item" ] && [[ "$item" == *.org ]]; then
50-
local file_name=$(basename "$item" .org)
51-
local html_name="${file_name}.html"
52-
if [[ -n "${EXCEPTIONS[$html_name]}" ]]; then
53-
HEADER="$HEADER \
54-
[[file:${prefix}${html_name}][${EXCEPTIONS[$html_name]}]] |"
55-
else
56-
local file_item=$(capitalize "$file_name")
57-
HEADER="$HEADER [[file:${prefix}${html_name}][$file_item]] |"
58-
fi
22+
generate_header() {
23+
dir="$1"
24+
is_top="$2"
25+
header="$HEADER"
26+
27+
if [[ "$is_top" -eq 0 ]]; then
28+
header+="[[file:../index.html][../]] | "
29+
fi
30+
31+
for file in $(find "$dir" -mindepth 1 -maxdepth 1 -type f -name "*.org" ! -name ".*" | sort); do
32+
filename=$(basename "$file" .org)
33+
if [[ -n "${EXCEPTIONS[$filename]}" ]]; then
34+
header+="${EXCEPTIONS[$filename]} | "
35+
else
36+
filename_capitalized=$(capitalize "$filename")
37+
header+="[[file:$filename.html][$filename_capitalized]] | "
5938
fi
6039
done
6140

62-
if ! grep -q "About Me" "$file"; then
63-
echo -e "$HEADER\n$(cat "$file")" > "$file"
64-
fi
41+
for subdir in $(find "$dir" -mindepth 1 -maxdepth 1 -type d ! -name ".*" | sort); do
42+
subname=$(basename "$subdir")
43+
if [[ -n "${EXCEPTIONS[$subname]}" ]]; then
44+
header+="${EXCEPTIONS[$subname]} | "
45+
else
46+
subname_capitalized=$(capitalize "$subname")
47+
header+="[[file:$subname/index.html][$subname_capitalized/]] | "
48+
fi
49+
done
50+
51+
echo "$header\n#+OPTIONS: toc:nil num:nil"
52+
}
53+
54+
add_header() {
55+
dir="$1"
56+
is_top="$2"
57+
header=$(generate_header "$dir" "$is_top")
58+
59+
for file in "$dir"/*.org; do
60+
[ -e "$file" ] || continue
61+
echo -e "$header\n$(cat "$file")" > "$file"
62+
done
6563
}
6664

6765
export_html() {
68-
local org_file="$1"
66+
org_file="$1"
6967
emacs --batch "$org_file" \
7068
--eval "(progn
7169
(require 'org)
@@ -74,20 +72,30 @@ export_html() {
7472
}
7573

7674
process_files() {
77-
local dir="$1"
78-
local operation="$2"
75+
dir="$1"
76+
operation="$2"
77+
is_top="$3"
7978

80-
for file in "$dir"/*.org; do
81-
[ -e "$file" ] || continue
82-
case "$operation" in
83-
clear_header) clear_header "$file" ;;
84-
add_header) add_header "$file" ;;
85-
html_export) export_html "$file" ;;
86-
esac
87-
done
79+
case "$operation" in
80+
clear_header)
81+
for file in "$dir"/*.org; do
82+
[ -e "$file" ] || continue
83+
clear_header "$file"
84+
done
85+
;;
86+
add_header)
87+
add_header "$dir" "$is_top"
88+
;;
89+
html_export)
90+
for file in "$dir"/*.org; do
91+
[ -e "$file" ] || continue
92+
export_html "$file"
93+
done
94+
;;
95+
esac
8896

8997
for subdir in "$dir"/*/; do
90-
[ -d "$subdir" ] && process_files "$subdir" "$operation"
98+
[ -d "$subdir" ] && process_files "$subdir" "$operation" 0
9199
done
92100
}
93101

@@ -97,6 +105,6 @@ if [[ $# -ne 1 ]]; then
97105
fi
98106

99107
case "$1" in
100-
clear_header|add_header|html_export) process_files "." "$1" ;;
108+
clear_header|add_header|html_export) process_files "." "$1" 1 ;;
101109
*) echo "Invalid argument. Use clear_header, add_header, or html_export."; exit 1 ;;
102110
esac

work_experience.org

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1+
| [[file:assignments.html][Assignments]] | [[file:contact.html][Contact]] | [[file:index.html][Index]] | [[file:projects.html][Projects]] | [[file:work_experience.html][WorkExperience]] | [[file:cv/rossMikulskisResume.pdf][CV]] | [[file:research/index.html][Research/]] |
12
#+OPTIONS: toc:nil num:nil
2-
[[file:assignments.html][Assignments]] | [[file:contact.html][Contact]] | [[file:cv/rossMikulskisResume.pdf][CV]] | [[file:index.html][About Me]] | [[file:projects.html][Projects]] | [[file:research/][Research]] | [[file:work_experience.html][WorkExperience]] |
3-
43
* Work experience
54
** Systems Researcher
65
BU Student Researcher under Rich West

0 commit comments

Comments
 (0)