LaTeX

Generating table of contents and author index

Scenario
Compiling the proceedings of a conference using LaTeX with pdfpages to include individual articles.
Problem
To generate both a table of contents that lists the included articles in the right order with their page numbers and an author index with page numbers.
Possible solution
This simple LaTeX package and OCaml script. See the small example in examples/.

Matlab/Simulink

Producing eps files from Simulink models

Scenario
  • Using Simulink for modelling dynamic systems.
  • Writing reports about those systems (using LaTeX, for instance).
Problem
To automatically generate eps and pdf files from the model, all its subsystems, and any graphs produced during its simulation.
Possible solution
This simple matlab script, that uses ideas described across various websites and the Matlab/Simulink user documentation. The script is easily incorporated into a Makefile (see example).

Mutt

Querying evolution's address book

Scenario
  • Using mutt for sending email
  • But, evolution for storing contacts
Problem
Get addresses from evolution when sending messages from mutt.
Possible solution
This simple python script, that exploits the evolution library, using the ideas described here. (On Ubuntu: sudo apt-get install python-evolution.)

Uppaal

Changing a system declaration

Scenario
Problem
Change a system declaration from the command line so as to automatically generate different verification tasks.
Possible solution
This xslt stylesheet. It can be processed with xsltproc:
xsltproc --stringparam system 'system Train, Gate;'        \
         --novalid change_uppaal_system.xml inputmodel.xml \
         > outputmodel.xml

Vim

Checking sender address

Scenario
  • mutt email client
  • vim editor
  • sending from more than one email account (e.g. separate personal and work addresses)
Problem
Emails are sometimes sent from an inappropriate address.
Possible solution
A simple vim plugin script that checks the sender address, a database of personal contacts and offers a choice of sender addresses if necessary. Further details are given inside the script.

Otl2draft

Requirement
Convert outlines written with The Vim Outliner into LaTeX drafts (or manipulate with Standard ML).
Possible solution
A small program, otl2draft, that performs the conversion:

Otlmarks

Requirement
Your web bookmarks are currently kept in the Google Chrome browser, but you would prefer to use a Vim Outliner text file for more privacy, more convenient editing, and easier synchronization (for example, using git).
Possible solution
Use a small program, chromeotl, to convert your bookmarks.html file into a bookmarks.otl file. Delete your bookmarks from Chrome and use vim to store, search, synchronize, and edit them instead. Another small program, otlhtml, can turn the otl file into an html file for easy use within any web browser. Both scripts are available on GitHub.

Microcontrollers

ATmega328P 2-wire Serial Interface

The specification for software access to the TWI (Two Wire Interface)/I2C module of certain Atmel microcontrollers, notably the one used in the Arduino Uno, is described in ยง22 of the ATmega48A/PA/88A/PA/168A/PA/328/P Data Sheet. I made this state machine specification that summarizes the tables and sequence diagrams from the data sheet. Please mail me if you find any errors or have suggestions to improve it. I didn't bother writing a formal specification since the idea is to explain rather than to describe precisely. It is intended to be read in conjunction with the data sheet.