Hello, this is the developer blog of Questionmark, where we discuss technical challenges and solutions.
If instead you're interested in using our API, please see the API documentation.
13 Feb 2017 by wvengen

Storing barcodes

In a previous blogpost, we talked about barcodes and EAN-numbers, and how in some cases barcodes with different numbers still reference the same product. The solution for searching there was not very performant, and wouldn’t scale to more than a handful of barcodes to check. This post describes how to store barcodes in the PostgreSQL database in a normalized way, so that searching can be done without slowing down queries. As a bonus, we get a stronger uniqueness constraint. Partial... read more »
Questionmark provides information on sustainability and health of (food) products in the supermarket. Right now, we are able to analyze about 40k products (fully or partially). In past years, a lot of manual work was needed to type over details from photos (like name, brand, nutrients, ingredients), and to link them to concepts we have data for (researched ingredients, specific nutrients, etc.). But to keep information up-to-date, and to be able to add new products when they become available, we’re... read more »
With the Questionmark App you can scan the barcode of a supermarket product, and see how sustainable it is compared to other products. This barcode is generally a 13 or 8 digit international article number (EAN/UPC), which identifies the product. These numbers are handed out by the international GS1 organisation. Barcode: a unique identifier? This number is like a unique identifier for a (consumer) product. Pretty uniquely. But not completely. There are rules for this (also NL-specific ones). These aren’t... read more »
Active Record is great. Being able to split up large SQL queries into meaningful bits, and traversing relations with ease is invaluable. Yet some discipline remains needed. Using eager loading to avoid N+1 queries, to name something well-known to any Rails developer who has some real-world experience. For smaller projects, this is usually fine: the controller does the preloading, all set. But when it grows, and more and more functionality is moved to concerns and other places, it’s not so... read more »
Again and again I hear someone explain about how they manage data and notice that somewhere spreadsheets play an important role. Very often, that’s Microsoft Excel. From big companies to small organisations like ours. And so it’s surprising that it’s such a hassle to reliably export data for use in other tools. What would be the most logical format to export to? Comma separated values (CSV), with UTF-8 encoding. As field-separator preferably a comma (what’s in a name), but a... read more »
When developing a program in Ruby, you may sometimes encounter a memory leak. For a while now, Ruby has a facility to gather information about what objects are laying around: ObjectSpace. read more »
At Questionmark, we research the sustainability of product in (Dutch) supermarkets. On one side, we communicate that to consumers by showing ratings from 1-10 in our app and website. This needs to be easy enough to understand for people to make quick choices, and provide enough detail to understand what the ratings tell. At the other side, we show suppliers and producers why their products get these ratings - and provide information on how they could make their products more... read more »
In our backend, we’re heavily relying on select2 for choosing values from a list in forms. Sometimes we want to show a list of existing values, but still allow the user to add his own. This can easily be done like this: https://gist.github.com/be89a2f8bfec7c038084.js?file=select2_freeform.js In our ingredient edit form it looks like this: read more »