From 32bb94ffbab81b9d62f8c61c3c1a3a24a67f16c6 Mon Sep 17 00:00:00 2001 From: Kevin Mok Date: Fri, 15 Mar 2019 16:20:48 -0400 Subject: [PATCH] Update 369-a3 functions --- aliases/key_aliases | 2 ++ fish/.config/fish/config.fish | 8 +++---- .../fish/functions/369/a3/gdb-a3-break.fish | 15 +++++++++++-- .../fish/functions/369/a3/gdb-a3-custom.fish | 6 ----- .../.config/fish/functions/369/a3/gdb-a3.fish | 6 ----- .../fish/functions/369/a3/run-a3-custom.fish | 9 -------- .../fish/functions/369/a3/run-a3-file.fish | 9 -------- .../.config/fish/functions/369/a3/run-a3.fish | 22 ++++++++++++++++++- .../fish/functions/compile_commands.json | 1 - i3/.config/i3/config | 5 +++-- txt/key_dirs.txt | 1 + vim/.vimrc | 2 +- 12 files changed, 44 insertions(+), 42 deletions(-) delete mode 100644 fish/.config/fish/functions/369/a3/gdb-a3-custom.fish delete mode 100644 fish/.config/fish/functions/369/a3/gdb-a3.fish delete mode 100644 fish/.config/fish/functions/369/a3/run-a3-custom.fish delete mode 100644 fish/.config/fish/functions/369/a3/run-a3-file.fish delete mode 100644 fish/.config/fish/functions/compile_commands.json diff --git a/aliases/key_aliases b/aliases/key_aliases index 007def0..d34f61e 100644 --- a/aliases/key_aliases +++ b/aliases/key_aliases @@ -357,6 +357,8 @@ he "hugo serve -D --disableFastRender" ss "ssh kevin@192.168.0.100" ssb "ssh-bandit" +rt "python ~/coding/rt-scraper/rt-scraper.py" + # }}} coding projs # # school {{{ # diff --git a/fish/.config/fish/config.fish b/fish/.config/fish/config.fish index e0fa62c..e1c6270 100644 --- a/fish/.config/fish/config.fish +++ b/fish/.config/fish/config.fish @@ -72,11 +72,9 @@ abbr grc "grep-c" abbr grh "grep-headers" abbr rgh "rg-headers" -abbr r6 "run-a3" -abbr r6f "run-a3-file" -abbr r6c "run-a3-custom" -abbr g6 "gdb-a3" -abbr g6b "gdb-a3-break" +abbr r6 "run-a3 c lru" +abbr r6o "run-a3 c lru o" +abbr g6b "gdb-a3-break c lru" # abbr cs "carsim" # abbr ga2 "gdb-a2" diff --git a/fish/.config/fish/functions/369/a3/gdb-a3-break.fish b/fish/.config/fish/functions/369/a3/gdb-a3-break.fish index 7083d8e..c2be459 100644 --- a/fish/.config/fish/functions/369/a3/gdb-a3-break.fish +++ b/fish/.config/fish/functions/369/a3/gdb-a3-break.fish @@ -1,7 +1,18 @@ function gdb-a3-break + # 1 = trace file, 2 = alg + set trace_file 'traceprogs/tr-custom.ref' + set memsize 1 + set swapsize 10 + if test $argv[1] = 's' + set trace_file 'traceprogs/tr-simpleloop.ref' + set memsize 50 + set swapsize 3000 + end + printf '\033c' and bear make - and gdb -ex "b pagetable.c:147" \ + and gdb -ex "b pagetable.c:69" \ + # -ex "b lru.c:65" \ -ex "run" \ - --args ./sim -f /home/kevin/school/369/a3/a3/traceprogs/tr-simpleloop.ref -m 50 -s 3000 -a rand + --args ./sim -f $trace_file -m $memsize -s $swapsize -a $argv[2] end diff --git a/fish/.config/fish/functions/369/a3/gdb-a3-custom.fish b/fish/.config/fish/functions/369/a3/gdb-a3-custom.fish deleted file mode 100644 index 4b74a61..0000000 --- a/fish/.config/fish/functions/369/a3/gdb-a3-custom.fish +++ /dev/null @@ -1,6 +0,0 @@ -function gdb-a3-custom - printf '\033c' - and bear make - gdb -ex "run" -ex "bt" \ - --args ./sim -f /home/kevin/school/369/a3/a3/traceprogs/tr-custom-2.ref -m 1 -s 10 -a rand -end diff --git a/fish/.config/fish/functions/369/a3/gdb-a3.fish b/fish/.config/fish/functions/369/a3/gdb-a3.fish deleted file mode 100644 index 2de99db..0000000 --- a/fish/.config/fish/functions/369/a3/gdb-a3.fish +++ /dev/null @@ -1,6 +0,0 @@ -function gdb-a3 - printf '\033c' - and bear make - gdb -ex "run" -ex "bt" \ - --args ./sim -f /home/kevin/school/369/a3/a3/traceprogs/tr-simpleloop.ref -m 50 -s 3000 -a rand -end diff --git a/fish/.config/fish/functions/369/a3/run-a3-custom.fish b/fish/.config/fish/functions/369/a3/run-a3-custom.fish deleted file mode 100644 index 91f1d1c..0000000 --- a/fish/.config/fish/functions/369/a3/run-a3-custom.fish +++ /dev/null @@ -1,9 +0,0 @@ -function run-a3-custom - printf '\033c' - # and bear make clean - and bear make - # and ./sim -f /home/kevin/school/369/a3/a3/traceprogs/tr-custom.ref -m 5 -s 50 -a rand - and ./sim -f /home/kevin/school/369/a3/a3/traceprogs/tr-custom-2.ref -m 1 -s 10 -a rand - - # rm swapfile.* -end diff --git a/fish/.config/fish/functions/369/a3/run-a3-file.fish b/fish/.config/fish/functions/369/a3/run-a3-file.fish deleted file mode 100644 index 28cfc4a..0000000 --- a/fish/.config/fish/functions/369/a3/run-a3-file.fish +++ /dev/null @@ -1,9 +0,0 @@ -function run-a3-file - printf '\033c' - # and bear make clean - and bear make - # and ./sim -f /home/kevin/school/369/a3/a3/traceprogs/tr-simpleloop.ref -m 50 -s 3000 -a rand > task-1.out - and ./sim -f /home/kevin/school/369/a3/a3/traceprogs/tr-simpleloop.ref -m 50 -s 3000 -a rand > task-1.out 2>&1 - - # rm swapfile.* -end diff --git a/fish/.config/fish/functions/369/a3/run-a3.fish b/fish/.config/fish/functions/369/a3/run-a3.fish index e42cd82..302a9ff 100644 --- a/fish/.config/fish/functions/369/a3/run-a3.fish +++ b/fish/.config/fish/functions/369/a3/run-a3.fish @@ -1,8 +1,28 @@ function run-a3 + # 1 = trace file, 2 = alg, 3 = output + + set trace_file 'traceprogs/tr-custom.ref' + set memsize 3 + set swapsize 10 + if test $argv[1] = 's' + set trace_file 'traceprogs/tr-simpleloop.ref' + set memsize 50 + set swapsize 3000 + end + printf '\033c' # and bear make clean and bear make - and ./sim -f /home/kevin/school/369/a3/a3/traceprogs/tr-simpleloop.ref -m 50 -s 3000 -a rand + + switch $argv[3] + case f + ./sim -f $trace_file -m $memsize -s $swapsize -a $argv[2] > a3.out 2>&1 + case g + gdb -ex "run" -ex "bt" -ex "q" \ + --args ./sim -f $trace_file -m $memsize -s $swapsize -a $argv[2] + case o + ./sim -f $trace_file -m $memsize -s $swapsize -a $argv[2] + end # rm swapfile.* end diff --git a/fish/.config/fish/functions/compile_commands.json b/fish/.config/fish/functions/compile_commands.json deleted file mode 100644 index 0637a08..0000000 --- a/fish/.config/fish/functions/compile_commands.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/i3/.config/i3/config b/i3/.config/i3/config index fbce6a4..b97582d 100644 --- a/i3/.config/i3/config +++ b/i3/.config/i3/config @@ -45,6 +45,7 @@ bindsym Mod4+o exec xclip -selection clipboard ~/.password-store/social/gmail bindsym Mod4+p exec passmenu bindsym Mod4+q exec qdirstat bindsym Mod4+r exec urxvt -e ranger +bindsym Mod4+$mod+r exec notify-send "watson restart" "$(watson restart)" # bindsym control+$mod+s exec systemctl suspend bindsym control+$mod+s exec systemctl suspend # bindsym Mod4+t exec st @@ -213,8 +214,8 @@ set $ws2 "2 " workspace $ws2 output $samsung bindsym $mod+F2 workspace $ws2; exec $def_term -# set $ws3 "3 " -set $ws3 "3 " +set $ws3 "3 " +# set $ws3 "3 " workspace $ws3 output $benq bindsym $mod+F3 workspace $ws3; exec $browser diff --git a/txt/key_dirs.txt b/txt/key_dirs.txt index 206a0ca..91d48f8 100644 --- a/txt/key_dirs.txt +++ b/txt/key_dirs.txt @@ -52,6 +52,7 @@ e2 /home/kevin/school/309/e2 # 369 6 /home/kevin/school/369 a3 /home/kevin/school/369/a3/a3 +a3f /home/kevin/linux-config/fish/.config/fish/functions/369/a3 hp /home/kevin/school/hps lt /home/kevin/school/latex-notes diff --git a/vim/.vimrc b/vim/.vimrc index cd8f5a5..1a74f7e 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -64,7 +64,7 @@ autocmd VimLeave *.tex !tex-clean % autocmd BufNewFile,BufRead watson*.fish set tabstop=2 shiftwidth=2 expandtab autocmd BufRead commit-msg.txt set filetype=gitcommit tw=72 " autocmd BufWritePost key_* !sync-shortcuts -autocmd BufNewFile,BufRead key_* map !sync-shortcuts +autocmd BufNewFile,BufRead key_* map :silent !sync-shortcuts " }}} commands for specific files "