Monday, May 26, 2008

Aproximation of approximation of ...

Approximation is sometimes only way to make something reasonable.
What is the problem:
When you are adding new transformation you need to describe for which plug-ins it should be applied.
Now simple approach is taken - choose the first one found. The problem is that it can return strange errors when you will add new pattern which also matches other plug-in.


We've been talking how to deal with that and most reasonable approach is to find most specific pattern that matches resource name. But as we need fast solution we decide use something that have chance to work better than simple "choose first" approach.
First take all matches and choose the best one of them. What choose the best means ? Choose most specialized pattern.
From my observation seems that patterns are rather simple and choose the "longest pattern" strategy should work in most cases.
So ? Choose the exact name or the longest pattern.
I am far from claiming that this solution is working in all cases. In fact there are thousand of examples it's not. But it gives you answer when you will find some unexpected result and want to check which pattern was applied.

Tuesday, May 6, 2008

Long May weekend

Since I disabled weather cast plug-in in Firefox whether is nice. So it was during the long weekend. As previously I tend to travel on these days I did similar thing this year. The difference is that previously it had been hiking and this time it was swan :)
Here you will find some photos.

Product Customization

There is high time to provide you with some useful links in case you are interested in this project. First of all wiki page in PDE incubator projects category. The second one in case you like to follow project on bugzilla.
I will try to add some content to the wiki page this week.

Monday, May 5, 2008

Simple(x) Problem

Imagine you have following a problem. There are some people which needs access to some resources (lets make it students and beer problem). There are some dorms where students are located and shops which stores specific amount of this golden drink. As students are very lazy mammal they can access only this shops that are not very distanced.
We must provide each student with a bear. How to organize delivery?

How to deal with such a problem ?


Is there an optimal solution ?


This is typical resources allocation problem with constrains.
All students must be served. We can translate this problem and treat our students as resources. Let Xi be a number of bears per i'th dorm, Yj number of bears in j'th shop. Let also xij be number of bears for i'th dorm from j'th shop.
Then we can describe our problem as maximization problem of following function

SUM(xij) - where we take into consideration only such a xij where j'th shop can be reached from i'th dorm.
The constrains are following:
For each j: SUMi(xij) <= Yj
which means that we cannot give more bears than we have in j shop.

For each i: SUMj(xij) = Xi
which means that all students from i'th dorm must be served.


The only problem is that for some reason this cannot be solved using OpenOffice solver on my laptop (probably not ideal openSuse configuration ;) ). So please use something more comercial :D
Sometimes working at the university also means solving quite daily life problems ;)