Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output --solvestats as a file #7

Open
RagnarGrootKoerkamp opened this issue Oct 21, 2019 · 1 comment
Open

Output --solvestats as a file #7

RagnarGrootKoerkamp opened this issue Oct 21, 2019 · 1 comment

Comments

@RagnarGrootKoerkamp
Copy link
Contributor

RagnarGrootKoerkamp commented Oct 21, 2019

For BAPC I created a run.sh script as follows (login params omitted)

bazel run analysis:activity -- \
~/git/bapc/2019/bapc/solve_stats

bazel run analysis:activity -- \
--solvestats > ~/git/bapc/2019/bapc/solve_stats/problem_stats.tex

It would be really nice to directly create the problem_stats.tex (or probably solve_stats.tex) when running analysis:activity. The output I used was:

\newcommand{\solvestatsD}{\printsolvestats{26}{1}{11}}
\newcommand{\solvestatsH}{\printsolvestats{100}{26}{29}}
\newcommand{\solvestatsB}{\printsolvestats{57}{56}{0}}
\newcommand{\solvestatsL}{\printsolvestats{3}{2}{0}}
\newcommand{\solvestatsF}{\printsolvestats{100}{20}{27}}
\newcommand{\solvestatsC}{\printsolvestats{1}{1}{0}}
\newcommand{\solvestatsI}{\printsolvestats{20}{1}{7}}
\newcommand{\solvestatsJ}{\printsolvestats{80}{56}{0}}
\newcommand{\solvestatsE}{\printsolvestats{124}{23}{37}}
\newcommand{\solvestatsA}{\printsolvestats{15}{3}{8}}
\newcommand{\solvestatsG}{\printsolvestats{52}{10}{22}}
@RagnarGrootKoerkamp
Copy link
Contributor Author

RagnarGrootKoerkamp commented Oct 21, 2019

Btw, the LaTeX header I used with it is:

\newcommand{\problemletter}{} % Empty to hide activity chart

% If solve_stats/activity/A.tex exists, define the \activitychart command
\IfFileExists{./solve_stats/activity/A.tex}{
	\newcommand{\activitychart}{
	  \ifdefempty{\problemletter}{}{
		\includestandalone[width=\textwidth]{solve_stats/activity/\problemletter}
	  }
	}
}{
	\newcommand{\activitychart}{}
}

\newcommand{\printsolvestats}[3]{%
	\vfill
	\onslide<+->
	Statistics: #1 submissions, #2 accepted, #3 unknown%
}

% Define \solvestats for the current problem if the file exists.
\IfFileExists{./solve_stats/problem_stats.tex}{
	\newcommand{\solvestats}{\csname solvestats\problemletter \endcsname}
	\input{./solve_stats/problem_stats.tex}
}{
	\newcommand{\solvestats}{}
}

It might be nice to generate this as a separate file as well so users of the tool don't have to remember/copy this or figure it out otherwise.

\printsolvestats is the only customization punt here, so maybe that one should be user defined and the rest can be generated. (But then add a latex comment about this in the generated file anyway maybe.)

hex539 added a commit that referenced this issue Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant