OML syntax highlighting with Notepad++

I recently had to do some modeling with Microsoft Solver Fundation(MSF) and the corresponding Excel plugin.

Although it offers an easy way to use a powerful solver (Gurobi) transparently from Excel, the definition of the model components is a rather arduous task. Firstly because everything has to be done by a sequence of clicks, which is quickly unefficient, secondly because the user interface is not necesarily intuitive and quite buggy.

Nonetheless I found a way to bypass efficiently the interface for the writting of the model, by editing it directly in an external editor and then copying it to the “Model” tab of the plugin. The text is then automatically parsed and the model components (parameters, variables & constraints) appear directly in the interface.

To facilitate the editing, I used Notepad++ for which I created a language highlighting definition for OML (Optimization Modeling Language, the modelling language used by MSF). It can be downloaded here, the installation procedure is the following:

  1. Install Notepad++
  2. Download the language definition file userDefineLang.xml
  3. Copy the file to %APPDATA%\Notepad++\ (copy past the direction in the address bar of windows explorer)

Note that if you already had Notepad++ installed with user defined languages, you need to append the content of the definition file to the end of your own userDefineLang.xml file.

OML highlighting for Notepad++

OML highlighting for Notepad++

Download the above example : example.xlsx and example.oml

If your are interested in creating your own language definition, this post by Jon Galloway gives a usefull tutorial.


Tips to work collaboratively

Having a supervisor on each side of the Atlantic Ocean can sometime complicate communication, who never experienced endless chains of emails to revise a document? It is then quite hard to remember who did what, or which of the 10 files with the same name is the latest version. Thankfully, there are some useful tools that can simplify this process.

Online collaborative tools

Since almost everybody has a Google Mail account, an easy way to create and collaboratively work on a document is to use the google docs suite. It is in fact quite useful for text documents, spreadsheets or presentation drafts. The set of features is however quite limited and you won’t be able to create documents with fancy formatting, but it still offers all the basic revision tools, keeping track of the successive editing and their respective authors. If you are looking for more advanced functionalities, there exists other free online office suite alternatives, among which Zoho and Think Free.

Collaborative edition of a Latex document

Latex being a reference for the writing of scientific documents, it is worth noting that being based on plain text files, it can be easily shared via any source-revision systems such as CVS or SVN, as any other source code. A way to do this is to create a Google Code project, which gives you a 1 Gb storage space online with Subversion access, beware however that all the content of such project is publicly available.

Share files

If you are more used to your favourite desktop office software suite, you can also use a tool to share your documents with other people. An excellent way to do it is to use dropbox, which synchronises your files with an online directory. You can find more detail on the uses of dropbox in this previous post. The key feature to work collaboratively is to share one of your dropbox folder with your colleagues, then every time one of you does a change in one of the file of this shared folder, all the others will receive the latest version of the file. Beside, a revision control function allows you to see the previous versions of the file, with the date and the user who modified it.