ILOG OPL cannot distinguish apples from oranges

I used to think about OPL that promotes obligatorily mathematical rigor as one would expect from a mathematical modeling language. I was misunderstood: it seems that OPL deludes itself when comparing apples and oranges. OPL still requires enhancements that address serious idiosyncrasies how the model is handled.

Objectives

The article presents some OPL examples for expressions that do not satisfy type safety. It additionally relates possible error messages.

The Apple and Orange model

Eclipse subversive plugins frustrate me every day…

Please apologize, but I really need to expose my anger to the subversive plugins. The statement on Subversive – SVN Team Provider that “At the same time project is stable and had a long history on the previous location at the the Polarion.com” is really a very bad joke.

I have been using svn projects on eclipse for about 6 years and always praised this combination. It was a pleasure to see polairon plugins providing a better integration over time. Unfortunately, since the subversion plugins have been available on eclipse repositories, I cannot anymore talk any good word about subversive.

How to prevent EOFException when socket is closed

When one needs some very simple java client that reads some data from socket, then it might be a bit annoying to effectively detect that there is no more data to read, aka “End of File”. Here I show an approach to solve some issues to avoid spurious IOExceptions.

Consider two Java applications that exchange data over a socket, lets call them Alice and Bob. On my example, Bob sends triples of integers, and when he does not have any more triples to send, he takes initiative to close the socket. Here I only show a simple code for Alice.

About the Transcend SDHC Class 10 8GB memory card

The “Class 10” label on Transcend card suggest that is should work 2½ as fast as the my plain 3 years old Kingston SDHC Class 4 8GB memory card. Indeed, I was disappointed to realize the opposite: Transcend class 10 was on average about twice as slow as Kingstone class 4.

The Transcend SDHC Class 10 8GB memory card was the best compromise among price, speed and capacity. “Class 10” means that the card is expected to read and write data at a rate of at least 10MB/s.

Java: Class.forName() to retrieve inner class

Sounds trivial, but was not obvious because Eclipse IDE mislead me: How do I get a reference to a inner class by calling Class.forName() ?

package a.b.c;
public class Outer {
   ...
   public static class Inner {
      ...
   }
   ...
}

I first tried to call Class.forName() passing as parameter the fully qualified name generated by Eclipse:

Class innerClass = Class.forName("a.b.c.Outer.Inner");

But that was wrong! After wondering for some time, I found the (obvious solution):

Class innerClass = Class.forName("a.b.c.Outer$Inner");

Looks like as Eclipse “fully qualified” name is not exactly the same fully qualified name that the Java compiler uses to identify inner classes.

On fixing CPLEX variable names generated by OPL

You wrote your OPL model for your important mathematical programming problem. But the result looks weird: the model just cannot produce such solution. The most desperate approach consists in diving though the mathematical programming model generated by OPL, checking each (in)equation one by one.

Here I describe some issues that happened while using the OPL Java interface to create the CPLEX model and to print out the mathematical programming model as a .lp file. And after days of frustration with this .lp printout, I found myself writing my own Java class that renames all CPLEX variables generated by OPL…

Serializing Hibernate objects as XML using XStream

People have been looking for  serializing Hibernate as XML using XStream, a task that is not straightforward.

I designed a solution that I would like to share with the open source community, called xstream-for-pojo.

It seams a quite simple approach at the beginning. Until you discover that Hibernate injected a lot of additional fields into your original objects and that sometimes Hibernate exchanges your original objects with proxies. Even worse, data may not yet be loaded on fields declared as lazy. Hibernate collections are even more complicated.

OPL and Java: loading dynamic Linux libraries

When calling IBM ILOG OPL (Optimization Programming Language) from a Java application running on Linux, one will face some issues regarding loading dynamic OPL libraries. Typical error messages look like:

Native code library failed to load: ensure the appropriate library (oplXXX.dll/.so) is in your path.

java.lang.UnsatisfiedLinkError: no opl63 in java.library.path
java.lang.UnsatisfiedLinkError: no opl_lang_wrap_cpp in java.library.path
java.lang.UnsatisfiedLinkError: no cp_wrap_cpp_java63 in java.library.path
java.lang.UnsatisfiedLinkError: no concert_wrap_cpp_java63 in java.library.path

This article explains my considerations and some approaches how to fix it.

Running Eclipse on a machine without Java

As “portable applications” are getting more and more popular, it is important to say that Eclipse has always been portable: just unzip it anywhere and run it. The real issue is not having Java Runtime Environment installed on the machine where you want to run Eclipse. Unfortunately, installing Java on Windows requires full administrator rights.

I decided to create my portable Eclipse distribution on an USB hard drive (a Western Digital Passport) instead of an USB pen drive. The latter would be impractically too slow to support applications that require  handling thousands of files.

OPL language: the battle of array declarations

The OPL Development Studio, created by ILOG (and recently acquired by IBM), provides tools based on the Optimization Programming Language. This tool intends to simplify the process of feeding data and model formulae to other ILOG optimization tools for mathematical programming and constraint programming.

Experience has been proven OPL to be extremely helpful as a compact and high level language for both data and model. Nevertheless, this language still reveals some constructs that are not well understood nor well documented.