Skip to content

Commit

Permalink
Merge pull request #14 from josehu07/crossword
Browse files Browse the repository at this point in the history
Critical path experiments & figure helper scripts
  • Loading branch information
josehu07 authored Nov 19, 2023
2 parents eab0934 + 98801fa commit 103e2af
Show file tree
Hide file tree
Showing 35 changed files with 1,592 additions and 1,724 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
/tla+/**/*.old

/results/

/backups/
72 changes: 72 additions & 0 deletions models/crop_slide_pdfs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#! /usr/bin/bash

# Requires:
# sudo apt install python3-tk ghostscript poppler-utils
# pip3 install pdfCropMargins --user --upgrade

# Usage:
# 1. save slides exported PDF as results/slide-figures.pdf
# 2. run: ./models/crop_slides_pdfs.sh

ORIGINAL_PDF=results/slide-figures.pdf
TAKE_PAGES=8


echo
echo "Deleting old results..."
rm results/slides/*.pdf


echo
echo "Separating desired pages..."
pdfseparate -l $TAKE_PAGES $ORIGINAL_PDF "results/slides/slide-%d.pdf"


echo
echo "Cropping separated pages..."
for FILE in $(ls results/slides/ | grep .pdf);
do
echo " cropping $FILE"
pdfcropmargins -p 0 -t 255 -mo -o results "results/slides/$FILE"
done


echo
echo "Cropping extra files..."
EXTRA_FILES=("models/cstr_bounds" "rs_coding/rs_coding"
"adaptive/exper-adaptive" "adaptive/legend-adaptive"
"bd_n_space/exper-bd_n_space" "bd_n_space/legend-bd_n_space"
"failover/exper-failover" "failover/legend-failover"
"unbalanced/exper-unbalanced" "unbalanced/legend-unbalanced"
"critical/exper-critical-5.small.50.dc" "critical/exper-critical-5.small.50.wan"
"critical/exper-critical-5.large.50.dc" "critical/exper-critical-5.large.50.wan"
"critical/exper-critical-5.mixed.50.dc" "critical/exper-critical-5.mixed.50.wan"
"critical/exper-critical-cluster_size" "critical/exper-critical-write_ratio"
"critical/legend-critical" "critical/legend-critical-minor")
for FILE_NAME in ${EXTRA_FILES[@]};
do
echo " cropping results/final/${FILE_NAME}.pdf"
pdfcropmargins -p 0 -t 255 -mo -o results "results/final/${FILE_NAME}.pdf"
done
echo " cropping results/final/critical/ylabels-critical.pdf"
pdfcropmargins -p4 0 50 0 0 -t 255 -mo -o results "results/final/critical/ylabels-critical.pdf"


echo
echo "Deleting uncropped files..."
rm results/*_uncropped.pdf
rm "results/slide-figures.pdf:Zone.Identifier"


echo
echo "Renaming cropped slide pages..."
TARGET_NAMES=("status_diagram" "log_in_action" "rs_codeword_space" "policy-multipaxos"
"policy-rspaxos" "policy-balanced_rr" "policy-unbalanced" "concurrent_failures")
for IDX in ${!TARGET_NAMES[@]};
do
OLD_NAME="slide-$((IDX+1)).pdf"
NEW_NAME="${TARGET_NAMES[$IDX]}.pdf"
echo " renaming $OLD_NAME to $NEW_NAME"
mv "results/slides/$OLD_NAME" "results/slides/$NEW_NAME"
done
echo
Loading

0 comments on commit 103e2af

Please sign in to comment.