a library for unit carrying mathematical computations
In my last project I faced a few tasks of page layouting in a dynamic manner. I had to code rules to position and scale elements on documents with the complication of all data being of dynamic nature. So forget using a clean sheet of paper, a pencil, a ruler and a pocket calculator. Instead a basic layout has to be filled at runtime with data from various sources, text, logos, plans, tables. Sure, not such a complex thing from a mathematical point of view: geometry defines all required tools, all computation rules to find out where to position the top left corner of a logo file which has to be scaled by what factor to fit inside a predefined area whilst still leaving some space defined elsewhere. All fine, so let’s go… However everyone who has coded such a layouting routine will agree that this quickly leads to endless monotonous computations in the code, an flowing list of numbers getting converted, added, subtracted, factored. When you want to find out afterwards why that code scales a logo slightly wider than expected things get annoying. Because all you see is endless computations, but no layouting.
So instead (ok, after a few frustrating hours) I created a simple library to be able to use higher level concepts of geometry for this. Instead of computing an endless series of numbers and trying to keep the code readable by using self-explaning variable names I now can use things like an “area” or a “distance”. This immediately results in much shorter code, since all those endless computations are not inside the layouting routines any more, but safely stored away in the tested types offered by the library. The extra topping you can always expect if I implement something is this:
The library knows about units! And how to handle them! This means: you can define an area by its dimensions, say 200cm x 3,5m and subtract a length of 567mm from its width. The resulting area does not only have the correct size, you can also ask its size in whatever units you want to, let’s say feet (though I never understood the concept of that twisted and just plain stupid american units system). So you can simply code what layout operation you want, specify the units your measurement numbers are in and things work. You get a logos dimensions in pixels, whilst your page layout is measured in mm? Fine, just place the logo and have it scaled. The library does the computation.
The current implementation lives on github. It certainly is limited, there is little sense in coding completeness without usage. But I am convinced that there are new challenges to come, be it for me or someone else. So let’s see, it would be great if more types in geometry, more fields in physics and even stuff beyond that (finance, chemisty, …) would get implemented by the time they are required. Everyone is invited to try the library, use it in open projects and contribute extensions!
Im App-Store des owncloud-Projekts wurde ein “Mobile compatible theme” veröffentlicht. Ziel ist es, die owncloud Oberfläche besser an mobile Endgeräte anzupassen, dort also besser nutzbar zu machen. Diese Geräte haben ja einen kleinen Bildschirm, geringere Auflösung und werden per Touchscreen bedient, was in Relation gesehen ungenauer ist als eine Maus.
Ich habe mich über einen Hinweis in der Beschreibung gefreut:
IMPORTANT : YOU SHOULD ACTIVATE "FluXX compensator" APPLICATION FOR BETTER HANDLING
Whilst browsing through the web looking for hints on how to work around some annoying issue with a programming task I did not make any progress over the last hour I also came over to the famous Stackoverflow board. That is a high quality tech exchange site where IT professionals (and those trying to) help each other on a give and take base. Actually I quite like that board, it wisely uses “gamification” to motivate users to contribute good answers.
One specific question was asked right when I looked at the list and it caught my eye…
Guess what: I could not resist to answer myself
I spent the last days at a StartupWeekend !
A truly interesting and inspiring event, though pretty challenging too… 54 hours to shape and prepare a startup business means little sleep, huge amounts of caffeine and a big black hole in ones normal social life during that period. But this also rewards with a great experience, amazing team spirit, a bundle of new things discovered, great people met. So for me it all boils down to: awesome!