Scripts and open source projects

Scripts for academics (Latex, grading, etc.).

mkbooklet.pl Perl scripts to make any PDF/PS file into a "booklet" for eco-friendly printing. You can print up to 4 pages per sheet (2 pages per side) and still get very readable output.
pscenter.pl
tex_autoclose.vim Vim TeX/LaTeX ftplugin to automatically close environments.
tex.vim A few settings that make life easier when using Latex + Vim. Pressing Ctrl-K runs latex, and puts the errors in the quickfix window. Pressing F9 opens xdvi showing the location of the cursor. And finally some spelling / abbreviation settings that you might not find useful. Put this file in ~/.vim/after/ftplugin/tex.vim.
hwaverage A Gnumeric/Python script to compute homework averages. When grading, I usually have a spreadsheet with homework scores in a row, and the totals in a different row. This script computes the percentage average of all homeworks, optionally dropping the lowest N (percentage) scores.
gpa A Gnumeric/Python script to compute grades / normalise scores. This can compute letter grades, based on given cutoffs. More importantly, say you have 2 exams each worth 50% of the total grade. Directly adding the scores from each of these exams will not be a correct indication of the students grade (esp. if one exam was a lot harder than the other). This becomes apparent if for instance you have three exams, and only count the better two. The correct way to compute the final grade would be to normalise the scores to be on the same scale (using an interpolant via quartiles/deciles, or specified grade cutoffs) and then average. This script has functions for this. The help should be visible within Gnumeric.
subargs.pl Perl script to substitute arguments -- it executes a given command substituting %n with field values from a given file. (I guess you can use awk/sed directly instead.) I usually use this to send mails to students with their individual grades: E.g. subargs -i scores.csv -C mail-scores.subargs

General Linux applications / scripts

SourceForge A few open source projects I contributed to on Source Forge. I eventually got sick of their site outages / bad service so I switched to Google code.
Google Code All my more recent projects are here (mostly small utilities)
Vim scripts A few Vim scripts I wrote. (I use Vim for everything).

Miscellaneous

hp2710p/ Installing Linux on the HP 2710p (convertible tablet).

Javascript

modalPopup.js Easily show "modal popups". Example

This creates modal popups on click.

Simplest usage: Use rel='modalPopup.open' for an anchor, and put the modal popup dialogue in the next element. E.g.

<a rel='modalPopup.open'>Open Popup</a>
<div>Popup text goes here</div>

Alternately, one can choose the ID of the element to put in the popup:

<a rel='modalPopup.open.myId'>Open Popup</a>
...
<div id='myId'>Popup text goes here</div>

To include a close button in your popup dialogue, use an anchor with rel='modalPopup.close'. If you don't provide one, it will be added as the first element. The class attribute of this element will be set to the value of the class attribute of the popup, followed by the string 'modalPopupClose'.

toggleDisplay.js Dynamically show / hide parts of your document.
Example:

This script toggles display of elements.

<div name='toggleable'>...</div>

will become a toggleable element in your document. A hide/show link will be automatically generated and added as the first element of this div. The initial state of the element is taken from the style. That is,

<div name='toggleable' style='display: none'>...</div>

will produce a '(show)' link, which will expand to the div when clicked. The show/hide links have class ToggleLink so you can control the display.

Alternately,

<a rel='toggleDisplay'></a>

will make the next element toggleable. (If the anchor is the last element, then it will make the next element of the parent of the anchor toggleable).

Questions? Comments? Send me hate mail? . Public Key DB04C471

Firefox Vim Logo LaTeX Logo Linux Logo
Stanford University University of Chicago St. Xaviers College Rishi Valley School

And did they get you trade your heroes for ghosts?
Hot ashes for trees? Hot air for a cool breeze?
Cold comfort for change? And did you exchange
a walk on part in the war for a lead role in a cage?

Last Modified: Mon 17 Jan 2011 11:40:36 PM EST