Domain-specific languages for fixture generation – a case study with Antlr4

A domain-specific language (DSL) is a programming language or descriptive file format to formulate and solve specific problems in specific domains, as opposed to generic descriptive file formats (such as XML) and general-purpose programming languages (such as Java) which can be employed in any domain.

A paradigmatic use case for a domain specific programming language is domain-specific computations, e.g. physical simulations, which can be simplified and optimized by using a language containing the required and only the required mathematical and physical expressions. At a project at Mayflower, we recently encountered a use case for employing a DSL as a descriptive file format: we designed a DSL describing document models to generate database fixtures from it. Weiterlesen

Playing around with fragment shaders in WebGL

WebGL is a graphics library for web browsers, based on a version of OpenGL for embedded devices, OpenGL ES. The library allows for customized real-time 3d graphics rendering in modern browsers, including the use of shaders. There is a variety of scenarios in which you would want to make use of such a library. Consider, for example, browser games, 3D maps and product views. The simple WebGL interface is accessible via JavaScript and even whole frameworks are available, such as three.js (for an introduction, see Johannes Brosi’s great article from earlier this month).

As Christmas holidays are approaching, it is nice to have some toys to play around with. In this tutorial, I will provide a basis for fiddling around and experimenting with WebGL and fragment shaders, since it turned out to be a lot of fun to play around with them, and the basic concept is relatively easy to grasp. This article basically follows my own way of coming to play around with fragment shaders in WebGL. The idea was generated shortly before the Mayflower/Liip Barcamp, where David Sora Parra and I organized a collaborative session in which we wanted to generate some coding fun by discovering the unknown together. Weiterlesen

Image similarity search with LIRE

Content-based image similarity search — determining the images in a database visually similar to a search image on the basis of pixel data alone — is a hot topic. Applications are numerous. Just recently, has introduced a visual product similarity search for some products, and google has introduced a search-by-image feature.

In addition to hands-on applications, there is a lot of research on the topic. The abilities of university maintained image search engines grow constantly. Unfortunately, implementing current techniques requires a bunch of specialist knowledge and some mathematical sophistication. Fortunately, however, there are effective simple techniques for which there exist open source libraries.

One such library for JAVA is the LIRE API. In this short article, I demonstrate how to implement a basic linear content-based visual image similarity search using this library. Weiterlesen