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.